Thread (22 messages) 22 messages, 5 authors, 2025-05-15

Re: [PATCH net-next v4 10/15] net/sched: act_mirred: Move the recursion counter struct netdev_xmit

From: Juri Lelli <juri.lelli@redhat.com>
Date: 2025-05-15 12:49:11
Also in: linux-rt-devel

On 15/05/25 11:55, Paolo Abeni wrote:
CC sched maintainers.

On 5/12/25 11:27 AM, Sebastian Andrzej Siewior wrote:
quoted
mirred_nest_level is a per-CPU variable and relies on disabled BH for its
locking. Without per-CPU locking in local_bh_disable() on PREEMPT_RT
this data structure requires explicit locking.

Move mirred_nest_level to struct netdev_xmit as u8, provide wrappers.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Cong Wang <redacted>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/netdevice_xmit.h |  3 +++
 net/sched/act_mirred.c         | 28 +++++++++++++++++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/include/linux/netdevice_xmit.h b/include/linux/netdevice_xmit.h
index 38325e0702968..848735b3a7c02 100644
--- a/include/linux/netdevice_xmit.h
+++ b/include/linux/netdevice_xmit.h
@@ -8,6 +8,9 @@ struct netdev_xmit {
 #ifdef CONFIG_NET_EGRESS
 	u8  skip_txqueue;
 #endif
+#if IS_ENABLED(CONFIG_NET_ACT_MIRRED)
+	u8 sched_mirred_nest;
+#endif
 };
The above struct is embedded into task_struct in RT build. The new field
 *should* use an existing hole. According to my weak knowledge in that
area the task_struct binary layout is a critical, an explicit ack from
SMEs would be nice.
Agree. Still fitting in an existing task_struct hole.

Reviewed-by: Juri Lelli <juri.lelli@redhat.com>

Best,
Juri
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help