[PATCH v3 net-next 2/5] net: ethernet: mtk_eth_soc: add basic XDP support

Lorenzo Bianconi lorenzo.bianconi at redhat.com
Tue Jul 19 03:31:03 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.

ack, I will fix it in the next version.

Regards,
Lorenzo

> 
> /P
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20220719/fc79d30e/attachment.sig>


More information about the Linux-mediatek mailing list