-
Notifications
You must be signed in to change notification settings - Fork 347
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
T6917: fix RPS ethernet settings for CPUs with more than 32 cores #4215
Conversation
👍 |
What happens on:
|
Interesting thing
|
The maximun value theat could be written for the 'rpc_cpu' is 4294967295 or 0xffffffff in the chunk splitted by commas
@c-po I updated PR and logic
|
CI integration ❌ failed! Details
|
@@ -310,22 +310,35 @@ def set_rps(self, state): | |||
rps_cpus = 0 | |||
queues = len(glob(f'/sys/class/net/{self.ifname}/queues/rx-*')) | |||
if state: | |||
cpu_count = os.cpu_count() |
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.
os.cpu_count()
still returns numbers un-adjusted for SMT like Intel Hyper-Threading. We have a function that returns physical CPUs only in (vyos.utils.cpu).
I'm not completely sure if the distinction can be truly important here, but maybe use that.
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 we do not know which cores are real cores it is useless
In this case we interested in total cores and calculate a bit mask for CPU’s
And it is not new, we used this before
this way it could be the worse thing if you have 4 CPU and 2 threads
For example real cores could be 0,2,4,6 and logical cores 1,3,5,7. What will be if you calculate only 4 cores (which is mix in this case of real/logical cores)?
In this case it will process by 2 real and 2 logical cores instead of all cores.
Change Summary
The maximum value that could be written for the 'rpc_cpu' is 4294967295 or 0xffffffff
Ensure that the bitmask size doesn't exceed 32 bits, even if the system has more CPUs.
Types of changes
Related Task(s)
Related PR(s)
Component(s) name
ethernet, rps
Proposed changes
How to test
The system with 96 CPUs
Try to configure offload RPS
Try to configure 33 CPUs and get the error
Value too large for defined data type
Try 32 CPUs (for the chunk):
After the fix:
Smoketest result
Checklist: