aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriel Ehrenberg <aehrenberg@nvidia.com>2026-07-23 07:32:05 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-08-03 20:38:49 +0000
commitd8afb9b13f4141dc42fb1eb1c7c6a45bd2cd0bc4 (patch)
tree2cb5bdfe774085eb95db5ba7c22d39c0200430fa
parent9f071039ca34801fee7727106e23b824e98ed4a9 (diff)
sys/ofed: don't stop removing stale RoCE GIDs at the first hole
When cleaning up stale GIDs the scan stopped as soon as rdma_get_gid_attr() failed. But that can also happen for empty entries in the middle of the table, so a single gap left everything after it behind and the GID entries could eventually run out. Now the whole table is scanned and the empty slots are simply skipped. Reviewed by: kib, jhb Sponsored by: Nvidia networking Fixes: 6a75471dbcf0 ("OFED: Various changes from Linux 4.19") Differential revision: https://reviews.freebsd.org/D58510
-rw-r--r--sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
index e24a6645e8e4..d6d882dd59b3 100644
--- a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
+++ b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
@@ -213,6 +213,7 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
union ib_gid gid;
if_t ifp;
int default_gids;
+ int gid_tbl_len;
int i;
struct ipx_queue ipx_head;
@@ -271,13 +272,15 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
update_gid(GID_ADD, device, port, &gid, entry->ndev);
}
+ gid_tbl_len = device->port_immutable[port].gid_tbl_len;
+
/* remove stale GIDs, if any */
- for (i = default_gids;; i++) {
+ for (i = default_gids; i < gid_tbl_len; i++) {
union ipx_addr ipx;
sgid_attr = rdma_get_gid_attr(device, port, i);
if (IS_ERR(sgid_attr))
- break;
+ continue;
ndev = sgid_attr->ndev;
gid = sgid_attr->gid;