HomeFreeBSD

iflib: initialize LRO unconditionally

Description

iflib: initialize LRO unconditionally

Changes to the LRO code have exposed a bug in iflib where devices
which are not capable of doing LRO are still calling
tcp_lro_flush_all(), even when they have not initialized the LRO
context. This used to be mostly harmless, but the LRO code now sets
the VNET based on the ifp in the lro context and will try to access it
through a NULL ifp resulting in a panic at boot.

To fix this, we unconditionally initializes LRO so that we have a
valid LRO context when calling tcp_lro_flush_all(). One alternative is
to check the device capabilities before calling tcp_lro_flush_all() or
adding a new state flag in the ctx. However, it seems unwise to add an
extra, mostly useless test for higher performance devices when we can
just initialize LRO for all devices.

Reviewed by: erj, hselasky, markj, olivier
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29928

Details

Provenance
gallatinAuthored on Apr 23 2021, 9:51 AM
Reviewer
erj
Differential Revision
D29928: iflib: initialize LRO unconditionally
Parents
rG5f00292fe3b7: cxgbe(4): Move the hw-specific parts of VXLAN setup to a separate function.
Branches
Unknown
Tags
Unknown