HomeFreeBSD

bge: tell debugnet there are 2 rx rings, not 1,024

Description

bge: tell debugnet there are 2 rx rings, not 1,024

debugnet provides the network stack for netgdb and netdump. Since it
must operate under panic/debugger conditions and can't rely on dynamic
memory allocation, it preallocates mbufs during boot or network
configuration. At that time, it does not yet know which interface
will be used for debugging, so it does not know the required size and
quantity of mbufs to allocate. It takes the worst-case approach by
calculating its requirements from the largest MTU and largest number
of receive queues across all interfaces that support debugnet.

Unfortunately, the bge NIC driver told debugnet that it supports 1,024
receive queues. It actually supports only 2 queues (with 1,024 slots,
thus the error). This greatly exaggerated debugnet's preallocation,
so with an MTU of 9000 on any interface, it allocated 600 MB of memory.
A tiny fraction of this memory would be used if netgdb or netdump were
invoked; the rest is completely wasted.

Reviewed by: markj, rlibby
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D35845

Details

Provenance
vangyzenAuthored on Jul 18 2022, 6:07 PM
Reviewer
markj
Differential Revision
D35845: bge: tell debugnet there are 2 rx rings, not 1,024
Parents
rGbd980ca847b7: sched_ule: Ensure we hold the thread lock when modifying td_flags
Branches
Unknown
Tags
Unknown