From nobody Wed Jun 17 18:23:49 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLF5pk3z6hJPq for ; Wed, 17 Jun 2026 18:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLF4mYVz3k6m for ; Wed, 17 Jun 2026 18:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOdfcAN7cX2bPhdFY9jFI9mDvXQOhLuH0zN/FxSjYmo=; b=PQ5YQ9i7DVbYinSpe4ho5SZEu+BZkT/mRbyRHgFbpKOipSKPtsYz4ckdDCqNLE0bjKnuHD UUGy5UHnzc/ta59ZRqj1eB1HWQ+6W9DBz1jKg/CwZU5VqzQWz9RtwHShxCRaxzRh8drjgz KZlBM3o3WLx+MuDnXnNrvHRBuhUvZB7ZlEtuxOAKZbZ6/0T5PSn/85WLUkkKAiGd1aTMhs y+3/OiNLQH3gJG0ynNwrldHAyrRiu+g9kyy4A0sSbgeFjGyTCg3dRVcKa0kPyMWNXP/tZR OOuCft+LJHxErGxd6bpINriGw6QTejNntZeCXHTIhZykYUKwzkGAzhoTiEYSHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720629; a=rsa-sha256; cv=none; b=iNhliG2QEEw9V7fvn7RCgJXutYPoIAdUzNZPyZ5Gpl4uzgvWlO8CPNYTq4R9U9z/NwJV3S rrmjWaZalQFf1xic5uE1K2uDVlgH1UzF5VRYhG90Z5YrxQvlKcZVsySjQbhgKKBGTI8s1n uO8wSHtHPWiPOkKiOKPkJIBvcHjr/4/FEm4YWOY56xGVBKN9Ywuoz9b4DnUh3NZ0SdQrbv x0SuT+1N92eV+CNq2SGIuBv9BK5kqUC94HgLOzZu1TuGwUr1UgsMRDeksKbIVCU6h66yPc t2gs10LMtUaIPlK3VnqxnVP/lZsWyya9vHKmsymAf0jcS5LsdAdB0TIGqJngNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOdfcAN7cX2bPhdFY9jFI9mDvXQOhLuH0zN/FxSjYmo=; b=birhBuWGJA0u9IUDq3z9gpNQCCsv2tcgftT8hhR73IaJRQbI7PH7SOZ//VHK/UCbdlH1K3 10p9y4Kmepq8bNYQmAafoBNwbuGFDGIociRuLmwY/PkHlX602OONX075o8UMVyEwg2+KXP v1qwypUhZNe5QTTKRpXOEQqWYmn90MDUxpnEsfawiuV4zFN3SXpI6C4qrWCEGAghkKseu7 cC2cUumqqUwlCvoUBR+vGUX45nSKCtrScnIN+Yn81dvp+n8bCM75MmAoipIdNJYqUf6u/r dQScP3Ma8vC8cmqCNjcKr35P7KIdvxhYk8o3eausnfktQ8EPO07OLqn9DIByYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLF4KVsz7pC for ; Wed, 17 Jun 2026 18:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24c26 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: e5d8b775bbf6 - main - RDMA: Fix link active_speed size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5d8b775bbf6f378a591211e373859ec44f74149 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:49 +0000 Message-Id: <6a32e635.24c26.3632fed5@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5d8b775bbf6f378a591211e373859ec44f74149 commit e5d8b775bbf6f378a591211e373859ec44f74149 Author: Slava Shwartsman AuthorDate: 2026-05-13 14:54:51 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 RDMA: Fix link active_speed size According to the IB spec active_speed size should be u16 and not u8 as before. Changing it to allow further extensions in offered speeds. Linux commit: 376ceb31ff87 RDMA: Fix link active_speed size Reviewed by: kib Tested by: Wafa Hamzah MFC after: 1 week Sponsored by: NVIDIA Networking Differential revision: https://reviews.freebsd.org/D57084 --- sys/dev/bnxt/bnxt_re/ib_verbs.c | 5 +++-- sys/dev/irdma/irdma_kcompat.c | 2 +- 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 +- 6 files changed, 11 insertions(+), 9 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/irdma/irdma_kcompat.c b/sys/dev/irdma/irdma_kcompat.c index 51f44133252c..4d02bd08ca65 100644 --- a/sys/dev/irdma/irdma_kcompat.c +++ b/sys/dev/irdma/irdma_kcompat.c @@ -1634,7 +1634,7 @@ irdma_query_port(struct ib_device *ibdev, u8 port, props->state = IB_PORT_DOWN; props->phys_state = IB_PORT_PHYS_STATE_DISABLED; } - ib_get_eth_speed(ibdev, port, (u16 *)& props->active_speed, &props->active_width); + ib_get_eth_speed(ibdev, port, &props->active_speed, &props->active_width); if (rdma_protocol_roce(ibdev, 1)) { props->gid_tbl_len = 32; 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; };