]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Do not place the sglist used for Rx/Tx on the stack
authorBryan Venteicher <bryanv@FreeBSD.org>
Sun, 2 Feb 2014 05:15:36 +0000 (05:15 +0000)
committerBryan Venteicher <bryanv@FreeBSD.org>
Sun, 2 Feb 2014 05:15:36 +0000 (05:15 +0000)
commit443c3d0bd1abfd59becf5c0839e532c99755fdec
treea1b3643d200b5e8dd9588a1efbbb3afc8eae69d0
parent37211e7bcd59bc4d44c86b889c75527d6aff7577
Do not place the sglist used for Rx/Tx on the stack

The sglist segment array has grown to a bit over 512 bytes (on
64-bit system) which is more than ideally should be put on the
stack. Instead allocate an appropriately sized sglist and hang
it off each Rx/Tx queue structure.

Bump the maximum number of Tx segments to 64 to make it unlikely
we'll have defragment an mbuf chain. Our previous count was
rounded up to this value since it is the next power of two, so
effective memory usage should not change.

Also only allocate the maximum number of Tx segments if TSO was
negotiated.
sys/dev/virtio/network/if_vtnet.c
sys/dev/virtio/network/if_vtnetvar.h