[PATCH v3 net-next 2/5] net: ethernet: mtk_eth_soc: add basic XDP support
Paolo Abeni
pabeni at redhat.com
Tue Jul 19 02:22:26 PDT 2022
On Sat, 2022-07-16 at 09:34 +0200, Lorenzo Bianconi wrote:
> Introduce basic XDP support to mtk_eth_soc driver.
> Supported XDP verdicts:
> - XDP_PASS
> - XDP_DROP
> - XDP_REDIRECT
>
> Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 147 +++++++++++++++++---
> drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +
> 2 files changed, 131 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 9a92d602ebd5..bc3a7dcab207 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -1494,11 +1494,44 @@ static void mtk_rx_put_buff(struct mtk_rx_ring *ring, void *data, bool napi)
> skb_free_frag(data);
> }
>
> +static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
> + struct xdp_buff *xdp, struct net_device *dev)
> +{
> + struct bpf_prog *prog = rcu_dereference(eth->prog);
It looks like here you need to acquire the RCU read lock. lockdep
should splat otherwise.
/P
More information about the Linux-mediatek
mailing list