All of lore.kernel.org
 help / color / mirror / Atom feed
* [pull request][net 0/9] mlx5 fixes 2022-07-28
@ 2022-07-28 20:46 Saeed Mahameed
  2022-07-28 20:46 ` [net 1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version Saeed Mahameed
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan

From: Saeed Mahameed <saeedm@nvidia.com>

This series provides bug fixes to mlx5 driver.
Please pull and let me know if there is any problem.

Thanks,
Saeed.


The following changes since commit 4d3d3a1b244fd54629a6b7047f39a7bbc8d11910:

  stmmac: dwmac-mediatek: fix resource leak in probe (2022-07-28 10:43:04 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2022-07-28

for you to fetch changes up to 42b4f7f66a43cdb9216e76e595c8a9af154806da:

  net/mlx5: Fix driver use of uninitialized timeout (2022-07-28 13:44:41 -0700)

----------------------------------------------------------------
mlx5-fixes-2022-07-28

----------------------------------------------------------------
Gal Pressman (1):
      net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version

Maher Sanalla (1):
      net/mlx5: Adjust log_max_qp to be 18 at most

Maor Dickman (1):
      net/mlx5e: TC, Fix post_act to not match on in_port metadata

Maxim Mikityanskiy (3):
      net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS
      net/mlx5e: xsk: Account for XSK RQ UMRs when calculating ICOSQ size
      net/mlx5e: Fix calculations related to max MPWQE size

Shay Drory (1):
      net/mlx5: Fix driver use of uninitialized timeout

Vlad Buslov (1):
      net/mlx5e: Modify slow path rules to go to slow fdb

Yevgeny Kliteynik (1):
      net/mlx5: DR, Fix SMFS steering info dump format

 drivers/net/ethernet/mellanox/mlx5/core/en.h       | 21 ++++++++++----------
 .../net/ethernet/mellanox/mlx5/core/en/params.c    | 12 +++++++++++
 .../ethernet/mellanox/mlx5/core/en/tc/post_act.c   |  1 +
 .../ethernet/mellanox/mlx5/core/en_accel/ktls.c    |  2 +-
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 23 ++++++++++++++++------
 drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c | 11 ++++-------
 drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h |  1 -
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  4 +---
 .../ethernet/mellanox/mlx5/core/steering/dr_dbg.c  | 13 +++++++-----
 9 files changed, 55 insertions(+), 33 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [net 1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-30  4:50   ` patchwork-bot+netdevbpf
  2022-07-28 20:46 ` [net 2/9] net/mlx5e: TC, Fix post_act to not match on in_port metadata Saeed Mahameed
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Gal Pressman, Maxim Mikityanskiy

From: Gal Pressman <gal@nvidia.com>

The driver reports whether TX/RX TLS device offloads are supported, but
not which ciphers/versions, these should be handled by returning
-EOPNOTSUPP when .tls_dev_add() is called.

Remove the WARN_ON kernel trace when the driver gets a request to
offload a cipher/version that is not supported as it is expected.

Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
index 814f2a56f633..30a70d139046 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
@@ -54,7 +54,7 @@ static int mlx5e_ktls_add(struct net_device *netdev, struct sock *sk,
 	struct mlx5_core_dev *mdev = priv->mdev;
 	int err;
 
-	if (WARN_ON(!mlx5e_ktls_type_check(mdev, crypto_info)))
+	if (!mlx5e_ktls_type_check(mdev, crypto_info))
 		return -EOPNOTSUPP;
 
 	if (direction == TLS_OFFLOAD_CTX_DIR_TX)
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 2/9] net/mlx5e: TC, Fix post_act to not match on in_port metadata
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
  2022-07-28 20:46 ` [net 1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-28 20:46 ` [net 3/9] net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS Saeed Mahameed
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Maor Dickman, Roi Dayan

From: Maor Dickman <maord@nvidia.com>

The cited commit changed CT to use multi table actions post act infrastructure instead
of using it own post act infrastructure, this broke decap during VF tunnel offload
(Stack devices) with CT due to wrong match on in_port metadata in the post act table.
This changed only broke VF tunnel offload because it modify the packet in_port metadata
to be VF metadata and it isn't propagate the post act creation.

Fixed by modify post act rules to match only on fte_id and not match on in_port metadata
which isn't needed.

Fixes: a81283263bb0 ("net/mlx5e: Use multi table support for CT and sample actions")
Signed-off-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c
index dea137dd744b..2b64dd557b5d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c
@@ -128,6 +128,7 @@ mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *at
 	post_attr->inner_match_level = MLX5_MATCH_NONE;
 	post_attr->outer_match_level = MLX5_MATCH_NONE;
 	post_attr->action &= ~MLX5_FLOW_CONTEXT_ACTION_DECAP;
+	post_attr->flags |= MLX5_ATTR_FLAG_NO_IN_PORT;
 
 	handle->ns_type = post_act->ns_type;
 	/* Splits were handled before post action */
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 3/9] net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
  2022-07-28 20:46 ` [net 1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version Saeed Mahameed
  2022-07-28 20:46 ` [net 2/9] net/mlx5e: TC, Fix post_act to not match on in_port metadata Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-28 20:46 ` [net 4/9] net/mlx5e: xsk: Account for XSK RQ UMRs when calculating ICOSQ size Saeed Mahameed
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Maxim Mikityanskiy

From: Maxim Mikityanskiy <maximmi@nvidia.com>

MLX5E_MAX_RQ_NUM_MTTS should be the maximum value, so that
MLX5_MTT_OCTW(MLX5E_MAX_RQ_NUM_MTTS) fits into u16. The current value of
1 << 17 results in MLX5_MTT_OCTW(1 << 17) = 1 << 16, which doesn't fit
into u16. This commit replaces it with the maximum value that still
fits u16.

Fixes: 73281b78a37a ("net/mlx5e: Derive Striding RQ size from MTU")
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.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index b6c15efe92ad..f794ffaf1e04 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -109,7 +109,7 @@ struct page_pool;
 #define MLX5E_REQUIRED_WQE_MTTS		(MLX5_ALIGN_MTTS(MLX5_MPWRQ_PAGES_PER_WQE + 1))
 #define MLX5E_REQUIRED_MTTS(wqes)	(wqes * MLX5E_REQUIRED_WQE_MTTS)
 #define MLX5E_MAX_RQ_NUM_MTTS	\
-	((1 << 16) * 2) /* So that MLX5_MTT_OCTW(num_mtts) fits into u16 */
+	(ALIGN_DOWN(U16_MAX, 4) * 2) /* So that MLX5_MTT_OCTW(num_mtts) fits into u16 */
 #define MLX5E_ORDER2_MAX_PACKET_MTU (order_base_2(10 * 1024))
 #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW	\
 		(ilog2(MLX5E_MAX_RQ_NUM_MTTS / MLX5E_REQUIRED_WQE_MTTS))
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 4/9] net/mlx5e: xsk: Account for XSK RQ UMRs when calculating ICOSQ size
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2022-07-28 20:46 ` [net 3/9] net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-28 20:46 ` [net 5/9] net/mlx5e: Fix calculations related to max MPWQE size Saeed Mahameed
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Maxim Mikityanskiy

From: Maxim Mikityanskiy <maximmi@nvidia.com>

ICOSQ is used to post UMR WQEs for both regular RQ and XSK RQ. However,
space in ICOSQ is reserved only for the regular RQ, which may cause
ICOSQ overflows when using XSK (the most risk is on activating
channels).

This commit fixes the issue by reserving space for XSK UMR WQEs as well.
As XSK may be enabled without restarting the channel and recreating the
ICOSQ, this space is reserved unconditionally.

Fixes: db05815b36cb ("net/mlx5e: Add XSK zero-copy support")
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/params.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
index 3c1edfa33aa7..e025040350ba 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
@@ -790,8 +790,20 @@ static u8 mlx5e_build_icosq_log_wq_sz(struct mlx5_core_dev *mdev,
 		return MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE;
 
 	wqebbs = MLX5E_UMR_WQEBBS * BIT(mlx5e_get_rq_log_wq_sz(rqp->rqc));
+
+	/* If XDP program is attached, XSK may be turned on at any time without
+	 * restarting the channel. ICOSQ must be big enough to fit UMR WQEs of
+	 * both regular RQ and XSK RQ.
+	 * Although mlx5e_mpwqe_get_log_rq_size accepts mlx5e_xsk_param, it
+	 * doesn't affect its return value, as long as params->xdp_prog != NULL,
+	 * so we can just multiply by 2.
+	 */
+	if (params->xdp_prog)
+		wqebbs *= 2;
+
 	if (params->packet_merge.type == MLX5E_PACKET_MERGE_SHAMPO)
 		wqebbs += mlx5e_shampo_icosq_sz(mdev, params, rqp);
+
 	return max_t(u8, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE, order_base_2(wqebbs));
 }
 
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 5/9] net/mlx5e: Fix calculations related to max MPWQE size
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2022-07-28 20:46 ` [net 4/9] net/mlx5e: xsk: Account for XSK RQ UMRs when calculating ICOSQ size Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-28 20:46 ` [net 6/9] net/mlx5e: Modify slow path rules to go to slow fdb Saeed Mahameed
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Maxim Mikityanskiy

From: Maxim Mikityanskiy <maximmi@nvidia.com>

Before commit 76c31e5f7585 ("net/mlx5e: Use FW limitation for max MPW
WQEBBs"), the maximum size of MPWQE in WQEBBs was hardcoded as a driver
constant. That commit started using the firmware capability that can
further limit the size, however, it unintentionally changed a few
things:

1. The calculation of MLX5E_MAX_KLM_PER_WQE used the size in DS, which
was replaced by the size in WQEBBs, making the resulting value 4 times
smaller.

2. MLX5E_TX_MPW_MAX_WQEBBS used to be aligned to the cache line size
(either 64 or 128 bytes, i.e. 1 or 2 WQEBBs), but it's no longer the
case if the firmware capability is smaller than the driver maximum.

Fix both issues by using the correct units for MLX5E_MAX_KLM_PER_WQE and
by aligning mlx5e_get_sw_max_sq_mpw_wqebbs after taking the minimum.

Besides fixing the arithmetics in calculation of MLX5E_MAX_KLM_PER_WQE,
also use appropriate constants: `size of BSF * num of DS per WQEBB *
number of WQEBBs` (the calculation before the blamed commit) doesn't
make much sense to calculate the WQE size in bytes, so just use `size of
WQEBB * number of WQEBBs`.

While at it, replace the types that hold the number of WQEBBs by u8.
These values don't exceed 16, and it allows to fill holes in two
structs.

Fixes: 76c31e5f7585 ("net/mlx5e: Use FW limitation for max MPW WQEBBs")
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.h | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index f794ffaf1e04..29b10ef787b9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -174,8 +174,8 @@ struct page_pool;
 	ALIGN_DOWN(MLX5E_KLM_MAX_ENTRIES_PER_WQE(wqe_size), MLX5_UMR_KLM_ALIGNMENT)
 
 #define MLX5E_MAX_KLM_PER_WQE(mdev) \
-	MLX5E_KLM_ENTRIES_PER_WQE(mlx5e_get_sw_max_sq_mpw_wqebbs(mlx5e_get_max_sq_wqebbs(mdev)) \
-				   << MLX5_MKEY_BSF_OCTO_SIZE)
+	MLX5E_KLM_ENTRIES_PER_WQE(MLX5_SEND_WQE_BB * \
+		mlx5e_get_sw_max_sq_mpw_wqebbs(mlx5e_get_max_sq_wqebbs(mdev)))
 
 #define MLX5E_MSG_LEVEL			NETIF_MSG_LINK
 
@@ -233,7 +233,7 @@ static inline u16 mlx5e_get_max_sq_wqebbs(struct mlx5_core_dev *mdev)
 		     MLX5_CAP_GEN(mdev, max_wqe_sz_sq) / MLX5_SEND_WQE_BB);
 }
 
-static inline u16 mlx5e_get_sw_max_sq_mpw_wqebbs(u16 max_sq_wqebbs)
+static inline u8 mlx5e_get_sw_max_sq_mpw_wqebbs(u8 max_sq_wqebbs)
 {
 /* The return value will be multiplied by MLX5_SEND_WQEBB_NUM_DS.
  * Since max_sq_wqebbs may be up to MLX5_SEND_WQE_MAX_WQEBBS == 16,
@@ -242,11 +242,12 @@ static inline u16 mlx5e_get_sw_max_sq_mpw_wqebbs(u16 max_sq_wqebbs)
  * than MLX5_SEND_WQE_MAX_WQEBBS to let a full-session WQE be
  * cache-aligned.
  */
-#if L1_CACHE_BYTES < 128
-	return min_t(u16, max_sq_wqebbs, MLX5_SEND_WQE_MAX_WQEBBS - 1);
-#else
-	return min_t(u16, max_sq_wqebbs, MLX5_SEND_WQE_MAX_WQEBBS - 2);
+	u8 wqebbs = min_t(u8, max_sq_wqebbs, MLX5_SEND_WQE_MAX_WQEBBS - 1);
+
+#if L1_CACHE_BYTES >= 128
+	wqebbs = ALIGN_DOWN(wqebbs, 2);
 #endif
+	return wqebbs;
 }
 
 struct mlx5e_tx_wqe {
@@ -455,7 +456,7 @@ struct mlx5e_txqsq {
 	struct netdev_queue       *txq;
 	u32                        sqn;
 	u16                        stop_room;
-	u16                        max_sq_mpw_wqebbs;
+	u8                         max_sq_mpw_wqebbs;
 	u8                         min_inline_mode;
 	struct device             *pdev;
 	__be32                     mkey_be;
@@ -570,7 +571,7 @@ struct mlx5e_xdpsq {
 	struct device             *pdev;
 	__be32                     mkey_be;
 	u16                        stop_room;
-	u16                        max_sq_mpw_wqebbs;
+	u8                         max_sq_mpw_wqebbs;
 	u8                         min_inline_mode;
 	unsigned long              state;
 	unsigned int               hw_mtu;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 6/9] net/mlx5e: Modify slow path rules to go to slow fdb
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2022-07-28 20:46 ` [net 5/9] net/mlx5e: Fix calculations related to max MPWQE size Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-28 20:46 ` [net 7/9] net/mlx5: Adjust log_max_qp to be 18 at most Saeed Mahameed
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Vlad Buslov, Roi Dayan,
	Paul Blakey

From: Vlad Buslov <vladbu@nvidia.com>

While extending available range of supported chains/prios referenced commit
also modified slow path rules to go to FT chain instead of actual slow FDB.
However neither of existing users of the MLX5_ATTR_FLAG_SLOW_PATH
flag (tunnel encap entries with invalid encap and flows with trap action)
need to match on FT chain. After bridge offload was implemented packets of
such flows can also be matched by bridge priority tables which is
undesirable. Restore slow path flows implementation to redirect packets to
slow_fdb.

Fixes: 278d51f24330 ("net/mlx5: E-Switch, Increase number of chains and priorities")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../mellanox/mlx5/core/eswitch_offloads.c     | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 2ce3728576d1..eb79810199d3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -230,10 +230,8 @@ esw_setup_ft_dest(struct mlx5_flow_destination *dest,
 }
 
 static void
-esw_setup_slow_path_dest(struct mlx5_flow_destination *dest,
-			 struct mlx5_flow_act *flow_act,
-			 struct mlx5_fs_chains *chains,
-			 int i)
+esw_setup_accept_dest(struct mlx5_flow_destination *dest, struct mlx5_flow_act *flow_act,
+		      struct mlx5_fs_chains *chains, int i)
 {
 	if (mlx5_chains_ignore_flow_level_supported(chains))
 		flow_act->flags |= FLOW_ACT_IGNORE_FLOW_LEVEL;
@@ -241,6 +239,16 @@ esw_setup_slow_path_dest(struct mlx5_flow_destination *dest,
 	dest[i].ft = mlx5_chains_get_tc_end_ft(chains);
 }
 
+static void
+esw_setup_slow_path_dest(struct mlx5_flow_destination *dest, struct mlx5_flow_act *flow_act,
+			 struct mlx5_eswitch *esw, int i)
+{
+	if (MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ignore_flow_level))
+		flow_act->flags |= FLOW_ACT_IGNORE_FLOW_LEVEL;
+	dest[i].type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
+	dest[i].ft = esw->fdb_table.offloads.slow_fdb;
+}
+
 static int
 esw_setup_chain_dest(struct mlx5_flow_destination *dest,
 		     struct mlx5_flow_act *flow_act,
@@ -475,8 +483,11 @@ esw_setup_dests(struct mlx5_flow_destination *dest,
 	} else if (attr->dest_ft) {
 		esw_setup_ft_dest(dest, flow_act, esw, attr, spec, *i);
 		(*i)++;
-	} else if (mlx5e_tc_attr_flags_skip(attr->flags)) {
-		esw_setup_slow_path_dest(dest, flow_act, chains, *i);
+	} else if (attr->flags & MLX5_ATTR_FLAG_SLOW_PATH) {
+		esw_setup_slow_path_dest(dest, flow_act, esw, *i);
+		(*i)++;
+	} else if (attr->flags & MLX5_ATTR_FLAG_ACCEPT) {
+		esw_setup_accept_dest(dest, flow_act, chains, *i);
 		(*i)++;
 	} else if (attr->dest_chain) {
 		err = esw_setup_chain_dest(dest, flow_act, chains, attr->dest_chain,
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 7/9] net/mlx5: Adjust log_max_qp to be 18 at most
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2022-07-28 20:46 ` [net 6/9] net/mlx5e: Modify slow path rules to go to slow fdb Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-28 20:46 ` [net 8/9] net/mlx5: DR, Fix SMFS steering info dump format Saeed Mahameed
  2022-07-28 20:46 ` [net 9/9] net/mlx5: Fix driver use of uninitialized timeout Saeed Mahameed
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Maher Sanalla, Maor Gottlieb

From: Maher Sanalla <msanalla@nvidia.com>

The cited commit limited log_max_qp to be 17 due to FW capabilities.
Recently, it turned out that there are old FW versions that supported
more than 17, so the cited commit caused a degradation.

Thus, set the maximum log_max_qp back to 18 as it was before the
cited commit.

Fixes: 7f839965b2d7 ("net/mlx5: Update log_max_qp value to be 17 at most")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index c9b4e50a593e..95f26624b57c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -524,7 +524,7 @@ static int handle_hca_cap(struct mlx5_core_dev *dev, void *set_ctx)
 
 	/* Check log_max_qp from HCA caps to set in current profile */
 	if (prof->log_max_qp == LOG_MAX_SUPPORTED_QPS) {
-		prof->log_max_qp = min_t(u8, 17, MLX5_CAP_GEN_MAX(dev, log_max_qp));
+		prof->log_max_qp = min_t(u8, 18, MLX5_CAP_GEN_MAX(dev, log_max_qp));
 	} else if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < prof->log_max_qp) {
 		mlx5_core_warn(dev, "log_max_qp value in current profile is %d, changing it to HCA capability limit (%d)\n",
 			       prof->log_max_qp,
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 8/9] net/mlx5: DR, Fix SMFS steering info dump format
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
                   ` (6 preceding siblings ...)
  2022-07-28 20:46 ` [net 7/9] net/mlx5: Adjust log_max_qp to be 18 at most Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  2022-07-28 20:46 ` [net 9/9] net/mlx5: Fix driver use of uninitialized timeout Saeed Mahameed
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Yevgeny Kliteynik,
	Muhammad Sammar, Alex Vesker

From: Yevgeny Kliteynik <kliteyn@nvidia.com>

Fix several issues in SMFS steering info dump:
 - Fix outdated macro value for matcher mask in the SMFS debug dump format.
   The existing value denotes the old format of the matcher mask, as it was
   used during the early stages of development, and it results in wrong
   parsing by the steering dump parser - wrong fields are shown in the
   parsed output.
 - Add the missing destination table to the dumped action.
   The missing dest table handle breaks the ability to associate between
   the "go to table" action and the actual table in the steering info.

Fixes: 9222f0b27da2 ("net/mlx5: DR, Add support for dumping steering info")
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Muhammad Sammar <muhammads@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../ethernet/mellanox/mlx5/core/steering/dr_dbg.c   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
index d5998ef59be4..7adcf0eec13b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
@@ -21,10 +21,11 @@ enum dr_dump_rec_type {
 	DR_DUMP_REC_TYPE_TABLE_TX = 3102,
 
 	DR_DUMP_REC_TYPE_MATCHER = 3200,
-	DR_DUMP_REC_TYPE_MATCHER_MASK = 3201,
+	DR_DUMP_REC_TYPE_MATCHER_MASK_DEPRECATED = 3201,
 	DR_DUMP_REC_TYPE_MATCHER_RX = 3202,
 	DR_DUMP_REC_TYPE_MATCHER_TX = 3203,
 	DR_DUMP_REC_TYPE_MATCHER_BUILDER = 3204,
+	DR_DUMP_REC_TYPE_MATCHER_MASK = 3205,
 
 	DR_DUMP_REC_TYPE_RULE = 3300,
 	DR_DUMP_REC_TYPE_RULE_RX_ENTRY_V0 = 3301,
@@ -114,13 +115,15 @@ dr_dump_rule_action_mem(struct seq_file *file, const u64 rule_id,
 		break;
 	case DR_ACTION_TYP_FT:
 		if (action->dest_tbl->is_fw_tbl)
-			seq_printf(file, "%d,0x%llx,0x%llx,0x%x\n",
+			seq_printf(file, "%d,0x%llx,0x%llx,0x%x,0x%x\n",
 				   DR_DUMP_REC_TYPE_ACTION_FT, action_id,
-				   rule_id, action->dest_tbl->fw_tbl.id);
+				   rule_id, action->dest_tbl->fw_tbl.id,
+				   -1);
 		else
-			seq_printf(file, "%d,0x%llx,0x%llx,0x%x\n",
+			seq_printf(file, "%d,0x%llx,0x%llx,0x%x,0x%llx\n",
 				   DR_DUMP_REC_TYPE_ACTION_FT, action_id,
-				   rule_id, action->dest_tbl->tbl->table_id);
+				   rule_id, action->dest_tbl->tbl->table_id,
+				   DR_DBG_PTR_TO_ID(action->dest_tbl->tbl));
 
 		break;
 	case DR_ACTION_TYP_CTR:
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net 9/9] net/mlx5: Fix driver use of uninitialized timeout
  2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
                   ` (7 preceding siblings ...)
  2022-07-28 20:46 ` [net 8/9] net/mlx5: DR, Fix SMFS steering info dump format Saeed Mahameed
@ 2022-07-28 20:46 ` Saeed Mahameed
  8 siblings, 0 replies; 11+ messages in thread
From: Saeed Mahameed @ 2022-07-28 20:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Saeed Mahameed, netdev, Tariq Toukan, Shay Drory, Moshe Shemesh

From: Shay Drory <shayd@nvidia.com>

Currently, driver is setting default values to all timeouts during
function setup. The offending commit is using a timeout before
function setup, meaning: the timeout is 0 (or garbage), since no
value have been set.
This may result in failure to probe the driver:
mlx5_function_setup:1034:(pid 69850): Firmware over 4294967296 MS in pre-initializing state, aborting
probe_one:1591:(pid 69850): mlx5_init_one failed with error code -16

Hence, set default values to timeouts during tout_init()

Fixes: 37ca95e62ee2 ("net/mlx5: Increase FW pre-init timeout for health recovery")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c | 11 ++++-------
 drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h |  1 -
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  2 --
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c
index d758848d34d0..696e45e2bd06 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c
@@ -32,20 +32,17 @@ static void tout_set(struct mlx5_core_dev *dev, u64 val, enum mlx5_timeouts_type
 	dev->timeouts->to[type] = val;
 }
 
-void mlx5_tout_set_def_val(struct mlx5_core_dev *dev)
+int mlx5_tout_init(struct mlx5_core_dev *dev)
 {
 	int i;
 
-	for (i = 0; i < MAX_TIMEOUT_TYPES; i++)
-		tout_set(dev, tout_def_sw_val[i], i);
-}
-
-int mlx5_tout_init(struct mlx5_core_dev *dev)
-{
 	dev->timeouts = kmalloc(sizeof(*dev->timeouts), GFP_KERNEL);
 	if (!dev->timeouts)
 		return -ENOMEM;
 
+	for (i = 0; i < MAX_TIMEOUT_TYPES; i++)
+		tout_set(dev, tout_def_sw_val[i], i);
+
 	return 0;
 }
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h
index 257c03eeab36..bc9e9aeda847 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h
@@ -35,7 +35,6 @@ int mlx5_tout_init(struct mlx5_core_dev *dev);
 void mlx5_tout_cleanup(struct mlx5_core_dev *dev);
 void mlx5_tout_query_iseg(struct mlx5_core_dev *dev);
 int mlx5_tout_query_dtor(struct mlx5_core_dev *dev);
-void mlx5_tout_set_def_val(struct mlx5_core_dev *dev);
 u64 _mlx5_tout_ms(struct mlx5_core_dev *dev, enum mlx5_timeouts_types type);
 
 #define mlx5_tout_ms(dev, type) _mlx5_tout_ms(dev, MLX5_TO_##type##_MS)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 95f26624b57c..ba2e5232b90b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1023,8 +1023,6 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, u64 timeout)
 	if (mlx5_core_is_pf(dev))
 		pcie_print_link_status(dev->pdev);
 
-	mlx5_tout_set_def_val(dev);
-
 	/* wait for firmware to accept initialization segments configurations
 	 */
 	err = wait_fw_init(dev, timeout,
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [net 1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version
  2022-07-28 20:46 ` [net 1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version Saeed Mahameed
@ 2022-07-30  4:50   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 11+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-30  4:50 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: davem, kuba, pabeni, edumazet, saeedm, netdev, tariqt, gal, maximmi

Hello:

This series was applied to netdev/net.git (master)
by Saeed Mahameed <saeedm@nvidia.com>:

On Thu, 28 Jul 2022 13:46:32 -0700 you wrote:
> From: Gal Pressman <gal@nvidia.com>
> 
> The driver reports whether TX/RX TLS device offloads are supported, but
> not which ciphers/versions, these should be handled by returning
> -EOPNOTSUPP when .tls_dev_add() is called.
> 
> Remove the WARN_ON kernel trace when the driver gets a request to
> offload a cipher/version that is not supported as it is expected.
> 
> [...]

Here is the summary with links:
  - [net,1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version
    https://git.kernel.org/netdev/net/c/115d9f95ea7a
  - [net,2/9] net/mlx5e: TC, Fix post_act to not match on in_port metadata
    https://git.kernel.org/netdev/net/c/903f2194f74b
  - [net,3/9] net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS
    https://git.kernel.org/netdev/net/c/562696c3c62c
  - [net,4/9] net/mlx5e: xsk: Account for XSK RQ UMRs when calculating ICOSQ size
    https://git.kernel.org/netdev/net/c/52586d2f56b3
  - [net,5/9] net/mlx5e: Fix calculations related to max MPWQE size
    https://git.kernel.org/netdev/net/c/677e78c8d44f
  - [net,6/9] net/mlx5e: Modify slow path rules to go to slow fdb
    https://git.kernel.org/netdev/net/c/c0063a43700f
  - [net,7/9] net/mlx5: Adjust log_max_qp to be 18 at most
    https://git.kernel.org/netdev/net/c/a6e9085d791f
  - [net,8/9] net/mlx5: DR, Fix SMFS steering info dump format
    https://git.kernel.org/netdev/net/c/62d2664351ef
  - [net,9/9] net/mlx5: Fix driver use of uninitialized timeout
    https://git.kernel.org/netdev/net/c/42b4f7f66a43

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-30  4:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 20:46 [pull request][net 0/9] mlx5 fixes 2022-07-28 Saeed Mahameed
2022-07-28 20:46 ` [net 1/9] net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version Saeed Mahameed
2022-07-30  4:50   ` patchwork-bot+netdevbpf
2022-07-28 20:46 ` [net 2/9] net/mlx5e: TC, Fix post_act to not match on in_port metadata Saeed Mahameed
2022-07-28 20:46 ` [net 3/9] net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS Saeed Mahameed
2022-07-28 20:46 ` [net 4/9] net/mlx5e: xsk: Account for XSK RQ UMRs when calculating ICOSQ size Saeed Mahameed
2022-07-28 20:46 ` [net 5/9] net/mlx5e: Fix calculations related to max MPWQE size Saeed Mahameed
2022-07-28 20:46 ` [net 6/9] net/mlx5e: Modify slow path rules to go to slow fdb Saeed Mahameed
2022-07-28 20:46 ` [net 7/9] net/mlx5: Adjust log_max_qp to be 18 at most Saeed Mahameed
2022-07-28 20:46 ` [net 8/9] net/mlx5: DR, Fix SMFS steering info dump format Saeed Mahameed
2022-07-28 20:46 ` [net 9/9] net/mlx5: Fix driver use of uninitialized timeout Saeed Mahameed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.