Skip to content

Commit

Permalink
Merge PR #935 (virtio/net_device: Fix bug with mrg_rxbuf) into max-next
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Jun 9, 2016
2 parents d347f65 + 4eb21b6 commit 655bdf7
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 655bdf7

Please sign in to comment.