]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
IB/core: Add helper to convert port attributes to data rate
authorOr Har-Toov <ohartoov@nvidia.com>
Thu, 18 Dec 2025 15:58:32 +0000 (17:58 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 5 Jan 2026 07:42:53 +0000 (02:42 -0500)
commit2941abac6d0bffd6bf8f438135505b39168a0a08
treed64e679beca447cf6f4b648cf0109042ab45fb74
parent263d1d9975b5ac2b813c3107fe21c957b57f0a59
IB/core: Add helper to convert port attributes to data rate

Introduce ib_port_attr_to_rate() to compute the data rate in 100 Mbps
units (deci-Gb/sec) from a port's active_speed and active_width
attributes. This generic helper removes duplicated speed-to-rate
calculations, which are used by sysfs and the upcoming new verb.

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>
drivers/infiniband/core/verbs.c
include/rdma/ib_verbs.h