From: Javier Domingo <javierdo1@gmail.com>
To: netdev@vger.kernel.org
Subject: Re: Information about napi_struct and net_device
Date: Mon, 29 Oct 2012 18:40:44 +0100 [thread overview]
Message-ID: <CALZVapmbFCh4+2FmKxi_RkhNf9m50eAC2q5Tk2etx9C_g7TjcQ@mail.gmail.com> (raw)
In-Reply-To: <1351478461.4450.8.camel@deadeye.wl.decadent.org.uk>
I finally found the problem, and I think also the answer.
I am modifying netif_receive_skb(), putting there my own queue. So the
only problem I face now is how may I disable the main netpoll through.
Looking at dev.c file, and knowing that there must be some way the
solution I was looking for, I discovered enqueue_to_backlog function,
that does what I want to do, from a packet, after processing it, be
able to take the napi_struct that was responsible from it.
I if you could tell me if using the method to obtain the napi_struct
from the net_device pointer used in enqueue_to_backlog is ok, it would
be great,
Any way I will continue doing experiments and reading,
Thanks a lot for your help and attention, and for whoever did [1]
Javier Domingo
[1]: http://www.linuxfoundation.org/images/1/1c/Network_data_flow_through_kernel.png
2012/10/29 Ben Hutchings <bhutchings@solarflare.com>:
> On Sat, 2012-10-27 at 18:18 +0200, Javier Domingo wrote:
>> Hello,
>>
>> I am updating a kernel patch from 2.6.23-rc7 to v3.6, using git
>> facilities, and I have found that there have been lots of changes in
>> networking. Now the drivers are all by vendor, and more important,
>> net_device is not used always, as napi_struct took its place.
>>
>> I have asked in #kernel but no one answered me, so I subscribed here.
>> Is there any place I can read about how is it now designed the use of
>> napi_struct and net_device? I have found a presentation[1] about how
>> networking was changing etc, and I wondered if there is anything more
>> precise about how it is actually implemented.
>>
>> I understand a little why napi_struct, but don't really know much
>> about the change,
>>
>> Hope someone can help me,
>
> The initial change to napi_struct is explained in
> <http://lwn.net/Articles/244640/>.
>
> Since then there have been further changes:
>
> - netif_napi_del() has been added. You must call it to clean up NAPI
> contexts before freeing the associated net device(s).
>
> - Instead of netif_rx_schedule(), netif_rx_complete(), etc. you must use
> napi_schedule(), napi_complete() etc. which just take a napi_struct
> pointer.
>
> Ben.
>
> --
> Ben Hutchings, Staff Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
prev parent reply other threads:[~2012-10-29 17:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-27 16:18 Information about napi_struct and net_device Javier Domingo
2012-10-27 17:03 ` Eric Dumazet
2012-10-27 18:22 ` Francois Romieu
2012-10-27 23:02 ` Eric Dumazet
2012-10-28 23:23 ` Javier Domingo
2012-10-28 23:13 ` Francois Romieu
2012-10-29 11:49 ` Javier Domingo
2012-10-27 20:10 ` Rami Rosen
2012-10-29 1:09 ` Stephen Hemminger
2012-10-29 2:41 ` Ben Hutchings
2012-10-29 17:40 ` Javier Domingo [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=CALZVapmbFCh4+2FmKxi_RkhNf9m50eAC2q5Tk2etx9C_g7TjcQ@mail.gmail.com \
--to=javierdo1@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).