From mboxrd@z Thu Jan 1 00:00:00 1970 From: Weiping Pan Subject: Re: [PATCH V2] vlan:return error when real dev is enslaved Date: Wed, 16 Nov 2011 15:16:40 +0800 Message-ID: <4EC36358.3030905@redhat.com> References: <4EC2BB48.2070802@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Patrick McHardy (maintainer:VLAN (802.1Q))" , "\"David S. Miller\" (maintainer:NETWORKING [GENERAL])" , "open list:VLAN (802.1Q)" , open list To: =?UTF-8?B?Tmljb2xhcyBkZSBQZXNsb8O8YW4=?= Return-path: In-Reply-To: <4EC2BB48.2070802@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 11/16/2011 03:19 AM, Nicolas de Peslo=C3=BCan wrote: > Le 15/11/2011 13:44, Weiping Pan a =C3=A9crit : >> Qinhuibin reported a kernel panic when he do some operation about vl= an. >> https://lkml.org/lkml/2011/11/6/218 >> >> The operation is as below: >> ifconfig eth2 up >> modprobe bonding >> modprobe 8021q >> ifconfig bond0 up >> ifenslave bond0 eth2 >> vconfig add eth2 3300 >> vconfig add bond0 33 >> vconfig rem eth2.3300 >> >> the panic stack is as below: >> [] panic_event+0x49/0x70 [ipmi_msghandler] >> [] notifier_call_chain+0x37/0x70 >> [] panic+0xa2/0x195 >> [] oops_end+0xd8/0x140 >> [] no_context+0xf7/0x280 >> [] __bad_area_nosemaphore+0x175/0x250 >> [] page_fault+0x28/0x30 >> [] igb_vlan_rx_kill_vid+0x4d/0x100 [igb] >> [] bond_vlan_rx_kill_vid+0x9f/0x290 [bonding] >> [] unregister_vlan_dev+0x136/0x180 [8021q] >> [] vlan_ioctl_handler+0x170/0x3f0 [8021q] >> [] sock_ioctl+0x21f/0x280 >> [] vfs_ioctl+0x2f/0xb0 >> [] do_vfs_ioctl+0x3cb/0x5a0 >> [] sys_ioctl+0xa1/0xb0 >> [] system_call_fastpath+0x16/0x1b >> [<00007f108a2b8bd7>] 0x7f108a2b8bd7 >> And the nic is as below: >> [root@localhost ~]# ethtool -i eth2 >> driver: igb >> version: 3.0.6-k2 >> firmware-version: 1.2-1 >> bus-info: 0000:04:00.0 >> kernel version=EF=BC=9A >> 2.6.32.12-0.7 also happen in 2.6.32-131 >> >> For kernel 2.6.32, the reason of this bug is that when we do "vconfi= g=20 >> add bond0 33", >> adapter->vlgrp is overwritten in igb_vlan_rx_register. So when we do= =20 >> "vconfig rem >> eth2.3300", it can't find the correct vlgrp. >> >> And this bug is avoided by vlan cleanup patchset from Jiri Pirko >> , especially commit b2cb09b1a772(igb: do vlan=20 >> cleanup). >> >> But it is not a correct operation to creat a vlan interface on eth2 >> when it have been enslaved by bond0, so this patch is to return erro= r >> when the real dev is already enslaved. > > Why isn't this setup correct? > > Compare to bridge, where ebtables allow for some sort of sharing of=20 > the physical interface between bridge and vlan. > > I think bonding should behave the same way instead of denying this se= tup. > > Nicolas. > Hi, Nicolas, After some investigation I agree with you that this setup is correct, since we can "switchport trunk allowed vlan 2-3" on the switch. I can confirm that both bonding and bridge support this kind of setup. bond0.2 br0.2 | | eth0 ----- eth0.3 eth0 -----eth0.3 Both works fine(git commit 06236ac3726f1), so please discard this patc= h. thanks Weiping Pan