netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Maxim Mikityanskiy <maximmi@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: [net-next 14/15] net/mlx5e: Move the LRO-XSK check to mlx5e_fix_features
Date: Wed, 13 Jul 2022 15:58:58 -0700	[thread overview]
Message-ID: <20220713225859.401241-15-saeed@kernel.org> (raw)
In-Reply-To: <20220713225859.401241-1-saeed@kernel.org>

From: Maxim Mikityanskiy <maximmi@nvidia.com>

LRO is mutually exclusive with XSK. When LRO is enabled, it checks
whether XSK is active. This commit moves this check to a more correct
place at mlx5e_fix_features.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 087952b84ccb..be84f800e122 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3594,13 +3594,6 @@ static int set_feature_lro(struct net_device *netdev, bool enable)
 
 	mutex_lock(&priv->state_lock);
 
-	if (enable && priv->xsk.refcnt) {
-		netdev_warn(netdev, "LRO is incompatible with AF_XDP (%u XSKs are active)\n",
-			    priv->xsk.refcnt);
-		err = -EINVAL;
-		goto out;
-	}
-
 	cur_params = &priv->channels.params;
 	if (enable && !MLX5E_GET_PFLAG(cur_params, MLX5E_PFLAG_RX_STRIDING_RQ)) {
 		netdev_warn(netdev, "can't set LRO with legacy RQ\n");
@@ -3916,6 +3909,11 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
 	}
 
 	if (priv->xsk.refcnt) {
+		if (features & NETIF_F_LRO) {
+			netdev_warn(netdev, "LRO is incompatible with AF_XDP (%u XSKs are active)\n",
+				    priv->xsk.refcnt);
+			features &= ~NETIF_F_LRO;
+		}
 		if (features & NETIF_F_GRO_HW) {
 			netdev_warn(netdev, "HW GRO is incompatible with AF_XDP (%u XSKs are active)\n",
 				    priv->xsk.refcnt);
-- 
2.36.1


  parent reply	other threads:[~2022-07-13 22:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 22:58 [pull request][net-next 00/15] mlx5 updates 2022-07-13 Saeed Mahameed
2022-07-13 22:58 ` [net-next 01/15] net/mlx5: Use the bitmap API to allocate bitmaps Saeed Mahameed
2022-07-15  5:20   ` patchwork-bot+netdevbpf
2022-07-13 22:58 ` [net-next 02/15] net/mlx5: Introduce ifc bits for using software vhca id Saeed Mahameed
2022-07-13 22:58 ` [net-next 03/15] net/mlx5: Use software VHCA id when it's supported Saeed Mahameed
2022-07-13 22:58 ` [net-next 04/15] net/mlx5: Expose vnic diagnostic counters for eswitch managed vports Saeed Mahameed
2022-07-13 22:58 ` [net-next 05/15] net/mlx5: debugfs, Add num of in-use FW command interface slots Saeed Mahameed
2022-07-13 22:58 ` [net-next 06/15] net/mlx5: Bridge, refactor groups sizes and indices Saeed Mahameed
2022-07-13 22:58 ` [net-next 07/15] net/mlx5: Bridge, rename filter fg to vlan_filter Saeed Mahameed
2022-07-13 22:58 ` [net-next 08/15] net/mlx5: Bridge, extract VLAN push/pop actions creation Saeed Mahameed
2022-07-13 22:58 ` [net-next 09/15] net/mlx5: Bridge, implement infrastructure for VLAN protocol change Saeed Mahameed
2022-07-13 22:58 ` [net-next 10/15] net/mlx5: Bridge, implement QinQ support Saeed Mahameed
2022-07-13 22:58 ` [net-next 11/15] net/mlx5e: Removed useless code in function Saeed Mahameed
2022-07-13 22:58 ` [net-next 12/15] net/mlx5e: configure meter in flow action Saeed Mahameed
2022-07-13 22:58 ` [net-next 13/15] net/mlx5e: Extend flower police validation Saeed Mahameed
2022-07-13 22:58 ` Saeed Mahameed [this message]
2022-07-13 22:58 ` [net-next 15/15] net/mlx5e: Remove the duplicating check for striding RQ when enabling LRO Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220713225859.401241-15-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=maximmi@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).