summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOr Har-Toov <ohartoov@nvidia.com>2025-12-18 18:58:46 +0300
committerLeon Romanovsky <leon@kernel.org>2026-01-05 10:43:05 +0300
commit51a07ce2fefd061edf4ba552a741c85f07b3e6dd (patch)
treede0336218a8a2fb14209f997a38d58e7cf75de82 /include
parentd4adeff26c3e8f1a9bc86d5dfb14f227c9041070 (diff)
downloadlinux-51a07ce2fefd061edf4ba552a741c85f07b3e6dd.tar.xz
IB/core: Add query_port_speed verb
Add new ibv_query_port_speed() verb to enable applications to query the effective bandwidth of a port. This verb is particularly useful when the speed is not a multiplication of IB speed and width where width is 2^n. Signed-off-by: Or Har-Toov <ohartoov@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Edward Srouji <edwards@nvidia.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/rdma/ib_verbs.h2
-rw-r--r--include/uapi/rdma/ib_user_ioctl_cmds.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index b984f9581a73..a4786395328a 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2418,6 +2418,8 @@ struct ib_device_ops {
int comp_vector);
int (*query_port)(struct ib_device *device, u32 port_num,
struct ib_port_attr *port_attr);
+ int (*query_port_speed)(struct ib_device *device, u32 port_num,
+ u64 *speed);
int (*modify_port)(struct ib_device *device, u32 port_num,
int port_modify_mask,
struct ib_port_modify *port_modify);
diff --git a/include/uapi/rdma/ib_user_ioctl_cmds.h b/include/uapi/rdma/ib_user_ioctl_cmds.h
index de6f5a94f1e3..35da4026f452 100644
--- a/include/uapi/rdma/ib_user_ioctl_cmds.h
+++ b/include/uapi/rdma/ib_user_ioctl_cmds.h
@@ -73,6 +73,7 @@ enum uverbs_methods_device {
UVERBS_METHOD_QUERY_CONTEXT,
UVERBS_METHOD_QUERY_GID_TABLE,
UVERBS_METHOD_QUERY_GID_ENTRY,
+ UVERBS_METHOD_QUERY_PORT_SPEED,
};
enum uverbs_attrs_invoke_write_cmd_attr_ids {
@@ -86,6 +87,11 @@ enum uverbs_attrs_query_port_cmd_attr_ids {
UVERBS_ATTR_QUERY_PORT_RESP,
};
+enum uverbs_attrs_query_port_speed_cmd_attr_ids {
+ UVERBS_ATTR_QUERY_PORT_SPEED_PORT_NUM,
+ UVERBS_ATTR_QUERY_PORT_SPEED_RESP,
+};
+
enum uverbs_attrs_get_context_attr_ids {
UVERBS_ATTR_GET_CONTEXT_NUM_COMP_VECTORS,
UVERBS_ATTR_GET_CONTEXT_CORE_SUPPORT,