diff mbox series

[net-next] net: fec: turn on XDP features

Message ID 20230518143236.1638914-1-wei.fang@nxp.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: fec: turn on XDP features | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 14 of 14 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Wei Fang May 18, 2023, 2:32 p.m. UTC
From: Wei Fang <wei.fang@nxp.com>

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 <wei.fang@nxp.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Horman May 18, 2023, 5:47 p.m. UTC | #1
+Lorenzo

On Thu, May 18, 2023 at 10:32:36PM +0800, wei.fang@nxp.com wrote:
> From: Wei Fang <wei.fang@nxp.com>
> 
> 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 <wei.fang@nxp.com>
> ---
>  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 Bianconi May 18, 2023, 8:15 p.m. UTC | #2
> +Lorenzo
> 
> On Thu, May 18, 2023 at 10:32:36PM +0800, wei.fang@nxp.com wrote:
> > From: Wei Fang <wei.fang@nxp.com>
> > 
> > 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 <wei.fang@nxp.com>
> > ---
> >  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
> > 
> > 
>
Wei Fang May 19, 2023, 1:27 a.m. UTC | #3
> -----Original Message-----
> From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
> Sent: 2023年5月19日 4:16
> To: Simon Horman <simon.horman@corigine.com>
> Cc: Wei Fang <wei.fang@nxp.com>; davem@davemloft.net;
> edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
> ast@kernel.org; daniel@iogearbox.net; hawk@kernel.org;
> john.fastabend@gmail.com; Shenwei Wang <shenwei.wang@nxp.com>; Clark
> Wang <xiaoning.wang@nxp.com>; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; bpf@vger.kernel.org; dl-linux-imx
> <linux-imx@nxp.com>; Lorenzo Bianconi <lorenzo@kernel.org>
> Subject: Re: [PATCH net-next] net: fec: turn on XDP features
> 
> > +Lorenzo
> >
> > On Thu, May 18, 2023 at 10:32:36PM +0800, wei.fang@nxp.com wrote:
> > > From: Wei Fang <wei.fang@nxp.com>
> > >
> > > 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 <wei.fang@nxp.com>
> > > ---
> > >  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
> > >
> > >
> >
diff mbox series

Patch

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);