Repository : ssh://git@diktynna/batman-adv
On branch : master
commit f07a0c37ab278fb6a9e95cad89429b1282f1ab59 Author: Sebastian Andrzej Siewior bigeasy@linutronix.de Date: Sun Mar 6 22:57:48 2022 +0100
batman-adv: Use netif_rx().
Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.")
the function netif_rx() can be used in preemptible/thread context as well as in interrupt context.
Use netif_rx().
Signed-off-by: Sebastian Andrzej Siewior bigeasy@linutronix.de Signed-off-by: David S. Miller davem@davemloft.net [sven@narfation.org: add compat code] Signed-off-by: Sven Eckelmann sven@narfation.org
f07a0c37ab278fb6a9e95cad89429b1282f1ab59 compat-include/linux/netdevice.h | 26 +++++++++++++------------- net/batman-adv/bridge_loop_avoidance.c | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h index 6ee0d21c..eeb31bed 100644 --- a/compat-include/linux/netdevice.h +++ b/compat-include/linux/netdevice.h @@ -39,19 +39,6 @@
#endif /* LINUX_VERSION_IS_LESS(4, 11, 9) */
-#if LINUX_VERSION_IS_LESS(5, 10, 0) - -#define netif_rx_any_context batadv_netif_rx_any_context -static inline int batadv_netif_rx_any_context(struct sk_buff *skb) -{ - if (in_interrupt()) - return netif_rx(skb); - else - return netif_rx_ni(skb); -} - -#endif /* LINUX_VERSION_IS_LESS(5, 10, 0) */ -
#if LINUX_VERSION_IS_LESS(5, 15, 0)
@@ -75,4 +62,17 @@ static inline void batadv_dev_hold(struct net_device *dev)
#endif /* LINUX_VERSION_IS_LESS(5, 15, 0) */
+#if LINUX_VERSION_IS_LESS(5, 18, 0) + +static inline int batadv_netif_rx(struct sk_buff *skb) +{ + if (in_interrupt()) + return netif_rx(skb); + else + return netif_rx_ni(skb); +} +#define netif_rx batadv_netif_rx + +#endif /* LINUX_VERSION_IS_LESS(5, 18, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_LINUX_NETDEVICE_H_ */ diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 337e20b6..7f8a14d9 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -444,7 +444,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, const u8 *mac, batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES, skb->len + ETH_HLEN);
- netif_rx_any_context(skb); + netif_rx(skb); out: batadv_hardif_put(primary_if); }