iflib limits one packet to a twelfth of the TX ring and gives the
stack a TSO segment count 3 below that limit, leaving room for the
m_pullup()s in iflib_parse_header(). On a ring of 32 descriptors the
limit is 2, so the count wraps to UINT_MAX, which tcp_m_copym() takes
as a seglimit of -1. An INVARIANTS kernel panics with "seglimit went
too low" as soon as TCP sends a TSO burst. Without INVARIANTS,
iflib_encap() has to squeeze full-size TSO chains into 2 segments and
drops what doesn't fit.
vmx(4) and aq(4) accept rings of 32 descriptors and bnxt(4) of 16.
When the limit leaves nothing after the reserve, take TSO out of the
interface's capabilities, so the stack never uses it and SIOCSIFCAP
can't turn it back on.
Fixes: 7f87c0406df8 ("Assorted TSO fixes for em(4)/iflib(9) and...")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")