[Bug 287501] Fix witness warning w.r.t rcu_read_lock() API

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 16 Jun 2025 13:02:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287501

--- Comment #3 from Mark Johnston <markj@FreeBSD.org> ---
(In reply to Sreekanth Reddy from comment #2)
The LinuxKPI has some constraints compared to native Linux.  In particular, we
lazily allocate per-thread memory for the LinuxKPI; that allocation is
happening here in rcu_read_lock(), which is triggering the warning.  After that
allocation is done once for the current thread, rcu_read_lock() calls will not
allocate memory and you will not see a warning.

So, the solution is either:
- don't use the linuxkpi in this context, or
- ensure that linux_set_current() has already been called before entering an
RCU read section, but drivers should not call this directly, so we would need
to see more code from bnxt_tls_snd_tag_free() to understand how best to handle
this

-- 
You are receiving this mail because:
You are the assignee for the bug.