Page MenuHomeFreeBSD

bnxt: HW_LRO Rx Pkt with > 32 fragments caused Crash (iflib)
ClosedPublic

Authored by bhargava.marreddy_broadcom.com on Oct 24 2017, 1:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 4, 7:35 AM
Unknown Object (File)
Feb 8 2024, 6:17 PM
Unknown Object (File)
Jan 31 2024, 3:53 AM
Unknown Object (File)
Jan 31 2024, 3:53 AM
Unknown Object (File)
Jan 13 2024, 8:56 PM
Unknown Object (File)
Jan 13 2024, 8:36 PM
Unknown Object (File)
Jan 12 2024, 1:47 AM
Unknown Object (File)
Dec 28 2023, 3:24 PM
Subscribers

Details

Summary

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.

Test Plan

Verified iperf TCP, no issue seen.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

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).

This revision is now accepted and ready to land.Oct 26 2017, 3:33 PM
sys/net/iflib.c
289–290

Change back to 64.

Add comment: /* bnxt supports 64 with hardware LRO enabled */ before the define.

This revision now requires review to proceed.Oct 27 2017, 6:16 AM
bhargava.marreddy_broadcom.com added inline comments.
sys/net/iflib.c
289–290

Taken care.

This revision is now accepted and ready to land.Oct 30 2017, 8:18 PM
This revision was automatically updated to reflect the committed changes.