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 15AEDA0471 for ; Wed, 17 Jul 2019 17:16:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B29081BE50; Wed, 17 Jul 2019 17:16:11 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 4CD171BE48 for ; Wed, 17 Jul 2019 17:16:10 +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 x6HFFuXJ012024; Wed, 17 Jul 2019 08:16:09 -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=AWmGxYnrffaJRH0TwX6abq+5VFFSADWDE+fFIucYuw4=; b=FYvIe0GfxJ1xx+KwL+10cLsSYyWxsaJTGvvasHJTQyvqdzTTgsTxOV6No7Ded6/7NtAh yv/6QGnPMBCf5dgZsIIDPuRxDGf6gZTDkBChHCCQqKUtqAk/yDYAi0PD8J5ev3U8YHkb LrX7ZtMiWTkztT2B9R1YcN5yQn+luXA2incy6RNcugzz348xtGd0GQ2NwJ63Zm2Elqvn 1s41ARXgSuIjXZDffL3yzX64QdTtYUkSamkxNGr5b9tLa7Do99QFsd0KWVmKiUBD9rMy LTauSAv+BYNYcr63z5AcDiERXxXaPiEa92alOusztDbpaV+Z8K57f2Yx9gN3t70HIxl1 RQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2ts0a2845h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2019 08:16:08 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 17 Jul 2019 08:16:07 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (104.47.34.51) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 17 Jul 2019 08:16:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BFDDF+b+5LrUIWNwPtWMrGmRWMSO/pWL5Bn7GRoTnJEfXfOy7ojiB2vqpI8YHV30Ge9NJFHej1besJ85VWf/zECLHru+QHWesR1s1w2Sya+zfMFSeUdJmJ2TwlfyvBk6YC3O5pqoHRdaEGgtmg+0gefvdDfETsTayqS6QOAl2MSBrDLN0YMEf4lfDoa4R1tzt8uNEmK7MkFmeqEVWL0PI34bt/YGsDddre626+zIeDZe/gxF2hdxGD+hghLpbvSJzb6/kdzeGCk1XvUeMLjF5XNzHKM6h8y5Je2TRFZv2HUVo3bcpWCTkRAkeYjw9FdyYb3bp/a3aX9pnGSU0X2s3g== 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=AWmGxYnrffaJRH0TwX6abq+5VFFSADWDE+fFIucYuw4=; b=jD7PsFI5hsfz+U/PJUslLE6UK+SiF8aG5lVeIfbUg7ALk2dTB2qyS2de5FkdExJeGVCCgMX++2dyxEwEsrmYcieIBc6nKjvG6bJkLJHots5AJmCfOrnkhGLdUHfwmvANGp8bQD0/GiVJz+H621fsuzwFppGofHOqYO9SR8EPsYpa7S4QehRd8zVdykMUSYNJUIRz4PdCR8Gh7L8tphneaE1wwnUy0QuaxS+q4Yktc4BYpqg7TEGk/rQwIkYUP9NxaDhxJ6P1/kmGzg+nTCHWsc5xq63yqECGdByqEFjuu5uIebBDMlOuUm08c3XU+InCibhpPHqt9sLTn8ZKZ6pKrw== 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=AWmGxYnrffaJRH0TwX6abq+5VFFSADWDE+fFIucYuw4=; b=AFBKIzXdlszjUy+7P6PSHTuQmJ9jLLtVHfO+pa6KH4RncWCXvAfIdYOIeHcCvQWOQGjOD+my+7s2Siybb8jfyWYNKw0uW4Kj8SPId9n4Rv11Y/eSf/cK0Cvkv4juJCOJPJPiaIEz5cdFdyh0fBGtMgh03tQLNAWfT4vF/8f3BSk= Received: from DM6PR18MB2427.namprd18.prod.outlook.com (20.179.104.21) by DM6PR18MB2601.namprd18.prod.outlook.com (20.179.106.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.11; Wed, 17 Jul 2019 15:16:05 +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 15:16:05 +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: AQHVPJ1ZYnRYqTJOwEifoFrR7PCIr6bOxSaAgAAbToCAAAiLgIAAAtMA Date: Wed, 17 Jul 2019 15:16:05 +0000 Message-ID: <20190717151554.GB5114@outlook.office365.com> References: <20190717115852.171416-1-ndabilpuram@marvell.com> <20190717124354.142668-1-ndabilpuram@marvell.com> <20190717124354.142668-3-ndabilpuram@marvell.com> <20190717143513.GA5114@outlook.office365.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::12) 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: e2dd34af-69ee-4357-9ab6-08d70ac9afe7 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:DM6PR18MB2601; x-ms-traffictypediagnostic: DM6PR18MB2601: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(376002)(396003)(39850400004)(346002)(13464003)(189003)(199004)(6436002)(6116002)(6512007)(9686003)(11346002)(3846002)(68736007)(54906003)(478600001)(6246003)(256004)(14444005)(8936002)(446003)(66066001)(476003)(66946007)(64756008)(66476007)(66556008)(52116002)(66446008)(86362001)(8676002)(486006)(55236004)(316002)(386003)(6506007)(81156014)(81166006)(6486002)(76176011)(2906002)(229853002)(4326008)(5660300002)(102836004)(71200400001)(71190400001)(25786009)(26005)(305945005)(7736002)(33656002)(99286004)(6916009)(53936002)(1076003)(14454004)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR18MB2601; 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: ke8F+df3vY/GXIlHj9qjgOyHJFol9+8azUj/2TP4DcvNS+6scfUrGU1WHBpPYku3HC0bq462jJzJKcx8OzfCLqmdt46e6PeTPiiOt+GaXuN2hkMekJVYWq+3/h1cjDG4e5fAxraSmFYNGq+NAdTOFFllmTctpGsWk7cqKtRhsDppfhmye+ljiVQRo+Z75ktxD+/yb/X57HbS3/wLU31EljksLQv94TzLRNxbAH13ChszFoWdL4v0V34Om60q9mb73SxYenj6C8aMRl+8uj3xmQoygZjfNrIOMcd5DkKy0WQPIPUBxuz/7GDng9n+JOoaYz6AGdMLfrNVvT2BL+isO3zCQoq6w2Ptq+TnE2sCAS6eNc/3Ab4l1BBxQzw59fpxWfcNEqHvftQr6jzNF2ZbUbdReXrR0WqDU2UnSNLNXEI= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e2dd34af-69ee-4357-9ab6-08d70ac9afe7 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 15:16:05.3619 (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: DM6PR18MB2601 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-17_07: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 03:05:47PM +0000, Hyong Youb Kim (hyonkim) wrote: > > -----Original Message----- > > From: Nithin Kumar Dabilpuram > > Sent: Wednesday, July 17, 2019 11:36 PM > [...] > > > > Subject: [PATCH v2 2/3] eal: add ack interrupt API > > > > > > > > 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. > > > > > > > > Using rte_intr_enable() for acking interrupt has below issues > > > > > > > > * Time consuming to do for every interrupt received as it will > > > > free_irq() followed by request_irq() and all other initializatio= ns > > > > * 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 > > > > > > > > In this patch, rte_intr_ack() is a no-op for VFIO_MSIX/VFIO_MSI > > interrupts > > > > as they are edge triggered and kernel would not mask the interrupt > > before > > > > delivering the event to userspace and we don't need to ack. > > > > > > > > Signed-off-by: Nithin Dabilpuram > > > > Signed-off-by: Jerin Jacob > > > > --- > > > > v2: > > > > * No change > > > > > > > > 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(+) > > > > > > > > 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_hand= le > > > > *intr_handle); > > > > */ > > > > int rte_intr_disable(const struct rte_intr_handle *intr_handle); > > > > > > > > +/** > > > > + * 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. > > > > + * > > > [...] > > > > > > Shouldn't we explain that this really is "unmask" but named "ack" bec= ause > > > 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 > >=20 > > Ok. Is the below text fine with you ? Or please suggest. > >=20 > > @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. > > This needs be used atleast for PCI devices with INTx interrupt > > as kernel before passing on event for INTx triggered interrupt, > > masks the interrupt and expects application to unmask it so that, > > further interrupts can be raised/triggered. This is also due to > > the fact that INTx is level triggered interrupt where as MSI/MSIx > > is not. Ideally this should have been called as intr_unmask() > > representing underlying api, but since unmask operation > > is not supported and not needed for VFIO MSI/MSIx interrupts > > after handling, it is named as ack. > >=20 >=20 > How about this? >=20 > PMD generally calls this function at the end of its IRQ callback. > Internally, it unmasks the interrupt if possible. For INTx, unmasking > is required as the interrupt is auto-masked prior to invoking > callback. For MSI/MSI-X, unmasking is typically not needed as the > interrupt is not auto-masked. In fact, for interrupt handle types > VFIO_MSIX and VFIO_MSI, this function is no-op. > Ok. Thanks. Will add this in next revision. > Thanks for your effort.. > -Hyong >=20