Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Jan 2021 14:33:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 252518] iflib/ice panics when netmap/pkt-gen exits
Message-ID:  <bug-252518-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-252518-227>