[PATCH 1/7] net/mlx5: fix the modify field check of tag

Bing Zhao bingz at nvidia.com
Mon Jul 3 15:31:37 CEST 2023


Hi Stephen,
If I understand correctly, do you mean that the internal value and rte_flow API value may have some conflict?
All the MLX5 internal enum values start from INT_MIN. When treating it as a int value, it would not have the same value with rte_flow enums, unless all the 2^^32 are defined.
But yes, this has some risk since there is no limitation of the values in the rte_flow API.

BR. Bing

> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Friday, June 30, 2023 2:09 PM
> To: Bing Zhao <bingz at nvidia.com>
> Cc: Matan Azrad <matan at nvidia.com>; Slava Ovsiienko
> <viacheslavo at nvidia.com>; Ori Kam <orika at nvidia.com>; Suanming Mou
> <suanmingm at nvidia.com>; Raslan Darawsheh <rasland at nvidia.com>;
> dev at dpdk.org; Michael Baum <michaelba at nvidia.com>
> Subject: Re: [PATCH 1/7] net/mlx5: fix the modify field check of tag
> 
> External email: Use caution opening links or attachments
> 
> 
> On Fri, 30 Jun 2023 08:43:03 +0300
> Bing Zhao <bingz at nvidia.com> wrote:
> 
> > @@ -1117,9 +1117,10 @@ flow_dv_fetch_field(const uint8_t *data,
> > uint32_t size)  static inline bool
> > flow_modify_field_support_tag_array(enum rte_flow_field_id field)  {
> > -     switch (field) {
> > +     switch ((int)field) {
> >       case RTE_FLOW_FIELD_TAG:
> >       case RTE_FLOW_FIELD_MPLS:
> > +     case MLX5_RTE_FLOW_FIELD_META_REG:
> 
> Mixing internal and API fields seems like something that could get easily
> broken by changes to rte_flow.


More information about the dev mailing list