All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.r.fastabend@intel.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	"jesse@nicira.com" <jesse@nicira.com>,
	"hans.schillstrom@ericsson.com" <hans.schillstrom@ericsson.com>,
	"jpirko@redhat.com" <jpirko@redhat.com>,
	"mbizon@freebox.fr" <mbizon@freebox.fr>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"fubar@us.ibm.com" <fubar@us.ibm.com>
Subject: Re: [net-next PATCH] net: allow vlan traffic to be received under bond
Date: Fri, 28 Oct 2011 19:20:32 -0700	[thread overview]
Message-ID: <4EAB62F0.2040101@intel.com> (raw)
In-Reply-To: <1319799986.23112.101.camel@edumazet-laptop>

On 10/28/2011 4:06 AM, Eric Dumazet wrote:
> Le vendredi 28 octobre 2011 à 12:00 +0200, Eric Dumazet a écrit :
> 
>> Oh well, this broke my setup, a very basic one.
>>
>> eth1 and eth2 on a bonding device, bond0, active-backup
>>
>> some vlans on top of bond0, say vlan.103
>>
>> $ ip link show dev vlan.103
>> 8: vlan.103@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
>> pfifo_fast state UP qlen 100
>>     link/ether 00:1e:0b:ec:d3:d2 brd ff:ff:ff:ff:ff:ff
>>
>>
>> arp_rcv() now gets packets with skb->type PACKET_OTHERHOST and drops
>> such packets.
>>
>>      [000] 52870.115435: skb_gro_reset_offset <-napi_gro_receive
>>      [000] 52870.115435: dev_gro_receive <-napi_gro_receive
>>      [000] 52870.115435: napi_skb_finish <-napi_gro_receive
>>      [000] 52870.115435: netif_receive_skb <-napi_skb_finish
>>      [000] 52870.115435: get_rps_cpu <-netif_receive_skb
>>      [000] 52870.115435: __netif_receive_skb <-netif_receive_skb
>>      [000] 52870.115436: vlan_do_receive <-__netif_receive_skb
>>      [000] 52870.115436: bond_handle_frame <-__netif_receive_skb
>>      [000] 52870.115436: vlan_do_receive <-__netif_receive_skb
>>      [000] 52870.115436: arp_rcv <-__netif_receive_skb
>>      [000] 52870.115436: kfree_skb <-arp_rcv
>>      [000] 52870.115437: __kfree_skb <-kfree_skb
>>      [000] 52870.115437: skb_release_head_state <-__kfree_skb
>>      [000] 52870.115437: skb_release_data <-__kfree_skb
>>      [000] 52870.115437: kfree <-skb_release_data
>>      [000] 52870.115437: kmem_cache_free <-__kfree_skb
>>
>>
>> By the way, we have no SNMP counter here so I spent some time to track
>> this. I'll send a patch for this.
>>
>> If this host initiates the trafic, all is well.
>>
>> Please guys, can we get back ARP or revert this patch ?
> 
> Following patch cures the problem, I am not sure its the right fix.
> 
> Problem is we dont know how many times vlan_do_receive() can be called
> for a packet.
> 
> Only last call should set/mess pkt_type to PACKET_OTHERHOST.
> 
> So the caller should be responsible for this, not vlan_do_receive()
> 
> 
> Alternative would be to check skb->dev->rx_handler being NULL,
> but its not clean.
> 
> Following patch is a hack because it handles multicast/broadcast trafic
> only. Unicast is already handled in lines 26-33, this is why we didnt
> catch the problem.
> 
> diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
> index f1f2f7b..6861899 100644
> --- a/net/8021q/vlan_core.c
> +++ b/net/8021q/vlan_core.c
> @@ -13,7 +13,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
>  
>  	vlan_dev = vlan_find_dev(skb->dev, vlan_id);
>  	if (!vlan_dev) {
> -		if (vlan_id)
> +		if (vlan_id && skb->pkt_type == PACKET_HOST)
>  			skb->pkt_type = PACKET_OTHERHOST;
>  		return false;
>  	}
> 

Thanks Eric! Thought about this some and I haven't come up
with anything better yet. Even though this might be a slight
hack I would prefer this to reverting the patch.

I'll think about this more tomorrow. Would you be against
submitting this patch?

.John

  reply	other threads:[~2011-10-29  2:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 19:16 [net-next PATCH] net: allow vlan traffic to be received under bond John Fastabend
2011-10-10 22:37 ` Jiri Pirko
2011-10-11  2:07   ` John Fastabend
2011-10-11  2:43     ` Jesse Gross
2011-10-11 11:08       ` Hans Schillstrom
2011-10-11 13:13         ` John Fastabend
2011-10-13 13:09           ` Hans Schillström
2011-10-11 13:16       ` John Fastabend
2011-10-11 10:57   ` Jiri Pirko
2011-10-13 15:04   ` Maxime Bizon
2011-10-13 15:38     ` Jiri Pirko
2011-10-13 15:48       ` Maxime Bizon
2011-10-13 15:59       ` Hans Schillström
2011-10-13 17:42         ` John Fastabend
2011-10-13 18:23           ` Hans Schillström
2011-10-14  0:22           ` Jesse Gross
2011-10-19  3:47             ` David Miller
2011-10-28 10:00               ` Eric Dumazet
2011-10-28 11:06                 ` Eric Dumazet
2011-10-29  2:20                   ` John Fastabend [this message]
2011-10-29 10:22                     ` Eric Dumazet
2011-10-29 14:59                       ` Jiri Pirko
2011-10-29 16:00                         ` Eric Dumazet
2011-10-29 16:13                           ` [PATCH v2] vlan: allow nested vlan_do_receive() Eric Dumazet
2011-10-29 16:28                             ` Jiri Pirko
2011-10-30  8:38                               ` Jiri Pirko
2011-10-30  8:44                                 ` David Miller
2011-10-30  8:44                                 ` Eric Dumazet
2011-10-29 16:16                           ` [net-next PATCH] net: allow vlan traffic to be received under bond Jiri Pirko

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=4EAB62F0.2040101@intel.com \
    --to=john.r.fastabend@intel.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=fubar@us.ibm.com \
    --cc=hans.schillstrom@ericsson.com \
    --cc=jesse@nicira.com \
    --cc=jpirko@redhat.com \
    --cc=mbizon@freebox.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.