From: Wei Fang <[email protected]>
The XDP features are supported since the commit 66c0e13ad236
("drivers: net: turn on XDP features"). Currently, the fec
driver supports NETDEV_XDP_ACT_BASIC, NETDEV_XDP_ACT_REDIRECT
and NETDEV_XDP_ACT_NDO_XMIT. So turn on these XDP features
for fec driver.
Signed-off-by: Wei Fang <[email protected]>
---
drivers/net/ethernet/freescale/fec_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index cd215ab20ff9..577affda6efa 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -4030,6 +4030,8 @@ static int fec_enet_init(struct net_device *ndev)
}
ndev->hw_features = ndev->features;
+ ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
+ NETDEV_XDP_ACT_NDO_XMIT;
fec_restart(ndev);
--
2.25.1
+Lorenzo
On Thu, May 18, 2023 at 10:32:36PM +0800, [email protected] wrote:
> From: Wei Fang <[email protected]>
>
> The XDP features are supported since the commit 66c0e13ad236
> ("drivers: net: turn on XDP features"). Currently, the fec
> driver supports NETDEV_XDP_ACT_BASIC, NETDEV_XDP_ACT_REDIRECT
> and NETDEV_XDP_ACT_NDO_XMIT. So turn on these XDP features
> for fec driver.
>
> Signed-off-by: Wei Fang <[email protected]>
> ---
> drivers/net/ethernet/freescale/fec_main.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index cd215ab20ff9..577affda6efa 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -4030,6 +4030,8 @@ static int fec_enet_init(struct net_device *ndev)
> }
>
> ndev->hw_features = ndev->features;
> + ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
> + NETDEV_XDP_ACT_NDO_XMIT;
>
> fec_restart(ndev);
>
> --
> 2.25.1
>
>
> +Lorenzo
>
> On Thu, May 18, 2023 at 10:32:36PM +0800, [email protected] wrote:
> > From: Wei Fang <[email protected]>
> >
> > The XDP features are supported since the commit 66c0e13ad236
> > ("drivers: net: turn on XDP features"). Currently, the fec
> > driver supports NETDEV_XDP_ACT_BASIC, NETDEV_XDP_ACT_REDIRECT
> > and NETDEV_XDP_ACT_NDO_XMIT. So turn on these XDP features
> > for fec driver.
> >
> > Signed-off-by: Wei Fang <[email protected]>
> > ---
> > drivers/net/ethernet/freescale/fec_main.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> > index cd215ab20ff9..577affda6efa 100644
> > --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -4030,6 +4030,8 @@ static int fec_enet_init(struct net_device *ndev)
> > }
> >
> > ndev->hw_features = ndev->features;
> > + ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
> > + NETDEV_XDP_ACT_NDO_XMIT;
should we check FEC_QUIRK_SWAP_FRAME here? something like:
if (!(fep->quirks & FEC_QUIRK_SWAP_FRAME)
ndev->xdp_features = NETDEV_XDP_ACT_BASIC |
NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_NDO_XMIT;
Regards,
Lorenzo
> >
> > fec_restart(ndev);
> >
> > --
> > 2.25.1
> >
> >
>
> -----Original Message-----
> From: Lorenzo Bianconi <[email protected]>
> Sent: 2023??5??19?? 4:16
> To: Simon Horman <[email protected]>
> Cc: Wei Fang <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; Shenwei Wang <[email protected]>; Clark
> Wang <[email protected]>; [email protected];
> [email protected]; [email protected]; dl-linux-imx
> <[email protected]>; Lorenzo Bianconi <[email protected]>
> Subject: Re: [PATCH net-next] net: fec: turn on XDP features
>
> > +Lorenzo
> >
> > On Thu, May 18, 2023 at 10:32:36PM +0800, [email protected] wrote:
> > > From: Wei Fang <[email protected]>
> > >
> > > The XDP features are supported since the commit 66c0e13ad236
> > > ("drivers: net: turn on XDP features"). Currently, the fec driver
> > > supports NETDEV_XDP_ACT_BASIC, NETDEV_XDP_ACT_REDIRECT and
> > > NETDEV_XDP_ACT_NDO_XMIT. So turn on these XDP features for fec
> > > driver.
> > >
> > > Signed-off-by: Wei Fang <[email protected]>
> > > ---
> > > drivers/net/ethernet/freescale/fec_main.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > > b/drivers/net/ethernet/freescale/fec_main.c
> > > index cd215ab20ff9..577affda6efa 100644
> > > --- a/drivers/net/ethernet/freescale/fec_main.c
> > > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > > @@ -4030,6 +4030,8 @@ static int fec_enet_init(struct net_device *ndev)
> > > }
> > >
> > > ndev->hw_features = ndev->features;
> > > + ndev->xdp_features = NETDEV_XDP_ACT_BASIC |
> NETDEV_XDP_ACT_REDIRECT |
> > > + NETDEV_XDP_ACT_NDO_XMIT;
>
> should we check FEC_QUIRK_SWAP_FRAME here? something like:
>
> if (!(fep->quirks & FEC_QUIRK_SWAP_FRAME)
> ndev->xdp_features = NETDEV_XDP_ACT_BASIC |
> NETDEV_XDP_ACT_REDIRECT |
> NETDEV_XDP_ACT_NDO_XMIT;
>
>
It's really a good suggestion, thank you so much!
> > >
> > > fec_restart(ndev);
> > >
> > > --
> > > 2.25.1
> > >
> > >
> >