Hi Ferruh & Haiyue,
Have you checked other headers? Like:
rte_ipv4_hdr
rte_ipv6_hdr
rte_tcp_hdr
...

Also
        [ITEM_UDP_SRC] = {
                .name = "src",
                .help = "UDP source port",
                .next = NEXT(item_udp, NEXT_ENTRY(UNSIGNED), item_param),
                .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_udp,
                                             hdr.src_port)),
        },
        [ITEM_UDP_DST] = {
                .name = "dst",
                .help = "UDP destination port",
                .next = NEXT(item_udp, NEXT_ENTRY(UNSIGNED), item_param),
                .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_udp,
                                             hdr.dst_port)),
        },

Or did I get sth. wrong?

BR. Bing

> -----Original Message-----
> From: Ferruh Yigit <[email protected]>
> Sent: Saturday, November 28, 2020 3:09 AM
> To: Olivier Matz <[email protected]>
> Cc: Ferruh Yigit <[email protected]>; [email protected]; Haiyue Wang
> <[email protected]>; Stephen Hemminger
> <[email protected]>; Bing Zhao <[email protected]>
> Subject: [RFC] net: make eCPRI header host network order
> 
> External email: Use caution opening links or attachments
> 
> 
> 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 <[email protected]>
> Signed-off-by: Ferruh Yigit <[email protected]>
> ---
> Cc: Stephen Hemminger <[email protected]>
> Cc: Bing Zhao <[email protected]>
> Cc: Olivier Matz <[email protected]>
> ---
>  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

Reply via email to