From: Jason Gunthorpe <jgg@ziepe.ca>
To: Chenguang Zhao <zhaochenguang@kylinos.cn>
Cc: Leon Romanovsky <leon@kernel.org>, Kees Cook <kees@kernel.org>,
Etienne AUJAMES <eaujames@ddn.com>,
zhenwei pi <zhenwei.pi@linux.dev>, Jiri Pirko <jiri@resnulli.us>,
Maor Gottlieb <maorg@nvidia.com>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH] IB/cache: Check GID table references before attempting deletion
Date: Mon, 18 May 2026 14:58:51 -0300 [thread overview]
Message-ID: <20260518175851.GU7702@ziepe.ca> (raw)
In-Reply-To: <a7c17297-6c80-48c1-aa8c-c729afc84f30@kylinos.cn>
On Mon, May 18, 2026 at 10:36:57AM +0800, Chenguang Zhao wrote:
> After calling kref_put(&entry->kref) in put_gid_entry_locked(), the reference count does not drop to zero.
> This is because the GID entry is still held by NFS via call paths such as
> cma_acquire_dev_by_src_ip() -> cma_validate_port() -> rdma_find_gid_by_port() -> get_gid_entry().
> Consequently, the GID entry cannot be freed. Meanwhile, the corresponding GID has already been removed
> from hardware/driver layer via ib_dev->ops.del_gid(). Subsequent ifup attempts keep inserting new entries
> into the GID table, and repeated cycles of ifdown and ifup eventually exhaust the entire GID table space.
This is a bug in NFS/etc to hold on to GID entries forever.
> To resolve this issue, we add a check before removing GID entries in the driver. We forbid the deletion
> operation if entry->kref is not equal to 1 (the initial reference count value). With this constraint, existing
> valid entries will be detected and reused after ifup, avoiding redundant insertion into the GID table.
Definately no, you cannot keep GID entries alive that are removed from
the netdev.
Jason
prev parent reply other threads:[~2026-05-18 17:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 8:07 [PATCH] IB/cache: Check GID table references before attempting deletion Chenguang Zhao
2026-05-17 10:32 ` Leon Romanovsky
2026-05-18 2:36 ` Chenguang Zhao
2026-05-18 17:58 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260518175851.GU7702@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=eaujames@ddn.com \
--cc=jiri@resnulli.us \
--cc=kees@kernel.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=maorg@nvidia.com \
--cc=zhaochenguang@kylinos.cn \
--cc=zhenwei.pi@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox