netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next v3 0/3] Disable LEGACY iptables on PREEMPT_RT
@ 2025-03-25 16:58 Sebastian Andrzej Siewior
  2025-03-25 16:58 ` [net-next v3 1/3] netfilter: replace select by depends on for IP{6}_NF_IPTABLES_LEGACY Sebastian Andrzej Siewior
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-03-25 16:58 UTC (permalink / raw)
  To: netfilter-devel, coreteam, linux-rt-devel
  Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	Thomas Gleixner, Sebastian Andrzej Siewior

The per-CPU xt_recseq is a custom netfilter seqcount. It provides
synchronisation for the replacement of the xt_table::private pointer and
ensures that the two counter in xt_counters are properly observed during
an update on 32bit architectures. xt_recseq also supports recursion.

This construct is less than optimal on PREMPT_RT because the lack of an
associated lock (with the seqcount) can lead to a deadlock if a high
priority reader interrupts a writer. Also xt_recseq relies on locking
with BH-disable which becomes problematic if the lock, currently part of
local_bh_disable() on PREEMPT_RT, gets removed.

Based on discussion with Pablo and Florian the legacy code is disabled
on PREEMPT_RT. I picked up the patches referenced by Florian and tried
to fix them up as suggested plus the bits we talked about.

v2…v3 https://lore.kernel.org/all/20250221133143.5058-1-bigeasy@linutronix.de/
  - Instead of getting LEGACY code to work for PREEMPT_RT the code is
    now disabled on PREEMPT_RT. Since the long term plan is to get rid of
    it anyway, it might be less painful for everyone.

v1…v2 https://lore.kernel.org/all/20250216125135.3037967-1-bigeasy@linutronix.de/
  - Updated kerneldoc in 2/3 so that the renamed parameter is part of
    it.
  - Updated description 1/3 in case there are complains regarding the
    synchronize_rcu(). The suggested course of action is to motivate
    people to move away from "legacy" towards "nft" tooling. Last resort
    is not to wait for the in-flight counter and just copy what is
    there.

Pablo Neira Ayuso (1):
  netfilter: replace select by depends on for IP{6}_NF_IPTABLES_LEGACY

Sebastian Andrzej Siewior (2):
  netfilter: Let IP6_NF_IPTABLES_LEGACY select IP6_NF_IPTABLES.
  netfilter: Introduce NETFILTER_LEGACY to group all legacy code.

 net/Kconfig                  | 10 ++++++++++
 net/bridge/netfilter/Kconfig |  8 ++++----
 net/ipv4/netfilter/Kconfig   | 15 ++++++++-------
 net/ipv6/netfilter/Kconfig   | 13 +++++++------
 net/netfilter/x_tables.c     | 16 +++++++++++-----
 5 files changed, 40 insertions(+), 22 deletions(-)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-03-26 21:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-25 16:58 [net-next v3 0/3] Disable LEGACY iptables on PREEMPT_RT Sebastian Andrzej Siewior
2025-03-25 16:58 ` [net-next v3 1/3] netfilter: replace select by depends on for IP{6}_NF_IPTABLES_LEGACY Sebastian Andrzej Siewior
2025-03-26 17:09   ` Phil Sutter
2025-03-26 17:11     ` Sebastian Andrzej Siewior
2025-03-25 16:58 ` [net-next v3 2/3] netfilter: Let IP6_NF_IPTABLES_LEGACY select IP6_NF_IPTABLES Sebastian Andrzej Siewior
2025-03-25 16:58 ` [net-next v3 3/3] netfilter: Introduce NETFILTER_LEGACY to group all legacy code Sebastian Andrzej Siewior
2025-03-25 19:48 ` [net-next v3 0/3] Disable LEGACY iptables on PREEMPT_RT Florian Westphal
2025-03-26  7:47   ` Sebastian Andrzej Siewior
2025-03-26 21:18     ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).