public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks•com>
To: Ben Hutchings <bhutchings@solarflare•com>
Cc: Stephen Hemminger <shemminger@vyatta•com>,
	David Miller <davem@davemloft•net>,
	netdev@vger•kernel.org
Subject: Re: [RFC] NAPI as kobject proposal
Date: Wed, 03 Feb 2010 13:38:45 -0800	[thread overview]
Message-ID: <4B69ECE5.7060803@caviumnetworks.com> (raw)
In-Reply-To: <1265232216.2116.46.camel@achroite.uk.solarflarecom.com>

Ben Hutchings wrote:
> On Fri, 2010-01-29 at 10:18 -0800, Stephen Hemminger wrote:
>> The NAPI interface structure in current kernels is managed by the driver.
>> As part of receive packet steering there is a requirement to add an
>> additional parameter to this for the CPU map. And this map needs to
>> have an API to set it.
>>
>> The right way to do this in the kernel model is to make NAPI into
>> a kobject and associate it back with the network device (parent).
>> This isn't wildly difficult but does change some of the API for
>> network device drivers because:
>>   1. They need to handle another possible error on setup
>>   2. NAPI object needs to be dynamically allocated
>>      separately (not as part of netdev_priv)
>>   3. Driver should pass index that can be uses as part of
>>      name (easier than scanning)
>>
>> Eventually, there will be:
>>   /sys/class/net/eth0/napi0/
>>                             weight
>>                             cpumap
> 
> I think the NAPI objects should be created as children of a bus device
> and then linked from the net device directories, e.g.
> 
> /sys/devices/.../ net/eth0/
>                            napi0 -> ../../napi/napi0
>                       eth1/
>                            napi0 -> ../../napi/napi0
>                   napi/napi0/
>                              weight
>                              cpumap
> 

This seems right.

Some drivers have a single napi object logically associated with 
multiple interfaces.  Although the current architecture forces us to 
associate the napi object with a single net_device, it would be nice to 
move towards something that allows sharing a napi object between 
multiple devices.

David Daney

  parent reply	other threads:[~2010-02-03 21:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-29 18:18 [RFC] NAPI as kobject proposal Stephen Hemminger
2010-02-03 21:23 ` Ben Hutchings
2010-02-03 21:26   ` Al Viro
2010-02-03 21:41     ` Stephen Hemminger
2010-02-03 21:38   ` David Daney [this message]
2010-02-04  1:33 ` David Miller
2010-02-04  1:58   ` Stephen Hemminger
2010-02-04  2:17     ` David Miller

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=4B69ECE5.7060803@caviumnetworks.com \
    --to=ddaney@caviumnetworks$(echo .)com \
    --cc=bhutchings@solarflare$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=shemminger@vyatta$(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