From: Gregory Etelson <getelson@nvidia.com>
To: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>
Cc: Matan Azrad <matan@nvidia.com>,
Slava Ovsiienko <viacheslavo@nvidia.com>,
"dev@dpdk.org" <dev@dpdk.org>,
Raslan Darawsheh <rasland@nvidia.com>,
"Shahaf Shuler" <shahafs@nvidia.com>,
Asaf Penso <asafp@nvidia.com>
Subject: Re: [dpdk-dev] [PATCH v2 5/5] net/mlx5: fix non-dv compilation errors
Date: Sat, 14 Nov 2020 18:31:45 +0000 [thread overview]
Message-ID: <MN2PR12MB46390856C6E3CB461E60BB53A5E50@MN2PR12MB4639.namprd12.prod.outlook.com> (raw)
In-Reply-To: <3521151.qGM00RRr3l@thomas>
> 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.
>
The parameter in question is 64 bit unsigned long value.
Structure coating is a syntactic sugar, because
C language does not have bit-field types.
In general, if structure size does not exceed 64 bit it can be passed
by value.
Passing it by reference would create unnecessary indirect access.
> > > 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?
>
>
next prev parent reply other threads:[~2020-11-14 18:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 14:52 [dpdk-dev] [PATCH v2 0/5] restore tunnel offload functionality in mlx5 Gregory Etelson
2020-11-13 14:52 ` [dpdk-dev] [PATCH v2 1/5] net/mlx5: fix tunnel offload object allocation Gregory Etelson
2020-11-13 19:00 ` Thomas Monjalon
2020-11-14 17:47 ` Gregory Etelson
2020-11-14 17:55 ` Thomas Monjalon
2020-11-13 14:52 ` [dpdk-dev] [PATCH v2 2/5] net/mlx5: fix tunnel offload hub multi-thread protection Gregory Etelson
2020-11-13 14:52 ` [dpdk-dev] [PATCH v2 3/5] net/mlx5: fix double table referencing Gregory Etelson
2020-11-13 14:52 ` [dpdk-dev] [PATCH v2 4/5] net/mlx5: fix tunnel offload callback names Gregory Etelson
2020-11-13 14:52 ` [dpdk-dev] [PATCH v2 5/5] net/mlx5: fix non-dv compilation errors Gregory Etelson
2020-11-14 12:06 ` Thomas Monjalon
2020-11-14 17:41 ` Gregory Etelson
2020-11-14 17:53 ` Thomas Monjalon
2020-11-14 18:31 ` Gregory Etelson [this message]
2020-11-14 19:24 ` Thomas Monjalon
2020-11-15 5:47 ` Gregory Etelson
2020-11-13 19:03 ` [dpdk-dev] [PATCH v2 0/5] restore tunnel offload functionality in mlx5 Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN2PR12MB46390856C6E3CB461E60BB53A5E50@MN2PR12MB4639.namprd12.prod.outlook.com \
--to=getelson@nvidia.com \
--cc=asafp@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=rasland@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).