ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	ath10k@lists.infradead.org
Subject: Re: [RFC] ethtool: Support ETHTOOL_GSTATS2 command.
Date: Tue, 20 Mar 2018 11:29:54 -0700	[thread overview]
Message-ID: <da10fdf8-80a7-9a8a-e56d-92319152fd5e@candelatech.com> (raw)
In-Reply-To: <20180320182420.u5aa7eny3fbix7fj@unicorn.suse.cz>

On 03/20/2018 11:24 AM, Michal Kubecek wrote:
> On Tue, Mar 20, 2018 at 08:39:33AM -0700, Ben Greear wrote:
>> On 03/20/2018 03:37 AM, Michal Kubecek wrote:
>>>
>>> IMHO it would be more practical to set "0 means same as GSTATS" as a
>>> rule and make ethtool_get_stats() a wrapper for ethtool_get_stats2() to
>>> avoid code duplication (or perhaps a use fall-through in the switch). It
>>> would also allow drivers to provide only one of the callbacks.
>>
>> Yes, but that would require changing all drivers at once, and would make backporting
>> and out-of-tree drivers harder to manage.  I had low hopes that this feature would
>> make it upstream, so I didn't want to propose any large changes up front.
>
> I don't think so. What I mean is:
>
> (a) driver implements ->get_ethtool_stats2() callback; then we use it
>     for GSTATS2
> (b) driver does not implement get_ethtool_stats2() but implements
>     ->get_ethtool_stats(); then we call for GSTATS2 if level is zero,
>     otherwise GSTATS2 returns -EINVAL
>
> and GSTATS is always translated to GSTATS2 with level 0, either by
> defining ethtool_get_stats() as a wrapper or by fall-through in the
> switch statement.
>
> This way, most drivers could be left untouched and only those which
> would implement non-default levels would provide ->get_ethtool_stats2()
> callback instead of ->get_ethtool_stats().

OK, that makes sense.  I'll wait on feedback from the flags or #defined levels
and re-spin the patch accordingly.

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

      reply	other threads:[~2018-03-20 18:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 19:51 [RFC] ethtool: Support ETHTOOL_GSTATS2 command greearb
2018-03-20 10:37 ` Michal Kubecek
2018-03-20 15:39   ` Ben Greear
2018-03-20 16:11     ` Steve deRosier
2018-03-20 16:24       ` Ben Greear
2018-03-20 18:24     ` Michal Kubecek
2018-03-20 18:29       ` Ben Greear [this message]

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=da10fdf8-80a7-9a8a-e56d-92319152fd5e@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /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