netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/2 v2] af-packet:  Use existing netdev reference for bound sockets.
Date: Thu, 26 May 2011 21:11:15 -0700	[thread overview]
Message-ID: <4DDF2463.3020001@candelatech.com> (raw)
In-Reply-To: <1306467745.2543.60.camel@edumazet-laptop>

On 05/26/2011 08:42 PM, Eric Dumazet wrote:
> Le jeudi 26 mai 2011 à 16:55 -0700, greearb@candelatech.com a écrit :

>>   out_free:
>>   	kfree_skb(skb);
>>   out_unlock:
>> -	if (dev)
>> +	if (dev&&  need_rls_dev)
>>   		dev_put(dev);
>>   out:
>>   	return err;
>
> Hmmm, I wonder why you want this Ben.
>
> IMHO this is buggy, because we can sleep in this function.
>
> We must take a ref on device (its really cheap these days, now we have a
> percpu device refcnt)

Why must you take the reference?  And if we must, why isn't the
current code that assigns the prot_hook.dev without taking a
reference OK?

It seems a waste to do the lookup and free if we don't have to,
and with thousands of devices, the lookup might take a reasonable
amount of effort?

Thanks,
Ben


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

  reply	other threads:[~2011-05-27  4:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 23:55 [PATCH 1/2 v2] af-packet: Use existing netdev reference for bound sockets greearb
2011-05-26 23:55 ` [PATCH 2/2 v2] af-packet: Add flag to distinguish VID 0 from no-vlan greearb
2011-05-27  3:46   ` Eric Dumazet
2011-05-27  3:42 ` [PATCH 1/2 v2] af-packet: Use existing netdev reference for bound sockets Eric Dumazet
2011-05-27  4:11   ` Ben Greear [this message]
2011-05-27 20:08     ` Eric Dumazet
2011-05-27 20:15       ` David Miller
2011-05-27 20:18         ` Ben Greear
2011-05-28  6:20           ` Eric Dumazet
2011-05-28 17:01             ` Ben Greear

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=4DDF2463.3020001@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=eric.dumazet@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).