From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 09:53:29 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 207FD12B; Fri, 3 Oct 2014 09:53:29 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF70E30C; Fri, 3 Oct 2014 09:53:28 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XZvYu-0004c0-Lo; Fri, 03 Oct 2014 09:37:52 +0400 Message-ID: <542E71D3.6000500@FreeBSD.org> Date: Fri, 03 Oct 2014 13:52:19 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Hariprasad S , "freebsd-net@freebsd.org" Subject: Re: Detaching the slave from the lagg interface which has vlan on top of it, hits an panic References: <26E3F92EC670BD429DB5CB319D773C137A8878@nice.asicdesigners.com> In-Reply-To: <26E3F92EC670BD429DB5CB319D773C137A8878@nice.asicdesigners.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2014 09:53:29 -0000 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" >