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 167CEA0471 for ; Wed, 17 Jul 2019 10:03:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA2C81DBE; Wed, 17 Jul 2019 10:03:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id D9A541B53 for ; Wed, 17 Jul 2019 10:03:18 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6H804JY024850; Wed, 17 Jul 2019 01:03:17 -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-transfer-encoding : mime-version; s=pfpt0818; bh=fa3W4F7/yyy3sjM/t5AhuU9WKRfMwvd0vAOpnvcofao=; b=gr3THQbfBgQ0qR5PN5K/rNrW4Fxij34m8zr4XihkadNhIqQiHU7nSVujDh3LNvHwX3nR tzTMy6rgazf6P+Sw8lKwrsWvwHKPEejEFrFNfxMUsXnwflGyf35/ghy0EpqdASJ4N1Eu caceJwonKjeBazuy6lRl2/jdNX7f2BmFZnRH57lAWefAA4Q4PB3C7OJZHda3+eGsiS7S weal6INwsfJH3kYyzi7fPkJhVZBb0vunkHEO7f5wkohgcUfC7hE1MLgl3E4XPYMNkG0k gpHHbpb+mHVOMWFDlrFnEvHRvNORJ/UIR0rQqzHXCUj/Hyja1DUsN2Y0og5AjvJHfEEd EA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2ts07vfa8t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2019 01:03:17 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 17 Jul 2019 01:03:12 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.52) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 17 Jul 2019 01:03:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D+zIR9axXo6oBKTIggD/XT8tzP5Co4xMdxPU2cV9LdVhQjNeXljoa9InIMhVxPg52f6PUfVmBjLuRtgwRVzsx+tVvrUjbHGhSdMRAyV9dpeNFcrKwqsbv6uE7eB7RvcwwGEQlV+LXrUhnvpsJq4f8yN/eWzADWzS2NmprdUXC6IwFqvDEK8HauR34Z6GT59sSCeNXo7SevBsw4+VTjgrjuDO1EcFg+Ym2pW7LjXDIls+3F1u9PH7MBeHfu0LdqifkJSnA/jhmhecWY9pByLwFUZEqqabLK8OkVzgNJge8qTTGKu9QKN1vh4/9BAcQpZUKTZxXtipCufam31KVGn5Iw== 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=fa3W4F7/yyy3sjM/t5AhuU9WKRfMwvd0vAOpnvcofao=; b=W+MHokFW3nfeRAPFscdgWDaj3ZGP57iqNzQmtCttAjHzjIAxMKv4t4R359POwHqcstDYCINx1Cod+snWEDjnORZnjaP7qa/kJzRmpjHn+FFwEuEXep3ehO6Da6ccC/Tta86eiAGvYnybbzAX2Zu8AaMhWKjUY5BvC6am8rZevu+STzIbx1nqLR2N8VIQMrqj0tCZlFDUU49Gol/1l6tYkA148gBm0uMu2zHDosqwLOVX8ju6TeqVdi5iqSJdtC1VDFvnSgLoGBmz1Wd8IuDl6nu77y9LEomvwmzw1lVb6MmJZXsYvqzEQBsLfY+Q4CXXDwrrWJ7uClObloZ3DJp5Pg== 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=fa3W4F7/yyy3sjM/t5AhuU9WKRfMwvd0vAOpnvcofao=; b=SdLE+glXJh8hUr5IP3RsnyYBx9WK+wGeGbTVpJzDw3RQNsW9m39nK/feguCAkxWR7cc2LtiHROJSEgCJCp+4gXO8E9pPrQseQgDdAxWQjLmfDRuKQPjCKHAK2u04ESsnJQdA3vsp4Ix+cS4wNwmjc5eCYU/ZOOt2EOlwP4fpoAs= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Wed, 17 Jul 2019 08:03:10 +0000 Received: from BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::2d42:12b6:aa2e:2862]) by BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::2d42:12b6:aa2e:2862%4]) with mapi id 15.20.2073.012; Wed, 17 Jul 2019 08:03:10 +0000 From: Jerin Jacob Kollanukkaran 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" Thread-Topic: [RFC PATCH v3 2/3] eal: add mask and unmask interrupt APIs Thread-Index: AQHVO/XIb9GeLyW36Uqi1XtdG9Kqj6bOUK4AgAAD+yCAABCQAIAAChEg Date: Wed, 17 Jul 2019 08:03:09 +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: x-originating-ip: [106.200.248.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd8573df-8c71-411a-3a36-08d70a8d3585 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BYAPR18MB2424; x-ms-traffictypediagnostic: BYAPR18MB2424: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(136003)(376002)(39860400002)(346002)(13464003)(199004)(189003)(9686003)(11346002)(25786009)(55016002)(476003)(3846002)(102836004)(99286004)(6116002)(26005)(14454004)(186003)(54906003)(446003)(66476007)(7696005)(316002)(6506007)(110136005)(53546011)(81156014)(76176011)(66446008)(81166006)(64756008)(486006)(66946007)(66556008)(8936002)(68736007)(6246003)(33656002)(478600001)(4326008)(71200400001)(71190400001)(66066001)(256004)(2906002)(305945005)(6436002)(7736002)(86362001)(229853002)(5660300002)(8676002)(52536014)(76116006)(53936002)(74316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2424; H:BYAPR18MB2424.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: zljNbEdWcFfup6291YRNmsO6fiNVR0lVP80FOkjOu7gCV2GAQ0YulL/Ty2ghFZ2ipt2P+b9ozY8CHtE8P70Uf1MFERLwnvytIfslzkp98cHz3iGkrSoqmXTbnSeQ28RipgGu0jYaD+nBmkeSUYmyU2JHSEiKRY3DJTN6dukLrv/ksDOLXtqj5oH0kO8BT6JpMofAc5YbDnFkVgqD8WA8tD2mB+Q9T2tUzs4nERp7znxYiy9ZjFeU6IeqoaarZpSIBt+RYVll+zvwCdcUTrf329tutSDb/NnJum5pWCEteYZiWvTEV/SEZrvuQP2MROBxqCIkJOx7z7qmCoBaaIcLXWi1IiJSTN/i9gkqzon0CiiLtBFlzXqGWG00Nv8arOyPT16wiMrENlPZ0K8oR7gKAkBOW/CfT8FgHwfXfxva2qY= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bd8573df-8c71-411a-3a36-08d70a8d3585 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 08:03:09.9055 (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: jerinj@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2424 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-17_02:2019-07-16,2019-07-17 signatures=0 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: 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 > > > (johndale) ; 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 mas= ked. > > > > 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() for 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.. Sure. He is on vacation. Any reason for thinking, rte_intr_ack() may not be semantically correct? I think, it is very much correct if there are no better suggestions. Anyway it the name, From VFIO perspective, we know what is expected so I th= ink it is fine. >=20 > Why not return -1 and let the caller deal with it? If we make it as rte_intr_ack() no need to return -1 for MSIX-VFIO+Linux as it is semantically correct. >=20 > 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. If we make it as ack then it fine as driver does not need to know the fine= =20 details. >=20 > Pessimist view: > Wastes a lot of people's time. Potentially duplicate code like this > everywhere. >=20 > if (INTx) unmask(); >=20 > BTW, are you targeting 19.08 or 19.11? Not sure how much change we can > tolerate in 19.08. 19.08 as fundamentally it correct. Finer adjustment can made by existing drivers if required in the testing phase. It is trivial change as scope is limited to interrupt hander rte_intr_enabl= e() replacement with rte_intr_ack(). For MSIX case, it should be real NOP, so I don't think there issue. It should be much better than the existing state, where almost everything broken. > 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? Proposed patch will fix the above mentioned issues. >=20 > Thanks.. > -Hyong >=20 > > > 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/unmaskin= g > 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= for > > > 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 > interrupt). > > > Windows and FreeBSD do not do auto-masking either. > > > > rte_intr_ack() can abstract FreeBSD and Windows difference. > >