-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add GetDefaultPkeyFromPci and GetPKeyByIndexFromPci functions #69
Add GetDefaultPkeyFromPci and GetPKeyByIndexFromPci functions #69
Conversation
sriovnet.go
Outdated
@@ -520,3 +520,32 @@ func GetPciFromNetDevice(name string) (string, error) { | |||
} | |||
return base, nil | |||
} | |||
|
|||
// GetPKeyFromPci returns the index0 PKey for the IB PCI device | |||
func GetPKeyFromPci(pciAddress string) (string, error) { |
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 works for both PF and VFs ? (just making sure, my memory is dusty around these parts :D)
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.
there are several indexes for pkey membership, index0 is the default membership.
should we have two functions ?
func GetPkeyByIndexFromPci(pciAddress string) (string, error)
and
func GetDefaultlPkeyFromPci(pciAddress string) (string, error
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 works for both PFs and VFs as the mechanism around how PKeys are stored is the same for both.
I'm not opposed having two functions to retrieve different PKeys. Let me address that in the PR
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.
Split into two new functions
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.
later on we might want to split infiniband specific functionality to its own file if deemed nessecary.
988e8b5
to
4f978d0
Compare
@bn222 PTAL, quick one :) |
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.
Two small nits that will aid debugging. Once those are addressed, it's an LGTM from me.
4f978d0
to
e886cd2
Compare
Hi @bn222, thank you for the review! addressed your comments. |
The functions read the from the PCI device's infiniband dir and returns either the PKey for index0 or given index Signed-off-by: amaslennikov <[email protected]>
e886cd2
to
11b7b17
Compare
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,
@bn222 PTAL i believe we can merge this one
LGTM. |
The functions read the from the PCI device's
infiniband dir and returns either the PKey for index0 or given index