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 94D0341D8B; Mon, 27 Feb 2023 07:29:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4084240A84; Mon, 27 Feb 2023 07:29:22 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 7170740A7D for ; Mon, 27 Feb 2023 07:29:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677479360; x=1709015360; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=I1gcA9dFmC9Bh2Y7jkAiwoPAwDbhrtpRupP9SKpLs+s=; b=jW+O9957CmpE1aj7Gs4HUB65xByonPHlL+AS2AmTUoJ/68EOYZUR1L8H 3wJfWHUs7E9OFUZs7hdkfJtzzL/RHoQWsQ9iCrbKEEjcuqhEE2IxdAviI JBiiybqX/sTghY02ragT4EmzMAntV548AR7O6bVXpfUG0U+cHX72ksmcQ hnXIuYj3gnxlMJWWGUW2fWjldxNZ+6Hr98UBHHKu9vTbZNszEhahM5tgA cs4q02dT8XBbkAl+rOYXpYodfn3BHh7UYqmj8bgxaGK/QVCoEOoJXl4hq uD7jQfJ3hvZJEeYUYew50zq4T35jGmo+hD3E07LrdLdsT6xj8k9H2BWJR w==; X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="317588254" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="317588254" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2023 22:29:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="703895493" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="703895493" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP; 26 Feb 2023 22:29:19 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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 22:29:18 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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 22:29:18 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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 22:29:18 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (192.55.55.71) 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 22:29:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ksWo59gFaKMMGsvmu169+lRKGFIcXXjr8fjorhlm7qd4rGg0bnw+F6f6D/cs2YJb3gvYBylPsRKqhrFrniSYkcPzTa7nl7Oyg9C2eMdVTcFoGn41mYciCE98Rrk3my59YFF5yFQxSyBv+U0H50GI1T3ppA0R2IQNtHXNqttDMK0GNzbIMd9IoWt4m1CFchmJ85MFj7PFbLhK6zeZ+fHGUS+UVLFCPZrzw72JOoD2A2UmAEp83s95rwT5rDoDtbnQW9THxyGrak0n5ftAUx0HIBvb9qdljwzX0Fa8pV8zd7WdPHfFpts+0V2kC+UtFX9j/rP8pNnpx42PG0ChweMqwg== 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=vk+V4YINxDaFVfdBMmWoOOWg0X8x9QXFodQBjTr5dTo=; b=Whxmu+An6+YxmaefzkxEcrIvGDLpvXSIkwMW9iNoDU77VWrihBynwg/TBIRvD9DSvUF2UmbR0lYB8JeUv1lVl/E3wfvgeL3WOun9Hd5VRH8DSgW8hL8yxDy3iBZATlSAZPqeCtw1PKxZh+KG4cQyEzd7pQ7LLnleKf0sLnjAFUpZ+fpEVdXWuGCtJ87IQlTRMfo2DyXfMWrkyIj6CqvAO3r0C3PbVWGlgpDYD0GseMnia/1XR4XG7xH7Uz5eEdkjsusybHfJIOYkFdEznOJkWCiC7tjIjJKt+H6GFI56iIuXu+TzPNjR2YH2IoOu6CljHcX8QsmD+VQcG7NGyztpaw== 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 DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by SA1PR11MB5802.namprd11.prod.outlook.com (2603:10b6:806:235::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.28; Mon, 27 Feb 2023 06:29:11 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e%7]) with mapi id 15.20.6134.021; Mon, 27 Feb 2023 06:29:11 +0000 From: "Xu, Rosen" 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 Thread-Topic: [PATCH v2 12/20] raw/ifpga: inherit lock annotations Thread-Index: AQHZSGJw+Zb/Wi9maEeaOQzm/OUjFK7iWJgw Date: Mon, 27 Feb 2023 06:29:11 +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: <20230224151143.3274897-13-david.marchand@redhat.com> 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: DM6PR11MB4252:EE_|SA1PR11MB5802:EE_ x-ms-office365-filtering-correlation-id: 85b90f95-7495-4171-249a-08db188bf020 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gT+q8nF1FG4aDapN3IkeL+nTlb33ZwkpudIYfhvqWeoHmfuzfc+Q9s61gfcpTa8pjW/830yOTYbhaE4LuClThgLAaRpUUPMG0CIAq2ow2mA/4j4hBv4MMeh3UlK+IYrMNQSXkp+glUjvIN4PkqvhO/xZ0pzH+qKWu+IZNlng8YJPnoPCqnr++bjK5z8ruffjGsj1/fKeTjbIrJD3Vnw6xTJsDVGq+TjIW8j++afs06wUM146f2Y1II4dwk1ByDhOyxyrCwILnC0Kroit0gjM8Yt8wcnVI/yRDgiwJrmEVVwhV0rMN1dysCdy/tjI0kg8vi7bKeuVerHZQ3HGPRhNfraaBQ/8o4FW94go+nJcz2xXlpt6uuzTy3d96zWCj93akbiACSxrML2qmuSO5gRYHoJemZX752klMB7abqRJheAH/zFkWWXtLhjFrjzLU9k/bzbaNG0CXVsNp8I+1irjr/y4fqsC4rlG4yz7odYum8AZspQzXQLYHarc34rxMy8dE1HW+Y/N2BW3ZuyJ02UVH2FdjkBQNyBvz9M1BeDHgZS5bbrF4yKKaEi6fpVgAbmF6aHUhIJNfBZwVXT0fLo+KvGC9cwTNRsOjjmncTpmprOY5Y3oo/0BELChflzadnFGOg9PzG9wmgjXB12EiY6+hv/uR6lK00cJago0VzN0g11RLtIBkOYRHaOjWbXnPb6MFlac86Ge1dtsn315/LC/BQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(376002)(366004)(396003)(346002)(136003)(451199018)(38100700002)(2906002)(82960400001)(122000001)(5660300002)(83380400001)(8936002)(316002)(86362001)(66476007)(66556008)(38070700005)(52536014)(66946007)(6506007)(53546011)(9686003)(26005)(4326008)(186003)(64756008)(8676002)(478600001)(7696005)(71200400001)(54906003)(110136005)(33656002)(76116006)(107886003)(55016003)(41300700001)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?R4uTsSBJrqLjEZrvsMkicpHZJRz+FS3xKtYDnOCOCmeOA+DjP51XwdPhBEQK?= =?us-ascii?Q?JCpNXVHxVcdDyb+9cAIF3nUT0+rzUUIYkoAaTw9IzQ4NGIGJvlN8LqoxhqmZ?= =?us-ascii?Q?VMqGWL/rhsEZsuUJyJ0FfP1V72wjZiPg8xazR+PmDwfQkX6uQJCuSAXoFZVn?= =?us-ascii?Q?fS3GCBefflvNShP1NPTKG9mdH5YtGTiAZHSCYVMQioQmVjNMJAPo3kClQ+Ec?= =?us-ascii?Q?jNxYPHiqg8TOcVVKJFvZS9C/KCVHoI4i5Z/4/P5Z0ZYwiK3UZKzQNUIOT/lZ?= =?us-ascii?Q?vAiEYDx/FJ+ZC2bT0GhYEZbZzlOwIUo5dLtD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rUV5VURAm/Ih0UqJNcY2WvkST0sbRwFbtc3faawu?= =?us-ascii?Q?zifeboF1mxXxi04Efnwg4LBRPgfFZE03z6/QHm74X4uLSpqMq38JM/QOxff0?= =?us-ascii?Q?4ozjUsLahUORmnO0yv/HGkmSR1pJMSr8LlpLcSs/QNPaQwFyPakWEwgW3NMk?= =?us-ascii?Q?Z8jpF2AGiPpUPolioyoNGoVyO7IF7F5RD4vckrSFwdNW2lbD4v7yx94d52Mh?= =?us-ascii?Q?27V0pDnWcZmrxCA7YN4I/NhV5x208+J9JvI6KdTgnspAL2+fB0WXtVHRiQHm?= =?us-ascii?Q?UM+o1VUsoVSz7uVID1qZ5NV1SXSZJDvTCfDiYK336FLUDXPLGN5faYGIaWPx?= =?us-ascii?Q?vo7shzpqyqxwXZfG9+gthVa6ctPuZag2zqi/XqzQ?= 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: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85b90f95-7495-4171-249a-08db188bf020 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2023 06:29:11.0747 (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: Ase2g39pwPLD76D3y7jTHiRYH8IGCuHdtkvpZR7SYVJkm/dUCvedhF4y+cUKfEwYJGjFRlkF8Yj8R2dpUCj3jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB5802 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: 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 >=20 > 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 callin= g > those helpers for a dev pointer that did not pass initialisation, >=20 > 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 l= ock > API. >=20 > Signed-off-by: David Marchand > --- > drivers/raw/ifpga/afu_pmd_core.c | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) >=20 > 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); >=20 > -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) >=20 > static int afu_rawdev_configure(const struct rte_rawdev *rawdev, > rte_rawdev_obj_t config, size_t config_size) > -- > 2.39.2 It looks good for me. Reviewed-by: Rosen Xu