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 6292C41BAB; Thu, 2 Feb 2023 11:01:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41404406A2; Thu, 2 Feb 2023 11:01:10 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 7A80D40689 for ; Thu, 2 Feb 2023 11:01:09 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id E402650; Thu, 2 Feb 2023 13:01:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru E402650 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1675332069; bh=3Xh5l4XHivUjdhzkYlVcH/FDdOOpk/ox8v4T0SBwZRE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=c+RQrAer+mFcupP3zojocN148v5ivoeYWvQbvXrUZeERyEkpFkXpfcSxcbxuJSDE2 pkemAS1mbEViU9d2Hwf1GHwBWFnuMbXoVvYTq+qN9SgbiWh13jTvnt5R8Br5h6ivyM gS3R8t4HBb1LHAhWmMv/DvSi3cIo4k/mC9hN9bb0= Message-ID: Date: Thu, 2 Feb 2023 13:01:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v5 8/8] net: mark all big endian types Content-Language: en-US To: Ferruh Yigit , Thomas Monjalon , Ori Kam , Olivier Matz Cc: David Marchand , dev@dpdk.org References: <20221025214410.715864-1-thomas@monjalon.net> <20230126161904.864517-1-ferruh.yigit@amd.com> <20230126161904.864517-9-ferruh.yigit@amd.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20230126161904.864517-9-ferruh.yigit@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 1/26/23 19:19, Ferruh Yigit wrote: > From: Thomas Monjalon > > Some protocols (ARP, MPLS and HIGIG2) were using uint16_t and uint32_t > types for their 16 and 32-bit fields. > It was correct but not conveying the big endian nature of these fields. > > As for other protocols defined in this directory, > all types are explicitly marked as big endian fields. > > Signed-off-by: Thomas Monjalon One nit below, Acked-by: Andrew Rybchenko > diff --git a/lib/net/rte_arp.h b/lib/net/rte_arp.h > index 076c8ab314ee..151e6c641fc5 100644 > --- a/lib/net/rte_arp.h > +++ b/lib/net/rte_arp.h > @@ -23,28 +23,28 @@ extern "C" { > */ > struct rte_arp_ipv4 { > struct rte_ether_addr arp_sha; /**< sender hardware address */ > - uint32_t arp_sip; /**< sender IP address */ > + rte_be32_t arp_sip; /**< sender IP address */ > struct rte_ether_addr arp_tha; /**< target hardware address */ > - uint32_t arp_tip; /**< target IP address */ > + rte_be32_t arp_tip; /**< target IP address */ > } __rte_packed __rte_aligned(2); > > /** > * ARP header. > */ > struct rte_arp_hdr { > - uint16_t arp_hardware; /* format of hardware address */ > -#define RTE_ARP_HRD_ETHER 1 /* ARP Ethernet address format */ > + rte_be16_t arp_hardware; /** format of hardware address */ > +#define RTE_ARP_HRD_ETHER 1 /** ARP Ethernet address format */ The comment is fixed above, but it is still wrong. It should be /**<. So, I'd either don't touch it at all, or fix in a right way. Same for all fields below. > > - uint16_t arp_protocol; /* format of protocol address */ > - uint8_t arp_hlen; /* length of hardware address */ > - uint8_t arp_plen; /* length of protocol address */ > - uint16_t arp_opcode; /* ARP opcode (command) */ > -#define RTE_ARP_OP_REQUEST 1 /* request to resolve address */ > -#define RTE_ARP_OP_REPLY 2 /* response to previous request */ > -#define RTE_ARP_OP_REVREQUEST 3 /* request proto addr given hardware */ > -#define RTE_ARP_OP_REVREPLY 4 /* response giving protocol address */ > -#define RTE_ARP_OP_INVREQUEST 8 /* request to identify peer */ > -#define RTE_ARP_OP_INVREPLY 9 /* response identifying peer */ > + rte_be16_t arp_protocol; /** format of protocol address */ > + uint8_t arp_hlen; /** length of hardware address */ > + uint8_t arp_plen; /** length of protocol address */ > + rte_be16_t arp_opcode; /** ARP opcode (command) */ > +#define RTE_ARP_OP_REQUEST 1 /** request to resolve address */ > +#define RTE_ARP_OP_REPLY 2 /** response to previous request */ > +#define RTE_ARP_OP_REVREQUEST 3 /** request proto addr given hardware */ > +#define RTE_ARP_OP_REVREPLY 4 /** response giving protocol address */ > +#define RTE_ARP_OP_INVREQUEST 8 /** request to identify peer */ > +#define RTE_ARP_OP_INVREPLY 9 /** response identifying peer */ > > struct rte_arp_ipv4 arp_data; > } __rte_packed __rte_aligned(2); [snip[