[PATCH 24/38] backports: add netif_rx()
Johannes Berg <[email protected]> Tue, 11 Oct 2022 23:04:32 +0200
| Newsgroups | org.kernel.vger.backports |
|---|---|
| Message-ID | <20221011230356.fb36659a480f.I4b1f5287579f615582a608782b8513f2f5cb374c@changeid> |
From: Johannes Berg <[email protected]> This got changed upstream to detect the context to get rid of netif_rx_ni(), so just copy the new upstream version with the detection. Signed-off-by: Johannes Berg <[email protected]> --- backport/backport-include/linux/netdevice.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index d2e175243560..9b3291bb7188 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -254,4 +254,21 @@ struct net_device_path_ctx { }; #endif /* NET_DEVICE_PATH_STACK_MAX */ +#if LINUX_VERSION_IS_LESS(5,18,0) +static inline int LINUX_BACKPORT(netif_rx)(struct sk_buff *skb) +{ + bool need_bh_off = !(hardirq_count() | softirq_count()); + int ret; + + if (need_bh_off) + local_bh_disable(); + ret = netif_rx(skb); + if (need_bh_off) + local_bh_enable(); + + return ret; +} +#define netif_rx LINUX_BACKPORT(netif_rx) +#endif /* < 5.18.0 */ + #endif /* __BACKPORT_NETDEVICE_H */ -- 2.37.3 -- To unsubscribe from this list: send the line "unsubscribe backports" in