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 C6D2145FFF; Mon, 6 Jan 2025 12:01:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB1B84066E; Mon, 6 Jan 2025 12:01:19 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by mails.dpdk.org (Postfix) with ESMTP id 40C674066E for ; Mon, 6 Jan 2025 12:01:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736161277; x=1767697277; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=4BRJ1sNNpVfRwgLNS+WTUfyEd/pP9P21vv4epOt3w/A=; b=heHEEgnEC9xeI0aKDCYkAoiITqmpGv4bikUdgVDx4EEjGYwY15d4Ob3p HtG6DHNFHcwBpNAR4oom2czIdnQXc4egjw/Y9ph6D3pYuwVzIdGcKz+d/ x/JqWMCkukgywBmky1bGktTa7KMLMfJDfjrZlK1QHbtjc+qzJGqsBb5vQ kfgqw5EHJHb2ETA5/tXe0ryHYLTcntAX+xYWPoJCdQjbTbPtTeSc1KsI+ QBxZIzVi12VljffkB0YBMl6Vd9eo/y6kQekKB87DzE33char9gYuJ9b2R 52ASy23vOC/wEj+wxzVXJDx4V5a4Go2ZaamezVHmWyzTYSOUvLnjxyIUN w==; X-CSE-ConnectionGUID: Ic9kjLswQqK21xuuJjfhag== X-CSE-MsgGUID: qNf9OZahTEunUnlmpclG7A== X-IronPort-AV: E=McAfee;i="6700,10204,11307"; a="46802588" X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="46802588" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2025 03:01:16 -0800 X-CSE-ConnectionGUID: E8NRhDOQQ4iUeN60aJ5aFw== X-CSE-MsgGUID: hIkVrRkgQWSWw7p0m0aRJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="102933530" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Jan 2025 03:01:09 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Mon, 6 Jan 2025 03:01:07 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Mon, 6 Jan 2025 03:01:07 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Mon, 6 Jan 2025 03:01:06 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vn++7IOxAW2hCY2hGEeNgI8rYfdj04vRriSYH/3VpAB59m9DfLcLkcyAiR14ogQAqlkZ+S5j1mat7/bujTqLma974HeXMhHS3DTj1PhrKNb7sdUGo8w/tZd9TMjR3/ifUxndFjjZmePeZ3kSEDTy6rrDzde4wIRDZR030TyUtulmUardajjM2Nf0zFGdjpcoBYS3qWdOXWq4jsSpkdKh7VoDcGqBEBtKtxBoWaZ62pCGqh8h2bXKZKps3D+ZpkEvJuNSg2yGWvZ4va+/7HKLCisLeID+ZB+PhHuTA+Q+xvI1qJWM9HFpzt8ce943wNXIF+YXpl6K+9bpbDLBdxSZpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=O3/6/s9tKzkF/9t19I++mgsODQvU+NB9aZ651ACxM4U=; b=b1+nSuf5/H6mbTsX0S6M7RIS0+omOaAcSLzh3V92a1GpdaiC5pbgU5kF+N96FZ5Sou3mvwL2nOY6HCZy/RCwD5gC4+OyoFavbZLHjdCF8Ij+YuHk/gAVSP+TJXsMiIvJP1spsax6im0FtFR4bOpEpdm5t7U5vJNXdw88C3CkgsWB4X6vp+QjKtyVTER8OIrra3XlzJzeMSfPOXSmakV4RSNzmpdbUJ/XZqCL+CoQTikG8G2UcMmWJ1Z8T74SRGxh7EMIstuGv8/dbMxuoBGMgwK8KMdnE8+/PRnXlkKnFsaHzLO4YzUt/rcKb2pLsLEfptr/Bj46n2slT7r0/b9GZg== 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 CY5PR11MB6090.namprd11.prod.outlook.com (2603:10b6:930:2e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Mon, 6 Jan 2025 11:00:20 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%5]) with mapi id 15.20.8314.015; Mon, 6 Jan 2025 11:00:20 +0000 Date: Mon, 6 Jan 2025 11:00:15 +0000 From: Bruce Richardson To: Andre Muezerie CC: Stephen Hemminger , Subject: Re: [PATCH v11 0/3] add diagnostics macros to make code portable Message-ID: References: <1735263196-2809-1-git-send-email-andremue@linux.microsoft.com> <1735918611-17374-1-git-send-email-andremue@linux.microsoft.com> <20250103112402.64bf2d96@pi5> <20250103212634.GA24552@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20250103212634.GA24552@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-ClientProxiedBy: DUZPR01CA0109.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::28) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CY5PR11MB6090:EE_ X-MS-Office365-Filtering-Correlation-Id: feb83530-f2cb-4192-732a-08dd2e414fc0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qMAdFtsgyusoaLPCXqZsFVMtkc5omCWQH+voWexEGocSlp2oU5dR6ktyLvas?= =?us-ascii?Q?D4rtpXnGfG3VBc6Rx/EWnT2DuwTdnt8uRc2x60crj83epyGhXTv0vOkXh/pG?= =?us-ascii?Q?rcojCPL32lHPItxF8nsZKBcHjLOgiWZPRXsAK0BNXUZCcoA8hHN/bIvCI1TB?= =?us-ascii?Q?vBoU0cr5wJ9qbY6VDPVwJh6ay1KwnCFzQriLx4s4sizOIRtmy7AxkOOfARZl?= =?us-ascii?Q?FXsenPq8zs1AqrMdrm0TSqPXkwD794DEz9FY41msh5dLaMU/tb+BdaNcmW3F?= =?us-ascii?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AkRZpQ9PX+vP24pWV?= =?us-ascii?Q?M1yluyXnIyX9TGFl/VtJ3lw0o25XC9JQ3hiqKH1XGi4OkJ2nlRqWcAuwqEH9?= =?us-ascii?Q?TxEcnS4bLnQSO8MxGahncMNlB4lkyzuhcI7KEa2Yn+JdB+M7BE8J/OPdmsUg?= =?us-ascii?Q?jVETsgkwFFnQLNOocN40TyT+2tGbSGQ9/aR499LtbUWx2w=3D=3D?= 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:(13230040)(366016)(376014)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?JSQU+9+TdF0IX8KprWIGqC5VRPpPxq6a4gK/oxVTqoXxA20W7CrUJeNe6JS5?= =?us-ascii?Q?hXZWJEvv1NfJWWVBy4a5k1RepbiubS+zHa3VRGKhsYUC8CrO6B6LzrKK0mec?= =?us-ascii?Q?tpNl9YaVx+V5FnQDIlFUD6tMc1bZEru9U9tc9DXd3HgZsPImb4hwIKVl8tFF?= =?us-ascii?Q?qyTN6AAhz0EO89OrHN1kAIi37fqpLgxIQlFB7rGjC1ZHR0MWz7H2XZGPgIHG?= =?us-ascii?Q?ehsTBvGo4aB0ASUX6hXSoyOmIyMx3xH9VBeE5jukhReYeGN4GHW3TFeqJlo0?= =?us-ascii?Q?iHdpVWFnqPqeRgzdtO/fZcf0o1H3EbLvqA8vaYST7Mvb8/6lF1DORQF8edBm?= =?us-ascii?Q?DkaF6r8U9psx1YPjyp8vj5djwpHbbq7ny3Fr96qtypnaSh2OVF4t6HVPG6Ax?= =?us-ascii?Q?53WnzU18ZymlPyXbotYIADdoSbhUDYGgRWx7fk4s2OcNZ8pSqmxXezxyClUA?= =?us-ascii?Q?2efm0JoCB1sgtbZU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ii?Q?3B7Ih9E9CBJsVd8VfU42v5HLtPcsHKZGvFO/PrKdtKlgP1W3M0tlSuWPPL6P?= =?us-ascii?Q?s5GR+vFoLn7LaSW82UsXrIZply0qaGV0fQBJLqA5/Cgr8yRkd48Rk383iCkl?= =?us-ascii?Q?LYwrcw/SkWFo6A7vqJX2nfEhZtt2R79mZAV996CYbHB4RRC8LTIJ05Iky4Jk?= =?us-ascii?Q?nBPUe+xoNiHFfBjR6VGw2d6Imogzw1HuS7+UdlNQ7dyUzshpQAP+12/J5vX0?= =?us-ascii?Q?Ng=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: feb83530-f2cb-4192-732a-08dd2e414fc0 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2025 11:00:20.3552 (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: AXvYcjElc7AAYg5HiQOiBxLO6Noe1tR9uV5iU3o0PrUtHoYdvCttQnGBGVu/LaBBYdu06ZN8B/iXRpT4tNW1HHGr8fRe7Dsn/U0GygOb27M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6090 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 Fri, Jan 03, 2025 at 01:26:34PM -0800, Andre Muezerie wrote: > On Fri, Jan 03, 2025 at 11:24:02AM -0800, Stephen Hemminger wrote: > > On Fri, 3 Jan 2025 07:36:48 -0800 > > Andre Muezerie wrote: > > > > > From: Andre Muezerie > > > To: andremue@linux.microsoft.com > > > Cc: dev@dpdk.org, stephen@networkplumber.org > > > Subject: [PATCH v11 0/3] add diagnostics macros to make code portable > > > Date: Fri, 3 Jan 2025 07:36:48 -0800 > > > X-Mailer: git-send-email 1.8.3.1 > > > > > > It was a common pattern to have "GCC diagnostic ignored" pragmas > > > sprinkled over the code and only activate these pragmas for certain > > > compilers (gcc and clang). Clang supports GCC's pragma for > > > compatibility with existing source code, so #pragma GCC diagnostic > > > and #pragma clang diagnostic are synonyms for Clang > > > (https://clang.llvm.org/docs/UsersManual.html). > > > > > > Now that effort is being made to make the code compatible with MSVC > > > these expressions would become more complex. It makes sense to hide > > > this complexity behind macros. This makes maintenance easier as these > > > macros are defined in a single place. As a plus the code becomes > > > more readable as well. > > > > Since 90% of these cases are about removing const from a pointer, > > maybe it would be better to have a macro that did that? > > > > Would not work for base driver code which is pretending to be platform independent. > > Most of the warnings I've seen were about dropping the volatile qualifier, like the one below: > > ../drivers/net/i40e/i40e_rxtx_vec_sse.c:42:32: warning: cast from 'volatile struct i40e_32byte_rx_desc::(unnamed at ../drivers/net/i40e/base/i40e_type.h:803:2) *' to '__attribute__((__vector_size__(2 * sizeof(long long)))) long long *' drops volatile qualifier [-Wcast-qual] > 42 | _mm_store_si128((__m128i *)&rxdp[i].read, > | ^ > > To make sure I understood your suggestion correctly, you're proposing to replace this > > __rte_diagnostic_push > __rte_diagnostic_ignored_wcast_qual > _mm_store_si128((__m128i *)&rxdp[i].read, dma_addr0); > __rte_diagnostic_pop > > > with something like this? > > _mm_store_si128(RTE_IGNORE_CAST_QUAL((__m128i *)&rxdp[i].read), dma_addr0); > > This could be done, and I think it does look better, despite the slight line length increase. +1 for this option. One macro can be used to drop all qualifiers, both const and volatile, right?