https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252518
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: [email protected]
Reporter: [email protected]
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 rx'.
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 whether
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
===================================================================
--- iflib.c (revision 368515)
+++ iflib.c (working copy)
@@ -875,6 +875,11 @@
iru_init(&iru, rxq, 0 /* flid */);
map = fl->ifl_sds.ifsd_map;
nic_i = fl->ifl_pidx;
+
+ device_t dev = 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 == 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 = nic_i;
+
+ device_printf(dev, "nm_i: %i\n", nm_i);
+
MPASS(!init || nm_i == 0);
MPASS(nm_i == kring->rhead);
kring->nr_hwcur = 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 == 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 == 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 == 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 == 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 == 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 == 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()
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"