]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: enable virtio-net mergeable rx buffers for tap(4)
authorvmaffione <vmaffione@FreeBSD.org>
Thu, 20 Feb 2020 21:07:23 +0000 (21:07 +0000)
committervmaffione <vmaffione@FreeBSD.org>
Thu, 20 Feb 2020 21:07:23 +0000 (21:07 +0000)
commitab8f5c5d3015effedab33f9c885d0c76a7fcaae2
tree2d743e66c95b4bb2389b7bd046f81c2daf7be07c
parent807c4389a7b9d8ff3b0a1f9035dc93bfa627aee8
bhyve: enable virtio-net mergeable rx buffers for tap(4)

This patch adds a new netbe_peek_recvlen() function to the net
backend API. The new function allows the virtio-net receive code
to know in advance how many virtio descriptors chains will be
needed to receive the next packet. As a result, the implementation
of the virtio-net mergeable rx buffers feature becomes efficient,
so that we can enable it also with the tap(4) backend. For the
tap(4) backend, a bounce buffer is introduced to implement the
peeck_recvlen() callback, which implies an additional packet copy
on the receive datapath. In the future, it should be possible to
remove the bounce buffer (and so the additional copy), by
obtaining the length of the next packet from kevent data.

Reviewed by:    grehan, aleksandr.fedorov@itglobal.com
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D23472
usr.sbin/bhyve/iov.c
usr.sbin/bhyve/iov.h
usr.sbin/bhyve/net_backends.c
usr.sbin/bhyve/net_backends.h
usr.sbin/bhyve/pci_virtio_net.c