Skip to content

Commit 2420b60

Browse files
Eli CohenRoland Dreier
authored andcommitted
IB/uverbs: Return link layer type to userspace for query port operation
Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
1 parent ff7f5aa commit 2420b60

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/infiniband/core/uverbs_cmd.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
460460
resp.active_width = attr.active_width;
461461
resp.active_speed = attr.active_speed;
462462
resp.phys_state = attr.phys_state;
463+
resp.link_layer = rdma_port_get_link_layer(file->device->ib_dev,
464+
cmd.port_num);
463465

464466
if (copy_to_user((void __user *) (unsigned long) cmd.response,
465467
&resp, sizeof resp))

‎include/rdma/ib_user_verbs.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ struct ib_uverbs_query_port_resp {
205205
__u8 active_width;
206206
__u8 active_speed;
207207
__u8 phys_state;
208-
__u8 reserved[3];
208+
__u8 link_layer;
209+
__u8 reserved[2];
209210
};
210211

211212
struct ib_uverbs_alloc_pd {

0 commit comments

Comments
 (0)