From: Thomas Monjalon <thomas@monjalon.net>
To: Gregory Etelson <getelson@nvidia.com>
Cc: Matan Azrad <matan@nvidia.com>,
Slava Ovsiienko <viacheslavo@nvidia.com>,
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 20:24:47 +0100 [thread overview]
Message-ID: <41621094.tlia0Zn6mn@thomas> (raw)
In-Reply-To: <MN2PR12MB46390856C6E3CB461E60BB53A5E50@MN2PR12MB4639.namprd12.prod.outlook.com>
14/11/2020 19:31, Gregory Etelson:
> > 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.
Did you measure a performance difference?
This current code triggers this compiler note:
drivers/net/mlx5/mlx5_flow.c:7106:1: note:
parameter passing for argument of type 'struct flow_grp_info' changed in GCC 9.1
I'm afraid it can be a problem.
In general we don't have such note on the whole DPDK code base.
next prev parent reply other threads:[~2020-11-14 19:24 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
2020-11-14 19:24 ` Thomas Monjalon [this message]
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=41621094.tlia0Zn6mn@thomas \
--to=thomas@monjalon.net \
--cc=asafp@nvidia.com \
--cc=dev@dpdk.org \
--cc=getelson@nvidia.com \
--cc=matan@nvidia.com \
--cc=rasland@nvidia.com \
--cc=shahafs@nvidia.com \
--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).