freebsd-dev/sys/dev/bge
Eric van Gyzen 3ca4a33903 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
2022-07-18 16:05:18 -05:00
..
if_bge.c bge: tell debugnet there are 2 rx rings, not 1,024 2022-07-18 16:05:18 -05:00
if_bgereg.h bge(4): remove obsolete support for on-board Fujitsu and Sun MACs 2020-12-25 20:04:19 +01:00