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 2A92D41D8D; Mon, 27 Feb 2023 08:16:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B95A40ED6; Mon, 27 Feb 2023 08:16:03 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 657F440ED6 for ; Mon, 27 Feb 2023 08:16:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677482161; x=1709018161; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=fFKG6x1yhBS1dZn/mS0NeIr4fc3AEBcFw5XJdlYQ3p0=; b=LkNVZUXL7YBMB/YcWQHi/w7y0gl1An/yTV+MQ4V4p+9+raPy1sZex9Zk vTk4w/gehZVUI34uOvCcfy9kIGmHtt2BWB/XzlFVFBc6EKEKjmSingGa0 Z89RizNCVEoIVE/Dtc216l1zot63FwSROS1HgKhzfe+Fu7f+AXhUEQqol 4jLmzt4XVX0t5JbWHP3GVSTk3bGmSzMT/5+lI1pbw6dRxxkbhCwQJB95I 75FoU9HR6MucX8VYRjqmKr4p1nt6N0uzfZx7mPBiJJHxwQpwubZjXoxiW 0XUNlmQe1jIWdlO/ycInbYAOQlB/f/2hogp3yrhSHLj/hUBtR9+sL6A6/ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="335276795" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="335276795" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2023 23:15:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="703902816" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="703902816" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 26 Feb 2023 23:15:41 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 26 Feb 2023 23:15:41 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sun, 26 Feb 2023 23:15:41 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sun, 26 Feb 2023 23:15:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bb39mboBU1h6X4bz4+k+6h1ppjt1JnMtxvvHu8DCWi8n4IChqxM00qLeZt2nO/Mhyl79A3tdh1JtRsBtdP1cFrXpWeZ3sHO9+5EpDui6TbpbYVvaSYK550hlWtchpe732XcqZU63vNUP73qcHUm11HQSZ+RYr4x6AKuVgfNHh/EwQdRLS7RxCzH56IcMtaY+9ILyD6NHq2FiWb2uAdAhfZ9xvagQPGFAMsMbc7SUBViHvV67/uPajnY4uzfeGZNPZTEn5RvVQjLgMImWzm6JLqfaqkhxuFz+RR8ouIPjf8c1uzeEbCUoCP7QFWd2U6+nkZEGoYed2cnKa69GooKopg== 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=zsYbbT7dwva3ClvyKs5DygAHrhAdY2TO9x7iZ/mcIC0=; b=efRXl0Zkny5H/eA7aPyTmXsAn9TbszHu9g1rX6x67FqhhZGkQ5FRCvf8FJ6nXXYEGZQhhX65MFX6Dhc/8IUagtZ1U2DeSyhFHdhJ9Fi+OadUiSeqQlDtx2Vik2uzyuLdDMRp7qd3ZNhn0cM6yPkOeeKgYzX9YGU7Ffu3nLEUWcnzXBl0GHjK8Xjh+LLK1YMScenY4X/p+JLt95dUCoFEPkfVe+89R8+6+l1YFUrNRs9vbhO86MBc0R9LD3XHNuEt7p7C5sOg9xn3OqVLCGV6kaFwpGEzCDK3BHTjir67kJXiqecqCHOtlIUzmazhNBgiXr6des3h48pnIDnyOLzlpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3530.namprd11.prod.outlook.com (2603:10b6:5:72::19) by DS7PR11MB7690.namprd11.prod.outlook.com (2603:10b6:8:e6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 07:15:36 +0000 Received: from DM6PR11MB3530.namprd11.prod.outlook.com ([fe80::2a1b:9bf9:445f:567f]) by DM6PR11MB3530.namprd11.prod.outlook.com ([fe80::2a1b:9bf9:445f:567f%3]) with mapi id 15.20.6134.024; Mon, 27 Feb 2023 07:15:36 +0000 From: "Huang, Wei" To: "Xu, Rosen" , David Marchand , "dev@dpdk.org" CC: "thomas@monjalon.net" , "Zhang, Tianfei" Subject: RE: [PATCH v2 12/20] raw/ifpga: inherit lock annotations Thread-Topic: [PATCH v2 12/20] raw/ifpga: inherit lock annotations Thread-Index: AQHZSGJw+Zb/Wi9maEeaOQzm/OUjFK7iWJgwgAAMmiA= Date: Mon, 27 Feb 2023 07:15:36 +0000 Message-ID: References: <20230224081642.2566619-1-david.marchand@redhat.com> <20230224151143.3274897-1-david.marchand@redhat.com> <20230224151143.3274897-13-david.marchand@redhat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB3530:EE_|DS7PR11MB7690:EE_ x-ms-office365-filtering-correlation-id: 36488d98-1625-41a0-6e44-08db18926c3f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iYupHW0zCXzvRTwctyuQHBA06uNnoPSOFr3DfdCdXZPzsaGBVH6tNbMv3oo836dLKrMntqYouhijxa/yMIYGXWnPUwuLW1rcz+D/vNgdjDNtiF3IMc5EcYrjKZsZdGvFrtlBwRKPJdrTp6XrY3WibRA40liWSWAlC1E3koAaoXuO/xQMroKNrH3SO2RVHhN67uRAVB+JZQ1+WNvp5+tXozRHFHl0vN/F9MYimZLGkHI0oFmREphr7BTo89OqNiRQtObsIQCZCgx5jExPRmdwKZo7TXPAwq86nFJgrxnsWkKlqv9BoWayEucgz68F8QK28+jCKk92cXKquvhxQW5BQqn8u7eWbJjeiqR4Xtq7pbO3WUJCR8JGf6xTEGafn2xhjh28e7w5lPaCg7/fzfFhrHmjUWvsay4cPrXnKWmJ8bg1ZbAaTqVsd1gvdkzsc1lIl6iJ9DLNLvLV2qsWvpXODpV0bXdtr80CCok/6gjVsKKClWhDA8Ki+kkcXJqUUtGgkTxlM+rq0LS3fuo2xz9m0TZxZIGM1EhaNOqv1RVZCMsoMOG5mGfA0petE6uSP4eh9cLlN2MDk0p4gUn6gnSDFhbanARmKIim84vm43xxi4IP1tKCdf4CtL42Bh4n6xXy/gCIrD9iorii663qrZrllOFlRFK+yXcZpfJoxMuGzFmAgHPdxaFWlce+izAeCNWkKAeyfC9k38AVfcjr2pFkaw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3530.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(136003)(396003)(346002)(376002)(366004)(451199018)(122000001)(316002)(82960400001)(2906002)(33656002)(5660300002)(8936002)(52536014)(55016003)(86362001)(53546011)(6506007)(71200400001)(66946007)(76116006)(9686003)(186003)(26005)(64756008)(66476007)(4326008)(66446008)(110136005)(54906003)(66556008)(38100700002)(8676002)(41300700001)(38070700005)(83380400001)(478600001)(7696005)(107886003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Bv1LsAuqntYIBnNVQScX0g+yskzSU6Cwrnf9Hwyy6/NLwSK2Dsk2/QTegLqe?= =?us-ascii?Q?z3nrzD12MTO5rjFS4ByAhcQ69avjrNuYUJhhfHh32VAC0T+uxFvb4g5CXA+z?= =?us-ascii?Q?W+mfbbyFzNNj2fzjm87j6aK8QT80kHg8S7jKOop3WMoXXxAbPoNwR3vbhNoU?= =?us-ascii?Q?KrOaHq329RebFtleEj3HqVcdW3BvLXaRhpPAN2Mug9ZTIB3tXabmo6BSqNBr?= =?us-ascii?Q?T0AcK1Ktt8yaMZmvFi/MkLEIN0VTlAFwnoWMNye3m/mg62yaNtLXLl06VkMj?= =?us-ascii?Q?tZIGDvSYK/GLtpE5m5xcB1Pdw4gn7hEd85NYXhyuffLfVJhOekf3sX1Fdzh5?= =?us-ascii?Q?0f8EXtKoWsv2b/ppM/1PmV33gqUbYUoHROyZ8exZlhh1fNbO/6XYZTS3pvyA?= =?us-ascii?Q?yJ5x1HnUTB0NOkAqx4npmPEjJm4DJdl2yu37ss6GnJZemsrOrMNE4u8j23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d+CC/DUPuoRrbqRhDjFc9m1vUXsMK?= =?us-ascii?Q?jQ4uYioAwJMuUTPx/rEbpES6ji4m+8QnFehpBYf+LziD+UTJxSw2Afqa36hZ?= =?us-ascii?Q?AkKCWZgABw0DRAcG3CIY9Krmn28FzvaIrTm5g9ZV+0BJt+xAbUQLvCKE8p1h?= =?us-ascii?Q?JoWmgOy6T7mu9j4fdQaBF4m+pb9/T0Eyd5XFeNHhQHmhJGw6/jvUBxqpGr2T?= =?us-ascii?Q?nUFoSaZSIFyNPXet05Geb6Kq67fOmRYCnGTSk8nz?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3530.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36488d98-1625-41a0-6e44-08db18926c3f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2023 07:15:36.3289 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Sbyslcg0mtbuti1R/5qTbjdWTpGo14oRMo7RlXdwQe+AW/eZadR1lRm6aVzwccXAKJLdK2MM2l12SioSvrM5Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7690 X-OriginatorOrg: intel.com 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 Hi, > -----Original Message----- > From: Xu, Rosen > Sent: Monday, February 27, 2023 14:29 > To: David Marchand ; dev@dpdk.org > Cc: thomas@monjalon.net; Zhang, Tianfei ; Huang, > Wei > Subject: RE: [PATCH v2 12/20] raw/ifpga: inherit lock annotations >=20 > Hi, >=20 > > -----Original Message----- > > From: David Marchand > > Sent: Friday, February 24, 2023 11:12 PM > > To: dev@dpdk.org > > Cc: thomas@monjalon.net; Xu, Rosen ; Zhang, > > Tianfei > > Subject: [PATCH v2 12/20] raw/ifpga: inherit lock annotations > > > > The checks in those helpers are useless: > > - all (start/stop/reset/test) callers ensure that dev !=3D NULL, > > - dev->sd can't be NULL either as it would mean the application is call= ing > > those helpers for a dev pointer that did not pass initialisation, > > > > Once the checks are removed, the only thing that remains is calls to > > the rte_spinlock API, so simply use macros and inherit annotations > > from the lock API. > > > > Signed-off-by: David Marchand > > --- > > drivers/raw/ifpga/afu_pmd_core.c | 17 ++--------------- > > 1 file changed, 2 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/raw/ifpga/afu_pmd_core.c > > b/drivers/raw/ifpga/afu_pmd_core.c > > index ddf7a34f33..3ab1f47ac1 100644 > > --- a/drivers/raw/ifpga/afu_pmd_core.c > > +++ b/drivers/raw/ifpga/afu_pmd_core.c > > @@ -23,21 +23,8 @@ static struct rte_afu_uuid > > afu_pmd_uuid_map[AFU_RAWDEV_MAX_DRVS+1]; > > TAILQ_HEAD(afu_drv_list, afu_rawdev_drv); static struct afu_drv_list > > afu_pmd_list =3D TAILQ_HEAD_INITIALIZER(afu_pmd_list); > > > > -static inline int afu_rawdev_trylock(struct afu_rawdev *dev) -{ > > - if (!dev || !dev->sd) > > - return 0; > > - > > - return rte_spinlock_trylock(&dev->sd->lock); > > -} > > - > > -static inline void afu_rawdev_unlock(struct afu_rawdev *dev) -{ > > - if (!dev || !dev->sd) > > - return; > > - > > - rte_spinlock_unlock(&dev->sd->lock); > > -} > > +#define afu_rawdev_trylock(dev) rte_spinlock_trylock(&dev->sd->lock) > > +#define afu_rawdev_unlock(dev) rte_spinlock_unlock(&dev->sd->lock) > > > > static int afu_rawdev_configure(const struct rte_rawdev *rawdev, > > rte_rawdev_obj_t config, size_t config_size) > > -- > > 2.39.2 >=20 >=20 > It looks good for me. > Reviewed-by: Rosen Xu Agree that pointer check is redundant, rte_spinlock API can be called direc= tly. Reviewed-by: Wei Huang