-
Notifications
You must be signed in to change notification settings - Fork 197
fix or GetPfName in non-priv mode #646
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
base: master
Are you sure you want to change the base?
fix or GetPfName in non-priv mode #646
Conversation
Patch fixes the GetPfName method to collect the PfName from sysfs when - SF is created - plugin used in non-priv mode Signed-off-by: gvrangan-nvidia <[email protected]>
|
@adrianchiris Can you please review this PR. This issue occurs everytime when working with Scalable functions. |
| return "", err | ||
| } else if len(files) > 0 { | ||
| return files[0].Name(), nil | ||
| name, err := getPfNameSysFs(pciAddr) |
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.
according to the description, SFs are used. so id expect the device is in switchdev mode in this case.
then we should hit L#91 and get the correct netdevice name.
the logic implemented in this PR (getPfNameSysFs) is very similar to GetUplinkRepresentor[1]
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.
does it fail to identify the correct PF because you are running this in non privileged mode ? (and devlink command fails ?)
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.
@adrianchiris Yes, we are running in non-priv mode. Our deployment does not allow priv-mode.
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.
according to the description, SFs are used. so id expect the device is in switchdev mode in this case. then we should hit L#91 and get the correct netdevice name.
the logic implemented in this PR (getPfNameSysFs) is very similar to GetUplinkRepresentor[1]
yes, the logic is similar. in our deployement using non-priv mode is not able to determine if switchdev mode is enabled or not.
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.
we rely on the ability to invoke devlink and query devices (here and in other places in code, such as getting DDP profile for intel nic)
generally device plugin requires access to system resources to properly advertise devices.
can you try to add NET_ADMIN capability to your device plugin deployment ?
i think this should do it for your usecase.
securityContext:
privileged: false
capabilities:
add: ["NET_ADMIN"]
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.
@adrianchiris no, currently the usage of NET_ADMIN capabilities is not allowed.
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.
@adrianchiris Also the bug is that, If executed in non-priv mode. wrong device name
is picked as PfName.
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.
@adrianchiris Please let me know if there aare any other queries or any actio ns to be taken?
Patch fixes the GetPfName method to collect the PfName from sysfs when
fix #645