From df8e83c6771a7b892324922f25d5123a69f651d9 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. --- 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 bf8e451f8c..328cdb5858 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