[PATCH rdma-next 4/9] RDMA/core: Derive enforce_security from the cache event
From: Edward Srouji
Date: Sun Nov 22 2026 - 12:39:55 EST
ib_dispatch_event() marks the cache update work of P_Key and GID
changes with enforce_security, which ib_cache_event_task() then passes
to ib_cache_update(). The work item carries the event itself, so derive
the flag from it in ib_cache_event_task() and drop it from struct
ib_update_work.
No functional change.
Reviewed-by: Michael Gur <michaelgur@xxxxxxxxxx>
Signed-off-by: Edward Srouji <edwards@xxxxxxxxxx>
---
drivers/infiniband/core/cache.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 647a547e2d7fb20721ed5fecdccd723891ba2ef2..c338c2e52d8bd041bdc194ca574b7c35cc9b6d0d 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -52,7 +52,6 @@ struct ib_pkey_cache {
struct ib_update_work {
struct work_struct work;
struct ib_event event;
- bool enforce_security;
};
union ib_gid zgid;
@@ -1536,7 +1535,8 @@ static void ib_cache_event_task(struct work_struct *_work)
work->event.event == IB_EVENT_GID_CHANGE ||
work->event.event == IB_EVENT_CLIENT_REREGISTER,
work->event.event == IB_EVENT_PKEY_CHANGE,
- work->enforce_security);
+ work->event.event == IB_EVENT_PKEY_CHANGE ||
+ work->event.event == IB_EVENT_GID_CHANGE);
/* GID event is notified already for individual GID entries by
* dispatch_gid_change_event(). Hence, notifiy for rest of the
@@ -1589,10 +1589,6 @@ void ib_dispatch_event(const struct ib_event *event)
INIT_WORK(&work->work, ib_generic_event_task);
work->event = *event;
- if (event->event == IB_EVENT_PKEY_CHANGE ||
- event->event == IB_EVENT_GID_CHANGE)
- work->enforce_security = true;
-
queue_work(ib_wq, &work->work);
}
EXPORT_SYMBOL(ib_dispatch_event);
--
2.49.0