From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3EE51A0C43; Wed, 20 Oct 2021 11:25:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9B8B40687; Wed, 20 Oct 2021 11:25:35 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 64DBA40142 for ; Wed, 20 Oct 2021 11:25:34 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19K2OkXQ015218; Wed, 20 Oct 2021 02:25:31 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by mx0a-0016f401.pphosted.com with ESMTP id 3btaa79mh3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 02:25:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EP6TzFs4ZIB5RTlvzs7OHWnAshXsaynp8fVec42IV0QCunRMOvBByqqCfiseSg8uneUYL6RvtOIqwtD/wEOlZOhLASNyuWJk5WbgQtMJ0fWL9LuZg4zyvU1i8mitRRMy3mhMTf+JVAVQmMGEe7gGAqlEYWjGVtSXF2zlYurNGZmwZQu+uDAfC4oQP0eiLD6vaZoQtThMxETtMK2LFY6mgF2CCBaQBo7pIahYVwZ1mGO5FU6RCgRPy3TAuiDD0Tx4Yy9uApAI9AkH/satLmL7AJOX02fokqOvpOEg01engsyIS9e6x3MeI/TWUqt9OPm714JuttpkxSniQFZlDeKbJA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XpLcrC85mQxb0hJtTxacPlMDE47oha2v5XveUrcBbXI=; b=getQjABnLy2vKNXYs2TRVzwrG7yYUdYLS97c+gE2QOPmbYPvsbZNVNNd0kt94mrRZVOSI8S113Ad4GOxbxB4sxpCmOayG6OFaBEkUvDh5KJnjI9hp6hWinqnWLStrdViRhs8UjNobcT4dBR628omUJuF/QbNeQ6HaaZrA9+SexwiWvpLg0Y8sxSgctJTglbPFYb9jTdpLyhlYZ+EaUGFI+bLnrdT2dZKbQTzjwTqHXDcbtLTuvo1oqLaKzYFKwZvwVZ3fPLVNJtiFPTnq6cFh8QJdv99OF7mQ9I3IYZCec7kK0LpR1e2xP7Xm4/a2GsKDf6870OHPYYMkGYrQYkdDg== 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=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XpLcrC85mQxb0hJtTxacPlMDE47oha2v5XveUrcBbXI=; b=sp/oDsqTPrTwnnA5Omut1wC0IhzbC0SB1fj/19RwW7GtjvyTFoKoZRrPzL2GguqlqDzl0ZQdxpmjGrrSn8GjFDig/ctRv1RR0SbidtAlnG37fyXlHhvRCCl7q32x95dggKbBWlYa+LQiTpDwUlYCvkV6/nBSu44pdrxahVcelCA= Received: from BN9PR18MB4204.namprd18.prod.outlook.com (2603:10b6:408:119::18) by BN6PR1801MB2034.namprd18.prod.outlook.com (2603:10b6:405:68::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Wed, 20 Oct 2021 09:25:29 +0000 Received: from BN9PR18MB4204.namprd18.prod.outlook.com ([fe80::29f4:8e3d:264f:26b1]) by BN9PR18MB4204.namprd18.prod.outlook.com ([fe80::29f4:8e3d:264f:26b1%8]) with mapi id 15.20.4628.016; Wed, 20 Oct 2021 09:25:29 +0000 From: Harman Kalra To: Dmitry Kozlyuk CC: "dev@dpdk.org" , Bruce Richardson , "david.marchand@redhat.com" , "mdr@ashroe.eu" , "thomas@monjalon.net" Thread-Topic: [EXT] Re: [PATCH v4 3/7] eal/interrupts: avoid direct access to interrupt handle Thread-Index: AQHXxRg0a8lv8cK+4EC6K8/CoFm8mava1i4AgADCUfA= Date: Wed, 20 Oct 2021 09:25:29 +0000 Message-ID: References: <20210826145726.102081-1-hkalra@marvell.com> <20211019183543.132084-1-hkalra@marvell.com> <20211019183543.132084-4-hkalra@marvell.com> <20211020002758.47063c5a@sovereign> In-Reply-To: <20211020002758.47063c5a@sovereign> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 54a178a7-7058-4a1a-00e0-08d993ab8eb9 x-ms-traffictypediagnostic: BN6PR1801MB2034: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:669; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VwzHpyreS9bn8Jet0e/BycqRjT40cpNU5PbFZn/1REP6JiOxJFpQXReALiyrfX6PeiaDjpj1/KPLAUixRqaF2+kKrMVIdQNv27rpTSGHCbqtMU6g31q0CqU2dCeyTEIA5ajUdg9OybeRP77oxVTLFVQt5sg8bFD2Xr4jgmF21xawPoJwsIw2PSLswjMepMQ7/XU+Tg20NCcNTooy9ERnrcczGTtDX9rCgA8xbiM/kXFoA++2VV8Dw/9w/9gkatxWqYSHxqLEE03fIeaQqdpKx1Nnf2qJU1u5cwMubAlABwDh6FxNQIbrH7QQrFw/NDTS2y89OKddBBpA2yfs4hDUMUnrj+DVhraGh7/fAxoACRiX4KrCvlIyG6MQrFw6UufhVbV/QwOGQWLD6sMxLpu9Y/Tm0lQNIblIM/VmQx7EBy1kOihRfl2EY71DhR4qBvbMH+/SblLXkUQ4iJfXwqTxKk+DQ8hv4Mnvy0kIPoKNz8czBmRs4bvWcdyNnr/KLUCZrfTzJ0pcYNJ0G6VUb9SoAZO01wHoFzzjUA1DX6CXcDw9WF7rEzTZxLwPfS54pu8vKHLjiFs3Zg1byLeT5faxvNsB8cA+HHsrDlFu0fI9C4FQfdLOzLU2YimM89P05lxWt4v6ZhWTHiGzJZ3kMOZZt1l4dpdknS5IPvM0N5tKdAve56zd2HNmsjKOu/F8SHVPzNbSLlQGWxwOxSo9HCOhiw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR18MB4204.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(508600001)(38070700005)(33656002)(54906003)(316002)(8676002)(9686003)(38100700002)(83380400001)(66556008)(66476007)(71200400001)(53546011)(2906002)(66446008)(64756008)(4326008)(122000001)(86362001)(8936002)(5660300002)(26005)(186003)(7696005)(4001150100001)(52536014)(76116006)(6916009)(6506007)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wmrfXS8UsDxUWxxjJSrXhjglfDh3vwEUBx9caGUvdyUAGDeC31dGyHjFIWxU?= =?us-ascii?Q?CuYffhVXLwq6RqI6Zo/GV+AhETuDflB355p6AnDZDastbtVSrdRUuwZSUfA4?= =?us-ascii?Q?xZ0K3p5ssOrRwMwhhUP7eN4v2KLvoMOUm5VU8I+7iqm3drSpaqZBPd/8+2Rc?= =?us-ascii?Q?YCZ+Lfl1YQ5vj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zo9jsRB?= =?us-ascii?Q?/BVI412ujGfDUKrQQnSjjN7x60pDwKBIFJIndLNV/OO2fQgcAoOlmD5+VCud?= =?us-ascii?Q?yziIeCmE7pQMx9rWkui9Ilyue9gqUJtbBqpqdTO1OOBvxlsDPi/Z7Y0jd5/f?= =?us-ascii?Q?4UxL+aCYPVK9i5madaCnJMLWcV9Nd8QZZIH4mjWlLUCDY2AdetpTgjRttiAH?= =?us-ascii?Q?wnftyhuURw6oUCpc2stE5PrVYipVUNdYuo6ValwC9UEQpV3xOeTl0ZYcG8J6?= =?us-ascii?Q?Fy4Hno5tAm94Hqp8rQCMHpgG?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR18MB4204.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54a178a7-7058-4a1a-00e0-08d993ab8eb9 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2021 09:25:29.1123 (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: hkalra@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1801MB2034 X-Proofpoint-ORIG-GUID: Q0yfJUP1CVSmqLPOyrOVw24xZ6qPD4pl X-Proofpoint-GUID: Q0yfJUP1CVSmqLPOyrOVw24xZ6qPD4pl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-20_04,2021-10-19_01,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v4 3/7] eal/interrupts: avoid direct access to interrupt handle X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Dmitry Kozlyuk > Sent: Wednesday, October 20, 2021 2:58 AM > To: Harman Kalra > Cc: dev@dpdk.org; Bruce Richardson ; > david.marchand@redhat.com; mdr@ashroe.eu; thomas@monjalon.net > Subject: [EXT] Re: [PATCH v4 3/7] eal/interrupts: avoid direct access to > interrupt handle >=20 > External Email >=20 > ---------------------------------------------------------------------- > 2021-10-20 00:05 (UTC+0530), Harman Kalra: > > Making changes to the interrupt framework to use interrupt handle APIs > > to get/set any field. Direct access to any of the fields should be > > avoided to avoid any ABI breakage in future. >=20 > I get and accept the point why EAL also should use the API. > However, mentioning ABI is still a wrong wording. > There is no ABI between EAL structures and EAL functions by definition of > ABI. Sure, I will reword the commit message without ABI inclusion. >=20 > > > > Signed-off-by: Harman Kalra > > --- > > lib/eal/freebsd/eal_interrupts.c | 92 ++++++---- > > lib/eal/linux/eal_interrupts.c | 287 +++++++++++++++++++------------ > > 2 files changed, 234 insertions(+), 145 deletions(-) > > > > diff --git a/lib/eal/freebsd/eal_interrupts.c > > b/lib/eal/freebsd/eal_interrupts.c > [...] > > @@ -135,9 +137,18 @@ rte_intr_callback_register(const struct > rte_intr_handle *intr_handle, > > ret =3D -ENOMEM; > > goto fail; > > } else { > > - src->intr_handle =3D *intr_handle; > > - TAILQ_INIT(&src->callbacks); > > - TAILQ_INSERT_TAIL(&intr_sources, src, next); > > + src->intr_handle =3D rte_intr_instance_alloc(); > > + if (src->intr_handle =3D=3D NULL) { > > + RTE_LOG(ERR, EAL, "Can not create > intr instance\n"); > > + free(callback); > > + ret =3D -ENOMEM; >=20 > goto fail? I think goto not required, as we not setting wake_thread =3D 1 here, API will just return error after unlocking the spinlock and trace. >=20 > > + } else { > > + rte_intr_instance_copy(src- > >intr_handle, > > + intr_handle); > > + TAILQ_INIT(&src->callbacks); > > + TAILQ_INSERT_TAIL(&intr_sources, > src, > > + next); > > + } > > } > > } > > > [...] > > @@ -213,7 +226,7 @@ rte_intr_callback_unregister_pending(const struct > rte_intr_handle *intr_handle, > > struct rte_intr_callback *cb, *next; > > > > /* do parameter checking first */ > > - if (intr_handle =3D=3D NULL || intr_handle->fd < 0) { > > + if (intr_handle =3D=3D NULL || rte_intr_fd_get(intr_handle) < 0) { >=20 > The handle is checked for NULL inside the accessor, here and in other pla= ces: > grep -R 'intr_handle =3D=3D NULL ||' lib/eal Ack, I will remove these NULL checks. >=20 > > RTE_LOG(ERR, EAL, > > "Unregistering with invalid input parameter\n"); > > return -EINVAL; >=20 > > diff --git a/lib/eal/linux/eal_interrupts.c > > b/lib/eal/linux/eal_interrupts.c > [...]