Skip to content

Commit

Permalink
Merge #935 branch 'lukego/vhost-user-mergeable-rx-fix' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Jun 10, 2016
2 parents 8fb3759 + 4eb21b6 commit 2304e5b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lib/virtio/net_device.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,16 @@ function VirtioNetDevice:tx_buffer_add_mrg_rxbuf(tx_p, addr, len)
self.tx.finished = true
end

return to_copy
-- XXX The "adjust" is needed to counter-balance an adjustment made
-- in virtq_device. If we don't make this adjustment then we break
-- chaining together multiple buffers in that we report the size of
-- each buffer (except for the first) to be 12 bytes more than it
-- really is. This causes the VM to see an inflated ethernet packet
-- size which may or may not be noticed by an application.
--
-- This formulation is not optimal and it would be nice to make
-- this code more transparent. -luke
return to_copy - adjust
end

function VirtioNetDevice:tx_packet_end_mrg_rxbuf(header_id, total_size, tx_p)
Expand Down

0 comments on commit 2304e5b

Please sign in to comment.