Date: Mon, 06 Jul 2026 01:42:58 +0000 From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Slava Shwartsman <slavash@nvidia.com> Subject: git: 5d044e4b9f33 - stable/15 - RDMA: Fix link active_speed size Message-ID: <6a4b0822.3e46a.187951ba@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5d044e4b9f33e2bdc8fa9ce071f3f735e1d531aa commit 5d044e4b9f33e2bdc8fa9ce071f3f735e1d531aa Author: Slava Shwartsman <slavash@nvidia.com> AuthorDate: 2026-05-13 14:54:51 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2026-07-06 01:35:49 +0000 RDMA: Fix link active_speed size (cherry picked from commit e5d8b775bbf6f378a591211e373859ec44f74149) --- sys/dev/bnxt/bnxt_re/ib_verbs.c | 5 +++-- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 6 +++--- sys/dev/qlnx/qlnxr/qlnxr_verbs.c | 2 +- sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c | 3 ++- sys/ofed/include/rdma/ib_verbs.h | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/dev/bnxt/bnxt_re/ib_verbs.c b/sys/dev/bnxt/bnxt_re/ib_verbs.c index 32899abab9ff..9e6887a7c6e1 100644 --- a/sys/dev/bnxt/bnxt_re/ib_verbs.c +++ b/sys/dev/bnxt/bnxt_re/ib_verbs.c @@ -241,7 +241,7 @@ int bnxt_re_modify_device(struct ib_device *ibdev, return 0; } -static void __to_ib_speed_width(u32 espeed, u8 lanes, u8 *speed, u8 *width) +static void __to_ib_speed_width(u32 espeed, u8 lanes, u16 *speed, u8 *width) { if (!lanes) { switch (espeed) { @@ -342,7 +342,8 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num, { struct bnxt_re_dev *rdev = to_bnxt_re_dev(ibdev, ibdev); struct bnxt_qplib_dev_attr *dev_attr = rdev->dev_attr; - u8 active_speed = 0, active_width = 0; + u16 active_speed = 0; + u8 active_width = 0; dev_dbg(rdev_to_dev(rdev), "QUERY PORT with port_num 0x%x\n", port_num); memset(port_attr, 0, sizeof(*port_attr)); diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index 5825cee87d9b..6ff4e55630d7 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -155,7 +155,7 @@ static if_t mlx5_ib_get_netdev(struct ib_device *device, return ndev; } -static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed, +static int translate_eth_proto_oper(u32 eth_proto_oper, u16 *active_speed, u8 *active_width) { switch (eth_proto_oper) { @@ -216,7 +216,7 @@ static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed, return 0; } -static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u8 *active_speed, +static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u16 *active_speed, u8 *active_width) { switch (eth_proto_oper) { @@ -969,7 +969,7 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port, if (err) goto out; - props->active_speed = (u8)ptys->ib_proto_oper; + props->active_speed = (u16)ptys->ib_proto_oper; pmtu->local_port = port; err = mlx5_core_access_pmtu(mdev, pmtu, 0); diff --git a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c index d74f51831da7..f3a054c707c3 100644 --- a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c +++ b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c @@ -546,7 +546,7 @@ qlnxr_query_device(struct ib_device *ibdev, struct ib_device_attr *attr, } static inline void -get_link_speed_and_width(int speed, uint8_t *ib_speed, uint8_t *ib_width) +get_link_speed_and_width(int speed, uint16_t *ib_speed, uint8_t *ib_width) { switch (speed) { case 1000: diff --git a/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c b/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c index 5d45a22eb9fe..a245cbdd440e 100644 --- a/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c +++ b/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c @@ -153,7 +153,8 @@ void copy_port_attr_to_resp(struct ib_port_attr *attr, resp->subnet_timeout = attr->subnet_timeout; resp->init_type_reply = attr->init_type_reply; resp->active_width = attr->active_width; - resp->active_speed = attr->active_speed; + /* This ABI needs to be extended to provide any speed more than IB_SPEED_NDR */ + resp->active_speed = min_t(u16, attr->active_speed, IB_SPEED_NDR); resp->phys_state = attr->phys_state; resp->link_layer = rdma_port_get_link_layer(ib_dev, port_num); } diff --git a/sys/ofed/include/rdma/ib_verbs.h b/sys/ofed/include/rdma/ib_verbs.h index 0c40a6f18f7c..0908c106f513 100644 --- a/sys/ofed/include/rdma/ib_verbs.h +++ b/sys/ofed/include/rdma/ib_verbs.h @@ -609,7 +609,7 @@ struct ib_port_attr { u8 subnet_timeout; u8 init_type_reply; u8 active_width; - u8 active_speed; + u16 active_speed; u8 phys_state; bool grh_required; };home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a4b0822.3e46a.187951ba>
