[Bug 268490] [igb] [lagg] [vlan]: Intel i210 performance severely degraded

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 20 Mar 2023 17:22:22 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268490

--- Comment #36 from Daniel Duerr <duerrd561@gmail.com> ---
(In reply to Kevin Bowling from comment #35)

Hi Kevin,

Okay, I finished another `git bisect` for you as we discussed, but this time I
manually reverted the `if_getflags(ifp)` change each time to see how that would
affect the results. Also, on the first commit (the one that works as-is), I
manually applied the `if_getflags(ifp)` change and confirmed it broke it. I
then reverted that, did a `git bisect good` on the first commit, and proceeded
with the rest of the process. It definitely produces a different result. Here's
the log:

### Step 1: Restart the `git bisect` and confirm the first commit still works

[root@nfs src]# git checkout releng/12.4
[root@nfs src]# git bisect start release/12.4.0 release/12.2.0 -- sys/dev/e1000
Bisecting: a merge base must be tested
[68cfeeb1d3c428e3c3881f45bc3a20a252b37d0e] MFC r365284:
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-PRERELEASE FreeBSD 12.2-PRERELEASE
68cfeeb1d3c4(HEAD) GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 10616
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.00 sec  1.15 GBytes   985 Mbits/sec
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 20446
[ ID] Interval       Transfer     Bandwidth
[  2] 0.00-10.00 sec  1.15 GBytes   988 Mbits/sec
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 10068
[ ID] Interval       Transfer     Bandwidth
[  3] 0.00-10.00 sec  1.15 GBytes   985 Mbits/sec

### Step 2: Recreate the if_getflags(ifp) change to sys/dev/e1000/if_em.c on
the first commit and see if it breaks it

[root@nfs src]# vi sys/dev/e1000/if_em.c
[root@nfs src]# git diff
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 558a75ac015e..42faacfc3eea 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1338,7 +1338,7 @@ em_if_init(if_ctx_t ctx)
        }

        /* Don't lose promiscuous settings */
-       em_if_set_promisc(ctx, IFF_PROMISC);
+       em_if_set_promisc(ctx, if_getflags(ifp));
        e1000_clear_hw_cntrs_base_generic(&adapter->hw);

        /* MSI-X configuration for 82574 */
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-PRERELEASE FreeBSD 12.2-PRERELEASE #15
68cfeeb1d3c4(HEAD)-dirty: Fri Mar 17 10:50:14 PDT 2023    
toor@nfs.tidepool.cloud:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 47216
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 37030
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 41145
^CWaiting for server threads to complete. Interrupt again to force quit.
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-76.70 sec  60.0 Bytes  6.26 bits/sec
[  2] 0.00-56.38 sec  60.0 Bytes  8.51 bits/sec
[  3] 0.00-36.23 sec  60.0 Bytes  13.2 bits/sec
[SUM] 0.00-78.70 sec   180 Bytes  18.3 bits/sec
[root@nfs src]# git checkout -- sys/dev/e1000/if_em.c
[root@nfs src]# git diff
[root@nfs src]# git bisect good

### Step 3: Advance to next commit (originally first bad), manually reverse the
if_getflags(ifp) change to sys/dev/e1000/if_em.c and see if it now works

[root@nfs src]# vi sys/dev/e1000/if_em.c
[root@nfs src]# git diff
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index ce13d57da60b..938c30a03f49 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1360,7 +1360,7 @@ em_if_init(if_ctx_t ctx)
        }

        /* Don't lose promiscuous settings */
-       em_if_set_promisc(ctx, if_getflags(ifp));
+       em_if_set_promisc(ctx, IFF_PROMISC);
        e1000_clear_hw_cntrs_base_generic(&adapter->hw);

        /* MSI-X configuration for 82574 */
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-STABLE FreeBSD 12.2-STABLE #18
n233898-355177efed6c-dirty: Fri Mar 17 14:27:50 PDT 2023    
toor@nfs.tidepool.cloud:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 17746
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 17750
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 17751
^CWaiting for server threads to complete. Interrupt again to force quit.
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-76.54 sec  60.0 Bytes  6.27 bits/sec
[  2] 0.00-56.22 sec  60.0 Bytes  8.54 bits/sec
[  3] 0.00-36.32 sec  60.0 Bytes  13.2 bits/sec
[SUM] 0.00-79.15 sec   180 Bytes  18.2 bits/sec
[root@nfs src]# git checkout -- sys/dev/e1000/if_em.c
[root@nfs src]# git bisect bad
Bisecting: 16 revisions left to test after this (roughly 4 steps)
[ded3123049a592ec1f9c5b757e3f0f98f104d6cf] e1000: fix build after 92804cf3dc48
(orig c1655b0f)

### Step 4: Advance to next commit, manually reverse the if_getflags(ifp)
change to sys/dev/e1000/if_em.c and see if it now works

[root@nfs src]# vi sys/dev/e1000/if_em.c
[root@nfs src]# git diff
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index bcf7e0e9ec56..a9c00e58d880 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1362,7 +1362,7 @@ em_if_init(if_ctx_t ctx)
        }

        /* Don't lose promiscuous settings */
-       em_if_set_promisc(ctx, if_getflags(ifp));
+       em_if_set_promisc(ctx, IFF_PROMISC);
        e1000_clear_hw_cntrs_base_generic(&adapter->hw);

        /* MSI-X configuration for 82574 */
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-STABLE FreeBSD 12.2-STABLE #19
n233610-ded3123049a5-dirty: Fri Mar 17 19:17:26 PDT 2023    
toor@nfs.tidepool.cloud:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 39123
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 51144
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 22030
recv failed: Connection reset by peer
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-79.38 sec  60.0 Bytes  6.05 bits/sec
recv failed: Connection reset by peer
[  2] 0.00-79.38 sec  60.0 Bytes  6.05 bits/sec
recv failed: Connection reset by peer
[  3] 0.00-79.38 sec  60.0 Bytes  6.05 bits/sec
[SUM] 0.00-122.26 sec   180 Bytes  11.8 bits/sec
[root@nfs src]# git checkout -- sys/dev/e1000/if_em.c
[root@nfs src]# git bisect bad
Bisecting: 7 revisions left to test after this (roughly 3 steps)
[60b1634944ed4c19c1db5d1c5f9ed9c83ed6585b] e1000: Improve device name strings

### Step 5: Advance to next commit, manually reverse the if_getflags(ifp)
change to sys/dev/e1000/if_em.c and see if it now works

[root@nfs src]# vi sys/dev/e1000/if_em.c
[root@nfs src]# git diff
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index f284de275066..919f687e5992 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1363,7 +1363,7 @@ em_if_init(if_ctx_t ctx)
        }

        /* Don't lose promiscuous settings */
-       em_if_set_promisc(ctx, if_getflags(ifp));
+       em_if_set_promisc(ctx, IFF_PROMISC);
        e1000_clear_hw_cntrs_base_generic(&adapter->hw);

        /* MSI-X configuration for 82574 */
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-STABLE FreeBSD 12.2-STABLE #20
n233210-60b1634944ed-dirty: Fri Mar 17 20:02:39 PDT 2023    
toor@nfs.tidepool.cloud:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 13641
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 44007
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 65487
^CWaiting for server threads to complete. Interrupt again to force quit.
[ ID] Interval       Transfer     Bandwidth
[  2] 0.00-48.64 sec  60.0 Bytes  9.87 bits/sec
[  3] 0.00-28.22 sec  60.0 Bytes  17.0 bits/sec
[  1] 0.00-72.92 sec  60.0 Bytes  6.58 bits/sec
[SUM] 0.00-72.92 sec   180 Bytes  19.7 bits/sec
[root@nfs src]# git checkout -- sys/dev/e1000/if_em.c
[root@nfs src]# git bisect bad
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[c9c1838988faa8bcb74af30384ab45a483562727] e1000: Add support for [Tiger,
Alder, Meteor] Lake

### Step 6: Advance to next commit, manually reverse the if_getflags(ifp)
change to sys/dev/e1000/if_em.c and see if it now works

[root@nfs src]# vi sys/dev/e1000/if_em.c
[root@nfs src]# git diff
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 79a9d8fdcfe9..839454c20fd7 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1363,7 +1363,7 @@ em_if_init(if_ctx_t ctx)
        }

        /* Don't lose promiscuous settings */
-       em_if_set_promisc(ctx, if_getflags(ifp));
+       em_if_set_promisc(ctx, IFF_PROMISC);
        e1000_clear_hw_cntrs_base_generic(&adapter->hw);

        /* MSI-X configuration for 82574 */
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-STABLE FreeBSD 12.2-STABLE #21
n233050-c9c1838988fa-dirty: Sat Mar 18 07:55:11 PDT 2023    
toor@nfs.tidepool.cloud:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 23361
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.00 sec  1.02 GBytes   877 Mbits/sec
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 23362
[ ID] Interval       Transfer     Bandwidth
[  2] 0.00-10.00 sec  1.07 GBytes   917 Mbits/sec
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 23363
[ ID] Interval       Transfer     Bandwidth
[  3] 0.00-10.00 sec  1.15 GBytes   986 Mbits/sec
[root@nfs src]# git checkout -- sys/dev/e1000/if_em.c
[root@nfs src]# git bisect good
Bisecting: 1 revision left to test after this (roughly 1 step)
[94c02a765cb7f68c80844acb5898be90dc4069c5] e1000: disable hw.em.sbp debug
setting

### Step 7: Advance to next commit, manually reverse the if_getflags(ifp)
change to sys/dev/e1000/if_em.c and see if it now works

[root@nfs src]# vi sys/dev/e1000/if_em.c
[root@nfs src]# git diff
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 2c13f7750af2..0ff2bd00d6b0 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1363,7 +1363,7 @@ em_if_init(if_ctx_t ctx)
        }

        /* Don't lose promiscuous settings */
-       em_if_set_promisc(ctx, if_getflags(ifp));
+       em_if_set_promisc(ctx, IFF_PROMISC);
        e1000_clear_hw_cntrs_base_generic(&adapter->hw);

        /* MSI-X configuration for 82574 */
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-STABLE FreeBSD 12.2-STABLE #21
n233050-c9c1838988fa-dirty: Sat Mar 18 07:55:11 PDT 2023    
toor@nfs.tidepool.cloud:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 41958
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.00 sec  1.14 GBytes   982 Mbits/sec
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 41959
[ ID] Interval       Transfer     Bandwidth
[  2] 0.00-10.00 sec  1.15 GBytes   987 Mbits/sec
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 41960
[ ID] Interval       Transfer     Bandwidth
[  3] 0.00-10.00 sec  1.15 GBytes   983 Mbits/sec
[root@nfs src]# git checkout -- sys/dev/e1000/if_em.c
[root@nfs src]# git bisect good
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[1a132077c2cb500410079f9120c3f676d15f7931] e1000: fix em_mac_min and 82547
packet buffer

### Step 8: Advance to next commit, manually reverse the if_getflags(ifp)
change to sys/dev/e1000/if_em.c and see if it now works

[root@nfs src]# vi sys/dev/e1000/if_em.c
[root@nfs src]# git diff
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index ce60b1f5d437..e8f215dfa089 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1363,7 +1363,7 @@ em_if_init(if_ctx_t ctx)
        }

        /* Don't lose promiscuous settings */
-       em_if_set_promisc(ctx, if_getflags(ifp));
+       em_if_set_promisc(ctx, IFF_PROMISC);
        e1000_clear_hw_cntrs_base_generic(&adapter->hw);

        /* MSI-X configuration for 82574 */
[root@nfs src]# make -j `sysctl -n hw.ncpu` buildkernel
KERNCONF=GENERIC-NODEBUG && make installkernel KERNCONF=GENERIC-NODEBUG
[root@nfs src]# reboot
[root@nfs src]# uname -a
FreeBSD nfs.tidepool.cloud 12.2-STABLE FreeBSD 12.2-STABLE #23
n233156-1a132077c2cb-dirty: Mon Mar 20 09:41:24 PDT 2023    
toor@nfs.tidepool.cloud:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
[root@nfs src]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[  1] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 20023
[  2] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 20024
[  3] local 172.27.6.135 port 5001 connected with 172.27.6.129 port 15792
^CWaiting for server threads to complete. Interrupt again to force quit.
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-72.73 sec  60.0 Bytes  6.60 bits/sec
[  2] 0.00-52.37 sec  60.0 Bytes  9.17 bits/sec
[  3] 0.00-32.30 sec  60.0 Bytes  14.9 bits/sec
[SUM] 0.00-74.75 sec   180 Bytes  19.3 bits/sec
[root@nfs src]# git checkout -- sys/dev/e1000/if_em.c
[root@nfs src]# git bisect bad
1a132077c2cb500410079f9120c3f676d15f7931 is the first bad commit
commit 1a132077c2cb500410079f9120c3f676d15f7931
Author: Kevin Bowling <kbowling@FreeBSD.org>
Date:   Thu Apr 15 09:58:36 2021 -0700

    e1000: fix em_mac_min and 82547 packet buffer

    The boundary differentiating "lem" vs "em" class devices was wrong
    after the iflib conversion of lem(4).

    The Packet Buffer size for 82547 class chips was not set correctly
    after the iflib conversion of lem(4).

    These changes restore functionality on an 82547 for the submitter.

    PR:             236119
    Reported by:    Jeff Gibbons <jgibbons@protogate.com>
    Reviewed by:    markj
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D29766

    (cherry picked from commit bb1b375fa7487ee5c3843121a0621ac8379c18e6)

 sys/dev/e1000/if_em.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.