Skip to content

Commit

Permalink
vhost-user: Support operation without MRG_RXBUF.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wingo committed Jun 8, 2016
1 parent 10901b8 commit df8e83c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/virtio/net_device.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit df8e83c

Please sign in to comment.