15/07/2021 14:55, David Marchand: > On Wed, Jul 7, 2021 at 12:56 PM Ivan Malov <ivan.ma...@oktetlabs.ru> wrote: > > diff --git a/drivers/net/sfc/sfc_flow.h b/drivers/net/sfc/sfc_flow.h > > index bd3b374d68..5b1f34aa7a 100644 > > --- a/drivers/net/sfc/sfc_flow.h > > +++ b/drivers/net/sfc/sfc_flow.h > > @@ -136,13 +136,21 @@ typedef int (sfc_flow_item_parse)(const struct > > rte_flow_item *item, > > > > struct sfc_flow_item { > > enum rte_flow_item_type type; /* Type of item */ > > + const char *name; /* Item name */ > > enum sfc_flow_item_layers layer; /* Layer of item */ > > enum sfc_flow_item_layers prev_layer; /* Previous layer of item */ > > enum sfc_flow_parse_ctx_type ctx_type; /* Parse context type */ > > sfc_flow_item_parse *parse; /* Parsing function */ > > }; > > > > -int sfc_flow_parse_pattern(const struct sfc_flow_item *flow_items, > > +#define SFC_FLOW_ITEM(_name) \ > > + .type = RTE_FLOW_ITEM_TYPE_##_name, \ > > + .name = #_name > > Using this concatenation (same for SFC_FLOW_ACTION) confuses > devtools/parse-flow-support.sh script. > > $ ./devtools/check-doc-vs-code.sh > rte_flow doc out of sync for sfc > item > item pf > item phy_port > item port_id > item pppoes > item tcp > item vf > action > > Either net/sfc keeps full RTE_FLOW_x_TYPE_y form like other drivers, > or the check script must be updated (see exclude/include helpers).
Generating code with macros is also counter-intuitive for grep. I think it should be avoided and keep full form RTE_FLOW_x_TYPE_y.