From owner-freebsd-net@freebsd.org Tue Feb 18 09:52:11 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0E8625A0CD for ; Tue, 18 Feb 2020 09:52:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48MGNW6658z46hP; Tue, 18 Feb 2020 09:52:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id A3EBE169D2; Tue, 18 Feb 2020 09:52:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.10.132.6] (94-225-81-19.access.telenet.be [94.225.81.19]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id B336B3D14A; Tue, 18 Feb 2020 10:52:09 +0100 (CET) From: "Kristof Provost" To: freebsd-net Subject: vtnet IFF_NEEDSEPOCH? Date: Tue, 18 Feb 2020 10:52:09 +0100 X-Mailer: MailMate (1.13.1r5671) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2020 09:52:12 -0000 Hi, I’ve been playing around with a risc-v qemu image, and run into this panic with vtnet: DHCPDISCOVER on vtnet0 to 255.255.255.255 port 67 interval 5 panic: Assertion in_epoch(net_epoch_preempt) failed at /usr/src/sys/net/netisr.c:1093 cpuid = 0 time = 1581981733 KDB: stack backtrace: db_trace_self() at db_trace_self db_fetch_ksymtab() at db_fetch_ksymtab+0x12a kdb_backtrace() at kdb_backtrace+0x2c vpanic() at vpanic+0x144 panic() at panic+0x26 netisr_dispatch_src() at netisr_dispatch_src+0x3c0 netisr_dispatch() at netisr_dispatch+0x10 ether_ifattach() at ether_ifattach+0x2fa vtmmio_attach() at vtmmio_attach+0x490c vtmmio_attach() at vtmmio_attach+0x4624 vtmmio_attach() at vtmmio_attach+0x544a virtqueue_intr() at virtqueue_intr+0xc vtmmio_attach() at vtmmio_attach+0x2008 db_dump_intr_event() at db_dump_intr_event+0x730 fork_exit() at fork_exit+0x68 fork_trampoline() at fork_trampoline+0xa KDB: enter: panic [ thread pid 12 tid 100023 ] Stopped at kdb_enter+0x44: sd zero,0(a0) db> It seems pretty clear that the vtmmio path doesn’t enter epoch before it runs the vtnet_attach() code. On the other hand, I run vtnet CURRENT guests in bhyve, and don’t see this panic. In that case it lives on top of PCI rather than mmio, but I don’t see why/where that’d enter epoch. The following does fix the panic for me, but I’m not sure if I’m fixing the correct problem: commit 4e388ab164c0d746875501d403a1c7052f1ed633 (HEAD -> kp-hardfloat) Author: Kristof Provost Date: Mon Feb 17 10:05:14 2020 +0100 vtnet: Needs epoch diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index ceb3ffaaf2b..8c776b27f21 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -950,7 +950,7 @@ vtnet_setup_interface(struct vtnet_softc *sc) if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_baudrate = IF_Gbps(10); /* Approx. */ ifp->if_softc = sc; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | IFF_NEEDSEPOCH; ifp->if_init = vtnet_init; ifp->if_ioctl = vtnet_ioctl; ifp->if_get_counter = vtnet_get_counter; Best regards, Kristof From owner-freebsd-net@freebsd.org Tue Feb 18 11:56:44 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9201B25DA4A for ; Tue, 18 Feb 2020 11:56:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 48MK8C1SkQz3Fqx for ; Tue, 18 Feb 2020 11:56:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 2F1F925DA49; Tue, 18 Feb 2020 11:56:43 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2ED9525DA48 for ; Tue, 18 Feb 2020 11:56:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48MK8C0Lj8z3Fqg for ; Tue, 18 Feb 2020 11:56:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0315D1F984 for ; Tue, 18 Feb 2020 11:56:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 01IBugGE008955 for ; Tue, 18 Feb 2020 11:56:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 01IBugcC008954 for net@FreeBSD.org; Tue, 18 Feb 2020 11:56:42 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 187835] ngctl(8) strange behavior when adding more than 530 vlan through nethraph Date: Tue, 18 Feb 2020 11:56:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: lutz@donnerhacke.de X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2020 11:56:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D187835 lutz@donnerhacke.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lutz@donnerhacke.de --- Comment #3 from lutz@donnerhacke.de --- That's a memory allocation issue with the netgraph framework. There are sev= eral ones, which become visible, if you add enough nodes. I've to have a look into it anyway. --=20 You are receiving this mail because: You are the assignee for the bug.=