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 E20DFA0471 for ; Wed, 17 Jul 2019 16:35:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F4831B9DF; Wed, 17 Jul 2019 16:35:41 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 6C07F1B9D9 for ; Wed, 17 Jul 2019 16:35:39 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6HETmAG013692; Wed, 17 Jul 2019 07:35:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0818; bh=w2fxMiFdQYMGHZdgGsAFS09FB2n+00z+c2xeLrgdqQk=; b=xzJ32TttZyjpdmAc32R4SVjrv0jXoOU/EADA5F04zRU381V4j9vPTnAnadE2fodtR/EC O6RQ/XOhUcDXtfD7sI1ysRCCsMJwQ7fT/bGm++2HlRcJRx7JF4OuLoxbWZSgeFb1mbEu kiErynHmnVRdIUcJTlNzG1bQPI8JF0RC+OxcO5uZMb8fiQqGpS5wMcPkqDOk3+dFTcWz qDXQBwnDIr3epUOEDCasYmt5lrSX5N7rljerSnDwO9N2So2lv0DQIlHdlokUXDVOqrP+ Khwq3P3P4bDa4xRYCfpmJ7Zxyc5b/M1OsXkOtP3Q5Wo4gDOS7AR+mQHOnj8ed4uvF/jn vA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2ts0a27yg3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2019 07:35:37 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 17 Jul 2019 07:35:36 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.51) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 17 Jul 2019 07:35:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PE16ICqjOzy2siS9haMKLK4pb4XgqbK1Ci77T2S/AGQAjU1sH/MxasI6ShVusn67oE5giC09+DiqhyRo/s2RmIOMWa2DWk7SwH450U/uXnsZ+AMFv4Xf21Kpi6XQjcttTicsG2BOE4DasnUNsOYmEH2GImLfMTdvHPnXRVg4qSB5BzEzI+TzXVMFtLYhzZVmAAskZKCRPZ47WkkRx22Q8LfWI13Hy4aB8NHKKRD0A1Ek8hvMjjPzrLY4EM8tXWO1bAWrpj6ZSnO6hoPD/56JkuAWTyiEia3EtjW1x8rSq9OFTy4dZnx9HPELyfcSgFlbjEj9Xcau5A1BaYe/dK6oag== 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=w2fxMiFdQYMGHZdgGsAFS09FB2n+00z+c2xeLrgdqQk=; b=ZwwliwuEvAnQm0MQAoSsKEmTaUyRI9Hm6EyiqkYiSmSNwQBpc4sMzCuRBdBo6OM3S5BPBNgVMGVCPHz2lNNjFnrzju5TlBK6NUIq8agcba6T7aCvdiTeCF58TQrSE6xAUJPZ/95DCC+JVmAsHiVfh42/g0kwzbG22j2znfcxfk1cPktalJ1NpZnglzuKv9JGlZxosgmBbiUpAS/+vkysDLBMMUdRQ6pkPC+b8xBse0BnUpI+FtgGJWcz2m2+Z3NQoAHMKWM7wVhf4baawkddZ/cvR0Ry75mMfMyGCp7IC48VQCLFFmJ8KrCPwvfYzhk0jHnzwzU5NzITjopA7ngI3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=marvell.com;dmarc=pass action=none header.from=marvell.com;dkim=pass header.d=marvell.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w2fxMiFdQYMGHZdgGsAFS09FB2n+00z+c2xeLrgdqQk=; b=dmN0qA1j3T6AvX3nku/V0yzoJtKHpgZ2Fv9MhBJ6ST58PLZylkpsgk5tRHVl2qLw8w21E3B/GVc4OoAPftiOJsHe+DkofE0cFRmF5Y/Up8OPmhnfdbmkDyiBfj1VBs73GE7+ZwY7GI63CimCnXPI2ikNjrcbYvGZtVNzSMvN4Bw= Received: from DM6PR18MB2427.namprd18.prod.outlook.com (20.179.104.21) by DM6PR18MB3179.namprd18.prod.outlook.com (10.255.172.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.11; Wed, 17 Jul 2019 14:35:33 +0000 Received: from DM6PR18MB2427.namprd18.prod.outlook.com ([fe80::657a:5df9:1fee:f4d4]) by DM6PR18MB2427.namprd18.prod.outlook.com ([fe80::657a:5df9:1fee:f4d4%4]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 14:35:33 +0000 From: Nithin Kumar Dabilpuram To: "Hyong Youb Kim (hyonkim)" CC: David Marchand , Thomas Monjalon , Ferruh Yigit , "Bruce Richardson" , Jerin Jacob Kollanukkaran , "John Daley (johndale)" , "Shahed Shaikh" , "dev@dpdk.org" Thread-Topic: [EXT] Re: [dpdk-dev] [PATCH v2 2/3] eal: add ack interrupt API Thread-Index: AQHVPJ1ZYnRYqTJOwEifoFrR7PCIr6bOxSaAgAAbToA= Date: Wed, 17 Jul 2019 14:35:33 +0000 Message-ID: <20190717143513.GA5114@outlook.office365.com> References: <20190717115852.171416-1-ndabilpuram@marvell.com> <20190717124354.142668-1-ndabilpuram@marvell.com> <20190717124354.142668-3-ndabilpuram@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0006.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::16) To DM6PR18MB2427.namprd18.prod.outlook.com (2603:10b6:5:180::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 291d3fbd-3757-4d3e-ceb3-08d70ac40651 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:DM6PR18MB3179; x-ms-traffictypediagnostic: DM6PR18MB3179: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(39860400002)(136003)(376002)(366004)(13464003)(189003)(199004)(81156014)(76176011)(52116002)(71200400001)(53936002)(68736007)(71190400001)(81166006)(8936002)(386003)(6512007)(9686003)(186003)(53546011)(99286004)(6506007)(33656002)(316002)(26005)(6486002)(55236004)(6246003)(102836004)(25786009)(478600001)(229853002)(6436002)(446003)(476003)(54906003)(66556008)(66476007)(4326008)(86362001)(14444005)(486006)(7736002)(66946007)(305945005)(11346002)(2906002)(66446008)(14454004)(5660300002)(66066001)(6116002)(3846002)(6916009)(8676002)(1076003)(64756008)(256004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR18MB3179; H:DM6PR18MB2427.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: sSDLufg3VVQsdVOHWY3faT32cBrCMxu4OYV4K3NaxgYGNzkLYKaNGfP8jmd6HVXMmgDd0wFOhmuSVWbnTask8XuNjxF+4FZopKW9VWXjsziuVRM26YZtr8Gn3+tIyeXvEgf8TBdbJd3qpmIkwxJU+u8U16Q1+39C1/KJYP/CvK68exLpBW2uWoeScyAVPSn1+bTEmi3WhMC3z0/5aZK62dGUWa/VCT551fVg6X/NALeOtqd5Rek96xqxmSrwPmHNTp1h973aSLupsdAqUN14RtMhLvMRxm16Kj9e8yjdJ2V1AEcjTYFFjV/5c+v/gFwWxIp/4nwfHveNEZqX9LcgBQWPgalWZM3J0GcOl3hF406hnksQ1yGutxcijM5BvC0zq6lAZ1KF0wdB0y12xJZic+yfkFYHzlLcR2EjGyMrLlc= Content-Type: text/plain; charset="us-ascii" Content-ID: <993C1217D2169845811F9FD80DBBE0BA@namprd18.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 291d3fbd-3757-4d3e-ceb3-08d70ac40651 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 14:35:33.4535 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ndabilpuram@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3179 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-17_06:2019-07-17,2019-07-17 signatures=0 Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v2 2/3] eal: add ack interrupt API 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" On Wed, Jul 17, 2019 at 12:57:29PM +0000, Hyong Youb Kim (hyonkim) wrote: > External Email >=20 > ---------------------------------------------------------------------- > > -----Original Message----- > > From: Nithin Dabilpuram > > Sent: Wednesday, July 17, 2019 9:44 PM > > To: Hyong Youb Kim (hyonkim) ; David Marchand > > ; Thomas Monjalon > > ; Ferruh Yigit ; Bruce > > Richardson > > Cc: jerinj@marvell.com; John Daley (johndale) ; > > Shahed Shaikh ; dev@dpdk.org; Nithin Dabilpuram > > > > Subject: [PATCH v2 2/3] eal: add ack interrupt API > >=20 > > Add new ack interrupt API to avoid using > > VFIO_IRQ_SET_ACTION_TRIGGER(rte_intr_enable()) for > > acking interrupt purpose for VFIO based interrupt handlers. > > This implementation is specific to Linux. > >=20 > > Using rte_intr_enable() for acking interrupt has below issues > >=20 > > * Time consuming to do for every interrupt received as it will > > free_irq() followed by request_irq() and all other initializations > > * A race condition because of a window between free_irq() and > > request_irq() with packet reception still on and device still > > enabled and would throw warning messages like below. > > [158764.159833] do_IRQ: 9.34 No irq handler for vector > >=20 > > In this patch, rte_intr_ack() is a no-op for VFIO_MSIX/VFIO_MSI interru= pts > > as they are edge triggered and kernel would not mask the interrupt befo= re > > delivering the event to userspace and we don't need to ack. > >=20 > > Signed-off-by: Nithin Dabilpuram > > Signed-off-by: Jerin Jacob > > --- > > v2: > > * No change > >=20 > > lib/librte_eal/common/include/rte_interrupts.h | 22 +++++++ > > lib/librte_eal/freebsd/eal/eal_interrupts.c | 9 +++ > > lib/librte_eal/linux/eal/eal_interrupts.c | 81 > > ++++++++++++++++++++++++++ > > lib/librte_eal/rte_eal_version.map | 1 + > > 4 files changed, 113 insertions(+) > >=20 > > diff --git a/lib/librte_eal/common/include/rte_interrupts.h > > b/lib/librte_eal/common/include/rte_interrupts.h > > index c1e912c..93b31cd 100644 > > --- a/lib/librte_eal/common/include/rte_interrupts.h > > +++ b/lib/librte_eal/common/include/rte_interrupts.h > > @@ -118,6 +118,28 @@ int rte_intr_enable(const struct rte_intr_handle > > *intr_handle); > > */ > > int rte_intr_disable(const struct rte_intr_handle *intr_handle); > >=20 > > +/** > > + * It acks an interrupt raised for the specified handle. > > + * > > + * Call this function to ack an interrupt from interrupt > > + * handler either from application or driver, so that > > + * new interrupts are raised. > > + * > > + * @note For interrupt handle types VFIO_MSIX and VFIO_MSI, > > + * this function is a no-op and returns success without > > + * changing anything as kernel doesn't expect > > + * them to be acked. > > + * > [...] >=20 > Shouldn't we explain that this really is "unmask" but named "ack" because > of x and y, and that it is expected at end of INTx handler? Ack does > not have a well-defined meaning, whereas everyone knows what unmask > means.. >=20 Ok. Is the below text fine with you ? Or please suggest. @note For interrupt handle types VFIO_MSIX and VFIO_MSI, this function is a no-op and returns success without changing anything as kernel doesn't expect=20 them to be acked.=20 This needs be used atleast for PCI devices with INTx interrupt=20 as kernel before passing on event for INTx triggered interrupt,=20 masks the interrupt and expects application to unmask it so that, further interrupts can be raised/triggered. This is also due to=20 the fact that INTx is level triggered interrupt where as MSI/MSIx=20 is not. Ideally this should have been called as intr_unmask()=20 representing underlying api, but since unmask operation=20 is not supported and not needed for VFIO MSI/MSIx interrupts=20 after handling, it is named as ack. > [...] >=20 > Thanks. > -Hyong >=20