From: Jiri Pirko <jpirko@redhat.com>
To: Jay Vosburgh <fubar@us.ibm.com>
Cc: stefan novak <lms.brubaker@gmail.com>,
Eric Dumazet <dada1@cosmosbay.com>,
linux-kernel@vger.kernel.org,
Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: bond interface arp, vlan and trunk / network question
Date: Thu, 23 Apr 2009 21:22:55 +0200 [thread overview]
Message-ID: <20090423192254.GA1618@psychotron.englab.brq.redhat.com> (raw)
In-Reply-To: <3302.1240511660@death.nxdomain.ibm.com>
Thu, Apr 23, 2009 at 08:34:20PM CEST, fubar@us.ibm.com wrote:
>Jiri Pirko <jpirko@redhat.com> wrote:
>>Thu, Apr 23, 2009 at 04:59:41PM CEST, fubar@us.ibm.com wrote:
>>>Jiri Pirko <jpirko@redhat.com> wrote:
>[...]
>>>>>+{
>>>>>+ struct net_device *dev = skb->dev;
>>>>>+ struct net_device *master = dev->master;
>>>>>+
>>>>>+ if (master)
>>>>>+ return bond_handle_frame_hook(skb);
>>>>
>>>>Maybe this hook can be called from netif_receive_skb() directly. You would safe
>>>>at least 2 dereferences, 1 if check. You would also need to add
>>>>"skb->dev->master &&" to if in __vlan_hwaccel_rx() and vlan_gro_common().
>>>
>>> This won't work, because the VLAN code reassigns skb->dev to the
>>>VLAN device before calling netif_receive_skb.
>>
>>Sure, but bond_should_drop is called before it actually reassigns that. So the
>>check in bond_should_drop tests "original_dev->master".
>>
>>I had on mind something like following:
>>
>>Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>>
>>diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
>>index c67fe6f..87a7334 100644
>>--- a/net/8021q/vlan_core.c
>>+++ b/net/8021q/vlan_core.c
>>@@ -11,7 +11,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
>> if (netpoll_rx(skb))
>> return NET_RX_DROP;
>>
>>- if (skb_bond_should_drop(skb))
>>+ if (skb->dev->master && bond_handle_frame_hook(skb))
>[...]
>
> Yah, ok, I see what you mean. The same could be accomplished by
>turning skb_bond_should_drop back into an inline in the header file, and
Well no exactly. In vlan_x certainly yes but in netif_receive_skb() you safe
something by not checking ->master twice and 2 dereferences. Just noting when I
see the waste...
>hiding the fiddly bits from the calling context.
>
> It's pretty grotty no matter how it's done; I'd prefer to avoid
>the whole hook business, but I haven't thought of a less bad way.
Yes I agree hooking this sucks :/ Anyway, is there any movement to eliminate
all these hooks from netif_receive_skb() ?
Jirka
>
> -J
>
>---
> -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
prev parent reply other threads:[~2009-04-23 19:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1ef444010904201050g72651387se3feca3fbd68ce30@mail.gmail.com>
2009-04-20 18:16 ` bond interface arp, vlan and trunk / network question Eric Dumazet
2009-04-20 18:37 ` Jay Vosburgh
2009-04-20 20:00 ` stefan novak
2009-04-20 20:36 ` Jay Vosburgh
2009-04-20 21:03 ` stefan novak
2009-04-20 21:15 ` Eric Dumazet
2009-04-20 21:23 ` Jay Vosburgh
2009-04-20 21:39 ` stefan novak
2009-04-21 0:01 ` Jay Vosburgh
2009-04-22 8:29 ` stefan novak
2009-04-23 1:12 ` Jay Vosburgh
2009-04-23 5:58 ` Eric Dumazet
2009-04-23 15:38 ` Jay Vosburgh
2009-04-23 7:48 ` Jiri Pirko
2009-04-23 14:59 ` Jay Vosburgh
2009-04-23 15:20 ` Jiri Pirko
2009-04-23 18:34 ` Jay Vosburgh
2009-04-23 19:22 ` Jiri Pirko [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=20090423192254.GA1618@psychotron.englab.brq.redhat.com \
--to=jpirko@redhat.com \
--cc=dada1@cosmosbay.com \
--cc=fubar@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lms.brubaker@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).