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 F3FF443AFA; Sun, 18 Feb 2024 03:28:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F13B402BB; Sun, 18 Feb 2024 03:28:58 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 0C6FE40262 for ; Sun, 18 Feb 2024 03:28:55 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TcqLH1hWjz2BcsP; Sun, 18 Feb 2024 10:26:47 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 25C001400CC; Sun, 18 Feb 2024 10:28:53 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 18 Feb 2024 10:28:52 +0800 Subject: Re: [PATCH v4 01/18] mbuf: deprecate GCC marker in rte mbuf struct To: Tyler Retzlaff , CC: Ajit Khaparde , Andrew Boyer , Andrew Rybchenko , Bruce Richardson , Chenbo Xia , 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 , References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1707978080-28859-1-git-send-email-roretzla@linux.microsoft.com> <1707978080-28859-2-git-send-email-roretzla@linux.microsoft.com> From: fengchengwen Message-ID: Date: Sun, 18 Feb 2024 10:28:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <1707978080-28859-2-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500024.china.huawei.com (7.185.36.10) 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 Some minor comments style may need adjust. With above fixed, Acked-by: Chengwen Feng On 2024/2/15 14:21, Tyler Retzlaff wrote: > Provide a macro that allows conditional expansion of RTE_MARKER fields > to empty to allow rte_mbuf to be used with MSVC. It is proposed that > we announce the fields to be __rte_deprecated (currently disabled). > > Introduce C11 anonymous unions to permit aliasing of well-known > offsets by name into the rte_mbuf structure by a *new* name and to > provide padding for cache alignment. > > Signed-off-by: Tyler Retzlaff > --- ... > > - /* remaining bytes are set on RX when pulling packet from descriptor */ > - RTE_MARKER rx_descriptor_fields1; > + uint64_t ol_flags; /**< Offload features. */ > > - /* > - * 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. */ > - __extension__ > - struct { > - uint8_t l2_type:4; /**< (Outer) L2 type. */ > - uint8_t l3_type:4; /**< (Outer) L3 type. */ > - uint8_t l4_type:4; /**< (Outer) L4 type. */ > - uint8_t tun_type:4; /**< Tunnel type. */ > + /* remaining bytes are set on RX when pulling packet from descriptor */ > + __rte_marker(RTE_MARKER, rx_descriptor_fields1); > union { > - uint8_t inner_esp_next_proto; > - /**< ESP next protocol type, valid if > - * RTE_PTYPE_TUNNEL_ESP tunnel type is set > - * on both Tx and Rx. > - */ > + char mbuf_rx_descriptor_fields1[8]; > __extension__ > struct { > - uint8_t inner_l2_type:4; > - /**< Inner L2 type. */ > - uint8_t inner_l3_type:4; > - /**< Inner L3 type. */ > + /* > + * 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. */ According dpdk doxygen guidelines [1], prefer prefix comment in above case. [1] https://doc.dpdk.org/guides/contributing/documentation.html#doxygen-guidelines > + __extension__ > + struct { > + uint8_t l2_type:4; > + /**< (Outer) L2 type. */ > + uint8_t l3_type:4; > + /**< (Outer) L3 type. */ > + uint8_t l4_type:4; > + /**< (Outer) L4 type. */ > + uint8_t tun_type:4; > + /**< Tunnel type. */ > + union { > + uint8_t inner_esp_next_proto; > + /**< ESP next protocol type, valid > + * if RTE_PTYPE_TUNNEL_ESP tunnel > + * type is set on both Tx and Rx. > + */ > + __extension__ > + struct { > + uint8_t inner_l2_type:4; > + /**< Inner L2 type. */ > + uint8_t inner_l3_type:4; > + /**< Inner L3 type. */ > + }; > + }; > + uint8_t inner_l4_type:4; > + /**< Inner L4 type. */ > + }; > + }; > + uint32_t pkt_len; > + /**< Total pkt len: sum of all segments. */ The above should also use prefix comment type. > }; > }; > - uint8_t inner_l4_type:4; /**< Inner L4 type. */ > - }; > - }; > ...