Netdev List
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Jose Abreu <Jose.Abreu@synopsys.com>,
	David Miller <davem@redhat.com>,
	Jakub Jelinek <jj@ultra.linux.cz>,
	Jeff Garzik <jgarzik@pobox.com>, Tim Hockin <thockin@sun.com>,
	Eli Kupermann <eli.kupermann@intel.com>,
	Chris Leech <christopher.leech@intel.com>,
	Scott Feldman <scott.feldman@intel.com>,
	Ben Hutchings <ben@decadent.org.uk>
Cc: netdev@vger.kernel.org, Joao Pinto <Joao.Pinto@synopsys.com>
Subject: Re: [RFC] ethtool: Support for driver private ioctl's
Date: Sat, 7 Apr 2018 12:58:07 -0700	[thread overview]
Message-ID: <80a8c4b7-2f2b-4b64-3065-4384b1b1e6e2@gmail.com> (raw)
In-Reply-To: <27c05ec7-1f85-8e4a-be06-70d6d80e8a10@synopsys.com>



On 04/06/2018 06:51 AM, Jose Abreu wrote:
> Hi Florian,
> 
> On 05-04-2018 16:50, Florian Fainelli wrote:
>>
>> On 04/05/2018 03:47 AM, Jose Abreu wrote:
>>> Hi All,
>>>
>>> I would like to know your opinion regarding adding support for
>>> driver private ioctl's in ethtool.
>>>
>>> Background: Synopsys Ethernet IP's have a certain number of
>>> features which can be reconfigured at runtime. Giving you two
>>> examples: One of the most recent one is the safety features,
>>> which can be enabled/disabled and forced at runtime. Another one
>>> is a Flexible RX Parser which can route specific packets to
>>> specific RX DMA channels. Given that these are features specific
>>> to our IP's it would not be useful to add an uniform API for this
>>> because the users would only be one or two drivers ...
>> Parsing of packets and directing the matched packets to specific
>> queues/channels can be done through ethtool rxnfc API, tc/cls_flower as
>> well, so you should really check whether those APIs don't already allow
>> you to do what you want.
> 
> Hmm, but in our case this is directly done by HW, we just have to
> program a kind of a table which will route automatically the
> packets. Does this API support this?

I was sort of expecting you to look at the ethtool rxnfc API to see if
it is suitable given your hardware, but if this is indeed a table
programming, then yes, this is what it is designed for. You might want
to consider using the newer, albeit more complex tc/cls_flower if that
works for your use case.

> 
>>
>> ethtool already supports a concept of private  flags, not ioctl() though
>> which allows you to toggle boolean values for instance (or technically
>> up to how many bits a "flag" is used to represent) is that enough or do
>> you need to turn on/off the feature as well as pass configuration
>> parameters?
> 
> Some of them I can just turn on/off but the remaining need
> configuration and sometimes the configuration is extensive (like
> in the case of RX Parser when we have to pass the routing table).
> 
>>
>>> This new feature would change the help usage for ethtool so that
>>> each driver private option would be shown, and then each driver
>>> specific file would have a structure with all the available
>>> options. Finally, each driver would have to handle the private
>>> IOCTL's.
>>>
>>> We already have this working locally and now I would like to know
>>> your opinion about upstreaming this ... Do you think this can be
>>> useful for anyone else? Or should we change direction to use, for
>>> example, debugfs/configfs?
>> In general, even if there is only one driver implementing a particular
>> feature, the approach chosen is to come up with an API that is as
>> generic as possible. Even if there is a single user of that API in tree,
>> having something that was thought to be generic is better than allowing
>> uncontrolled private ioctl() implementations.
> 
> I understand your point of view but this seems like an overkill
> to the -net subsystem because its specific to our IP, or are you
> just mentioning a new ethtool entry? i.e. adding a new #define to
> the list, plus -net handling ...

It depends on the feature, it can be a new set of defines just like it
can be a completely new ethtool command number with custom data
structures between user and kernel space.
-- 
Florian

  parent reply	other threads:[~2018-04-07 19:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 10:47 [RFC] ethtool: Support for driver private ioctl's Jose Abreu
2018-04-05 15:50 ` Florian Fainelli
2018-04-06  9:07   ` Michal Kubecek
2018-04-06 13:57     ` Jose Abreu
2018-04-06 13:51   ` Jose Abreu
2018-04-06 14:47     ` Andrew Lunn
2018-04-06 14:51       ` Jose Abreu
2018-04-07 19:58     ` Florian Fainelli [this message]
2018-04-24  9:37       ` Jose Abreu

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=80a8c4b7-2f2b-4b64-3065-4384b1b1e6e2@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=ben@decadent.org.uk \
    --cc=christopher.leech@intel.com \
    --cc=davem@redhat.com \
    --cc=eli.kupermann@intel.com \
    --cc=jgarzik@pobox.com \
    --cc=jj@ultra.linux.cz \
    --cc=netdev@vger.kernel.org \
    --cc=scott.feldman@intel.com \
    --cc=thockin@sun.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