]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RDMA/core: Rate limit GID cache warning messages
authorMaor Gottlieb <maorg@nvidia.com>
Mon, 16 Jun 2025 08:26:21 +0000 (11:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2025 08:47:28 +0000 (09:47 +0100)
[ Upstream commit 333e4d79316c9ed5877d7aac8b8ed22efc74e96d ]

The GID cache warning messages can flood the kernel log when there are
multiple failed attempts to add GIDs. This can happen when creating many
virtual interfaces without having enough space for their GIDs in the GID
table.

Change pr_warn to pr_warn_ratelimited to prevent log flooding while still
maintaining visibility of the issue.

Link: https://patch.msgid.link/r/fd45ed4a1078e743f498b234c3ae816610ba1b18.1750062357.git.leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/cache.c

index 0b88203720b05911aca7355a68a07f5ad0f29f85..77c0b89259911fdb8366662fe0397943c50765a7 100644 (file)
@@ -582,8 +582,8 @@ static int __ib_cache_gid_add(struct ib_device *ib_dev, u32 port,
 out_unlock:
        mutex_unlock(&table->lock);
        if (ret)
-               pr_warn("%s: unable to add gid %pI6 error=%d\n",
-                       __func__, gid->raw, ret);
+               pr_warn_ratelimited("%s: unable to add gid %pI6 error=%d\n",
+                                   __func__, gid->raw, ret);
        return ret;
 }