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 9E9C4A052B; Tue, 28 Jul 2020 15:06:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA1C01BFF4; Tue, 28 Jul 2020 15:06:52 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130070.outbound.protection.outlook.com [40.107.13.70]) by dpdk.org (Postfix) with ESMTP id 8291F1BFF3 for ; Tue, 28 Jul 2020 15:06:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AKx1ZepeOkbMdxqFXg4VNgjeYkp+VXg7x2hbz4UwlVQix6oD31YLKAcvZz70sXpopuxnNg2gmRUC99hEMogwnsiHmQS6zbKVSNCf5kBgwWm9OCX01ocHNUoufA19slVkdWHgYfFgCUsip/tf2vRlQeu7enS+QVHLl4Y+2b8fMefciC3R+auJSFp6055DT4ApfdBqIDAXXVaQP+Le6b+xj1uLAjACUXelB4BHj9yaE+kFqKbUUL09ELldco66KsYTZwtrnVaxLvRYhCBjtDiGFTLDWfKkwblCuwtCMeipX/Hl5wu63O7VCz4VSombmdqPWE9qWhHws4VYn+kzgWtdJg== 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=yayui3z2WesNzg3DrvqeSkhqwZ4RH3sOHT2dnDJN7Kk=; b=FJCu1VW2ksDvpPBSBOsFfSzP7TcfJm5oH434ZARIe3g2xJj2BkvH/XPkZvR2JcJenHHH2GFuyLpi1yF9YSSFkmCO2VNpjma5Ypl5ndbQBn5b5XACGZan2lmd87wtxWKSnoe4NZ4fL/qIKKMnSmc8clIU72ss3Xwsw5Hnu2hLcKnqq5PhhuicrK8zIDaGLaIkYSPIa5aO1aqjZ+HoYDzIs1pfpXPH2VAZ87efXgO4jhhojHEhWAeug9DqtL62A5UQ60HzKALMOHxwcnJ1bgKsX+FERizo+MSwQpbxttRcGkpQ6AHo7WlNltrRMVkMXhk/mFQlcMnY+uRXxhL0XjB9hA== 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=yayui3z2WesNzg3DrvqeSkhqwZ4RH3sOHT2dnDJN7Kk=; b=WUTWaoi6yg6sUtUtQEjkmadIjX1808LULs4gG/Y1GcfLKSS7N9/sS1Q4g/hgqVinKmK4Fo9WoicVykyI3HgEK22t/zth6l6ZMZOaFUUl0s9BDNqjKeHB0POyN0eODQlmAuX5WcS+/lOwuEgcEzy6CabryXGs4G9vh7g3cpqVo7s= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB5073.eurprd05.prod.outlook.com (2603:10a6:208:ce::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Tue, 28 Jul 2020 13:06:50 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012%5]) with mapi id 15.20.3216.034; Tue, 28 Jul 2020 13:06:50 +0000 From: Raslan Darawsheh To: Ophir Munk , "dev@dpdk.org" CC: Matan Azrad Thread-Topic: [PATCH v1] net/mlx4: return EAGAIN on premature disable interrupt calls Thread-Index: AQHWZNXVeVLQHOr6cEm85f5EzRqnJ6kc9dZg Date: Tue, 28 Jul 2020 13:06:50 +0000 Message-ID: References: <20200728115406.20141-1-ophirmu@mellanox.com> In-Reply-To: <20200728115406.20141-1-ophirmu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [84.242.49.134] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8f1845ca-8552-4bca-d68b-08d832f71750 x-ms-traffictypediagnostic: AM0PR05MB5073: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Gzf6AS1dgq5n2QrcFrEHyi/daSh8W6BvlmQOr1aX+CbrIQs3uSiJr7zzSntbEKkAyrAuXgXU2T69g4uom3u2HvFnsnCCfU1/SQ9HH2P1m67OZjesFpiVMAWHHu06TKRvVETkR/J0MwsYfZPPbf3Fjxm7S5PyKX6IUvc01QvEMVwv0GlmjRwwmZh2X/Jii9F66pcEAoonkzx8zLKS06W56ax4EwEFSn/RIyQbI5h0sKckypKKvhAIAuB9Bnz2Dg0POooJtDNpUEF13iCDCQJzFyUogJHod1R0Gp1Jy1qSZoZExfTDCG33n3eB6mKsBLyP4MNj6wYicsTcLK5cdfz0TA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(366004)(346002)(396003)(376002)(136003)(52536014)(76116006)(478600001)(86362001)(66946007)(110136005)(316002)(26005)(8676002)(9686003)(186003)(2906002)(55016002)(33656002)(83380400001)(5660300002)(66476007)(107886003)(64756008)(66556008)(53546011)(6506007)(66446008)(8936002)(4326008)(71200400001)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ZDhHeQo+sYztSAId0sLpBMm3RuxI8vtm47GNgZ7Y59hoXwtVqADFLQjPjZ2OLEzsjT8Ij1WNL0Ap1O5mjnUixmL7pd9QfiW7VI+0eww9lrv68vgzyvbAW4WCPcw/x7ExiXELnB+Gx3kXXTkyJouctARtXDR5rVHlApMPx8EHAqENIK8VkY/VUoGe7x5i78MAthOYuG9IIsyER405siTmg0Js21e14pZachPhfhuet2QDUxoEz5r++5e0EE3Z5+fWEH68Cu6WZqmeKbU3+VfBBKVo7T5Y8PgrGtwf5+oEHiuNi3wEcirDtQhrg/I5CqZeiZc41hK5rNiJ6mwn33N0V/aMoUhSuVGGAIEr2VtzwuBb0DJFQ0h4BgPaIAEnk5HOCDo+Ljc4SGix2+sOdHnH904DsWoQOmvpS8eoUIZW24hrhvNEJIjoPlI/soP5370Gj1S3mw6K3PkRMW3/5qISVvYiInz8qtKc4dYnjEt5lak= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6707.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f1845ca-8552-4bca-d68b-08d832f71750 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2020 13:06:50.1165 (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: qNe20srTdskqocZXrfsAAs9iF/ejPJmDMTGJFpEwnleWind2dwPeH65tiG6lijllTcGFPiy0r/MJY74K1bb5Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5073 Subject: Re: [dpdk-dev] [PATCH v1] net/mlx4: return EAGAIN on premature disable interrupt calls 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" Hi, > -----Original Message----- > From: Ophir Munk > Sent: Tuesday, July 28, 2020 2:54 PM > To: dev@dpdk.org > Cc: Raslan Darawsheh ; Ophir Munk > ; Matan Azrad > Subject: [PATCH v1] net/mlx4: return EAGAIN on premature disable interrup= t > calls >=20 > RXQ interrupts under Linux are based on the epoll mechanism. An > expected order of operations is as follows: > 1. Call rte_eth_dev_rx_intr_enable(), to arm the CQ for receiving events > on data input. > 2. Block on rte_epoll_wait() with an array of file descriptors > representing the CQ events. Upon data arrival the kernel will signal an > input event on the corresponding CQ fd. > 3. Call rte_eth_dev_rx_intr_disable() after the event was received and > continue in polling mode. The mlx4 implementation of > rte_eth_dev_rx_intr_disable() is to get the CQ event and ack it. >=20 > In practice applications may wake up from rte_epoll_wait() due to > timeout with no event to ack but still call > rte_eth_dev_rx_intr_disable() unconditionally. In such cases the call > should return EAGAIN (since the file descriptors are non-blocked), as > opposed to EINVAL which indicates a real failure. In case of EAGAIN the > PMD should not warn on "unable to disable interrupt on rx queue". >=20 > Signed-off-by: Ophir Munk Acked-by: Raslan Darawsheh > --- > drivers/net/mlx4/mlx4_intr.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c > index 020fc25..19af935 100644 > --- a/drivers/net/mlx4/mlx4_intr.c > +++ b/drivers/net/mlx4/mlx4_intr.c > @@ -326,13 +326,20 @@ mlx4_rx_intr_disable(struct rte_eth_dev *dev, > uint16_t idx) > } else { > ret =3D mlx4_glue->get_cq_event(rxq->cq->channel, &ev_cq, > &ev_ctx); > - if (ret || ev_cq !=3D rxq->cq) > + /** For non-zero ret save the errno (may be EAGAIN > + * which means the get_cq_event function was called before > + * receiving one). > + */ > + if (ret) > + ret =3D errno; > + else if (ev_cq !=3D rxq->cq) > ret =3D EINVAL; > } > if (ret) { > rte_errno =3D ret; > - WARN("unable to disable interrupt on rx queue %d", > - idx); > + if (ret !=3D EAGAIN) > + WARN("unable to disable interrupt on rx queue %d", > + idx); > } else { > rxq->mcq.arm_sn++; > mlx4_glue->ack_cq_events(rxq->cq, 1); > -- > 2.8.4 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh