From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3A5DBA0524; Tue, 25 Feb 2020 10:46:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2B3B1BFAB; Tue, 25 Feb 2020 10:46:30 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2081.outbound.protection.outlook.com [40.107.20.81]) by dpdk.org (Postfix) with ESMTP id ED4281BC24 for ; Tue, 25 Feb 2020 10:46:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IFL1H5MEr6DHohRq0QNHCBfgGLDLPaG0FOyDantmdSpSqQmGW1KC3WgOi/qcLR7qbokW21WukfKYiJ0kZ64RZeDNi17uNzjhr0l6Q5xkxnhgYwf6liUuVQnuZtGileCAClCWMhiuRwL8Fs1InVLHBsz6m0P8MkAjuJVAb2zImlzEtUk4GrAWyAR84WVOeAWLAMCrRwoBMe421ldX8I93KaiLSIOnWvE9ObU7E4XVtb7Wqjt7caayx8evD4EWZY9nO3lWvmkpYQ4NJwkYTy2mQz6TKWWkPP9C6NYU8z7QpiEKL0wwTQaohWfa3aUdJWE31VwdodGBxc9iKVXeQBVq2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P1+Ib2WZWQfpBOm0vnovOMi3HRRCjIqGp5KQM2UR2RQ=; b=KcA4O3AHCvc3QZIUSkl3eIRTM+ht0Pn6IJ+TwuX5I79+3YLpeqYb0gVdsUmVBkAl+3vROYfsQklh+d1j4AixezQzTFIXJ4FDzzihZOYfjiDJVZTU97eGnNGG4tdU2TVGzQwb4vJrIeWvdXClsNcb5pxOEYvVs084GtlAI11HvOm/ftLw2YhjmR/YQn7ixU+Kdv2Y/J8W0IelfZkzXg4XOvY90KtsAFrbnTTeMF7cSbAg/NWgZOSyyWCzII+fZwmOaibZ3QspJK8Y7b/SkmpSlvR3Hcdf4KFCJhlYwKmD2Db/JsLKvCrsgyBoBuEwEROrORp3KrArK11ADN83kPYB8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P1+Ib2WZWQfpBOm0vnovOMi3HRRCjIqGp5KQM2UR2RQ=; b=ZsoQgubHdLddrFVzpg1Ct7VaucbRCWJTqMd19+q67pKCbEvkRI/huNCPcxym1icCRrLrhkWFfuVg80sEPDHY5I2V4FVbFsP2c8JP3jLEgjZKBfyrPY4/2Bdce2lRaf8XrnnQkGp0xZPj6imrl0FJVB5sv2UQddGUvo/a9NP4PKU= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3491.eurprd05.prod.outlook.com (10.171.188.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.21; Tue, 25 Feb 2020 09:46:27 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da5:7919:35c1:894]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da5:7919:35c1:894%6]) with mapi id 15.20.2750.021; Tue, 25 Feb 2020 09:46:27 +0000 From: Slava Ovsiienko To: Matan Azrad , "dev@dpdk.org" CC: Thomas Monjalon , Maxime Coquelin Thread-Topic: [PATCH] vdpa/mlx5: fix event setup Thread-Index: AQHV67e5mM7mrMLRzUCmWahx4bRMC6grqVAQ Date: Tue, 25 Feb 2020 09:46:26 +0000 Message-ID: References: <1582620228-25629-1-git-send-email-matan@mellanox.com> In-Reply-To: <1582620228-25629-1-git-send-email-matan@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: cd04a626-0736-4b76-56a5-08d7b9d7955e x-ms-traffictypediagnostic: AM4PR05MB3491:|AM4PR05MB3491: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0324C2C0E2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(136003)(39860400002)(346002)(376002)(396003)(199004)(189003)(26005)(186003)(6506007)(53546011)(9686003)(478600001)(55016002)(7696005)(86362001)(71200400001)(66476007)(66446008)(316002)(66946007)(81156014)(52536014)(5660300002)(8936002)(33656002)(81166006)(76116006)(64756008)(66556008)(4326008)(110136005)(2906002)(8676002)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3491; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TE08Gt7idBKvq7rteYEifKslYXnwsEruWMZQjbXXQyGzBYf3uXMZbRbpMer5xSug/ulJ3HqdNrofr0Zej1k48U/qLmKeksllsLCxTc3qsekeKz6npHOhfnQskD82QwaRINDqXqv6cNLZp/qzwyR3QFSHk2WMoQCXZcPXRrB4FDp+Xtbs9spYfuhzGshL4SkYP7QUforUaZBLmu2Uc49LZ61f859COam8JwIs0UEUPkaa+8ibncqLBI0y+3CUUPaqe7KFCGMCapWXR0CfOeYcGUmsu2+lXK+4cbl4HI4buycmZUu+AnhyllmHAt5yOVPNHSH9nH3Qach4QI9afzAVoJEaKn5weuZG4F5qigYEB4Ao8zjnU3XpWTFk7v5jhbziZaim4BUQ/NLKOvCPJcYCJx+O/97DL8FyE9wjMwNigcNWn8gWsWchknglC8XhwzuI x-ms-exchange-antispam-messagedata: Vkf0YxYD41fNHPfT5ZcveQSxNTQDngyijvR/Hb1icK9xAMLy4MvTVBAYQWxRxUyIBgZbq3m8NalzodXlAITIu65IOx7u1Umxi0GGA+znTgW2mqmRWue7XuE3NMMtPwhR6VwL/Z2FwfIOa+uwI/zikg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd04a626-0736-4b76-56a5-08d7b9d7955e X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Feb 2020 09:46:26.9600 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pMvH3uKNz2w3HpsyglOBXBLZX0l+lhSXxESRAYWPsqJml+XqcbMCBlIS1fQ55B+j4MZcwKkXztlGgAAPsTHwn+cdT1EP7MFL/D5+9oa68cs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3491 Subject: Re: [dpdk-dev] [PATCH] vdpa/mlx5: fix event setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Matan Azrad > Sent: Tuesday, February 25, 2020 10:44 > To: dev@dpdk.org > Cc: Slava Ovsiienko ; Thomas Monjalon > ; Maxime Coquelin > Subject: [PATCH] vdpa/mlx5: fix event setup >=20 > The completion event mechanism should work only if at least one of the > virtqs has valid callfd to be notified on. >=20 > When all the virtqs works with poll mode, the event mechanism should not > be configured. >=20 > The driver didn't take it into account and crashed in the above case. >=20 > Do not configure event interrupt when all the virtqs are in poll mode. >=20 > Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues") >=20 > Signed-off-by: Matan Azrad Acked-by: Viacheslav Ovsiienko > --- > drivers/vdpa/mlx5/mlx5_vdpa_event.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c > b/drivers/vdpa/mlx5/mlx5_vdpa_event.c > index 16276f5..dd60150 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c > @@ -237,8 +237,14 @@ > int > mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv) { > - int flags =3D fcntl(priv->eventc->fd, F_GETFL); > - int ret =3D fcntl(priv->eventc->fd, F_SETFL, flags | O_NONBLOCK); > + int flags; > + int ret; > + > + if (!priv->eventc) > + /* All virtqs are in poll mode. */ > + return 0; > + flags =3D fcntl(priv->eventc->fd, F_GETFL); > + ret =3D fcntl(priv->eventc->fd, F_SETFL, flags | O_NONBLOCK); > if (ret) { > DRV_LOG(ERR, "Failed to change event channel FD."); > rte_errno =3D errno; > -- > 1.8.3.1