DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC] net: make eCPRI header host network order
@ 2020-11-27 19:09 Ferruh Yigit
  2020-11-28  3:18 ` Bing Zhao
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2020-11-27 19:09 UTC (permalink / raw)
  To: Olivier Matz; +Cc: Ferruh Yigit, dev, Haiyue Wang, Stephen Hemminger, Bing Zhao

Other protocol structs are in the host byte order, having eCPRI in
network byte order is insistent and error prone.

Making eCPRI protocol header host byte order.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Bing Zhao <bingz@nvidia.com>
Cc: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_net/rte_ecpri.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/librte_net/rte_ecpri.h b/lib/librte_net/rte_ecpri.h
index 1cbd6d813363..67bf9186ff6f 100644
--- a/lib/librte_net/rte_ecpri.h
+++ b/lib/librte_net/rte_ecpri.h
@@ -60,21 +60,20 @@ extern "C" {
 RTE_STD_C11
 struct rte_ecpri_common_hdr {
 	union {
-		rte_be32_t u32;			/**< 4B common header in BE */
+		uint32_t u32;			/**< 4B common header in host byte order */
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint32_t size:16;	/**< Payload Size */
-			uint32_t type:8;	/**< Message Type */
 			uint32_t c:1;		/**< Concatenation Indicator */
 			uint32_t res:3;		/**< Reserved */
 			uint32_t revision:4;	/**< Protocol Revision */
+			uint32_t type:8;	/**< Message Type */
 #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint32_t revision:4;	/**< Protocol Revision */
 			uint32_t res:3;		/**< Reserved */
 			uint32_t c:1;		/**< Concatenation Indicator */
 			uint32_t type:8;	/**< Message Type */
-			uint32_t size:16;	/**< Payload Size */
 #endif
+			uint32_t size:16;	/**< Payload Size */
 		};
 	};
 };
-- 
2.26.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-30  1:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 19:09 [dpdk-dev] [RFC] net: make eCPRI header host network order Ferruh Yigit
2020-11-28  3:18 ` Bing Zhao
2020-11-28  3:55   ` Wang, Haiyue
2020-11-28  5:31   ` Wang, Haiyue
2020-11-28  9:07     ` Bing Zhao
2020-11-30  1:15       ` Wang, Haiyue

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git