-
Notifications
You must be signed in to change notification settings - Fork 668
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
verbs: Add an API to retrieve IB device number of ports via netlink #958
Conversation
Why not make the verb return the query device value if netlink isn't support and forget about the dv API? |
What dv API? About the verb, the current definition of "netlink based number of ports" is very clear and creates a separate API from the regular query device (phys_port_cnt) which is limited to u8. Of course doing that (your comment) will allow us to say "don't user phys_port_cnt/ibv_query_device() and move to use ibv_get_device_num_ports()) are we okay with saying that? |
Yes move the logic to call to the device information to the ibv_query_device() and get rid of the dr_ function that tries to do that. We probably need to pass in the ibv_context instead of the device to make that work. Netlink or not netlink is too complicated a detail to expose as an API. This should always return the port count and be the only way to get a port count if it is larger than u8 |
Okay, so as ibv_query_device_ex() can fail as well so DR will need some logic anyway. This way an application can always use the new phys_port_cnt_ex value and there is no need for a new verb. |
Always fill that new field and encourage users to always read. Something like phys_port_cnt_real ??? |
Yea, that's the idea, it will look something like this (in ibv_cmd_query_device_any()):
so if the netlink value is there (sysfs_dev->num_ports) use it, otherwise just use the legacy phys_port_cnt. |
As kernel RDMA devices can have more than 255 ports the legacy port_phys_cnt doesn't have enough bits to represent that. Expose a new field (phys_port_cnt_ex) to let users know. Retrieve number of ports via netlink and in case that fails populate phys_port_cnt_ex with the legacy phys_port_cnt value. Signed-off-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Use ibv_query_port_ex() in order to support devices with more than 255 ports. Signed-off-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Alex Vesker <valex@nvidia.com> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Expose phys_port_cnt_ex, the extended version of phys_port_cnt so devices with more than 255 ports can be represented. Signed-off-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Edward Srouji <edwards@nvidia.com>
Phys_port_cnt_ex allows the user to get a uint32 value which is retrieved via netlink. Test it by making sure the value is equal to phys_port_cnt if the number of ports is less or equal to 255. Signed-off-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Edward Srouji <edwards@nvidia.com>
The PR was updated as was discussed above, thanks. |
This series adds a verbs API to retrieve IB device number of ports via netlink.
The new API is used by mlx5 in the DR area.