freebsd kernel with SKQ
674010a405
This patch fixes two issues seen on hot-unplug. The first one is a panic caused by calling ether_ifdetach after freeing the internal netfront queue structures. ether_ifdetach will call xn_qflush, and this needs to be done before freeing the queues. This prevents the following panic: Fatal trap 9: general protection fault while in kernel mode cpuid = 2; apic id = 04 instruction pointer = 0x20:0xffffffff80b1687f stack pointer = 0x28:0xfffffe009239e770 frame pointer = 0x28:0xfffffe009239e780 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (thread taskq) [ thread pid 0 tid 100015 ] Stopped at strlen+0x1f: movq (%rcx),%rax db> bt Tracing pid 0 tid 100015 td 0xfffff800038a6000 strlen() at strlen+0x1f/frame 0xfffffe009239e780 kvprintf() at kvprintf+0xfa0/frame 0xfffffe009239e890 vsnprintf() at vsnprintf+0x31/frame 0xfffffe009239e8b0 kassert_panic() at kassert_panic+0x5a/frame 0xfffffe009239e920 __mtx_lock_flags() at __mtx_lock_flags+0x164/frame 0xfffffe009239e970 xn_qflush() at xn_qflush+0x59/frame 0xfffffe009239e9b0 if_detach() at if_detach+0x17e/frame 0xfffffe009239ea10 netif_free() at netif_free+0x97/frame 0xfffffe009239ea30 netfront_detach() at netfront_detach+0x11/frame 0xfffffe009239ea40 [...] Another panic can be triggered by hot-plugging a NIC: Fatal trap 18: integer divide fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff80902203 stack pointer = 0x28:0xfffffe00508d3660 frame pointer = 0x28:0xfffffe00508d36a0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 2960 (ifconfig) [ thread pid 2960 tid 100088 ] Stopped at xn_txq_mq_start+0x33: divl %esi,%eax db> bt Tracing pid 2960 tid 100088 td 0xfffff8000850aa00 xn_txq_mq_start() at xn_txq_mq_start+0x33/frame 0xfffffe00508d36a0 ether_output() at ether_output+0x570/frame 0xfffffe00508d3720 arprequest() at arprequest+0x433/frame 0xfffffe00508d3820 arp_ifinit() at arp_ifinit+0x49/frame 0xfffffe00508d3850 xn_ioctl() at xn_ioctl+0x1a2/frame 0xfffffe00508d3890 in_control() at in_control+0x882/frame 0xfffffe00508d3910 ifioctl() at ifioctl+0xda1/frame 0xfffffe00508d39a0 kern_ioctl() at kern_ioctl+0x246/frame 0xfffffe00508d3a00 sys_ioctl() at sys_ioctl+0x171/frame 0xfffffe00508d3ae0 amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe00508d3bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00508d3bf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8011e185a, rsp = 0x7fffffffe478, rbp = 0x7fffffffe4c0 --- This is caused by marking the driver as active before it's fully initialized, and thus calling xn_txq_mq_start with num_queues set to 0. Reviewed by: Wei Liu <wei.liu2@citrix.com> Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6646 |
||
---|---|---|
bin | ||
cddl | ||
contrib | ||
crypto | ||
etc | ||
gnu | ||
include | ||
kerberos5 | ||
lib | ||
libexec | ||
release | ||
rescue | ||
sbin | ||
secure | ||
share | ||
sys | ||
targets | ||
tests | ||
tools | ||
usr.bin | ||
usr.sbin | ||
.arcconfig | ||
.arclint | ||
COPYRIGHT | ||
LOCKS | ||
MAINTAINERS | ||
Makefile | ||
Makefile.inc1 | ||
Makefile.libcompat | ||
ObsoleteFiles.inc | ||
README | ||
UPDATING |
This is the top level of the FreeBSD source directory. This file was last revised on: $FreeBSD$ For copyright information, please see the file COPYRIGHT in this directory (additional copyright information also exists for some sources in this tree - please see the specific source directories for more information). The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7) and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html for more information, including setting make(1) variables. The `buildkernel` and `installkernel` targets build and install the kernel and the modules (see below). Please see the top of the Makefile in this directory for more information on the standard build targets and compile-time flags. Building a kernel is a somewhat more involved process. See build(7), config(8), and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html for more information. Note: If you want to build and install the kernel with the `buildkernel` and `installkernel` targets, you might need to build world before. More information is available in the handbook. The kernel configuration files reside in the sys/<arch>/conf sub-directory. GENERIC is the default configuration used in release builds. NOTES contains entries and documentation for all possible devices, not just those commonly used. Source Roadmap: --------------- bin System/user commands. cddl Various commands and libraries under the Common Development and Distribution License. contrib Packages contributed by 3rd parties. crypto Cryptography stuff (see crypto/README). etc Template files for /etc. gnu Various commands and libraries under the GNU Public License. Please see gnu/COPYING* for more information. include System include files. kerberos5 Kerberos5 (Heimdal) package. lib System libraries. libexec System daemons. release Release building Makefile & associated tools. rescue Build system for statically linked /rescue utilities. sbin System commands. secure Cryptographic libraries and commands. share Shared resources. sys Kernel sources. tests Regression tests which can be run by Kyua. See tests/README for additional information. tools Utilities for regression testing and miscellaneous tasks. usr.bin User commands. usr.sbin System administration commands. For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html