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 939A2438E9; Wed, 17 Jan 2024 10:27:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 180D6402B0; Wed, 17 Jan 2024 10:27:11 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mails.dpdk.org (Postfix) with ESMTP id A828F402A6 for ; Wed, 17 Jan 2024 10:27:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705483630; x=1737019630; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=yWkD47/AfjLSolcbs5bB09odZvp3aPp15Vt3MQwXv8U=; b=X1YYFTNFaKSu8lv0xnfal66eFQle0t4qgE4hZCyzp2CqYI+lhM7lVv8J zCfUYJnCrVsWzaUo9sytca3EaE+dE2xUqdfD2BHxmlGgJN3Eio7y2BXMe A/fuh5Qcy8C8U2m/aFl8wgOG4ylA8HlLi/vHeUlGhdDo7dt/zxN+nNMis fMy5uyf1eGZNG19NyOeFjLJyVj0SoN4drhZkIzmrUkVSraZnBVa4o2XPx MrYcMC2CjPZVvawBLqugKWPo+Iz7evhNPCsF/Vl4jQtyOzqlEoMtJE3jU j3/LrT4Fe/CM+8PIUynJiHGJu22y3uz1qvJ89IhA1Vp3VWbUw8tLq8kob A==; X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="6838714" X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="6838714" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2024 01:27:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="903480481" X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="903480481" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Jan 2024 01:26:58 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.35; Wed, 17 Jan 2024 01:26:58 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 17 Jan 2024 01:26:57 -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.35 via Frontend Transport; Wed, 17 Jan 2024 01:26:57 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) 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.35; Wed, 17 Jan 2024 01:26:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g9VjUH5V7JLKohX4OwwDjr8E/teH2luA0tVtPq8d06KrLIOIInWoXlEG16LINGhwr/Lfk6REifS3Erhl/Y5DgoOgHvpq5JXgpoqQT110EJ0/LsM5LnvMKotEdnU0uoF3MNDUPVdI285UFS1WFQnRVeW797AjxwkzHdelC3BRbChtBmIgNZsEzLc0Tfdxch65libh1WgWuVQgAhTz5D06yV6OoD6b1iaO4HIzx/aXDxKLcNGeQvxSmmxLIfT4n5KoD8ln5+Csk5hpagNFkSLfbu5nIOaFoy2PLa2wg3n/dTHeogd1WG2NWC8/dhIS5zPDTLq0BSZ2VLS+xXbWgr33JA== 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=WrU7jWjbLzt6gDmtYOrTUK8l03s+GjThWWayeqMLryk=; b=diYlZXCABfFqPJJSUuudq8nRFnMqODRnk5XIJB/qHB8B1T5PnEgmQ7EjBUEv4/jQXCgrDh4LPhu0bKxTtijZfl9nhJ9addA5fHyAvHDcf3HNSBT3zS4JiJeH9X0DJ0Yr9SNH9tlVeBU+rbIsRD9Q/7U/5hN10GvXM0JkAHMyTHop0Igu2eHPgflPJs/e24sVcxrhao0Z91PjndBeIxQhQsPx9vznNFje4EDdlbASHYkR8BKe4sTcC4EJwOlSSu87UV9vrpC/dKRTP41j+sI7JTNnyEX9Hiz5KMQlVf7Mviq7HaaQAfdIhn40KepBp6JN0su7y3WW9nizhJaWgg2GOA== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by BL1PR11MB5541.namprd11.prod.outlook.com (2603:10b6:208:31f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.23; Wed, 17 Jan 2024 09:26:55 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::df88:b743:97f8:516c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::df88:b743:97f8:516c%5]) with mapi id 15.20.7181.029; Wed, 17 Jan 2024 09:26:55 +0000 Date: Wed, 17 Jan 2024 09:26:49 +0000 From: Bruce Richardson To: Andrew Rybchenko CC: Stephen Hemminger , , , Tyler Retzlaff , "Liang Ma" , Peter Mccarthy , =?iso-8859-1?Q?Se=E1n?= Harte Subject: Re: [PATCH v3 1/5] event/opdl: fix non-constant compile time assertion Message-ID: References: <20231111172153.57461-1-stephen@networkplumber.org> <20240116184307.162882-1-stephen@networkplumber.org> <20240116184307.162882-2-stephen@networkplumber.org> <34c1fbc6-ae4a-4789-9974-fcc4d6a74a60@oktetlabs.ru> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <34c1fbc6-ae4a-4789-9974-fcc4d6a74a60@oktetlabs.ru> X-ClientProxiedBy: DU2PR04CA0087.eurprd04.prod.outlook.com (2603:10a6:10:232::32) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|BL1PR11MB5541:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f47fad5-4f42-41ab-023f-08dc173e7270 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cIAlrFsk6w3JJxyScB0/qyGDmmM38s81SsGA54bJxIu+FaOA0hqhtPWfgtI+bp5khr4bLNrlH/kkACSaTjIJHsO0IKFICvNgnsqSGuyN9nsMxTOf4N/xy9PpFnIHC/dQjHg9XZOQb/g8pZpMH3kQZeElqrEB8VJuEwkpBwuJRUJUON8weXJDAUI8DzMXl+VqEmQeWcFZxAfnd0bMQSgtNbfcN0GK9lKrkyIKRQ3EPSdYV7DcZe/LlyY44rl5hEASFlpz5JyPmk+Lt1Uo2KLjbwvsMmuSyhuK8UY81m+MAbnQuYsQRG0Y4VljLWhdPejZPvpnAyvTH7PIX9TZuqxzvKD2qLLZu0yOngXGCdGNOI/revnhoDGEdZLzXHPju2ZBMDVu613lLxmMzq+/D3Aq7bKCp6UNRj9wqBxyDD7xQJ9O0NC5x1Xj8IeeJ9bzTQtY1Bl3DORHtpQfC7jGQ+UHGKyY9VLoTv2uv4lFdT1Dec8D+1BTxCjuJWEyzmD7FHbF1E1BnLJ02SAa/CheijwKv9ihyZgcOSrYcNLzKUqweykv7uQzdKN/ODD3WUnGOERm X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(4326008)(8676002)(8936002)(26005)(5660300002)(54906003)(44832011)(66946007)(66556008)(66476007)(2906002)(86362001)(6916009)(316002)(6486002)(82960400001)(53546011)(478600001)(6506007)(6666004)(6512007)(41300700001)(38100700002)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cVH8kdoIjdGWTwun/CpMex7RG5FMi9b4vJlwUQQd+0j4/ZEHip1HWb+1TYAz?= =?us-ascii?Q?4+0PXHK885AMRP7FQYva8tRpcdn2PUnFwU9CyThz6XnD+uYJYlpi+idYG98J?= =?us-ascii?Q?RwuuGIG9sB1dLbfJdbTvkYyo02N7GRCmnYm7pKeSOdi/FIUCuCyQJBcx9cXg?= =?us-ascii?Q?dLp8lo8+2G03hd76copqXoyXAAjVc85RqInLox9Ho10yumJ/YfUu30UYUTat?= =?us-ascii?Q?nsHFPQ8EamhlYtOcy4Kb7b1yupGz/25FjgsrElA85lDJRe+kow6Sy5Agx9im?= =?us-ascii?Q?eH68hTOja6ksSaVGuXg16mmRDpLilJMPGw4dhpRLJqNazj1/XALTKMfeHpvX?= =?us-ascii?Q?wbqif8fL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goxiQ2CF?= =?us-ascii?Q?D5nXup8NslJrUolWA3E7L09xJTIZFwOBz2EZr1RxMu0EzJbLD5zlWLCJ/Eel?= =?us-ascii?Q?FA2XUaHPkmQPeiBSm0qnumrIt6fYxUtPHXap7xL+PeHzj8DYNI82rtGbpfKc?= =?us-ascii?Q?tJH8L9V1DAHcRRS0eXUIQaAFrjW+lqa9zcudNxWOoa2YxgHQIpRh7cD3mMcg?= =?us-ascii?Q?1nZ5oWvoQ36mTdjl47yccnuNHFvz0IyAtseMqKR6YRE0KgAHydEPsXTrxP7s?= =?us-ascii?Q?N9X6I39KA61NLhBFRRpKpTEpCcs/yYqScUYZV8TZJn2WTRqGRBxbo2/3Ss0y?= =?us-ascii?Q?lSy+PhGFiRks5FZZT1WOtEXwq4DUS8H+7npnK89rU7InIOdmXe6515582SM0?= =?us-ascii?Q?Jw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5f47fad5-4f42-41ab-023f-08dc173e7270 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2024 09:26:55.7116 (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: uaibEBreUaNa0e3P62gXU5/rop9M5y+dtLulZhnMyRsBbx2/56hjl5+xNs/Y2rfCM2YxjEnPPvCHxM7zSZ0c5ypZs+UEeYmOUXeSpHfyhLU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5541 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 On Wed, Jan 17, 2024 at 10:58:12AM +0300, Andrew Rybchenko wrote: > On 1/16/24 21:41, Stephen Hemminger wrote: > > RTE_BUILD_BUG_ON() was being used with a non-constant value. > > The inline function rte_is_power_of_2() is not constant since > > inline expansion happens later in the compile process. > > Replace it with macro which will be constant. > > > > Fixes: 4236ce9bf5bf ("event/opdl: add OPDL ring infrastructure library") > > Cc: liang.j.ma@intel.com > > Signed-off-by: Stephen Hemminger > > Acked-by: Bruce Richardson > > Acked-by: Tyler Retzlaff > > --- > > drivers/event/opdl/opdl_ring.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c > > index 69392b56bbec..24e0bbe3222d 100644 > > --- a/drivers/event/opdl/opdl_ring.c > > +++ b/drivers/event/opdl/opdl_ring.c > > @@ -31,6 +31,9 @@ > > #define OPDL_OPA_MASK (0xFF) > > #define OPDL_OPA_OFFSET (0x38) > > +/* Equivalent to rte_is_power_of_2() but as macro. */ > > +#define IS_POWER_OF_2(x) (((x) & ((x) - 1)) == 0) > > IMHO adding it in specific driver is a wrong direction. I'm afraid it > will result in duplication of such macros in code base without clear > reason why. > > May be it is better to add it with a proper name to EAL? > +1 Even if it's a lower-case name, lets make it a macro in EAL so we can use it everywhere in asserts.