[PATCH v3 1/8] ethdev: add IPv6 routing extension header definition

Stephen Hemminger stephen at networkplumber.org
Tue Jan 31 03:55:53 CET 2023


On Tue, 31 Jan 2023 02:27:56 +0000
Rongwei Liu <rongweil at nvidia.com> wrote:

> HI Stephen
> 
> BR
> Rongwei
> 
> > -----Original Message-----
> > From: Stephen Hemminger <stephen at networkplumber.org>
> > Sent: Tuesday, January 31, 2023 00:48
> > To: Rongwei Liu <rongweil at nvidia.com>
> > Cc: Matan Azrad <matan at nvidia.com>; Slava Ovsiienko
> > <viacheslavo at nvidia.com>; Ori Kam <orika at nvidia.com>; NBU-Contact-
> > Thomas Monjalon (EXTERNAL) <thomas at monjalon.net>; Aman Singh
> > <aman.deep.singh at intel.com>; Yuying Zhang <yuying.zhang at intel.com>;
> > Ferruh Yigit <ferruh.yigit at amd.com>; Andrew Rybchenko
> > <andrew.rybchenko at oktetlabs.ru>; Olivier Matz <olivier.matz at 6wind.com>;
> > dev at dpdk.org; Raslan Darawsheh <rasland at nvidia.com>
> > Subject: Re: [PATCH v3 1/8] ethdev: add IPv6 routing extension header
> > definition
> > 
> > External email: Use caution opening links or attachments
> > 
> > 
> > On Mon, 30 Jan 2023 05:59:33 +0200
> > Rongwei Liu <rongweil at nvidia.com> wrote:
> >   
> > >
> > > +/**
> > > + * IPv6 Routing Extension Header
> > > + */
> > > +struct rte_ipv6_routing_ext {
> > > +     uint8_t next_hdr;                       /**< Protocol, next header. */
> > > +     uint8_t hdr_len;                        /**< Header length. */
> > > +     uint8_t type;                           /**< Extension header type. */
> > > +     uint8_t segments_left;                  /**< Valid segments number. */
> > > +     __extension__
> > > +     union {
> > > +             rte_be32_t flags;
> > > +             struct {
> > > +                     uint8_t last_entry;     /**< The last_entry field of SRH */
> > > +                     uint8_t flag;           /**< Packet flag. */
> > > +                     rte_be16_t tag;         /**< Packet tag. */
> > > +             };
> > > +     };
> > > +     __extension__
> > > +     rte_be32_t segments[0];                 /**< Each hop IPv6 address. */  
> > 
> > Use flex array rather than zero size.
> > Zero size arrays cause warnings with later compilers.  
> Using flex array helps improve this network header definition but caused warning in the rte_flow_item_**
> struct rte_flow_item_ipv6_routing_ext {
>        struct rte_ipv6_routing_ext hdr;                                                                                                                                                                                                                    
> }; 
> "invalid use of structure with flexible array member [-Werror=pedantic]"

Not sure, only Nvidia/Mellanox messes with pedantic


More information about the dev mailing list