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 9B40B43D14; Thu, 21 Mar 2024 11:32:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7551142830; Thu, 21 Mar 2024 11:32:18 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id 1693540261 for ; Thu, 21 Mar 2024 11:32:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711017137; x=1742553137; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=/xV3PX1Z5GRDRxNI4nVEaOx2OQJEYtYTOPjo1EVT/Qs=; b=Yt3Udf3XiDmuysVwCiGEuGelj41pwZ5KrqwLICVRhstnJaexveYK7Bic 5mt7MeFOuR3YN+hLm9VFU/FLJQDh/jDLwttdkzQ2DqnWub5GkWQN24mS7 DQrs3uWOUFkQciDOVBe2KoHzhtqGQ08ER57vKu/FDMLBZl/qccR4c/8+R bgDXaXZmgm89QKbe9IVKcq+kOGIeTp72R5yqtmW/2YCxHtlg4aaXLncrv mfitW/FJS+7BBOOMAPtFT68cKhZih03TUE9ONZ8CT+K1EPltyaNS505KS MvFceP21uJsJ/QA6TMSDJaMhM3/Cud3B5XvVuJSmErqPTAvNOrkODsQD7 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11019"; a="6112229" X-IronPort-AV: E=Sophos;i="6.07,142,1708416000"; d="scan'208";a="6112229" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 03:32:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,142,1708416000"; d="scan'208";a="14865123" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Mar 2024 03:32:16 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 21 Mar 2024 03:32:15 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 21 Mar 2024 03:32:15 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 21 Mar 2024 03:32:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mikT+RybOfrPFHWnfjAkxRGRnTNrrr8K9xl5kWxoi5/a5V6h7OUG8mzgP2GVQ52IZl6RH2BgRFXFDE9XBDb5GwW0P1aLEA7ajEnMkbgJmK9H6n8Bdzj94LW2k+eTObk48qoAoPFWXb30xMVdKTbz8dhmPj2h/D/MupbUWW2aU7708EqI7ibPHXP5lPUynAEr0kMJdVUtdcW4IxEL2TcN3Jp6lCp2Fca4LQaVCNVrZzWIHUbkTyt6f+5dgw2uFxxOR5+XV3N8SsFjFkY/ILeZTQuH2bJw2siglzT1ahERMxc9zvA6mn6+BvvLXVYa8KG+2WJXD+5WbgqCav38aGtjQQ== 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=40OyTnZ2D9KwRyMCTRawPNVbrFQB52r02YIjwxn9vjU=; b=iwuK73i4etzfExxjlooHGug4GOhRogOxhLPAfXnBZ3sTeTndB6yVH3vAYnoH2ndVG2BzKO/ajY3tQKYxFq6Y9/cOQ0bceiQyHqQfIyxfipracmaJJgeVj2dCvh9+hQ4mE+GEivmnyj4LQmS2iKXnw64vmqWastfeme0hmy1w2utKYbqryDlBdfkIP3BY1J+/oY5yO1WmJksl5r2SdLdTLCKDuUujRMRIjsIs7Eqz+nkZRB4En0UvhvocB3Tedm0jOwCuIL39uBivrCVNU9V0T68SsQxIROp1+PbtRDBpXfoYpBsvKRiTkbu58T1HvJ/nU86nxmcsfrFM51pJhu32Ug== 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 SN7PR11MB6852.namprd11.prod.outlook.com (2603:10b6:806:2a4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.12; Thu, 21 Mar 2024 10:32:12 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f%7]) with mapi id 15.20.7409.010; Thu, 21 Mar 2024 10:32:12 +0000 Date: Thu, 21 Mar 2024 10:32:02 +0000 From: Bruce Richardson To: Tyler Retzlaff CC: , Ajit Khaparde , Andrew Boyer , Andrew Rybchenko , Chenbo Xia , Chengwen Feng , Dariusz Sosnowski , David Christensen , Hyong Youb Kim , Jerin Jacob , Jie Hai , Jingjing Wu , John Daley , Kevin Laatz , Kiran Kumar K , "Konstantin Ananyev" , Maciej Czekaj , Matan Azrad , Maxime Coquelin , Nithin Dabilpuram , Ori Kam , Ruifeng Wang , Satha Rao , Somnath Kotur , Suanming Mou , Sunil Kumar Kori , Viacheslav Ovsiienko , Yisen Zhuang , Yuying Zhang , Subject: Re: [PATCH v7 2/4] mbuf: remove rte marker fields Message-ID: References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1710972098-2209-1-git-send-email-roretzla@linux.microsoft.com> <1710972098-2209-3-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1710972098-2209-3-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: DU2PR04CA0280.eurprd04.prod.outlook.com (2603:10a6:10:28c::15) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SN7PR11MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: a69e004b-d3e6-404b-eb3b-08dc49922b6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ckk5C8EHKM+Og4VkXfPyWwxj8ORwVBzynWNaUfAHSQh6/9uV4waOj8jjY6/teBJXhUH3E3HWSVGbfauGvzQfPXLrZU4uDhiYyIE32AC6at0lqNMswRo0sWJAa52133yKdseC3MZ6XO2pXBdrcFT/cN5U+e/KqsupTm9VoMRq5CXCcZIorTBOlU/XNBpboTIvKD67iJyMIlhAoC4vqmEjRofLEt8LhWlSNWJ8ccztBifGBOpsHchZ9XAg/jrGeIJtzKAMPjVNerAXlREKWHQuLof4MLL020hnbnnYpbdjWYrjvjX3KWNazC/YZ6hRXWWaJPzGmu9SLNXR1lgkOji90FzRlCWgBFcHx6MW66IuBAqHxyuTHH+t8nPME/rvKPH5P+GlxpQKtV2wRpe5XQNRfGVNyc/s8E5fEiGCnDXnvkFGpJCK+n3dPztv3GLRfYIPBkwq6iPqioOwHDdJX1TycpkBibcoe5/Rqt5dNtfK+g5814xAyK78cgaB7I8tRmeSaXAo32oT72WdHhcy2kwPXxMheGSsGEGCuXtMkenev+j5AK7r6Kxeq92m43NipEsmTq2aInsDKuv7aTOfjJN/LIu8UH8Uf6Xy3KM9lyUtSsVp4qkFxCnaqykYYfyWs/BsDZe6KD6rFLWF9ql7q6h0NPpkPCA5iJdcjN3eDEf6WmQ= 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)(1800799015)(376005)(366007)(7416005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UgcWpFoFhmFyfGEdZ/2W1aLAM2L6gR9kzYSMd+XPt7EKbCaheI2bA5G/7ckn?= =?us-ascii?Q?6Ja4+Qoa5qcgeAjMT+jLJj2V5rva879nWLj+Ywa7Q0q7JGyyjrQguSccLgvQ?= =?us-ascii?Q?cbBMTYTeJf1SvHqyIFxMS/io/PAyoGas4G6ARMFFNvZCeeZT9Megj5JoGrJB?= =?us-ascii?Q?tsHtWnWgZw7soyPUKzzt/DIfZoEpbdBJyT/qyaMlmGozsvDplVxwja3iVCXY?= =?us-ascii?Q?DGDSoHt3WEZozqK+0lm4AZ/ALnvGMbVnVMewHAkv34c5ty6Jn6MJ5l1zzRd2?= =?us-ascii?Q?iVK2uAxGdx46NFfwdWKFhCwBaRUzhAd/OIew8+eHMlNeGp3dkJEFK5GjICO0?= =?us-ascii?Q?vHd7u8fRhrBIJR0ASoQ7b7jLtC/oIkWbIRcju5Qy78pY8e47DQI2+qq8c/SV?= =?us-ascii?Q?ZH8H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N8phQQ2zoAn?= =?us-ascii?Q?yoKO1nUG+9Yq5hSrSCY5XoaNziI0c8h6eFEwViUsuLG8WwXNk9S96cXvIt0X?= =?us-ascii?Q?EzDSg17Rv3etu/nzPsv7eswD3qCGC/b179Rq318+JLsZqso7Lq3L5RzpjfS1?= =?us-ascii?Q?48HPRtGiXbYTOfdXZz+shyrnw9IaenC3+2GQ+1yBs/Rp7ro5yjsSdW3e/p75?= =?us-ascii?Q?S2wyy5nfpSCN8RSa6ekrZGsQ7MLUwmz4sII/sSrlaBKO3jirDgd03xa0ZEf8?= =?us-ascii?Q?ehBvBBz3sevxSh9braR0REdWsXYe9BXFFsUGcVfUoUWszE8N7lyjGchNK/8G?= =?us-ascii?Q?eQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: a69e004b-d3e6-404b-eb3b-08dc49922b6a X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2024 10:32:12.3659 (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: whMdBt1AoZu/EgkR7VTWOWjhuveq0SPAXZC2EbUdIPYGw6u9byby6zz5f4Nh7rKVVbVlZn4bGX8Zh5DHOeL5IVo1rYlH+t0zXLpTZN9lndk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6852 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, Mar 20, 2024 at 03:01:36PM -0700, Tyler Retzlaff wrote: > RTE_MARKER typedefs are a GCC extension unsupported by MSVC. Remove > RTE_MARKER fields from rte_mbuf struct. > > Maintain alignment of fields after removed cacheline1 marker by placing > C11 alignas(RTE_CACHE_LINE_MIN_SIZE). > > Provide new rearm_data and rx_descriptor_fields1 fields in anonymous > unions as single element arrays of with types matching the original > markers to maintain API compatibility. > > Signed-off-by: Tyler Retzlaff > --- > doc/guides/rel_notes/release_24_03.rst | 2 + > lib/mbuf/rte_mbuf.h | 4 +- > lib/mbuf/rte_mbuf_core.h | 188 ++++++++++++++++++--------------- > 3 files changed, 104 insertions(+), 90 deletions(-) > > diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst > index 14826ea..4f18cca 100644 > --- a/doc/guides/rel_notes/release_24_03.rst > +++ b/doc/guides/rel_notes/release_24_03.rst > @@ -216,6 +216,8 @@ Removed Items > > * acc101: Removed obsolete code for non productized HW variant. > > +* mbuf: ``RTE_MARKER`` fields ``cacheline0`` and ``cacheline1`` > + have been removed from ``struct rte_mbuf``. > > API Changes > ----------- > diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h > index 286b32b..4c4722e 100644 > --- a/lib/mbuf/rte_mbuf.h > +++ b/lib/mbuf/rte_mbuf.h > @@ -108,7 +108,7 @@ > static inline void > rte_mbuf_prefetch_part1(struct rte_mbuf *m) > { > - rte_prefetch0(&m->cacheline0); > + rte_prefetch0(m); > } > > /** > @@ -126,7 +126,7 @@ > rte_mbuf_prefetch_part2(struct rte_mbuf *m) > { > #if RTE_CACHE_LINE_SIZE == 64 > - rte_prefetch0(&m->cacheline1); > + rte_prefetch0(RTE_PTR_ADD(m, RTE_CACHE_LINE_MIN_SIZE)); > #else > RTE_SET_USED(m); > #endif > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h > index 9f58076..665213c 100644 > --- a/lib/mbuf/rte_mbuf_core.h > +++ b/lib/mbuf/rte_mbuf_core.h > @@ -465,8 +465,6 @@ enum { > * The generic rte_mbuf, containing a packet mbuf. > */ > struct __rte_cache_aligned rte_mbuf { > - RTE_MARKER cacheline0; > - > void *buf_addr; /**< Virtual address of segment buffer. */ > #if RTE_IOVA_IN_MBUF > /** > @@ -488,116 +486,130 @@ struct __rte_cache_aligned rte_mbuf { > #endif > > /* next 8 bytes are initialised on RX descriptor rearm */ > - RTE_MARKER64 rearm_data; > - uint16_t data_off; > - > - /** > - * Reference counter. Its size should at least equal to the size > - * of port field (16 bits), to support zero-copy broadcast. > - * It should only be accessed using the following functions: > - * rte_mbuf_refcnt_update(), rte_mbuf_refcnt_read(), and > - * rte_mbuf_refcnt_set(). The functionality of these functions (atomic, > - * or non-atomic) is controlled by the RTE_MBUF_REFCNT_ATOMIC flag. > - */ > - RTE_ATOMIC(uint16_t) refcnt; > + union { > + uint64_t rearm_data[1]; > + __extension__ > + struct { > + uint16_t data_off; > + > + /** > + * Reference counter. Its size should at least equal to the size > + * of port field (16 bits), to support zero-copy broadcast. > + * It should only be accessed using the following functions: > + * rte_mbuf_refcnt_update(), rte_mbuf_refcnt_read(), and > + * rte_mbuf_refcnt_set(). The functionality of these functions (atomic, > + * or non-atomic) is controlled by the RTE_MBUF_REFCNT_ATOMIC flag. > + */ > + RTE_ATOMIC(uint16_t) refcnt; > > - /** > - * Number of segments. Only valid for the first segment of an mbuf > - * chain. > - */ > - uint16_t nb_segs; > + /** > + * Number of segments. Only valid for the first segment of an mbuf > + * chain. > + */ > + uint16_t nb_segs; > > - /** Input port (16 bits to support more than 256 virtual ports). > - * The event eth Tx adapter uses this field to specify the output port. > - */ > - uint16_t port; > + /** Input port (16 bits to support more than 256 virtual ports). > + * The event eth Tx adapter uses this field to specify the output port. > + */ > + uint16_t port; > + }; > + }; > > uint64_t ol_flags; /**< Offload features. */ > > /* remaining bytes are set on RX when pulling packet from descriptor */ > - RTE_MARKER rx_descriptor_fields1; > - > - /* > - * The packet type, which is the combination of outer/inner L2, L3, L4 > - * and tunnel types. The packet_type is about data really present in the > - * mbuf. Example: if vlan stripping is enabled, a received vlan packet > - * would have RTE_PTYPE_L2_ETHER and not RTE_PTYPE_L2_VLAN because the > - * vlan is stripped from the data. > - */ > union { > - uint32_t packet_type; /**< L2/L3/L4 and tunnel information. */ > + void *rx_descriptor_fields1[1]; Can we make this array the actual size of all the fields, rather than just an 8-byte value? That would allow the right think to be done if assigning the descriptor fields from one mbuf to another, or when using memset or memcpy on them. /Bruce