netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: greearb@candelatech.com
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] af-packet: Save reference to bound network device.
Date: Wed, 25 May 2011 18:01:13 -0400 (EDT)	[thread overview]
Message-ID: <20110525.180113.1194226831134092545.davem@davemloft.net> (raw)
In-Reply-To: <1306360602-9672-1-git-send-email-greearb@candelatech.com>

From: greearb@candelatech.com
Date: Wed, 25 May 2011 14:56:42 -0700

> From: Ben Greear <greearb@candelatech.com>
> 
> This saves a network device lookup on each packet transmitted,
> for sockets that are bound to a network device.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>

You can't hold onto devices like this unless you also add a netdev
event notifier that will release it.  Otherwise we'll hang on net
driver module unload until the packet socket is closed.

I don't think you really want to walk all pf-packet sockets on netdev
events just to do this.

dev_get_by_index(,_rcu}() is insanely cheap, I doubt it's showing up
on your profiles at all.

  reply	other threads:[~2011-05-25 22:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 21:56 [RFC] af-packet: Save reference to bound network device greearb
2011-05-25 22:01 ` David Miller [this message]
2011-05-25 22:05   ` Ben Greear
2011-05-25 22:14     ` David Miller
2011-05-25 22:22       ` Ben Greear
2011-05-25 22:36       ` Ben Greear
2011-05-25 22:42         ` 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=20110525.180113.1194226831134092545.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=greearb@candelatech.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).