-
Notifications
You must be signed in to change notification settings - Fork 301
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
Redeclaration of 'should_continue' is hidding external variable #315
Conversation
This code is sensitive because it's the main performance hotspot for the NFV application. Changes here need to be checked for performance implications on the "NFV loadgen benchmark" before we can merge them. @eugeneia has a new version of the benchmark (#307) that I will merge now. Then we can get the key benchmark running nicely on chur and perhaps hook it into the CI too. |
I managed to run the "NFV loadgen benchmark" in grindewald, with and without the patch applied. Here are the results: Patch not applied
Patch applied
So it seems it doesn't make a difference. I would let @N-Nikolaev decide whether this logic is correct or not. Summarizing, in d62ffc1 (net_device: Refactor vrings) variable |
@@ -280,7 +280,8 @@ function VirtioNetDevice:transmit_packets_to_vm () | |||
for i = 0, p.niovecs - 1 do | |||
|
|||
local iovec = p.iovecs[i] | |||
local should_continue, b = self:vm_buffer(iovec) | |||
local b | |||
should_continue, b = self:vm_buffer(iovec) |
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 is definitely a bug.
Just out of curiosity can it be written like this:
should_continue, local b = self:vm_buffer(iovec)
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.
As far as I know, cannot. When trying to compile a statement like that LuaJIT returns error "unexpected symbol near 'local'".
Before applying the patch, I'd prefer to run the "NFV loadgen benchmark" in chur and check there are no regressions. What's the current the status of this?
@dpino You already ran the loadgen benchmark on Grindelwald and found that it does not affect performance, right? |
@lukego Yes, that's correct, I got similar results #315 (comment) |
Redeclaration of 'should_continue' is hidding external variable
Thanks for the patch! |
Monitor ingress packet drops and jit flush if threshold exceeded
Redeclaration of variable 'should_continue' in the inner loop is hiding value of external variable 'should_continue'.
We have doubts this is the intended behaviour. It seems 'should_continue' is used to keep track of whether exit the outer loop. Apparently this change was introduced in d62ffc1 (net_device: Refactor vrings).