Page MenuHomeFreeBSD

vtnet: Account for the padding when selecting allocation size
ClosedPublic

Authored by imp on Jan 29 2024, 9:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 7:12 AM
Unknown Object (File)
Thu, Oct 31, 10:20 AM
Unknown Object (File)
Wed, Oct 30, 2:18 PM
Unknown Object (File)
Wed, Oct 30, 2:18 PM
Unknown Object (File)
Wed, Oct 30, 2:00 PM
Unknown Object (File)
Oct 22 2024, 8:28 AM
Unknown Object (File)
Oct 17 2024, 10:29 PM
Unknown Object (File)
Oct 17 2024, 9:22 AM
Subscribers
None

Details

Summary

While we account for the padding in the length of the mbuf we use, we do
not account for it when we 'guess' the size of the mbuf to allocate
based in the MTU of the device. This leads to a situation where we might
fail if the mtu is close to a bucket size (say 2018) such that the added
padding would push us over the edge for a full-sized packet. mtu of 2018
is super rare (2016 and 2020 would both work), but fix it none-the-less.
It's a shame we can't just set VTNET_RX_HEADER_PAD to 2 in this case. The 4
seems hard-coded somewhere I've not found documented (I think it's in the
protocol given the comments about VIRTIO_F_ANY_LAYOUT).

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Jan 29 2024, 9:11 PM
imp created this revision.
sys/dev/virtio/network/if_vtnetvar.h
248

Thanks! even sized? We also require for the one above, right? Almost want to put these two above and then also s/both/all/?

This revision is now accepted and ready to land.Feb 1 2024, 11:32 AM