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 4BDE0A0471 for ; Wed, 17 Jul 2019 09:09:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE9A94D27; Wed, 17 Jul 2019 09:09:33 +0200 (CEST) Received: from alln-iport-5.cisco.com (alln-iport-5.cisco.com [173.37.142.92]) by dpdk.org (Postfix) with ESMTP id 8449E4C90 for ; Wed, 17 Jul 2019 09:09:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4091; q=dns/txt; s=iport; t=1563347372; x=1564556972; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p3xWCXBBWIAQBv5GzpVsqqetD1Mhzu5BUm2oQf+Sv1w=; b=X7oSu6l1K+jdqVgcL31ocFcv/G5MljQupwAyKutsm4zSgh5ojPoaOIhd OXFVdUVtPyHweUOLToUkUeY3Rva1LtH2J+Y4g0clvDn1FIwmSdj2MyK/+ bBl8xcnIrcf+0HMvzUC0uQazTcYCSPM+by54LAmmPENiKwRWTGwWXYAWH Y=; IronPort-PHdr: =?us-ascii?q?9a23=3AZf30HB2mwxvtwKkmsmDT+zVfbzU7u7jyIg8e44?= =?us-ascii?q?YmjLQLaKm44pD+JxKHt+51ggrPWoPWo7JfhuzavrqoeFRI4I3J8RVgOIdJSw?= =?us-ascii?q?dDjMwXmwI6B8vQCVz8Kv3ragQxHd9JUxlu+HToeUU=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CpAAB7yC5d/40NJK1mGgEBAQEBAgE?= =?us-ascii?q?BAQEHAgEBAQGBZ4FEUAOBQiAECyqHYwOOT4JbfpZSgUKBEANUCQEBAQwBAS0?= =?us-ascii?q?CAQGEQAKCQyM4EwEDAQEEAQECAQVthTwMhUoBAQEBAgESFRMGAQE3AQsEAgE?= =?us-ascii?q?IEQQBAR8QMhcBBQgCBAENBQgahGsDDg8BohMCgTiIYIFwM4J5AQEFgQYBhAY?= =?us-ascii?q?YghMJgTSLXxeBQD+BEEeCFzU+hCwaJIMXgiaMWJ4PCQKCGZQnmAqNNZdQAgQ?= =?us-ascii?q?CBAUCDgEBBYFnIYFYcBU7gmyCQQwXg06KHAE2coEpjQ0BAQ?= X-IronPort-AV: E=Sophos;i="5.64,273,1559520000"; d="scan'208";a="297729393" Received: from alln-core-8.cisco.com ([173.36.13.141]) by alln-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 17 Jul 2019 07:09:31 +0000 Received: from XCH-RCD-017.cisco.com (xch-rcd-017.cisco.com [173.37.102.27]) by alln-core-8.cisco.com (8.15.2/8.15.2) with ESMTPS id x6H79VdE001182 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 17 Jul 2019 07:09:31 GMT Received: from xhs-aln-003.cisco.com (173.37.135.120) by XCH-RCD-017.cisco.com (173.37.102.27) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 17 Jul 2019 02:09:30 -0500 Received: from xhs-aln-002.cisco.com (173.37.135.119) by xhs-aln-003.cisco.com (173.37.135.120) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 17 Jul 2019 02:09:30 -0500 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (173.37.151.57) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 17 Jul 2019 02:09:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=agAVVp2HDDEiymCfjR3VPtIDLExqIDnzG2lsrej7ZiRRYM3VtRCvYV9w/SQHyiybGLDmdcN8b9DJQ6QqXNfTVqhmnDp6lX8eZe3x1K5pJYCK0kxjyZWUpAT2dvtAWRaVFRd6SiEYo6UvuPSqEvo5zzCO9CX1dv0bFjb4RGsVAiHRR9m4JjmjNeorstFu3tmrrN4Y/0thwKcREu6E3dPgatn56zzy6iR+cDudHqZzdNEnIhJ9WzBFe+6UBODKxzlyHdhw424udTNhITvQ0+UPYFKmKza25nqmXRF1aXAwD7c/BpSdwr3KgARTQylMI52jLwt3WzlTHPXxbHtkjQVqeg== 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=/EeLGLNpl+A3pzdeeo3mHHSTSQMSGZmNTpVzEsL/gV8=; b=IO0EXOxhMngvFWPqMZhxmVE3FmQBIOvWTgUaghtbeqjqTznKT6djK5B34X4KLetZuPip0kUsBJkWt6o4+RmlWViWlx+t0mdcchZONd0m9XwZvuFiajaMfi9wGJ4VndWbENFLQAKxr7aVqFaCJQdh3zPRptchv7ErlXhg2YKQYSV+39ctRD49yZmWQM5zcN3DL4y9BxcZ3f4bsH/+8FSszA7E+qOfpC36IkW7aGFrKzkoIcQoL2rsOed0JMfylKNthhEjd9oGSbbyQofXxH+Gs05/xCPBcH2Nwuj6k/TOZgwRJZb8874+4hpsipLWOCECk0Dq4NBXOwsMAcdVql2d7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cisco.com;dmarc=pass action=none header.from=cisco.com;dkim=pass header.d=cisco.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/EeLGLNpl+A3pzdeeo3mHHSTSQMSGZmNTpVzEsL/gV8=; b=XOxU1YOqjBZTbgi3AlmJSx7eCN/ng4aRjbQ52t3wV/xeb5WrqJeSZB/bmJtGnzYwFQlXoMXpW1h5jsM6P9fl71/FO5G+GZ6Bz6SfEJGFTU0x0XDwnm8aWgks7eteza5caBmJtGhorRCR1EX/g7wp3c2sgFrwaV0J9U76zU7mgP8= Received: from MWHPR11MB1839.namprd11.prod.outlook.com (10.175.53.12) by MWHPR11MB1678.namprd11.prod.outlook.com (10.172.55.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.10; Wed, 17 Jul 2019 07:09:28 +0000 Received: from MWHPR11MB1839.namprd11.prod.outlook.com ([fe80::3cef:35b5:8800:39f1]) by MWHPR11MB1839.namprd11.prod.outlook.com ([fe80::3cef:35b5:8800:39f1%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 07:09:28 +0000 From: "Hyong Youb Kim (hyonkim)" To: Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram , David Marchand , Thomas Monjalon , Ferruh Yigit , Bruce Richardson CC: "John Daley (johndale)" , Shahed Shaikh , "dev@dpdk.org" Thread-Topic: [RFC PATCH v3 2/3] eal: add mask and unmask interrupt APIs Thread-Index: AQHVO/XevRYbQEFR2kiByXrzVb6deqbOSiswgAALwwCAAApQwA== Date: Wed, 17 Jul 2019 07:09:28 +0000 Message-ID: References: <20190716164424.16776-1-ndabilpuram@marvell.com> <20190716164424.16776-2-ndabilpuram@marvell.com> In-Reply-To: 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=hyonkim@cisco.com; x-originating-ip: [2001:420:c0dc:1001::133] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8cc71ff8-653e-449d-7928-08d70a85b56e x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1678; x-ms-traffictypediagnostic: MWHPR11MB1678: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(199004)(13464003)(189003)(55016002)(54906003)(9686003)(446003)(4326008)(66476007)(5660300002)(64756008)(6436002)(53936002)(66446008)(66946007)(66556008)(46003)(99286004)(476003)(7696005)(186003)(76116006)(53546011)(11346002)(102836004)(8676002)(81156014)(316002)(6506007)(81166006)(52536014)(76176011)(6116002)(229853002)(86362001)(71190400001)(478600001)(68736007)(256004)(71200400001)(7736002)(33656002)(14454004)(305945005)(6246003)(110136005)(2906002)(74316002)(486006)(25786009)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1678; H:MWHPR11MB1839.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: yZxM3/RgjA2AXGRBcZ3WxAOHMXFNBaZ0QiaxjS/4K4QwRIgx+0imh8xoOedtjb+JK5MbxrOgIrHqHsq21mqfQsWfXBKoqMEaCkiNU8PT9t9OAMKMq9xKn/zwCJIQBo4cdmYHoq/PC0QojmnCaoG4SpZ2na21lOIofZf7he7NIWCro2L5jH2ekZTezRNsl3ORHV8VPJQkiyOtGeSpJt4dgR/eSwHmsDq3ptpi/h8T3ny8PVF1muYkmD1gRZDQluRKJu7+3v6k0ENBFjcbdXeIcmbBP1E3Q7VRfhAOYwUEjk10WGPcnputNXvDvm2nImlX4RpelBHIMkpHtz8ydL1mckehQfvJ/teAqOTyvepEMhPjRpEXzhL39wUFbQkSWhXwlSpWYO4IEawtC1Bl/g4y553H5bYbA6bCU5Y3Ib26iaE= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8cc71ff8-653e-449d-7928-08d70a85b56e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 07:09:28.6378 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hyonkim@cisco.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1678 X-OriginatorOrg: cisco.com X-Outbound-SMTP-Client: 173.37.102.27, xch-rcd-017.cisco.com X-Outbound-Node: alln-core-8.cisco.com Subject: Re: [dpdk-dev] [RFC PATCH v3 2/3] eal: add mask and unmask interrupt APIs 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: Jerin Jacob Kollanukkaran > Sent: Wednesday, July 17, 2019 3:15 PM > To: Hyong Youb Kim (hyonkim) ; Nithin Kumar > Dabilpuram ; David Marchand > ; Thomas Monjalon > ; Ferruh Yigit ; Bruce > Richardson > Cc: John Daley (johndale) ; Shahed Shaikh > ; dev@dpdk.org > Subject: RE: [RFC PATCH v3 2/3] eal: add mask and unmask interrupt APIs >=20 > > -----Original Message----- > > From: Hyong Youb Kim (hyonkim) > > Sent: Wednesday, July 17, 2019 11:26 AM > > To: Nithin Kumar Dabilpuram ; David > Marchand > > ; Thomas Monjalon > > ; Ferruh Yigit ; Bruce > > Richardson > > Cc: Jerin Jacob Kollanukkaran ; John Daley (johndal= e) > > ; Shahed Shaikh ; > > dev@dpdk.org > > Subject: RE: [RFC PATCH v3 2/3] eal: add mask and unmask interrupt APIs > > > +rte_intr_mask(const struct rte_intr_handle *intr_handle) { > > > + if (intr_handle && intr_handle->type =3D=3D RTE_INTR_HANDLE_VDEV) > > > + return 0; > > > + > > > + if (!intr_handle || intr_handle->fd < 0 || intr_handle->uio_cfg_fd = < > > 0) > > > + return -1; > > > + > > > + switch (intr_handle->type){ > > > + /* Both masking and disabling are same for UIO */ > > > + case RTE_INTR_HANDLE_UIO: > > > + if (uio_intr_disable(intr_handle)) > > > + return -1; > > > + break; > > > + case RTE_INTR_HANDLE_UIO_INTX: > > > + if (uio_intx_intr_disable(intr_handle)) > > > + return -1; > > > + break; > > > + /* not used at this moment */ > > > + case RTE_INTR_HANDLE_ALARM: > > > + return -1; > > > +#ifdef VFIO_PRESENT > > > + case RTE_INTR_HANDLE_VFIO_MSIX: > > > + case RTE_INTR_HANDLE_VFIO_MSI: > > > + return 0; > > > > Isn't this a little confusing? It returns success, but irq is not maske= d. >=20 > Yes. How about changing the API to rte_intr_ack()(Acknowledge the > interrupt) > Or something similar? i.e replace rte_intr_unmask() with rte_intr_ack() f= or > this use > case. >=20 Not sure. I do not have a good suggestion here :-) Like to hear from David when he comes back, as he spent most time on this issue.. Why not return -1 and let the caller deal with it? Optimist view: Maintainers will see the error as vfio-pci + MSI/MSI_X is on everyone's test list. And it forces them to confront the issue. Do I really need unmask here, etc. Pessimist view: Wastes a lot of people's time. Potentially duplicate code like this everywhere. if (INTx) unmask(); BTW, are you targeting 19.08 or 19.11? Not sure how much change we can tolerate in 19.08. Requirements for 19.08 seem to be... - Must fix the redhat bz (lost interrupt issue with qede + MSI/MSI-X) - Fix potentially similar issues in other drivers too? Thanks.. -Hyong > > As is, return code 0 means... > > - igb_uio: irq is masked for INTx, MSI, MSI-X > > - vfio-pci + INTx: irq is masked > > - vfio-pci + MSI/MSI-X: no changes > > > > Masking is useful only for INTx, IMO... > > > > Masking MSI/MSI-X via PCI-defined mechanisms (e.g. Mask bit in MSI-X > > Table) has no practical use for drivers. Handshaking/masking/unmasking = is > > done via device/vendor specific ways, as needed. See all those > > ack/block/unblock/credit/... mechanisms used in various drivers/NICs to > > control interrupts their own way. > > > > A long time ago in early PCIe days, the linux kernel did auto-masking f= or > > MSI/MSI-X (i.e. mask before calling netdev irq handler). It was soon > removed > > as it was unnecessary overhead (expensive PIOs to NIC for every interru= pt). > > Windows and FreeBSD do not do auto-masking either. >=20 > rte_intr_ack() can abstract FreeBSD and Windows difference. >=20