[dpdk-dev] [PATCH v2 5/5] net/mlx5: fix non-dv compilation errors

Thomas Monjalon thomas at monjalon.net
Sat Nov 14 18:53:54 CET 2020


14/11/2020 18:41, Gregory Etelson:
> > 13/11/2020 15:52, Gregory Etelson:
> > > +       ret = mlx5_flow_group_to_table(dev, tunnel, jump_data->group,
> > > +                                      &flow_table, grp_info, error);
> > 
> > The parameter grp_info is a struct passed as value.
> > I believe it should be passed as a pointer.
> 
> struct flow_grp_info is a 64 bit-field:  
> struct flow_grp_info {
> 	uint64_t external:1;
> 	uint64_t transfer:1;
> 	uint64_t fdb_def_rule:1;
> 	/* force standard group translation */
> 	uint64_t std_tbl_fix:1;
> 	uint64_t skip_scale:1;
> };
> Since mlx5_flow_group_to_table() does not change bits configuration,
> there is no need to pass this type as a pointer.

I feel passing struct as pointer is a better practice.

> > I see some other functions are passing arrays with [] syntax, which does
> > not make sense in parameters. I should be a simple pointer.
> 
> I agree that arrays should not be passed with [] syntax.
> However, I kept existing rte flow style - see rte_flow_create

I recommend not following this bad code style.
Later other occurences should be fixed.

> > Matan, Slava, as maintainers, what are your policies in mlx5 code?





More information about the dev mailing list