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, Tariq Toukan <tariqt@nvidia.com>,
	Parav Pandit <parav@nvidia.com>,
	Daniel Jurgens <danielj@nvidia.com>
Subject: [net 02/14] net/mlx5e: Don't cache tunnel offloads capability
Date: Tue, 14 Mar 2023 10:49:28 -0700	[thread overview]
Message-ID: <20230314174940.62221-3-saeed@kernel.org> (raw)
In-Reply-To: <20230314174940.62221-1-saeed@kernel.org>

From: Parav Pandit <parav@nvidia.com>

When mlx5e attaches again after device health recovery, the device
capabilities might have changed by the eswitch manager.

For example in one flow when ECPF changes the eswitch mode between
legacy and switchdev, it updates the flow table tunnel capability.

The cached value is only used in one place, so just check the capability
there instead.

Fixes: 5bef709d76a2 ("net/mlx5: Enable host PF HCA after eswitch is initialized")
Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h          | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c     | 4 +---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c      | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 1 -
 4 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 4276c6eb6820..4a19ef4a9811 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -313,7 +313,6 @@ struct mlx5e_params {
 		} channel;
 	} mqprio;
 	bool rx_cqe_compress_def;
-	bool tunneled_offload_en;
 	struct dim_cq_moder rx_cq_moderation;
 	struct dim_cq_moder tx_cq_moderation;
 	struct mlx5e_packet_merge_param packet_merge;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 51b5f3cca504..56fc2aebb9ee 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4979,8 +4979,6 @@ void mlx5e_build_nic_params(struct mlx5e_priv *priv, struct mlx5e_xsk *xsk, u16
 	/* TX inline */
 	mlx5_query_min_inline(mdev, &params->tx_min_inline_mode);
 
-	params->tunneled_offload_en = mlx5_tunnel_inner_ft_supported(mdev);
-
 	/* AF_XDP */
 	params->xsk = xsk;
 
@@ -5285,7 +5283,7 @@ static int mlx5e_init_nic_rx(struct mlx5e_priv *priv)
 	}
 
 	features = MLX5E_RX_RES_FEATURE_PTP;
-	if (priv->channels.params.tunneled_offload_en)
+	if (mlx5_tunnel_inner_ft_supported(mdev))
 		features |= MLX5E_RX_RES_FEATURE_INNER_FT;
 	err = mlx5e_rx_res_init(priv->rx_res, priv->mdev, features,
 				priv->max_nch, priv->drop_rq.rqn,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 43fd12fb87b8..8ff654b4e9e1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -755,7 +755,6 @@ static void mlx5e_build_rep_params(struct net_device *netdev)
 	mlx5e_set_rx_cq_mode_params(params, cq_period_mode);
 
 	params->mqprio.num_tc       = 1;
-	params->tunneled_offload_en = false;
 	if (rep->vport != MLX5_VPORT_UPLINK)
 		params->vlan_strip_disable = true;
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
index c2a4f86bc890..baa7ef812313 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
@@ -70,7 +70,6 @@ static void mlx5i_build_nic_params(struct mlx5_core_dev *mdev,
 
 	params->packet_merge.type = MLX5E_PACKET_MERGE_NONE;
 	params->hard_mtu = MLX5_IB_GRH_BYTES + MLX5_IPOIB_HARD_LEN;
-	params->tunneled_offload_en = false;
 
 	/* CQE compression is not supported for IPoIB */
 	params->rx_cqe_compress_def = false;
-- 
2.39.2


  parent reply	other threads:[~2023-03-14 17:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 17:49 [pull request][net 00/14] mlx5 fixes 2023-03-14 Saeed Mahameed
2023-03-14 17:49 ` [net 01/14] net/mlx5e: Fix macsec ASO context alignment Saeed Mahameed
2023-03-14 17:49 ` Saeed Mahameed [this message]
2023-03-15 13:14   ` [net 02/14] net/mlx5e: Don't cache tunnel offloads capability Piotr Raczynski
2023-03-14 17:49 ` [net 03/14] net/mlx5: Fix setting ec_function bit in MANAGE_PAGES Saeed Mahameed
2023-03-15 13:10   ` Piotr Raczynski
2023-03-15 20:51     ` Saeed Mahameed
2023-03-15 21:04       ` Jakub Kicinski
2023-03-15 21:09         ` Saeed Mahameed
2023-03-15 21:33           ` Jakub Kicinski
2023-03-15 22:53             ` Saeed Mahameed
2023-03-14 17:49 ` [net 04/14] net/mlx5: Disable eswitch before waiting for VF pages Saeed Mahameed
2023-03-15 12:51   ` Piotr Raczynski
2023-03-14 17:49 ` [net 05/14] net/mlx5: E-switch, Fix wrong usage of source port rewrite in split rules Saeed Mahameed
2023-03-14 17:49 ` [net 06/14] net/mlx5: E-switch, Fix missing set of split_count when forward to ovs internal port Saeed Mahameed
2023-03-14 17:49 ` [net 07/14] net/mlx5e: Fix cleanup null-ptr deref on encap lock Saeed Mahameed
2023-03-14 17:49 ` [net 08/14] net/mlx5e: kTLS, Fix missing error unwind on unsupported cipher type Saeed Mahameed
2023-03-14 17:49 ` [net 09/14] net/mlx5: Set BREAK_FW_WAIT flag first when removing driver Saeed Mahameed
2023-03-14 17:49 ` [net 10/14] net/mlx5e: Lower maximum allowed MTU in XSK to match XDP prerequisites Saeed Mahameed
2023-03-14 17:49 ` [net 11/14] net/sched: TC, fix raw counter initialization Saeed Mahameed
2023-03-14 17:49 ` [net 12/14] net/mlx5e: TC, fix missing error code Saeed Mahameed
2023-03-14 17:49 ` [net 13/14] net/mlx5e: TC, fix cloned flow attribute Saeed Mahameed
2023-03-14 17:49 ` [net 14/14] net/mlx5e: TC, Remove error message log print 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=20230314174940.62221-3-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=danielj@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parav@nvidia.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).