Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Oct 2014 13:52:19 +0400
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        Hariprasad S <hariprasad@chelsio.com>,  "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Detaching the slave from the lagg interface which has vlan on top of it, hits an  panic
Message-ID:  <542E71D3.6000500@FreeBSD.org>
In-Reply-To: <26E3F92EC670BD429DB5CB319D773C137A8878@nice.asicdesigners.com>
References:  <26E3F92EC670BD429DB5CB319D773C137A8878@nice.asicdesigners.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03.10.2014 04:40, Hariprasad S wrote:
> HI,
>
> Detaching the slave from the lagg interface which has vlan on top of it, hits an  panic.
> Kernel used: FreeBSD HEAD r272051
>
> Is anyone aware of this issue?
Yes. What is happening here:
We acquire lagg WLOCK to set new link layer address (due to "master" 
interface change).
We propagate this change to vlans on top if lagg (or to lagg itself).
Then we need to send gratuitous ARP for each UP interface, so we have to 
acquire lagg read lock to actually transmit this frame..

We can fix this particular case, but I think it should be done more 
generic way via introducing one or more netisr(9) slow path queues
and making sure "every" locally-originated packet is queued instead of 
being transmitted directly.

Previous proposal: 
https://lists.freebsd.org/pipermail/freebsd-hackers/2014-January/044121.html
It looks like we should return to the discussion.

>
> Steps to reproduce:
> 1) Created a lagg interface (lagg0)
> # ifconfig lagg0 create
>
> 2) Attach slaves to the lag interface
> # ifconfig lagg0 laggport cxl0 laggport cxl1
> # ifconfig lagg0 up
>
> 3)Created a vlan interface over lagg0(lagg0.6)
> # ifconfig  vlan10 create
> # ifconfig vlan 10 1.1.1.1/24 vlan 10 vlandev lagg0
> # ifconfig vlan0 up
>
> 4) Ping the peer interface
> # ping 1.1.1.2
>
> 5)>Detached the active slave from lagg0.
> # ifconfig lagg0 -laggport cxl0
>
> -------------------------------------------------------
> Unread portion of the kernel message buffer:
> lock order reversal: (sleepable after non-sleepable)
> 1st 0xfffff800095d8408 if_lagg rmlock (if_lagg rmlock) @ /usr/src/sys/modules/if_lagg/../../net/if_lagg.c:1139
> 2nd 0xffffffff81aa7228 vlan_global (vlan_global) @ /usr/src/sys/net/if_vlan.c:542
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01236685e0
> kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe0123668690
> witness_checkorder() at witness_checkorder+0xdc2/frame 0xfffffe0123668720
> _sx_xlock() at _sx_xlock+0x75/frame 0xfffffe0123668760
> vlan_iflladdr() at vlan_iflladdr+0x36/frame 0xfffffe0123668790
> lagg_lladdr() at lagg_lladdr+0xee/frame 0xfffffe01236687c0
> lagg_port_destroy() at lagg_port_destroy+0x1cd/frame 0xfffffe0123668810
> lagg_ioctl() at lagg_ioctl+0xa23/frame 0xfffffe01236688f0
> in_control() at in_control+0x30b/frame 0xfffffe0123668970
> ifioctl() at ifioctl+0xba8/frame 0xfffffe0123668a30
> kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0123668a90
> sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0123668ae0
> amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0123668bf0
> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0123668bf0
> --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8011ced2a, rsp = 0x7fffffffe218, rbp = 0x7fffffffe290 ---
> panic: rm_rlock: wlock already held for if_lagg rmlock @ /usr/src/sys/modules/if_lagg/../../net/if_lagg.c:1325
> cpuid = 1
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0123668320
> kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe01236683d0
> vpanic() at vpanic+0x189/frame 0xfffffe0123668450
> kassert_panic() at kassert_panic+0x198/frame 0xfffffe01236684e0
> _rm_rlock_debug() at _rm_rlock_debug+0x1c3/frame 0xfffffe0123668520
> lagg_transmit() at lagg_transmit+0x4d/frame 0xfffffe01236685a0
> vlan_transmit() at vlan_transmit+0x14f/frame 0xfffffe01236685f0
> ether_output() at ether_output+0x5b1/frame 0xfffffe0123668660
> arprequest() at arprequest+0x287/frame 0xfffffe01236686d0
> arp_ifinit() at arp_ifinit+0x59/frame 0xfffffe0123668700
> if_setlladdr() at if_setlladdr+0x1fc/frame 0xfffffe0123668760
> vlan_iflladdr() at vlan_iflladdr+0xa0/frame 0xfffffe0123668790
> lagg_lladdr() at lagg_lladdr+0xee/frame 0xfffffe01236687c0
> lagg_port_destroy() at lagg_port_destroy+0x1cd/frame 0xfffffe0123668810
> lagg_ioctl() at lagg_ioctl+0xa23/frame 0xfffffe01236688f0
> in_control() at in_control+0x30b/frame 0xfffffe0123668970
> ifioctl() at ifioctl+0xba8/frame 0xfffffe0123668a30
> kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0123668a90
> sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0123668ae0
> amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0123668bf0
> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0123668bf0
> --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8011ced2a, rsp = 0x7fffffffe218, rbp = 0x7fffffffe290 ---
> KDB: enter: panic
>
>
> Thanks,
> Hariprasad
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?542E71D3.6000500>