All of lore.kernel.org
 help / color / mirror / Atom feed
* [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13
@ 2018-12-13 16:45 Saeed Mahameed
  2018-12-13 16:45 ` [net 1/9] net/mlx5: E-Switch, Fix fdb cap bits swap Saeed Mahameed
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Saeed Mahameed

Hi Dave,

This series introduces some fixes to the mlx5 core and mlx5e netdevice
driver.

=======
Conflict with net-next: When merged with net-next this series will
cause a moderate conflict:

1) in drivers/net/ethernet/mellanox/mlx5/core/en_tc.c (2 hunks)
Take hunks from net only and just replace *attr->mirror_count to *attr->split_count
1.1) there is one more instance of slow_attr->mirror_count to be replaced
with slow_attr->split_count, it doesn't appear in the conflict, it will
cause a compilation error if left out.
2) in mlx5_ifc.h, take hunks only from net.

Example for the merge resolution can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git/commit/?h=merge/mlx5-fixes&id=48830adf29804d85d77ed8a251d625db0eb5b8a8
branch merge/mlx5-fixes of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
(I simply merged this pull request tag into net-next and resolved the conflict)

I don't know if it's ok with you, but to save your time, you can just:
git pull git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux merge/mlx5-fixes
Into net-next, before your next net merge, and you will have a clean
merge of net into net-next (at least for mlx5 files).
======

Please pull and let me know if there's any problem.

For -stable v4.18
338d615be484 ('net/mlx5e: Cancel DIM work on close SQ')
91f40f9904ad ('net/mlx5e: RX, Verify MPWQE stride size is in range')

For -stable v4.19
c5c7e1c41bbe ('net/mlx5e: Remove unused UDP GSO remaining counter')

Thanks,
Saeed.

---

The following changes since commit 40e020c129cfc991e8ab4736d2665351ffd1468d:

  Linux 4.20-rc6 (2018-12-09 15:31:00 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2018-12-13

for you to fetch changes up to fa2bf86bab4bbc61e5678a42a14e40075093a98f:

  net/mlx5e: Cancel DIM work on close SQ (2018-12-13 01:24:44 -0800)

----------------------------------------------------------------
mlx5-fixes-2018-12-13

----------------------------------------------------------------
Gavi Teitz (1):
      net/mlx5e: Fix default amount of channels for VF representors

Mikhael Goikhman (1):
      net/mlx5e: Remove unused UDP GSO remaining counter

Moshe Shemesh (1):
      net/mlx5e: RX, Verify MPWQE stride size is in range

Or Gerlitz (4):
      net/mlx5e: Err if asked to mirror a goto chain tc eswitch rule
      net/mlx5e: Avoid overriding the user provided priority for offloaded tc rules
      net/mlx5e: Properly initialize flow attributes for slow path eswitch rule deletion
      net/mlx5e: Avoid encap flows deletion attempt the 1st time a neigh is resolved

Tal Gilboa (1):
      net/mlx5e: Cancel DIM work on close SQ

Vu Pham (1):
      net/mlx5: E-Switch, Fix fdb cap bits swap

 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  6 ++++
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |  9 +++---
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.c |  2 --
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h |  2 --
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    | 36 +++++++++++++---------
 include/linux/mlx5/mlx5_ifc.h                      | 10 +++---
 6 files changed, 38 insertions(+), 27 deletions(-)

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

* [net 1/9] net/mlx5: E-Switch, Fix fdb cap bits swap
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 2/9] net/mlx5e: Fix default amount of channels for VF representors Saeed Mahameed
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Vu Pham, Saeed Mahameed

From: Vu Pham <vu@mellanox.com>

The cap bits locations for the fdb caps of multi path to table (used for
local mirroring) and multi encap (used for prio/chains) were wrongly used
in swapped locations. This went unnoted so far b/c we tested the offending
patch with CX5 FW that supports both of them. On different environments where
not both caps are supported, we will be messed up, fix that.

Fixes: b9aa0ba17af5 ('net/mlx5: Add cap bits for multi fdb encap')
Signed-off-by: Vu Pham <vu@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Tested-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 include/linux/mlx5/mlx5_ifc.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 34e17e6f8942..4e77bfe0b580 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -582,11 +582,13 @@ struct mlx5_ifc_flow_table_nic_cap_bits {
 };
 
 struct mlx5_ifc_flow_table_eswitch_cap_bits {
-	u8      reserved_at_0[0x1c];
-	u8      fdb_multi_path_to_table[0x1];
-	u8      reserved_at_1d[0x1];
+	u8      reserved_at_0[0x1a];
 	u8      multi_fdb_encap[0x1];
-	u8      reserved_at_1e[0x1e1];
+	u8      reserved_at_1b[0x1];
+	u8      fdb_multi_path_to_table[0x1];
+	u8      reserved_at_1d[0x3];
+
+	u8      reserved_at_20[0x1e0];
 
 	struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_esw_fdb;
 
-- 
2.19.2

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

* [net 2/9] net/mlx5e: Fix default amount of channels for VF representors
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
  2018-12-13 16:45 ` [net 1/9] net/mlx5: E-Switch, Fix fdb cap bits swap Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 3/9] net/mlx5e: RX, Verify MPWQE stride size is in range Saeed Mahameed
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Gavi Teitz, Saeed Mahameed

From: Gavi Teitz <gavi@mellanox.com>

The default amount of channels a representor opens was erroneously
changed from one to the maximum amount of channels, restore to its
intended value.

Fixes: 779d986d60de ("net/mlx5e: Do not ignore netdevice TX/RX queues number")
Signed-off-by: Gavi Teitz <gavi@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index c3c657548824..6a4d782c1de1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -46,6 +46,7 @@
 
 #define MLX5E_REP_PARAMS_LOG_SQ_SIZE \
 	max(0x6, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
+#define MLX5E_REP_PARAMS_DEF_NUM_CHANNELS 1
 
 static const char mlx5e_rep_driver_name[] = "mlx5e_rep";
 
@@ -1083,9 +1084,7 @@ static int mlx5e_init_rep(struct mlx5_core_dev *mdev,
 	if (err)
 		return err;
 
-
-	priv->channels.params.num_channels =
-				mlx5e_get_netdev_max_channels(netdev);
+	priv->channels.params.num_channels = MLX5E_REP_PARAMS_DEF_NUM_CHANNELS;
 
 	mlx5e_build_rep_params(mdev, &priv->channels.params, netdev->mtu);
 	mlx5e_build_rep_netdev(netdev);
-- 
2.19.2

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

* [net 3/9] net/mlx5e: RX, Verify MPWQE stride size is in range
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
  2018-12-13 16:45 ` [net 1/9] net/mlx5: E-Switch, Fix fdb cap bits swap Saeed Mahameed
  2018-12-13 16:45 ` [net 2/9] net/mlx5e: Fix default amount of channels for VF representors Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 4/9] net/mlx5e: Err if asked to mirror a goto chain tc eswitch rule Saeed Mahameed
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Moshe Shemesh, Saeed Mahameed

From: Moshe Shemesh <moshe@mellanox.com>

Add check of MPWQE stride size is within range supported by HW. In case
calculated MPWQE stride size exceed range, linear SKB can't be used and
we should use non linear MPWQE instead.

Fixes: 619a8f2a42f1 ("net/mlx5e: Use linear SKB in Striding RQ")
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 871313d6b34d..c17de6a990ff 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -128,6 +128,8 @@ static bool mlx5e_rx_is_linear_skb(struct mlx5_core_dev *mdev,
 	return !params->lro_en && frag_sz <= PAGE_SIZE;
 }
 
+#define MLX5_MAX_MPWQE_LOG_WQE_STRIDE_SZ ((BIT(__mlx5_bit_sz(wq, log_wqe_stride_size)) - 1) + \
+					  MLX5_MPWQE_LOG_STRIDE_SZ_BASE)
 static bool mlx5e_rx_mpwqe_is_linear_skb(struct mlx5_core_dev *mdev,
 					 struct mlx5e_params *params)
 {
@@ -138,6 +140,9 @@ static bool mlx5e_rx_mpwqe_is_linear_skb(struct mlx5_core_dev *mdev,
 	if (!mlx5e_rx_is_linear_skb(mdev, params))
 		return false;
 
+	if (order_base_2(frag_sz) > MLX5_MAX_MPWQE_LOG_WQE_STRIDE_SZ)
+		return false;
+
 	if (MLX5_CAP_GEN(mdev, ext_stride_num_range))
 		return true;
 
-- 
2.19.2

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

* [net 4/9] net/mlx5e: Err if asked to mirror a goto chain tc eswitch rule
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2018-12-13 16:45 ` [net 3/9] net/mlx5e: RX, Verify MPWQE stride size is in range Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 5/9] net/mlx5e: Avoid overriding the user provided priority for offloaded tc rules Saeed Mahameed
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

Currently we are not supporting this and not err-ing on that either.

For now, just err if asked to do that.

Fixes: bf07aa730a04 ('net/mlx5e: Support offloading tc priorities and chains for eswitch flows')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index fca6f4132c91..1f01c905a042 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -2966,8 +2966,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
 				NL_SET_ERR_MSG(extack, "Requested destination chain is out of supported range");
 				return -EOPNOTSUPP;
 			}
-			action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
-				  MLX5_FLOW_CONTEXT_ACTION_COUNT;
+			action |= MLX5_FLOW_CONTEXT_ACTION_COUNT;
 			attr->dest_chain = dest_chain;
 
 			continue;
@@ -2980,6 +2979,14 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
 	if (!actions_match_supported(priv, exts, parse_attr, flow, extack))
 		return -EOPNOTSUPP;
 
+	if (attr->dest_chain) {
+		if (attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
+			NL_SET_ERR_MSG(extack, "Mirroring goto chain rules isn't supported");
+			return -EOPNOTSUPP;
+		}
+		attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
+	}
+
 	if (attr->mirror_count > 0 && !mlx5_esw_has_fwd_fdb(priv->mdev)) {
 		NL_SET_ERR_MSG_MOD(extack,
 				   "current firmware doesn't support split rule for port mirroring");
-- 
2.19.2

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

* [net 5/9] net/mlx5e: Avoid overriding the user provided priority for offloaded tc rules
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2018-12-13 16:45 ` [net 4/9] net/mlx5e: Err if asked to mirror a goto chain tc eswitch rule Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 6/9] net/mlx5e: Properly initialize flow attributes for slow path eswitch rule deletion Saeed Mahameed
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

Just a leftover which was wrongly left there, remove it while spawning
a message to suggest firmware upgrade.

Fixes: bf07aa730a04 ('net/mlx5e: Support offloading tc priorities and chains for eswitch flows')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 1f01c905a042..e6170ddf2cc4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -907,11 +907,10 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
 	struct mlx5e_priv *out_priv;
 	int err = 0, encap_err = 0;
 
-	/* if prios are not supported, keep the old behaviour of using same prio
-	 * for all offloaded rules.
-	 */
-	if (!mlx5_eswitch_prios_supported(esw))
-		attr->prio = 1;
+	if (!mlx5_eswitch_prios_supported(esw) && attr->prio != 1) {
+		NL_SET_ERR_MSG(extack, "E-switch priorities unsupported, upgrade FW");
+		return -EOPNOTSUPP;
+	}
 
 	if (attr->chain > max_chain) {
 		NL_SET_ERR_MSG(extack, "Requested chain is out of supported range");
-- 
2.19.2

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

* [net 6/9] net/mlx5e: Properly initialize flow attributes for slow path eswitch rule deletion
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2018-12-13 16:45 ` [net 5/9] net/mlx5e: Avoid overriding the user provided priority for offloaded tc rules Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 7/9] net/mlx5e: Avoid encap flows deletion attempt the 1st time a neigh is resolved Saeed Mahameed
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

When a neighbour is resolved, we delete the goto slow path rule from HW.

The eswitch flow attributes where not properly initialized on that case,
hence we mess up the eswitch refcounts for chain zero (the default one).

Fix that along with making sure to use semicolons and not commas on that code;

Fixes: 5dbe906ff1d5 ('net/mlx5e: Use a slow path rule instead if vxlan neighbour isn't available')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index e6170ddf2cc4..3b732c02b5e1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -870,9 +870,9 @@ mlx5e_tc_offload_to_slow_path(struct mlx5_eswitch *esw,
 	struct mlx5_flow_handle *rule;
 
 	memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
-	slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
-	slow_attr->mirror_count = 0,
-	slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN,
+	slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
+	slow_attr->mirror_count = 0;
+	slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN;
 
 	rule = mlx5e_tc_offload_fdb_rules(esw, flow, spec, slow_attr);
 	if (!IS_ERR(rule))
@@ -887,6 +887,9 @@ mlx5e_tc_unoffload_from_slow_path(struct mlx5_eswitch *esw,
 				  struct mlx5_esw_flow_attr *slow_attr)
 {
 	memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
+	slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
+	slow_attr->mirror_count = 0;
+	slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN;
 	mlx5e_tc_unoffload_fdb_rules(esw, flow, slow_attr);
 	flow->flags &= ~MLX5E_TC_FLOW_SLOW;
 }
-- 
2.19.2

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

* [net 7/9] net/mlx5e: Avoid encap flows deletion attempt the 1st time a neigh is resolved
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2018-12-13 16:45 ` [net 6/9] net/mlx5e: Properly initialize flow attributes for slow path eswitch rule deletion Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 8/9] net/mlx5e: Remove unused UDP GSO remaining counter Saeed Mahameed
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Eli Britstein, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

Currently, we are deleting offloaded encap flows in case the relevant neigh
becomes unconnected while the encap is valid (a sign that it used to be
connected), or if the curr neigh mac is different from the cached mac
(a sign that the remote side changed their mac).

The 2nd check also applies when the neigh becomes connected on the 1st
time (we start with zero mac). Before the offending commit, the deleting
handler was practically no op, as no flows were offloaded. But since
that commit, we offload neigh-less encap flows to slow path.

Under mirroring scheme, we go into the delete handler, attempt to unoffload a
mirror rule which was never set (as we were offloading to slow path) and crash.

Fix that by calling the delete handler only when the encap is valid,
which covers both cases mentioned above.

Fixes: 5dbe906ff1d5 ('net/mlx5e: Use a slow path rule instead if vxlan neighbour isn't available')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 4 ++--
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c  | 7 +++----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 6a4d782c1de1..820fe85100b0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -467,8 +467,8 @@ static void mlx5e_rep_update_flows(struct mlx5e_priv *priv,
 
 	ASSERT_RTNL();
 
-	if ((!neigh_connected && (e->flags & MLX5_ENCAP_ENTRY_VALID)) ||
-	    !ether_addr_equal(e->h_dest, ha))
+	if ((e->flags & MLX5_ENCAP_ENTRY_VALID) &&
+	    (!neigh_connected || !ether_addr_equal(e->h_dest, ha)))
 		mlx5e_tc_encap_flows_del(priv, e);
 
 	if (neigh_connected && !(e->flags & MLX5_ENCAP_ENTRY_VALID)) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 3b732c02b5e1..9dabe9d4b279 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1096,10 +1096,9 @@ void mlx5e_tc_encap_flows_del(struct mlx5e_priv *priv,
 		flow->rule[0] = rule;
 	}
 
-	if (e->flags & MLX5_ENCAP_ENTRY_VALID) {
-		e->flags &= ~MLX5_ENCAP_ENTRY_VALID;
-		mlx5_packet_reformat_dealloc(priv->mdev, e->encap_id);
-	}
+	/* we know that the encap is valid */
+	e->flags &= ~MLX5_ENCAP_ENTRY_VALID;
+	mlx5_packet_reformat_dealloc(priv->mdev, e->encap_id);
 }
 
 static struct mlx5_fc *mlx5e_tc_get_counter(struct mlx5e_tc_flow *flow)
-- 
2.19.2

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

* [net 8/9] net/mlx5e: Remove unused UDP GSO remaining counter
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
                   ` (6 preceding siblings ...)
  2018-12-13 16:45 ` [net 7/9] net/mlx5e: Avoid encap flows deletion attempt the 1st time a neigh is resolved Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-13 16:45 ` [net 9/9] net/mlx5e: Cancel DIM work on close SQ Saeed Mahameed
  2018-12-14  3:32 ` [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 David Miller
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Mikhael Goikhman, Saeed Mahameed

From: Mikhael Goikhman <migo@mellanox.com>

Remove tx_udp_seg_rem counter from ethtool output, as it is no longer
being updated in the driver's data flow.

Fixes: 3f44899ef2ce ("net/mlx5e: Use PARTIAL_GSO for UDP segmentation")
Signed-off-by: Mikhael Goikhman <migo@mellanox.com>
Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 --
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
index 3e99d0728b2f..4337afd610d7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
@@ -74,7 +74,6 @@ static const struct counter_desc sw_stats_desc[] = {
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_recover) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_cqes) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_wake) },
-	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_udp_seg_rem) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_cqe_err) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_xdp_xmit) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_xdp_full) },
@@ -198,7 +197,6 @@ void mlx5e_grp_sw_update_stats(struct mlx5e_priv *priv)
 			s->tx_nop               += sq_stats->nop;
 			s->tx_queue_stopped	+= sq_stats->stopped;
 			s->tx_queue_wake	+= sq_stats->wake;
-			s->tx_udp_seg_rem	+= sq_stats->udp_seg_rem;
 			s->tx_queue_dropped	+= sq_stats->dropped;
 			s->tx_cqe_err		+= sq_stats->cqe_err;
 			s->tx_recover		+= sq_stats->recover;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
index 3f8e870ef4c9..3ff69ddae2d3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
@@ -87,7 +87,6 @@ struct mlx5e_sw_stats {
 	u64 tx_recover;
 	u64 tx_cqes;
 	u64 tx_queue_wake;
-	u64 tx_udp_seg_rem;
 	u64 tx_cqe_err;
 	u64 tx_xdp_xmit;
 	u64 tx_xdp_full;
@@ -221,7 +220,6 @@ struct mlx5e_sq_stats {
 	u64 csum_partial_inner;
 	u64 added_vlan_packets;
 	u64 nop;
-	u64 udp_seg_rem;
 #ifdef CONFIG_MLX5_EN_TLS
 	u64 tls_ooo;
 	u64 tls_resync_bytes;
-- 
2.19.2

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

* [net 9/9] net/mlx5e: Cancel DIM work on close SQ
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
                   ` (7 preceding siblings ...)
  2018-12-13 16:45 ` [net 8/9] net/mlx5e: Remove unused UDP GSO remaining counter Saeed Mahameed
@ 2018-12-13 16:45 ` Saeed Mahameed
  2018-12-14  3:32 ` [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 David Miller
  9 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-13 16:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Tal Gilboa, Saeed Mahameed

From: Tal Gilboa <talgi@mellanox.com>

TXQ SQ closure is followed by closing the corresponding CQ. A pending
DIM work would try to modify the now non-existing CQ.
This would trigger an error:
[85535.835926] mlx5_core 0000:af:00.0: mlx5_cmd_check:769:(pid 124399):
MODIFY_CQ(0x403) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0x1d7771)

Fix by making sure to cancel any pending DIM work before destroying the SQ.

Fixes: cbce4f444798 ("net/mlx5e: Enable adaptive-TX moderation")
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index c17de6a990ff..b70cb6fd164c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1401,6 +1401,7 @@ static void mlx5e_close_txqsq(struct mlx5e_txqsq *sq)
 	struct mlx5_core_dev *mdev = c->mdev;
 	struct mlx5_rate_limit rl = {0};
 
+	cancel_work_sync(&sq->dim.work);
 	mlx5e_destroy_sq(mdev, sq->sqn);
 	if (sq->rate_limit) {
 		rl.rate = sq->rate_limit;
-- 
2.19.2

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

* Re: [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13
  2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
                   ` (8 preceding siblings ...)
  2018-12-13 16:45 ` [net 9/9] net/mlx5e: Cancel DIM work on close SQ Saeed Mahameed
@ 2018-12-14  3:32 ` David Miller
  2018-12-14 19:03   ` Saeed Mahameed
  9 siblings, 1 reply; 12+ messages in thread
From: David Miller @ 2018-12-14  3:32 UTC (permalink / raw)
  To: saeedm; +Cc: netdev

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Thu, 13 Dec 2018 08:45:29 -0800

> This series introduces some fixes to the mlx5 core and mlx5e netdevice
> driver.

Pulled.

> Please pull and let me know if there's any problem.
> 
> For -stable v4.18
> 338d615be484 ('net/mlx5e: Cancel DIM work on close SQ')
> 91f40f9904ad ('net/mlx5e: RX, Verify MPWQE stride size is in range')
> 
> For -stable v4.19
> c5c7e1c41bbe ('net/mlx5e: Remove unused UDP GSO remaining counter')

And queued up for -stable.

Although those SHA1-IDs do not match the SHA1-IDs in your tree that I
pulled from.

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

* Re: [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13
  2018-12-14  3:32 ` [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 David Miller
@ 2018-12-14 19:03   ` Saeed Mahameed
  0 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2018-12-14 19:03 UTC (permalink / raw)
  To: David S. Miller; +Cc: Saeed Mahameed, Linux Netdev List

On Thu, Dec 13, 2018 at 7:32 PM David Miller <davem@davemloft.net> wrote:
>
> From: Saeed Mahameed <saeedm@mellanox.com>
> Date: Thu, 13 Dec 2018 08:45:29 -0800
>
> > This series introduces some fixes to the mlx5 core and mlx5e netdevice
> > driver.
>
> Pulled.
>
> > Please pull and let me know if there's any problem.
> >
> > For -stable v4.18
> > 338d615be484 ('net/mlx5e: Cancel DIM work on close SQ')
> > 91f40f9904ad ('net/mlx5e: RX, Verify MPWQE stride size is in range')
> >
> > For -stable v4.19
> > c5c7e1c41bbe ('net/mlx5e: Remove unused UDP GSO remaining counter')
>
> And queued up for -stable.
>
> Although those SHA1-IDs do not match the SHA1-IDs in your tree that I
> pulled from.

oops, I took the log from the wrong branch, but still those are the
right patches.
Thank you Dave !

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

end of thread, other threads:[~2018-12-14 19:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 16:45 [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 Saeed Mahameed
2018-12-13 16:45 ` [net 1/9] net/mlx5: E-Switch, Fix fdb cap bits swap Saeed Mahameed
2018-12-13 16:45 ` [net 2/9] net/mlx5e: Fix default amount of channels for VF representors Saeed Mahameed
2018-12-13 16:45 ` [net 3/9] net/mlx5e: RX, Verify MPWQE stride size is in range Saeed Mahameed
2018-12-13 16:45 ` [net 4/9] net/mlx5e: Err if asked to mirror a goto chain tc eswitch rule Saeed Mahameed
2018-12-13 16:45 ` [net 5/9] net/mlx5e: Avoid overriding the user provided priority for offloaded tc rules Saeed Mahameed
2018-12-13 16:45 ` [net 6/9] net/mlx5e: Properly initialize flow attributes for slow path eswitch rule deletion Saeed Mahameed
2018-12-13 16:45 ` [net 7/9] net/mlx5e: Avoid encap flows deletion attempt the 1st time a neigh is resolved Saeed Mahameed
2018-12-13 16:45 ` [net 8/9] net/mlx5e: Remove unused UDP GSO remaining counter Saeed Mahameed
2018-12-13 16:45 ` [net 9/9] net/mlx5e: Cancel DIM work on close SQ Saeed Mahameed
2018-12-14  3:32 ` [pull request][net 0/9] Mellanox, mlx5 fixes 2018-12-13 David Miller
2018-12-14 19:03   ` 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.