Page MenuHomeFreeBSD

ng_eiface(4): Set IFF_KNOWSEPOCH flag to avoid enter net epoch recursively.
ClosedPublic

Authored by afedorov on Mar 31 2023, 3:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 31, 12:13 PM
Unknown Object (File)
Fri, Mar 29, 9:57 AM
Unknown Object (File)
Jan 11 2024, 11:48 PM
Unknown Object (File)
Nov 12 2023, 4:42 PM
Unknown Object (File)
Nov 10 2023, 4:43 PM
Unknown Object (File)
Oct 9 2023, 3:40 PM
Unknown Object (File)
Sep 17 2023, 5:09 PM
Unknown Object (File)
Jun 24 2023, 5:39 AM
Subscribers

Details

Reviewers
vmaffione
glebius
zlei
Group Reviewers
network
Summary

ng_eiface(4) RX path:

ng_eiface_rcvdata() -> ifp->input -> ether_input().

ng_eiface_rcvdata() is always called with NET_EPOCH as the netgraph(4) data path. But ether_input() checks the interface's IFF_KNOWSEPOCH flag to decide whether or not to enter NET_EPOCH. This results in a double entry to NET_EPOCH.

The patch slightly increases RX PPS: ~ 100 Kpps.

Test Plan

Two machines:
First M1:

CPU: Intel(R) Xeon(R) Gold 6226R CPU @ 2.90GHz (2900.00-MHz K8-class CPU)

ixl2: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4e507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP>
        ether 3c:ec:ef:3d:77:6a
        media: Ethernet autoselect (10GBase-KR <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Second M2:

CPU: Intel(R) Xeon(R) Gold 6226R CPU @ 2.90GHz (2900.00-MHz K8-class CPU)

ixl2: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4e507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP>
        ether 3c:ec:ef:3d:77:76
        media: Ethernet autoselect (10GBase-KR <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

M1:

ifconfig ixl2 up
./pkt-gen -i ixl2 -f tx

M2:

ifconfig ixl2 up
kldload ng_ether
ngctl mkpeer ixl2: eiface lower ether
ifconfig ngeth0 up

Check PPS using systat(1) - M2:

Before patch:

               /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
Load Average   ||||||||||||

 Interface           Traffic               Peak                Total
    ngeth0  in      3.289 Mp/s          3.308 Mp/s          129.722 Mp
            out     0.000 Kp/s          0.000 Kp/s            0.000 Kp

      ixl2  in      15.065 Kp/s         15.263 Mp/s          472.285 Mp
            out     0.000 Kp/s          0.000 Kp/s          256.000 Tp

With patch:

               /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
Load Average   ||||

 Interface           Traffic               Peak                Total
    ngeth0  in      3.489 Mp/s          3.518 Mp/s          250.177 Mp
            out     0.000 Kp/s          0.000 Kp/s            0.000 Kp

      ixl2  in     15.105 Mp/s         15.129 Mp/s         1016.303 Mp
            out     0.000 Kp/s          0.000 Kp/s          256.000 Tp

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Generally looks good to me.

The patch slightly increases RX PPS: ~ 100 Kpps.

From to ?

sys/netgraph/ng_eiface.c
415

Nits, no need for the parentheses.

This revision is now accepted and ready to land.Mar 31 2023, 3:53 PM
In D39369#896103, @zlei wrote:

Generally looks good to me.

The patch slightly increases RX PPS: ~ 100 Kpps.

From to ?

I added a test plan ^^^

In D39369#896103, @zlei wrote:

Generally looks good to me.

The patch slightly increases RX PPS: ~ 100 Kpps.

From to ?

I added a test plan ^^^

I meant an absolute increasing (increases RX PPS: ~ 100 Kpps) is not valuable in commit log, or even worse without details of test environment.

Anyway the patch is good and expected to win performance.

Abandon due to D39510

IFF_KNOWSEPOCH is enabled by default.