-
Notifications
You must be signed in to change notification settings - Fork 298
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
Intel10g: rx_buffsize config and check #274
Conversation
There is a problem with checking the freelist at init time: the freelist can be populated with different buffers over time so even if the contents were OK to start with this does not guarantee they will be OK in the future. (And in practice the freelist is probably empty at initialisation time and later becomes populated when buffers are retrieved from VMs.) Good news though. The virtio app should be happy to accept both zero-copy and non-zero-copy buffers (or even a mix for different iovecs of the same packet). So I think it would work to initially accept the rx_freelist and then stop using it if we are ever given an unsuitable buffer. Can we rename Is the |
ok, i'm going to change the test from init to (i'm updating with those changes right now) |
How about if One simple scheme could be to start with the maximum buffer size (16KB) and then for Then What do you think? 👍 or 👎? (Sorry never tried Github emoticons before...) |
ok, now |
@@ -92,7 +93,12 @@ function Intel82599:add_receive_buffers () | |||
-- Buffers from a special freelist | |||
local fl = self.rx_buffer_freelist | |||
while self.dev:can_add_receive_buffer() and freelist.nfree(fl) > 0 do | |||
self.dev:add_receive_buffer(freelist.remove(fl)) | |||
local b = freelist.remove(fl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This behaviour seems reasonable to me for dealing with too-small buffers.
…reshly allocated one
12a83db
to
5d2574b
Compare
Intel10g: rx_buffsize config and check
This PR breaks
SnabbBot didn't catch it because |
hum... that part of virtio/net_device.lua copies packets without first checking if it could allocate the destination. should it be fixed on this PR? (related question: if reverted, how can it be reopened? last time i had to do a bit of careful cherry-picking) |
I didn't know how long it would take to find the bug that's why I suggested reverting this PR for the time being but I don't mind how the fix gets into master. Just make sure master is "broken" as short as possible. |
Will pull req 286 fix this? On Monday, October 13, 2014, Max Rottenkolber notifications@github.com
|
Yes #286 did fix it! |
This is supposed to fix #272
rx_buffsize
is used to set the receive queue buffer size (rounded down to KB increments and clipped to 16KB max)rxdesc
, the size isassert()
'ed to be big enough.rx_freelist
, each buffer in it is checked for minimum size.I don't know if the virtio app can switch from zero-copy to non-optimized at any time, so i opted for checking the whole freelist immediately, and ignoring it if it's not acceptable.