Bug 271371

Summary: e1000 driver falsely reports that it supports LRO
Product: Base System Reporter: Ed Maste <emaste>
Component: kernAssignee: Kevin Bowling <kbowling>
Status: Closed Not A Bug    
Severity: Affects Only Me CC: erj, kbowling
Priority: --- Keywords: IntelNetworking
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254596

Description Ed Maste freebsd_committer freebsd_triage 2023-05-11 23:15:14 UTC
in sys/dev/e1000/if_em.c em and igb include IFCAP_LRO

#define LEM_CAPS                                                        \
    IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING |              \
    IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER

#define EM_CAPS                                                         \
    IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING |              \
    IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 |  \
    IFCAP_LRO | IFCAP_VLAN_HWTSO

#define IGB_CAPS                                                        \
    IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING |              \
    IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 |  \
    IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\
    IFCAP_TSO6

but there is no other reference to LRO in the driver, after f2d6ace4a684 which migrated lem/em/igb to iflib
Comment 1 Eric Joyner freebsd_committer freebsd_triage 2023-05-15 22:19:17 UTC
I don't understand this bug?

The IFCAP_LRO capability gets passed to iflib via the isc_capenable/isc_capabilities fields via the driver's if_softc_ctx_t object, then those are used in a if_setcapabilities/if_setcapenable() call in iflib when the driver loads. Then iflib sets up the lro context and handles sending packets via LRO's tcp_lro_rx() instead of the regular if_input() routine.

iflib ends up handling most of it, but the driver still needs to set IFCAP_LRO if it wants iflib to use LRO.
Comment 2 Kevin Bowling freebsd_committer freebsd_triage 2023-07-26 09:01:47 UTC
(In reply to Eric Joyner from comment #1)
Agreed