-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virtio-net: use large buffers when VIRTIO_NET_F_MRG_RXBUF is not nego…
…tiated Some hypervisors like firecracker do not support VIRTIO_NET_F_MRG_RXBUF feature which allows for more efficient and more fine grain utilization of memory when receiving incoming packets from host. When VIRTIO_NET_F_MRG_RXBUF is not negotiated and VIRTIO_NET_F_GUEST_TSO4 or VIRTIO_NET_F_GUEST_UFO are, the VirtIO spec mandates the guest to use large receive buffers of size of 65562 bytes. This patch changes OSv implementation of vitio-net to detect if large receive buffers need to be used and accordingly allocate and free those as necessary in relevant places. Prior to this patch attempts to fetch large enough data (for example 1MB file over http) would fail on firecracker with message "Receiving buffer is too small to hold frame of current size". Please note that using large buffers requires 17 times more memory (around 17MB) than when VIRTIO_NET_F_MRG_RXBUF is ON and buffers are merged from single pages. This obviously is not ideal and in future we might lower the number of SGs (currently 256) in this case to lower memory used. Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com>
- Loading branch information
Showing
2 changed files
with
62 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters