-
Notifications
You must be signed in to change notification settings - Fork 107
OCPBUGS-18662:rps: trigger udev even per queue #816
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
Conversation
Instead of trigger udev event per physical device creation, triggers it per queue creation so in case of queue resize (i.e. more queues are added) it applies the correct rps mask on the new created queues as well. Signed-off-by: Talor Itzhak <titzhak@redhat.com>
With the new udev rule, the full path passes to the systemd unit. Hence, we don't need jump through loops in order to figure out the physical device location. Signed-off-by: Talor Itzhak <titzhak@redhat.com>
@Tal-or: This pull request references Jira Issue OCPBUGS-18662, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/jira refresh |
@Tal-or: This pull request references Jira Issue OCPBUGS-18662, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/jira refresh |
@Tal-or: This pull request references Jira Issue OCPBUGS-18662, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (mniranja@redhat.com), skipping review request. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@Tal-or: GitHub didn't allow me to request PR reviews from the following users: pabeni. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -1 +1 @@ | |||
SUBSYSTEM=="net", ACTION=="add", ENV{DEVPATH}!="/devices/virtual/net/*", TAG+="systemd", ENV{SYSTEMD_WANTS}="update-rps@%k.service" | |||
SUBSYSTEM=="queues", ACTION=="add", ENV{DEVPATH}=="/devices/pci*/queues/rx*", TAG+="systemd", ENV{SYSTEMD_WANTS}="update-rps@%p.service" |
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.
Here the devpath for patching events is almost full sysfs queue directory - just missing the '/sys' prefix...
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.
AFAIK the path should start from /devices
and not from /sys
this is how it worked so far.
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.
@Tal-or: I was not clear in the sentence above, I'm sorry. What I mean is that since the devpath for patching events is almost full sysfs queue directory, we can exploit such fact to simplify the action, as hopefully better described in my comment on set-rps-mask.sh.
The above sentence and the comment there are supposed to be read one after another as part of a the same message
function find_dev_dir { | ||
systemd_devs=$(systemctl list-units -t device | grep sys-subsystem-net-devices | cut -d' ' -f1) | ||
# get the path for the queues | ||
queues_path=${de_escape_path%/rx*} |
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.
... so here you should be better off not trimming the trailing part and avoiding the loop below, with something alike:
queue_path=${de_escape_path//queues/rx//queues/rx-}
echo "${mask}" > "${queue_path}"
Side question: why is this script invoked via a systemd unit and not directly by the udev rule?
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.
Additionally, is devpath escaping really needed here? Otherwise you can replace '%i' with '%I' in the unit file and avoid the de-escaping above.
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.
why is this script invoked via a systemd unit and not directly by the udev rule?
I think the reason is because then we can use it as oneshot
service but maybe @MarSik knows better
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.
The loop was just to make sure we're on the safe side and nothing get missed, but yes removing the loop should be suffice as well
verification: {} | ||
group: {} | ||
mode: 448 | ||
path: /usr/local/bin/set-rps-mask.sh |
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.
out of sheer ignorance on my side...
the following file:
test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml
contains the 'old' (prior to this patchset) version of set-rps-mask.sh. Should such file be updated, too?
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.
Yea, we have a make target named redner-sync
for that, but it got break.
#824 should fix it, but this PR not depends on it since I fixed it manually here.
Signed-off-by: Talor Itzhak <titzhak@redhat.com>
Signed-off-by: Talor Itzhak <titzhak@redhat.com>
e6bf8ff
to
73ac2ab
Compare
queues_path=${de_escape_path%/rx*} | ||
queue_num=${path#*queues/} | ||
# replace '/' with '-' | ||
queue_num="${queue_num/\//-}" |
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.
minor nit: is this substitution required? If I read correctly $path is not escaped anymore and this is basically de-escaping the queue nr part
Another minor note: you could possibly mention in the commit message that this change additionally avoid looping on all the rx queue, just for better future memory ;)
both nits are not intended to block the MR, just to be considered if a new version should be needed for any reason
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.
minor nit: is this substitution required? If I read correctly $path is not escaped anymore and this is basically de-escaping the queue nr part
when the $path
is not escaped the queue number looks like rx\n
and not rx-n
as I would expect.
this is why this substitution is necessary.
LGTM! some minor comments on patch 3, but really not blocking |
/hold cancel |
/approve |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MarSik, Tal-or, yanirq The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Tal-or: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@Tal-or: Jira Issue OCPBUGS-18662: All pull requests linked via external trackers have merged:
Jira Issue OCPBUGS-18662 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fix included in accepted release 4.15.0-0.nightly-2023-10-17-065657 |
/cherrypick release-4.14 |
/cherry-pick release-4.14 |
@yanirq: new pull request created: #832 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Instead of trigger udev event per physical device creation,
triggers it per queue creation so in case of queue resize
(i.e. more queues are added) it applies the correct rps mask on the
new created queues as well.