From owner-freebsd-bugs@freebsd.org Fri Jan 8 14:33:27 2021 Return-Path: Delivered-To: freebsd-bugs@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 B025D4CB93F for ; Fri, 8 Jan 2021 14:33:27 +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 4DC5F34KDKz4SJG for ; Fri, 8 Jan 2021 14:33:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 9436E4CB93E; Fri, 8 Jan 2021 14:33:27 +0000 (UTC) Delivered-To: bugs@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 93FB24CB9BE for ; Fri, 8 Jan 2021 14:33:27 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4DC5F32d6Qz4SJF for ; Fri, 8 Jan 2021 14:33:27 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CF2D24C30 for ; Fri, 8 Jan 2021 14:33:27 +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 108EXRVq065801 for ; Fri, 8 Jan 2021 14:33:27 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 108EXRlA065800 for bugs@FreeBSD.org; Fri, 8 Jan 2021 14:33:27 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: bugs@FreeBSD.org Subject: [Bug 252518] iflib/ice panics when netmap/pkt-gen exits Date: Fri, 08 Jan 2021 14:33:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: brpoole@vt.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2021 14:33:27 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252518 Bug ID: 252518 Summary: iflib/ice panics when netmap/pkt-gen exits Product: Base System Version: 12.2-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: brpoole@vt.edu Hello, I am trying to use the Intel E810 ice driver in netmap mode on FreeBSD-12.2= . I can successfully use pkt-gen to receive packets with: 'pkt-gen -i ice0 -f r= x'. However, if I try to run pkt-gen with multiple threads '-p 2', iflib panics when pkt-gen is shutting down. I see two different panics depending on whet= her there are packets streaming into the E810 when I stop pkt-gen or whether I = have stopped all incoming packets before stopping pkt-gen. I instrumented iflib.c with additional debugging: Index: iflib.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- iflib.c (revision 368515) +++ iflib.c (working copy) @@ -875,6 +875,11 @@ iru_init(&iru, rxq, 0 /* flid */); map =3D fl->ifl_sds.ifsd_map; nic_i =3D fl->ifl_pidx; + + device_t dev =3D ctx->ifc_dev; + device_printf(dev, "nic_i: %i, netmap_idx_k2n: %i, nm_i: %i, ring: %i\n", + nic_i, netmap_idx_k2n(kring, nm_i), nm_i, ring->ringid); + MPASS(nic_i =3D=3D netmap_idx_k2n(kring, nm_i)); DBG_COUNTER_INC(fl_refills); while (n > 0) { @@ -915,6 +920,9 @@ ctx->isc_rxd_refill(ctx->ifc_softc, &iru); } fl->ifl_pidx =3D nic_i; + + device_printf(dev, "nm_i: %i\n", nm_i); + MPASS(!init || nm_i =3D=3D 0); MPASS(nm_i =3D=3D kring->rhead); kring->nr_hwcur =3D nm_i; ## Case 1: No packets streaming into E810 when pkt-gen is terminated Started transmitter Started receiver: pkt-gen -i ice0 -f rx -p 2 Terminated transmitter Gave pkt-gen CTRL-C #### Run 1 ice0: nic_i: 720, netmap_idx_k2n: 720, nm_i: 720, ring: 0 ice0: nm_i: 723 ice0: nic_i: 176, netmap_idx_k2n: 176176 nm_i: 0, ring: 1 ice0: nm_i: 256 ice0: nic_i: 256, netmap_idx_k2n: 256, nm_i: 256, ring: 1 ice0: nm_i: 260 ice0: nic_i: 260, netmap_idx_k2n: 260, nm_i: 260, ring: 1 ice0: nm_i: 261 ice0: nic_i: 0, netmap_idx_k2n: 0, nm_i: 261, ring: 1 panic: Assertion !init || nm_i =3D=3D 0 failed at /usr/src/sys/net/iflib.c:= 926 #### Run #2 ice0: nic_i: 184, netmap_idx_k2n: 184, nm_i: 184, ring: 1 ice0: nm_i: 230 ice0: nic_i: 980, netmap_idx_k2n: 980, nm_i: 980, ring: 0 ice0: nm_i: 984 ice0: nic_i: 984, netmap_idx_k2n: 984, nm_i: 984, ring: 0 ice0: nm_i: 985 ice0: nic_i: 0, netmap_idx_k2n: 0, nm_i: 230, ring: 1 ice0: nm_i: 230 panic: Assertion !init || nm_i =3D=3D 0 failed at /usr/src/sys/net/iflib.c:= 926 #### Run #3 ice0: nic_i: 844, netmap_idx_k2n: 844, nm_i: 884, ring: 0 ice0: nm_i: 852 ice0: nic_i: 188, netmap_idx_k2n: 188, nm_i: 188, ring: 1 ice0: nm_i: 248 ice0: nic_i: 248, netmap_idx_k2n: 248, nm_i: 248, ring: 1 ice0: nm_i: 312 ice0: nic_i: 312, netmap_idx_k2n: 312, nm_i: 312, ring: 1 ice0: nm_i: 399 ice0: nic_i: 0, netmap_idx_k2n: 0, nm_i: 399, ring: 1 ice0: nm_i: 399 panic: Assertion !init || nm_i =3D=3D 0 failed at /usr/src/sys/net/iflib.c:= 926 The panic is iflib.c:918 in the FreeBSD-12.2 source (my debugging adjusted = the line numbers). This code is in netmap_fl_refill(). ## Case 2: Packets are still hitting the E810 when pkt-gen is terminated Started transmitter Started receiver: pkt-gen -i ice0 -f rx -p 2 Gave pkt-gen CTRL-C ## Run #1 ice0: nm_i: 160 ice0: nic_i: 0, netmap_idx_k2n: 960, nm_i: 160, ring: 1 panic: Assertion nic_i =3D=3D netmap_idx_k2n(kring, nm_i) failed at /usr/src/sys/net/iflib:883 ## Run #2 ice0: nm_i: 704 ice0: nic_i: 0, netmap_idx_k2n: 936, nm_i: 704, ring: 1 panic: Assertion nic_i =3D=3D netmap_idx_k2n(kring, nm_i) failed at /usr/src/sys/net/iflib:883 ## Run #3 ice0: nic_i: 264, netmap_idx_k2n: 264, nm_i: 264, ring: 1 ice0: nm_i: 360 ice0: nic_i: 0, netmap_idx_k2n: 948, nm_i: 360, ring: 1 ice0: nm_i: 0 panic: Assertion nic_i =3D=3D netmap_idx_k2n(kring, nm_i) failed at /usr/src/sys/net/iflib:883 This panic is iflib:878 in the 12.2 sources. The stack trace I saw was: netmap_fl_refill() iflib_init_locked() iflib_netmap_register() netmap_hw_reg() netmap_do_unregif() netmap_dtor() --=20 You are receiving this mail because: You are the assignee for the bug.=