public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine•com>
To: "Tantilov, Emil S" <emil.s.tantilov@intel•com>
Cc: Pavan Kumar Linga <pavan.kumar.linga@intel•com>,
	willemb@google•com, pabeni@redhat•com, netdev@vger•kernel.org,
	jesse.brandeburg@intel•com, kuba@kernel•org, edumazet@google•com,
	anthony.l.nguyen@intel•com, intel-wired-lan@lists•osuosl.org,
	Phani Burra <phani.r.burra@intel•com>,
	decot@google•com, davem@davemloft•net
Subject: Re: [Intel-wired-lan] [PATCH net-next v2 14/15] idpf: add ethtool callbacks
Date: Sat, 22 Apr 2023 09:55:28 +0200	[thread overview]
Message-ID: <ZEOS8L9o+pDK02C/@corigine.com> (raw)
In-Reply-To: <2fdd6fe9-9672-8bf7-f8f9-e9906fa25167@intel.com>

On Fri, Apr 21, 2023 at 10:26:25PM -0700, Tantilov, Emil S wrote:
> 
> 
> On 4/13/2023 12:11 PM, Tantilov, Emil S wrote:
> > 
> > 
> > On 4/11/2023 2:55 AM, Simon Horman wrote:
> > > On Mon, Apr 10, 2023 at 06:13:53PM -0700, Pavan Kumar Linga wrote:
> > > > From: Alan Brady <alan.brady@intel•com>
> > > 
> > > ...
> > > 
> > > > diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> > > > b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> > > 
> > > ...
> > > 
> > > > +/**
> > > > + * idpf_add_qstat_strings - Copy queue stat strings into ethtool buffer
> > > > + * @p: ethtool supplied buffer
> > > > + * @stats: stat definitions array
> > > > + * @type: stat type
> > > > + * @idx: stat idx
> > > > + *
> > > > + * Format and copy the strings described by the const static
> > > > stats value into
> > > > + * the buffer pointed at by p.
> > > > + *
> > > > + * The parameter @stats is evaluated twice, so parameters with
> > > > side effects
> > > > + * should be avoided. Additionally, stats must be an array such that
> > > > + * ARRAY_SIZE can be called on it.
> > > > + */
> > > > +#define idpf_add_qstat_strings(p, stats, type, idx) \
> > > > +    __idpf_add_qstat_strings(p, stats, ARRAY_SIZE(stats), type, idx)
> > > 
> > > Hi Pavan, Hi Alan,
> > > 
> > > FWIIW, I think __idpf_add_qstat_strings() could be a function.
> > > It would give some type checking. And avoid possible aliasing of inputs.
> > > Basically, I think functions should be used unless there is a reason
> > > not to.
> > > 
> > > ...
> > 
> > Good catch, we'll resolve it in v3.
> 
> The reason a macro is used in this case is that it allows
> __idpf_add_qstat_strings() to get the size of the arrays passed by the
> caller. Is there a way to do this if we convert the macro to a function?

Understood, in that case perhaps a macro is best after all.

  reply	other threads:[~2023-04-22  7:55 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  1:13 [PATCH net-next v2 00/15] Introduce Intel IDPF driver Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 01/15] virtchnl: add virtchnl version 2 ops Pavan Kumar Linga
2023-04-11  8:51   ` Simon Horman
2023-04-12 21:38     ` Tantilov, Emil S
2023-04-11  1:13 ` [PATCH net-next v2 02/15] idpf: add module register and probe functionality Pavan Kumar Linga
2023-04-11 12:36   ` Leon Romanovsky
2023-04-12 23:10     ` Tantilov, Emil S
2023-04-13  6:03       ` Leon Romanovsky
2023-04-13 18:58         ` Tantilov, Emil S
2023-04-20 18:13       ` [Intel-wired-lan] " Tantilov, Emil S
2023-04-20 18:20         ` Leon Romanovsky
2023-04-11  1:13 ` [PATCH net-next v2 03/15] idpf: add controlq init and reset checks Pavan Kumar Linga
2023-04-11  9:19   ` Simon Horman
2023-04-11  1:13 ` [PATCH net-next v2 04/15] idpf: add core init and interrupt request Pavan Kumar Linga
2023-04-11  9:52   ` Simon Horman
2023-04-13 19:10     ` Tantilov, Emil S
2023-04-11  1:13 ` [PATCH net-next v2 05/15] idpf: add create vport and netdev configuration Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 06/15] idpf: continue expanding init task Pavan Kumar Linga
2023-04-11  9:04   ` Simon Horman
2023-04-13 19:04     ` Tantilov, Emil S
2023-04-11  1:13 ` [PATCH net-next v2 07/15] idpf: configure resources for TX queues Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 08/15] idpf: configure resources for RX queues Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 09/15] idpf: initialize interrupts and enable vport Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 10/15] idpf: add splitq start_xmit Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 11/15] idpf: add TX splitq napi poll support Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 12/15] idpf: add RX " Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 13/15] idpf: add singleq start_xmit and napi poll Pavan Kumar Linga
2023-04-11  1:13 ` [PATCH net-next v2 14/15] idpf: add ethtool callbacks Pavan Kumar Linga
2023-04-11  9:55   ` Simon Horman
2023-04-13 19:11     ` Tantilov, Emil S
2023-04-22  5:26       ` [Intel-wired-lan] " Tantilov, Emil S
2023-04-22  7:55         ` Simon Horman [this message]
2023-04-11  1:13 ` [PATCH net-next v2 15/15] idpf: configure SRIOV and add other ndo_ops Pavan Kumar Linga
2023-04-12 18:25 ` [Intel-wired-lan] [PATCH net-next v2 00/15] Introduce Intel IDPF driver Sasha Levin
2023-04-12 19:16   ` Willem de Bruijn
2023-04-13  0:03     ` Samudrala, Sridhar
2023-04-13  2:24       ` Jakub Kicinski
2023-04-13  7:15         ` Leon Romanovsky
2023-04-14 22:01         ` Sasha Levin
2023-04-14 22:27           ` Jakub Kicinski
2023-04-15 17:16             ` Sasha Levin
2023-04-17 16:38               ` Jakub Kicinski

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=ZEOS8L9o+pDK02C/@corigine.com \
    --to=simon.horman@corigine$(echo .)com \
    --cc=anthony.l.nguyen@intel$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=decot@google$(echo .)com \
    --cc=edumazet@google$(echo .)com \
    --cc=emil.s.tantilov@intel$(echo .)com \
    --cc=intel-wired-lan@lists$(echo .)osuosl.org \
    --cc=jesse.brandeburg@intel$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=pavan.kumar.linga@intel$(echo .)com \
    --cc=phani.r.burra@intel$(echo .)com \
    --cc=willemb@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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