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 was introduced to implement the peeck_recvlen() callback, which means 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.
|310 ↗||(On Diff #67671)|
I think we can replace this cycle with call buf_to_iov(priv->bbuf, priv->bbuflen, iov, iovcnt, 0)
In any case I tested 10 different combinations:
- VM-2-VM + tap + virtio-net + mtu 1500
- VM-2-VM + tap + virtio-net + mtu 9000
- VM-2-VM + tap + e1000 + mtu 1500
- VM-2-VM + tap + e1000 + mtu 9000
- VM-2-VM + vale + virtio-net + mtu 1500
- VM-2-VM + vale + virtio-net + mtu 9000
- VM-2-VM + vale + e1000 + mtu 1500
- VM-2-VM + vale + e1000 + mtu 9000
- VM-2-host + tap + virtio-net + mtu 1500
- VM-2-host + tap + virtio-net + mtu 9000
each one with ping (-D) and netperf. Everything looks good.