From 995f9d89d9ef0c35492a9597dc17a96868e38e35 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 8 Jun 2016 10:28:45 +0000 Subject: [PATCH] vhost-user: Support operation without MRG_RXBUF. MRG_RXBUF is enabled by default in the beginning, and QEMU will initially negotiate a feature set with Snabb NFV that includes MRG_RXBUF. This adds a field onto the virtio header, in legacy mode. However if we later negotiate to not have MRG_RXBUF, we need to re-set this value to not have the extra fields. (cherry picked from commit df8e83c6771a7b892324922f25d5123a69f651d9) --- src/lib/virtio/net_device.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/virtio/net_device.lua b/src/lib/virtio/net_device.lua index d259e92cff..14fa5c9b1e 100644 --- a/src/lib/virtio/net_device.lua +++ b/src/lib/virtio/net_device.lua @@ -392,6 +392,10 @@ function VirtioNetDevice:set_features(features) self.hdr_type = virtio_net_hdr_mrg_rxbuf_type self.hdr_size = virtio_net_hdr_mrg_rxbuf_size self.mrg_rxbuf = true + else + self.hdr_type = virtio_net_hdr_type + self.hdr_size = virtio_net_hdr_size + self.mrg_rxbuf = false end if band(self.features, C.VIRTIO_RING_F_INDIRECT_DESC) == C.VIRTIO_RING_F_INDIRECT_DESC then for i = 0, max_virtq_pairs-1 do