All of lore.kernel.org
 help / color / mirror / Atom feed
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: Sun, 15 Nov 2020 05:47:59 +0000	[thread overview]
Message-ID: <MN2PR12MB46393C012F3D499D1AE1434AA5E40@MN2PR12MB4639.namprd12.prod.outlook.com> (raw)
In-Reply-To: <41621094.tlia0Zn6mn@thomas>

> 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.
> 

I'll handle this issue in DV compilation patch.

  reply	other threads:[~2020-11-15  5:48 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
2020-11-15  5:47             ` Gregory Etelson [this message]
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=MN2PR12MB46393C012F3D499D1AE1434AA5E40@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.