netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07
@ 2019-06-07 21:47 Saeed Mahameed
  2019-06-07 21:47 ` [net 1/7] net/mlx5: Update pci error handler entries and command translation Saeed Mahameed
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Saeed Mahameed

Hi Dave,

This series introduces some fixes to mlx5 driver.

Please pull and let me know if there is any problem.

For -stable v4.17
  ('net/mlx5: Avoid reloading already removed devices')

For -stable v5.0
  ('net/mlx5e: Avoid detaching non-existing netdev under switchdev mode')

For -stable v5.1
  ('net/mlx5e: Fix source port matching in fdb peer flow rule')
  ('net/mlx5e: Support tagged tunnel over bond')
  ('net/mlx5e: Add ndo_set_feature for uplink representor')
  ('net/mlx5: Update pci error handler entries and command translation')

Thanks,
Saeed.

---
The following changes since commit f2c7c76c5d0a443053e94adb9f0918fa2fb85c3a:

  Linux 5.2-rc3 (2019-06-02 13:55:33 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2019-06-07

for you to fetch changes up to 45e7d4c0c1727d362012a62eb57254ea71a2d591:

  net/mlx5e: Support tagged tunnel over bond (2019-06-07 14:40:37 -0700)

----------------------------------------------------------------
mlx5-fixes-2019-06-07

----------------------------------------------------------------
Alaa Hleihel (2):
      net/mlx5: Avoid reloading already removed devices
      net/mlx5e: Avoid detaching non-existing netdev under switchdev mode

Chris Mi (1):
      net/mlx5e: Add ndo_set_feature for uplink representor

Edward Srouji (1):
      net/mlx5: Update pci error handler entries and command translation

Eli Britstein (1):
      net/mlx5e: Support tagged tunnel over bond

Raed Salem (1):
      net/mlx5e: Fix source port matching in fdb peer flow rule

Shay Agroskin (1):
      net/mlx5e: Replace reciprocal_scale in TX select queue function

 drivers/net/ethernet/mellanox/mlx5/core/cmd.c      |  8 +++++++
 drivers/net/ethernet/mellanox/mlx5/core/dev.c      | 25 ++++++++++++++++++++--
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  2 ++
 .../net/ethernet/mellanox/mlx5/core/en/tc_tun.c    | 11 +++++-----
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  9 ++++++--
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   | 10 +++++----
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    |  3 ---
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c    | 12 +++++------
 8 files changed, 58 insertions(+), 22 deletions(-)

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

* [net 1/7] net/mlx5: Update pci error handler entries and command translation
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
@ 2019-06-07 21:47 ` Saeed Mahameed
  2019-06-07 21:47 ` [net 2/7] net/mlx5: Avoid reloading already removed devices Saeed Mahameed
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Edward Srouji, Saeed Mahameed

From: Edward Srouji <edwards@mellanox.com>

Add missing entries for create/destroy UCTX and UMEM commands.
This could get us wrong "unknown FW command" error in flows
where we unbind the device or reset the driver.

Also the translation of these commands from opcodes to string
was missing.

Fixes: 6e3722baac04 ("IB/mlx5: Use the correct commands for UMEM and UCTX allocation")
Signed-off-by: Edward Srouji <edwards@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index d2ab8cd8ad9f..e94686c42000 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -441,6 +441,10 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
 	case MLX5_CMD_OP_CREATE_GENERAL_OBJECT:
 	case MLX5_CMD_OP_MODIFY_GENERAL_OBJECT:
 	case MLX5_CMD_OP_QUERY_GENERAL_OBJECT:
+	case MLX5_CMD_OP_CREATE_UCTX:
+	case MLX5_CMD_OP_DESTROY_UCTX:
+	case MLX5_CMD_OP_CREATE_UMEM:
+	case MLX5_CMD_OP_DESTROY_UMEM:
 	case MLX5_CMD_OP_ALLOC_MEMIC:
 		*status = MLX5_DRIVER_STATUS_ABORTED;
 		*synd = MLX5_DRIVER_SYND;
@@ -629,6 +633,10 @@ const char *mlx5_command_str(int command)
 	MLX5_COMMAND_STR_CASE(ALLOC_MEMIC);
 	MLX5_COMMAND_STR_CASE(DEALLOC_MEMIC);
 	MLX5_COMMAND_STR_CASE(QUERY_HOST_PARAMS);
+	MLX5_COMMAND_STR_CASE(CREATE_UCTX);
+	MLX5_COMMAND_STR_CASE(DESTROY_UCTX);
+	MLX5_COMMAND_STR_CASE(CREATE_UMEM);
+	MLX5_COMMAND_STR_CASE(DESTROY_UMEM);
 	default: return "unknown command opcode";
 	}
 }
-- 
2.21.0


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

* [net 2/7] net/mlx5: Avoid reloading already removed devices
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
  2019-06-07 21:47 ` [net 1/7] net/mlx5: Update pci error handler entries and command translation Saeed Mahameed
@ 2019-06-07 21:47 ` Saeed Mahameed
  2019-06-07 21:47 ` [net 3/7] net/mlx5e: Add ndo_set_feature for uplink representor Saeed Mahameed
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Alaa Hleihel, Saeed Mahameed

From: Alaa Hleihel <alaa@mellanox.com>

Prior to reloading a device we must first verify that it was not already
removed. Otherwise, the attempt to remove the device will do nothing, and
in that case we will end up proceeding with adding an new device that no
one was expecting to remove, leaving behind used resources such as EQs that
causes a failure to destroy comp EQs and syndrome (0x30f433).

Fix that by making sure that we try to remove and add a device (based on a
protocol) only if the device is already added.

Fixes: c5447c70594b ("net/mlx5: E-Switch, Reload IB interface when switching devlink modes")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/dev.c | 25 +++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/dev.c
index ebc046fa97d3..f6b1da99e6c2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c
@@ -248,11 +248,32 @@ void mlx5_unregister_interface(struct mlx5_interface *intf)
 }
 EXPORT_SYMBOL(mlx5_unregister_interface);
 
+/* Must be called with intf_mutex held */
+static bool mlx5_has_added_dev_by_protocol(struct mlx5_core_dev *mdev, int protocol)
+{
+	struct mlx5_device_context *dev_ctx;
+	struct mlx5_interface *intf;
+	bool found = false;
+
+	list_for_each_entry(intf, &intf_list, list) {
+		if (intf->protocol == protocol) {
+			dev_ctx = mlx5_get_device(intf, &mdev->priv);
+			if (dev_ctx && test_bit(MLX5_INTERFACE_ADDED, &dev_ctx->state))
+				found = true;
+			break;
+		}
+	}
+
+	return found;
+}
+
 void mlx5_reload_interface(struct mlx5_core_dev *mdev, int protocol)
 {
 	mutex_lock(&mlx5_intf_mutex);
-	mlx5_remove_dev_by_protocol(mdev, protocol);
-	mlx5_add_dev_by_protocol(mdev, protocol);
+	if (mlx5_has_added_dev_by_protocol(mdev, protocol)) {
+		mlx5_remove_dev_by_protocol(mdev, protocol);
+		mlx5_add_dev_by_protocol(mdev, protocol);
+	}
 	mutex_unlock(&mlx5_intf_mutex);
 }
 
-- 
2.21.0


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

* [net 3/7] net/mlx5e: Add ndo_set_feature for uplink representor
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
  2019-06-07 21:47 ` [net 1/7] net/mlx5: Update pci error handler entries and command translation Saeed Mahameed
  2019-06-07 21:47 ` [net 2/7] net/mlx5: Avoid reloading already removed devices Saeed Mahameed
@ 2019-06-07 21:47 ` Saeed Mahameed
  2019-06-07 21:47 ` [net 4/7] net/mlx5e: Replace reciprocal_scale in TX select queue function Saeed Mahameed
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Chris Mi, Roi Dayan, Vlad Buslov, Saeed Mahameed

From: Chris Mi <chrism@mellanox.com>

After we have a dedicated uplink representor, the new netdev ops
doesn't support ndo_set_feature. Because of that, we can't change
some features, eg. rxvlan. Now add it back.

In this patch, I also do a cleanup for the features flag handling,
eg. remove duplicate NETIF_F_HW_TC flag setting.

Fixes: aec002f6f82c ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode")
Signed-off-by: Chris Mi <chrism@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h      |  1 +
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c |  3 +--
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c  | 10 ++++++----
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 3a183d690e23..ab027f57725c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -1112,6 +1112,7 @@ void mlx5e_del_vxlan_port(struct net_device *netdev, struct udp_tunnel_info *ti)
 netdev_features_t mlx5e_features_check(struct sk_buff *skb,
 				       struct net_device *netdev,
 				       netdev_features_t features);
+int mlx5e_set_features(struct net_device *netdev, netdev_features_t features);
 #ifdef CONFIG_MLX5_ESWITCH
 int mlx5e_set_vf_mac(struct net_device *dev, int vf, u8 *mac);
 int mlx5e_set_vf_rate(struct net_device *dev, int vf, int min_tx_rate, int max_tx_rate);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index c65cefd84eda..cd490ae330d8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3635,8 +3635,7 @@ static int mlx5e_handle_feature(struct net_device *netdev,
 	return 0;
 }
 
-static int mlx5e_set_features(struct net_device *netdev,
-			      netdev_features_t features)
+int mlx5e_set_features(struct net_device *netdev, netdev_features_t features)
 {
 	netdev_features_t oper_features = netdev->features;
 	int err = 0;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 9aea9c5b2ce8..2f406b161bcf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -1351,6 +1351,7 @@ static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = {
 	.ndo_get_vf_stats        = mlx5e_get_vf_stats,
 	.ndo_set_vf_vlan         = mlx5e_uplink_rep_set_vf_vlan,
 	.ndo_get_port_parent_id	 = mlx5e_rep_get_port_parent_id,
+	.ndo_set_features        = mlx5e_set_features,
 };
 
 bool mlx5e_eswitch_rep(struct net_device *netdev)
@@ -1425,10 +1426,9 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev)
 
 	netdev->watchdog_timeo    = 15 * HZ;
 
+	netdev->features       |= NETIF_F_NETNS_LOCAL;
 
-	netdev->features	 |= NETIF_F_HW_TC | NETIF_F_NETNS_LOCAL;
-	netdev->hw_features      |= NETIF_F_HW_TC;
-
+	netdev->hw_features    |= NETIF_F_HW_TC;
 	netdev->hw_features    |= NETIF_F_SG;
 	netdev->hw_features    |= NETIF_F_IP_CSUM;
 	netdev->hw_features    |= NETIF_F_IPV6_CSUM;
@@ -1437,7 +1437,9 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev)
 	netdev->hw_features    |= NETIF_F_TSO6;
 	netdev->hw_features    |= NETIF_F_RXCSUM;
 
-	if (rep->vport != MLX5_VPORT_UPLINK)
+	if (rep->vport == MLX5_VPORT_UPLINK)
+		netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
+	else
 		netdev->features |= NETIF_F_VLAN_CHALLENGED;
 
 	netdev->features |= netdev->hw_features;
-- 
2.21.0


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

* [net 4/7] net/mlx5e: Replace reciprocal_scale in TX select queue function
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2019-06-07 21:47 ` [net 3/7] net/mlx5e: Add ndo_set_feature for uplink representor Saeed Mahameed
@ 2019-06-07 21:47 ` Saeed Mahameed
  2019-06-07 21:47 ` [net 5/7] net/mlx5e: Fix source port matching in fdb peer flow rule Saeed Mahameed
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Shay Agroskin, Tariq Toukan, Saeed Mahameed

From: Shay Agroskin <shayag@mellanox.com>

The TX queue index returned by the fallback function ranges
between [0,NUM CHANNELS - 1] if QoS isn't set and
[0, (NUM CHANNELS)*(NUM TCs) -1] otherwise.

Our HW uses different TC mapping than the fallback function
(which is denoted as 'up', user priority) so we only need to extract
a channel number out of the returned value.

Since (NUM CHANNELS)*(NUM TCs) is a relatively small number, using
reciprocal scale almost always returns zero.
We instead access the 'txq2sq' table to extract the sq (and with it the
channel number) associated with the tx queue, thus getting
a more evenly distributed channel number.

Perf:

Rx/Tx side with Intel(R) Xeon(R) Silver 4108 CPU @ 1.80GHz and ConnectX-5.
Used 'iperf' UDP traffic, 10 threads, and priority 5.

Before:	0.566Mpps
After:	 2.37Mpps

As expected, releasing the existing bottleneck of steering all traffic
to TX queue zero significantly improves transmission rates.

Fixes: 7ccdd0841b30 ("net/mlx5e: Fix select queue callback")
Signed-off-by: Shay Agroskin <shayag@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h      |  1 +
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c |  1 +
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c   | 12 ++++++------
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index ab027f57725c..cc6797e24571 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -385,6 +385,7 @@ struct mlx5e_txqsq {
 	/* control path */
 	struct mlx5_wq_ctrl        wq_ctrl;
 	struct mlx5e_channel      *channel;
+	int                        ch_ix;
 	int                        txq_ix;
 	u32                        rate_limit;
 	struct work_struct         recover_work;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index cd490ae330d8..564692227c16 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1082,6 +1082,7 @@ static int mlx5e_alloc_txqsq(struct mlx5e_channel *c,
 	sq->clock     = &mdev->clock;
 	sq->mkey_be   = c->mkey_be;
 	sq->channel   = c;
+	sq->ch_ix     = c->ix;
 	sq->txq_ix    = txq_ix;
 	sq->uar_map   = mdev->mlx5e_res.bfreg.map;
 	sq->min_inline_mode = params->tx_min_inline_mode;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 195a7d903cec..701e5dc75bb0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -113,13 +113,13 @@ static inline int mlx5e_get_dscp_up(struct mlx5e_priv *priv, struct sk_buff *skb
 u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,
 		       struct net_device *sb_dev)
 {
-	int channel_ix = netdev_pick_tx(dev, skb, NULL);
+	int txq_ix = netdev_pick_tx(dev, skb, NULL);
 	struct mlx5e_priv *priv = netdev_priv(dev);
 	u16 num_channels;
 	int up = 0;
 
 	if (!netdev_get_num_tc(dev))
-		return channel_ix;
+		return txq_ix;
 
 #ifdef CONFIG_MLX5_CORE_EN_DCB
 	if (priv->dcbx_dp.trust_state == MLX5_QPTS_TRUST_DSCP)
@@ -129,14 +129,14 @@ u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,
 		if (skb_vlan_tag_present(skb))
 			up = skb_vlan_tag_get_prio(skb);
 
-	/* channel_ix can be larger than num_channels since
+	/* txq_ix can be larger than num_channels since
 	 * dev->num_real_tx_queues = num_channels * num_tc
 	 */
 	num_channels = priv->channels.params.num_channels;
-	if (channel_ix >= num_channels)
-		channel_ix = reciprocal_scale(channel_ix, num_channels);
+	if (txq_ix >= num_channels)
+		txq_ix = priv->txq2sq[txq_ix]->ch_ix;
 
-	return priv->channel_tc2txq[channel_ix][up];
+	return priv->channel_tc2txq[txq_ix][up];
 }
 
 static inline int mlx5e_skb_l2_header_offset(struct sk_buff *skb)
-- 
2.21.0


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

* [net 5/7] net/mlx5e: Fix source port matching in fdb peer flow rule
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2019-06-07 21:47 ` [net 4/7] net/mlx5e: Replace reciprocal_scale in TX select queue function Saeed Mahameed
@ 2019-06-07 21:47 ` Saeed Mahameed
  2019-06-07 21:47 ` [net 6/7] net/mlx5e: Avoid detaching non-existing netdev under switchdev mode Saeed Mahameed
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Raed Salem, Roi Dayan, Saeed Mahameed

From: Raed Salem <raeds@mellanox.com>

The cited commit changed the initialization placement of the eswitch
attributes so it is done prior to parse tc actions function call,
including among others the in_rep and in_mdev fields which are mistakenly
reassigned inside the parse actions function.

This breaks the source port matching criteria of the peer redirect rule.

Fix by removing the now redundant reassignment of the already initialized
fields.

Fixes: 988ab9c7363a ("net/mlx5e: Introduce mlx5e_flow_esw_attr_init() helper")
Signed-off-by: Raed Salem <raeds@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 ---
 1 file changed, 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 31cd02f11499..e40c60d1631f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -2812,9 +2812,6 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
 	if (!flow_action_has_entries(flow_action))
 		return -EINVAL;
 
-	attr->in_rep = rpriv->rep;
-	attr->in_mdev = priv->mdev;
-
 	flow_action_for_each(i, act, flow_action) {
 		switch (act->id) {
 		case FLOW_ACTION_DROP:
-- 
2.21.0


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

* [net 6/7] net/mlx5e: Avoid detaching non-existing netdev under switchdev mode
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2019-06-07 21:47 ` [net 5/7] net/mlx5e: Fix source port matching in fdb peer flow rule Saeed Mahameed
@ 2019-06-07 21:47 ` Saeed Mahameed
  2019-06-07 21:47 ` [net 7/7] net/mlx5e: Support tagged tunnel over bond Saeed Mahameed
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Alaa Hleihel, Roi Dayan, Saeed Mahameed

From: Alaa Hleihel <alaa@mellanox.com>

After introducing dedicated uplink representor, the netdev instance
set over the esw manager vport (PF) became no longer in use, so it was
removed in the cited commit once we're on switchdev mode.
However, the mlx5e_detach function was not updated accordingly, and it
still tries to detach a non-existing netdev, causing a kernel crash.

This patch fixes this issue.

Fixes: aec002f6f82c ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Reviewed-by: Roi Dayan <roid@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 564692227c16..a8e8350b38aa 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5108,6 +5108,11 @@ static void mlx5e_detach(struct mlx5_core_dev *mdev, void *vpriv)
 	struct mlx5e_priv *priv = vpriv;
 	struct net_device *netdev = priv->netdev;
 
+#ifdef CONFIG_MLX5_ESWITCH
+	if (MLX5_ESWITCH_MANAGER(mdev) && vpriv == mdev)
+		return;
+#endif
+
 	if (!netif_device_present(netdev))
 		return;
 
-- 
2.21.0


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

* [net 7/7] net/mlx5e: Support tagged tunnel over bond
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2019-06-07 21:47 ` [net 6/7] net/mlx5e: Avoid detaching non-existing netdev under switchdev mode Saeed Mahameed
@ 2019-06-07 21:47 ` Saeed Mahameed
  2019-06-07 21:56 ` [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Jesse Brandeburg
  2019-06-10  2:47 ` David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: Saeed Mahameed @ 2019-06-07 21:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eli Britstein, Roi Dayan, Saeed Mahameed

From: Eli Britstein <elibr@mellanox.com>

Stacked devices like bond interface may have a VLAN device on top of
them. Detect lag state correctly under this condition, and return the
correct routed net device, according to it the encap header is built.

Fixes: e32ee6c78efa ("net/mlx5e: Support tunnel encap over tagged Ethernet")
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
index fe5d4d7f15ed..231e7cdfc6f7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
@@ -11,24 +11,25 @@ static int get_route_and_out_devs(struct mlx5e_priv *priv,
 				  struct net_device **route_dev,
 				  struct net_device **out_dev)
 {
+	struct net_device *uplink_dev, *uplink_upper, *real_dev;
 	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
-	struct net_device *uplink_dev, *uplink_upper;
 	bool dst_is_lag_dev;
 
+	real_dev = is_vlan_dev(dev) ? vlan_dev_real_dev(dev) : dev;
 	uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
 	uplink_upper = netdev_master_upper_dev_get(uplink_dev);
 	dst_is_lag_dev = (uplink_upper &&
 			  netif_is_lag_master(uplink_upper) &&
-			  dev == uplink_upper &&
+			  real_dev == uplink_upper &&
 			  mlx5_lag_is_sriov(priv->mdev));
 
 	/* if the egress device isn't on the same HW e-switch or
 	 * it's a LAG device, use the uplink
 	 */
-	if (!netdev_port_same_parent_id(priv->netdev, dev) ||
+	if (!netdev_port_same_parent_id(priv->netdev, real_dev) ||
 	    dst_is_lag_dev) {
-		*route_dev = uplink_dev;
-		*out_dev = *route_dev;
+		*route_dev = dev;
+		*out_dev = uplink_dev;
 	} else {
 		*route_dev = dev;
 		if (is_vlan_dev(*route_dev))
-- 
2.21.0


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

* Re: [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
                   ` (6 preceding siblings ...)
  2019-06-07 21:47 ` [net 7/7] net/mlx5e: Support tagged tunnel over bond Saeed Mahameed
@ 2019-06-07 21:56 ` Jesse Brandeburg
  2019-06-10  2:47 ` David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: Jesse Brandeburg @ 2019-06-07 21:56 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: David S. Miller, netdev, jesse.brandeburg

On Fri, 7 Jun 2019 21:47:35 +0000 Saeed wrote:
> Hi Dave,
> 
> This series introduces some fixes to mlx5 driver.
> 
> Please pull and let me know if there is any problem.
> 
> For -stable v4.17
>   ('net/mlx5: Avoid reloading already removed devices')
> 
> For -stable v5.0
>   ('net/mlx5e: Avoid detaching non-existing netdev under switchdev mode')
> 
> For -stable v5.1
>   ('net/mlx5e: Fix source port matching in fdb peer flow rule')
>   ('net/mlx5e: Support tagged tunnel over bond')
>   ('net/mlx5e: Add ndo_set_feature for uplink representor')
>   ('net/mlx5: Update pci error handler entries and command translation')
> 

For the series:
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

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

* Re: [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07
  2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
                   ` (7 preceding siblings ...)
  2019-06-07 21:56 ` [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Jesse Brandeburg
@ 2019-06-10  2:47 ` David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2019-06-10  2:47 UTC (permalink / raw)
  To: saeedm; +Cc: netdev

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Fri, 7 Jun 2019 21:47:35 +0000

> This series introduces some fixes to mlx5 driver.
> 
> Please pull and let me know if there is any problem.

Pulled.

> For -stable v4.17
>   ('net/mlx5: Avoid reloading already removed devices')
> 
> For -stable v5.0
>   ('net/mlx5e: Avoid detaching non-existing netdev under switchdev mode')
> 
> For -stable v5.1
>   ('net/mlx5e: Fix source port matching in fdb peer flow rule')
>   ('net/mlx5e: Support tagged tunnel over bond')
>   ('net/mlx5e: Add ndo_set_feature for uplink representor')
>   ('net/mlx5: Update pci error handler entries and command translation')

Queued up.

Thanks.

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

end of thread, other threads:[~2019-06-10  2:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 21:47 [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Saeed Mahameed
2019-06-07 21:47 ` [net 1/7] net/mlx5: Update pci error handler entries and command translation Saeed Mahameed
2019-06-07 21:47 ` [net 2/7] net/mlx5: Avoid reloading already removed devices Saeed Mahameed
2019-06-07 21:47 ` [net 3/7] net/mlx5e: Add ndo_set_feature for uplink representor Saeed Mahameed
2019-06-07 21:47 ` [net 4/7] net/mlx5e: Replace reciprocal_scale in TX select queue function Saeed Mahameed
2019-06-07 21:47 ` [net 5/7] net/mlx5e: Fix source port matching in fdb peer flow rule Saeed Mahameed
2019-06-07 21:47 ` [net 6/7] net/mlx5e: Avoid detaching non-existing netdev under switchdev mode Saeed Mahameed
2019-06-07 21:47 ` [net 7/7] net/mlx5e: Support tagged tunnel over bond Saeed Mahameed
2019-06-07 21:56 ` [pull request][net 0/7] Mellanox, mlx5 fixes 2019-06-07 Jesse Brandeburg
2019-06-10  2:47 ` David Miller

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).