diff mbox series

[net-next] net: dpaa2-eth: do not always set xsk support in xdp_features flag

Message ID 3dba6ea42dc343a9f2d7d1a6a6a6c173235e1ebf.1676471386.git.lorenzo@kernel.org (mailing list archive)
State Accepted
Commit 1c93e48cc39147723abdcadc251611f6f0c18dee
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: dpaa2-eth: do not always set xsk support in xdp_features flag | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 5 maintainers not CCed: john.fastabend@gmail.com daniel@iogearbox.net bpf@vger.kernel.org hawk@kernel.org ast@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
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: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Lorenzo Bianconi Feb. 15, 2023, 2:32 p.m. UTC
Do not always add NETDEV_XDP_ACT_XSK_ZEROCOPY bit in xdp_features flag
but check if the NIC really supports it.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Larysa Zaremba Feb. 15, 2023, 2:27 p.m. UTC | #1
On Wed, Feb 15, 2023 at 03:32:57PM +0100, Lorenzo Bianconi wrote:
> Do not always add NETDEV_XDP_ACT_XSK_ZEROCOPY bit in xdp_features flag
> but check if the NIC really supports it.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>

> 
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> index 746ccfde7255..a62cffaf6ff1 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> @@ -4598,8 +4598,10 @@ static int dpaa2_eth_netdev_init(struct net_device *net_dev)
>  	net_dev->hw_features = net_dev->features;
>  	net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
>  				NETDEV_XDP_ACT_REDIRECT |
> -				NETDEV_XDP_ACT_XSK_ZEROCOPY |
>  				NETDEV_XDP_ACT_NDO_XMIT;
> +	if (priv->dpni_attrs.wriop_version >= DPAA2_WRIOP_VERSION(3, 0, 0) &&
> +	    priv->dpni_attrs.num_queues <= 8)
> +		net_dev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
>  
>  	if (priv->dpni_attrs.vlan_filter_entries)
>  		net_dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
> -- 
> 2.39.1
>
patchwork-bot+netdevbpf@kernel.org Feb. 20, 2023, 7:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 15 Feb 2023 15:32:57 +0100 you wrote:
> Do not always add NETDEV_XDP_ACT_XSK_ZEROCOPY bit in xdp_features flag
> but check if the NIC really supports it.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: dpaa2-eth: do not always set xsk support in xdp_features flag
    https://git.kernel.org/netdev/net-next/c/1c93e48cc391

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 746ccfde7255..a62cffaf6ff1 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -4598,8 +4598,10 @@  static int dpaa2_eth_netdev_init(struct net_device *net_dev)
 	net_dev->hw_features = net_dev->features;
 	net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
 				NETDEV_XDP_ACT_REDIRECT |
-				NETDEV_XDP_ACT_XSK_ZEROCOPY |
 				NETDEV_XDP_ACT_NDO_XMIT;
+	if (priv->dpni_attrs.wriop_version >= DPAA2_WRIOP_VERSION(3, 0, 0) &&
+	    priv->dpni_attrs.num_queues <= 8)
+		net_dev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
 
 	if (priv->dpni_attrs.vlan_filter_entries)
 		net_dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;