Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtio/net_device: Fix bug with mergeable rx buffers #935

Merged
merged 1 commit into from
Jul 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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