Broadcom NIC with HW_LRO setting max_agg_segs = 6 can generate Rx pkt with 64 (2^6) fragments,
Modify IFLIB_MAX_RX_SEGS to 64 to avoid memory corruption / Crash.
Details
Verified iperf TCP, no issue seen.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
How many are required when max_agg_segs == 7? With that value change in future hardware designs?
How many are required when max_agg_segs == 7? With that value change in future hardware designs?
Though I'm seeing max of 45 in my setup, Theoretical max num_frags is 66 (64 frags + 1 TPA_Start + 1 TPA_End).
Modify IFLIB_MAX_RX_SEGS to 66 which is theoretical maximum for BRCM NIC (64 + 1 TPA_START + 1 TPA_END)
It doesn't look like the driver currently supports more than (RX_TPA_END_CMPL_AGG_BUFS_MASK >> RX_TPA_END_CMPL_AGG_BUFS_SFT) + 1 (64), so 64 seems like the best number if we change it here.
The other options are to put the max frags value in struct if_softc_ctx and have it dynamically allocated, or to have the driver limit the value to 32. I think this one is fine if changed back to 64 (or the driver is updated to support > 64).
sys/net/iflib.c | ||
---|---|---|
289 ↗ | (On Diff #34316) | Change back to 64. Add comment: /* bnxt supports 64 with hardware LRO enabled */ before the define. |
sys/net/iflib.c | ||
---|---|---|
289 ↗ | (On Diff #34316) | Taken care. |