mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-12 09:32:12 +00:00
Commit 0f022d32c3ec ("net/sched: Fix mirred deadlock on device recursion")
added code in the fast path, even when act_mirred is not used.
Prepare its revert by implementing loop detection in act_mirred.
Adds an array of device pointers in struct netdev_xmit.
tcf_mirred_is_act_redirect() can detect if the array
already contains the target device.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Tested-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20251014171907.3554413-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
27 lines
514 B
C
27 lines
514 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#ifndef _LINUX_NETDEVICE_XMIT_H
|
|
#define _LINUX_NETDEVICE_XMIT_H
|
|
|
|
#if IS_ENABLED(CONFIG_NET_ACT_MIRRED)
|
|
#define MIRRED_NEST_LIMIT 4
|
|
#endif
|
|
|
|
struct net_device;
|
|
|
|
struct netdev_xmit {
|
|
u16 recursion;
|
|
u8 more;
|
|
#ifdef CONFIG_NET_EGRESS
|
|
u8 skip_txqueue;
|
|
#endif
|
|
#if IS_ENABLED(CONFIG_NET_ACT_MIRRED)
|
|
u8 sched_mirred_nest;
|
|
struct net_device *sched_mirred_dev[MIRRED_NEST_LIMIT];
|
|
#endif
|
|
#if IS_ENABLED(CONFIG_NF_DUP_NETDEV)
|
|
u8 nf_dup_skb_recursion;
|
|
#endif
|
|
};
|
|
|
|
#endif
|