netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11
@ 2019-07-11 18:54 Saeed Mahameed
  2019-07-11 18:54 ` [net 1/6] net/mlx5: E-Switch, Fix default encap mode Saeed Mahameed
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Saeed Mahameed @ 2019-07-11 18:54 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.15
('net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn')

For -stable v5.1
('net/mlx5e: Fix port tunnel GRE entropy control')
('net/mlx5e: Rx, Fix checksum calculation for new hardware')
('net/mlx5e: Fix return value from timeout recover function')
('net/mlx5e: Fix error flow in tx reporter diagnose')

For -stable v5.2
('net/mlx5: E-Switch, Fix default encap mode')

Conflict note: This pull request will produce a small conflict when
merged with net-next.
In drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
Take the hunk from net and replace:
esw_offloads_steering_init(esw, vf_nvports, total_nvports);
with:
esw_offloads_steering_init(esw);

Thanks,
Saeed.

---
The following changes since commit e858faf556d4e14c750ba1e8852783c6f9520a0e:

  tcp: Reset bytes_acked and bytes_received when disconnecting (2019-07-08 19:29:19 -0700)

are available in the Git repository at:

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

for you to fetch changes up to ef1ce7d7b67b46661091c7ccc0396186b7a247ef:

  net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn (2019-07-11 11:45:04 -0700)

----------------------------------------------------------------
mlx5-fixes-2019-07-11

----------------------------------------------------------------
Aya Levin (3):
      net/mlx5e: Fix return value from timeout recover function
      net/mlx5e: Fix error flow in tx reporter diagnose
      net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn

Eli Britstein (1):
      net/mlx5e: Fix port tunnel GRE entropy control

Maor Gottlieb (1):
      net/mlx5: E-Switch, Fix default encap mode

Saeed Mahameed (1):
      net/mlx5e: Rx, Fix checksum calculation for new hardware

 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  1 +
 .../ethernet/mellanox/mlx5/core/en/reporter_tx.c   | 10 ++++------
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  3 +++
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |  7 ++++++-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  |  5 -----
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c |  7 +++++++
 .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c  |  9 ++++++++-
 .../net/ethernet/mellanox/mlx5/core/lib/port_tun.c | 23 ++++------------------
 include/linux/mlx5/mlx5_ifc.h                      |  3 ++-
 9 files changed, 35 insertions(+), 33 deletions(-)

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

* [net 1/6] net/mlx5: E-Switch, Fix default encap mode
  2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
@ 2019-07-11 18:54 ` Saeed Mahameed
  2019-07-11 18:54 ` [net 2/6] net/mlx5e: Fix port tunnel GRE entropy control Saeed Mahameed
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2019-07-11 18:54 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Maor Gottlieb, Roi Dayan, Saeed Mahameed

From: Maor Gottlieb <maorg@mellanox.com>

Encap mode is related to switchdev mode only. Move the init of
the encap mode to eswitch_offloads. Before this change, we reported
that eswitch supports encap, even tough the device was in non
SRIOV mode.

Fixes: 7768d1971de67 ('net/mlx5: E-Switch, Add control for encapsulation')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c          | 5 -----
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 7 +++++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 6a921e24cd5e..e9339e7d6a18 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1882,11 +1882,6 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
 	esw->enabled_vports = 0;
 	esw->mode = SRIOV_NONE;
 	esw->offloads.inline_mode = MLX5_INLINE_MODE_NONE;
-	if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, reformat) &&
-	    MLX5_CAP_ESW_FLOWTABLE_FDB(dev, decap))
-		esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_BASIC;
-	else
-		esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
 
 	dev->priv.eswitch = esw;
 	return 0;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 47b446d30f71..c2beadc41c40 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -1840,6 +1840,12 @@ int esw_offloads_init(struct mlx5_eswitch *esw, int vf_nvports,
 {
 	int err;
 
+	if (MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, reformat) &&
+	    MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, decap))
+		esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_BASIC;
+	else
+		esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
+
 	err = esw_offloads_steering_init(esw, vf_nvports, total_nvports);
 	if (err)
 		return err;
@@ -1901,6 +1907,7 @@ void esw_offloads_cleanup(struct mlx5_eswitch *esw)
 	esw_offloads_devcom_cleanup(esw);
 	esw_offloads_unload_all_reps(esw, num_vfs);
 	esw_offloads_steering_cleanup(esw);
+	esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
 }
 
 static int esw_mode_from_devlink(u16 mode, u16 *mlx5_mode)
-- 
2.21.0


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

* [net 2/6] net/mlx5e: Fix port tunnel GRE entropy control
  2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
  2019-07-11 18:54 ` [net 1/6] net/mlx5: E-Switch, Fix default encap mode Saeed Mahameed
@ 2019-07-11 18:54 ` Saeed Mahameed
  2019-07-11 18:54 ` [net 3/6] net/mlx5e: Rx, Fix checksum calculation for new hardware Saeed Mahameed
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2019-07-11 18:54 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eli Britstein, Saeed Mahameed

From: Eli Britstein <elibr@mellanox.com>

GRE entropy calculation is a single bit per card, and not per port.
Force disable GRE entropy calculation upon the first GRE encap rule,
and release the force at the last GRE encap rule removal. This is done
per port.

Fixes: 97417f6182f8 ("net/mlx5e: Fix GRE key by controlling port tunnel entropy calculation")
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../mellanox/mlx5/core/lib/port_tun.c         | 23 ++++---------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
index be69c1d7941a..48b5c847b642 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
@@ -98,27 +98,12 @@ static int mlx5_set_entropy(struct mlx5_tun_entropy *tun_entropy,
 	 */
 	if (entropy_flags.gre_calc_supported &&
 	    reformat_type == MLX5_REFORMAT_TYPE_L2_TO_NVGRE) {
-		/* Other applications may change the global FW entropy
-		 * calculations settings. Check that the current entropy value
-		 * is the negative of the updated value.
-		 */
-		if (entropy_flags.force_enabled &&
-		    enable == entropy_flags.gre_calc_enabled) {
-			mlx5_core_warn(tun_entropy->mdev,
-				       "Unexpected GRE entropy calc setting - expected %d",
-				       !entropy_flags.gre_calc_enabled);
-			return -EOPNOTSUPP;
-		}
-		err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, enable,
-							 entropy_flags.force_supported);
+		if (!entropy_flags.force_supported)
+			return 0;
+		err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev,
+							 enable, !enable);
 		if (err)
 			return err;
-		/* if we turn on the entropy we don't need to force it anymore */
-		if (entropy_flags.force_supported && enable) {
-			err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, 1, 0);
-			if (err)
-				return err;
-		}
 	} else if (entropy_flags.calc_supported) {
 		/* Other applications may change the global FW entropy
 		 * calculations settings. Check that the current entropy value
-- 
2.21.0


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

* [net 3/6] net/mlx5e: Rx, Fix checksum calculation for new hardware
  2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
  2019-07-11 18:54 ` [net 1/6] net/mlx5: E-Switch, Fix default encap mode Saeed Mahameed
  2019-07-11 18:54 ` [net 2/6] net/mlx5e: Fix port tunnel GRE entropy control Saeed Mahameed
@ 2019-07-11 18:54 ` Saeed Mahameed
  2019-07-11 18:54 ` [net 4/6] net/mlx5e: Fix return value from timeout recover function Saeed Mahameed
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2019-07-11 18:54 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Saeed Mahameed

CQE checksum full mode in new HW, provides a full checksum of rx frame.
Covering bytes starting from eth protocol up to last byte in the received
frame (frame_size - ETH_HLEN), as expected by the stack.

Fixing up skb->csum by the driver is not required in such case. This fix
is to avoid wrong checksum calculation in drivers which already support
the new hardware with the new checksum mode.

Fixes: 85327a9c4150 ("net/mlx5: Update the list of the PCI supported devices")
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_rx.c   | 7 ++++++-
 include/linux/mlx5/mlx5_ifc.h                     | 3 ++-
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index cc6797e24571..cc227a7aa79f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -294,6 +294,7 @@ enum {
 	MLX5E_RQ_STATE_ENABLED,
 	MLX5E_RQ_STATE_AM,
 	MLX5E_RQ_STATE_NO_CSUM_COMPLETE,
+	MLX5E_RQ_STATE_CSUM_FULL, /* cqe_csum_full hw bit is set */
 };
 
 struct mlx5e_cq {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index a8e8350b38aa..98d75271fc73 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -855,6 +855,9 @@ static int mlx5e_open_rq(struct mlx5e_channel *c,
 	if (err)
 		goto err_destroy_rq;
 
+	if (MLX5_CAP_ETH(c->mdev, cqe_checksum_full))
+		__set_bit(MLX5E_RQ_STATE_CSUM_FULL, &c->rq.state);
+
 	if (params->rx_dim_enabled)
 		__set_bit(MLX5E_RQ_STATE_AM, &c->rq.state);
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 13133e7f088e..8a5f9411cac6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -873,8 +873,14 @@ static inline void mlx5e_handle_csum(struct net_device *netdev,
 		if (unlikely(get_ip_proto(skb, network_depth, proto) == IPPROTO_SCTP))
 			goto csum_unnecessary;
 
+		stats->csum_complete++;
 		skb->ip_summed = CHECKSUM_COMPLETE;
 		skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
+
+		if (test_bit(MLX5E_RQ_STATE_CSUM_FULL, &rq->state))
+			return; /* CQE csum covers all received bytes */
+
+		/* csum might need some fixups ...*/
 		if (network_depth > ETH_HLEN)
 			/* CQE csum is calculated from the IP header and does
 			 * not cover VLAN headers (if present). This will add
@@ -885,7 +891,6 @@ static inline void mlx5e_handle_csum(struct net_device *netdev,
 						 skb->csum);
 
 		mlx5e_skb_padding_csum(skb, network_depth, proto, stats);
-		stats->csum_complete++;
 		return;
 	}
 
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 5e74305e2e57..7e42efa143a0 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -749,7 +749,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
 	u8         swp[0x1];
 	u8         swp_csum[0x1];
 	u8         swp_lso[0x1];
-	u8         reserved_at_23[0xd];
+	u8         cqe_checksum_full[0x1];
+	u8         reserved_at_24[0xc];
 	u8         max_vxlan_udp_ports[0x8];
 	u8         reserved_at_38[0x6];
 	u8         max_geneve_opt_len[0x1];
-- 
2.21.0


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

* [net 4/6] net/mlx5e: Fix return value from timeout recover function
  2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2019-07-11 18:54 ` [net 3/6] net/mlx5e: Rx, Fix checksum calculation for new hardware Saeed Mahameed
@ 2019-07-11 18:54 ` Saeed Mahameed
  2019-07-11 18:54 ` [net 5/6] net/mlx5e: Fix error flow in tx reporter diagnose Saeed Mahameed
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2019-07-11 18:54 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Aya Levin, Jiri Pirko, Tariq Toukan, Saeed Mahameed

From: Aya Levin <ayal@mellanox.com>

Fix timeout recover function to return a meaningful return value.
When an interrupt was not sent by the FW, return IO error instead of
'true'.

Fixes: c7981bea48fb ("net/mlx5e: Fix return status of TX reporter timeout recover")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index 476dd97f7f2f..a778c15e5324 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -142,22 +142,20 @@ static int mlx5e_tx_reporter_timeout_recover(struct mlx5e_txqsq *sq)
 {
 	struct mlx5_eq_comp *eq = sq->cq.mcq.eq;
 	u32 eqe_count;
-	int ret;
 
 	netdev_err(sq->channel->netdev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n",
 		   eq->core.eqn, eq->core.cons_index, eq->core.irqn);
 
 	eqe_count = mlx5_eq_poll_irq_disabled(eq);
-	ret = eqe_count ? false : true;
 	if (!eqe_count) {
 		clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
-		return ret;
+		return -EIO;
 	}
 
 	netdev_err(sq->channel->netdev, "Recover %d eqes on EQ 0x%x\n",
 		   eqe_count, eq->core.eqn);
 	sq->channel->stats->eq_rearm++;
-	return ret;
+	return 0;
 }
 
 int mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq)
-- 
2.21.0


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

* [net 5/6] net/mlx5e: Fix error flow in tx reporter diagnose
  2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2019-07-11 18:54 ` [net 4/6] net/mlx5e: Fix return value from timeout recover function Saeed Mahameed
@ 2019-07-11 18:54 ` Saeed Mahameed
  2019-07-11 18:54 ` [net 6/6] net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn Saeed Mahameed
  2019-07-11 22:08 ` [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2019-07-11 18:54 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Aya Levin, Tariq Toukan, Jiri Pirko, Saeed Mahameed

From: Aya Levin <ayal@mellanox.com>

Fix tx reporter's diagnose callback. Propagate error when failing to
gather diagnostics information or failing to print diagnostic data per
queue.

Fixes: de8650a82071 ("net/mlx5e: Add tx reporter support")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index a778c15e5324..f3d98748b211 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -262,13 +262,13 @@ static int mlx5e_tx_reporter_diagnose(struct devlink_health_reporter *reporter,
 
 		err = mlx5_core_query_sq_state(priv->mdev, sq->sqn, &state);
 		if (err)
-			break;
+			goto unlock;
 
 		err = mlx5e_tx_reporter_build_diagnose_output(fmsg, sq->sqn,
 							      state,
 							      netif_xmit_stopped(sq->txq));
 		if (err)
-			break;
+			goto unlock;
 	}
 	err = devlink_fmsg_arr_pair_nest_end(fmsg);
 	if (err)
-- 
2.21.0


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

* [net 6/6] net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn
  2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2019-07-11 18:54 ` [net 5/6] net/mlx5e: Fix error flow in tx reporter diagnose Saeed Mahameed
@ 2019-07-11 18:54 ` Saeed Mahameed
  2019-07-11 22:08 ` [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2019-07-11 18:54 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Aya Levin, Feras Daoud, Saeed Mahameed

From: Aya Levin <ayal@mellanox.com>

Check return value from mlx5e_attach_netdev, add error path on failure.

Fixes: 48935bbb7ae8 ("net/mlx5e: IPoIB, Add netdevice profile skeleton")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
index 9ca492b430d8..603d294757b4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
@@ -698,7 +698,9 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num,
 
 	prof->init(mdev, netdev, prof, ipriv);
 
-	mlx5e_attach_netdev(epriv);
+	err = mlx5e_attach_netdev(epriv);
+	if (err)
+		goto detach;
 	netif_carrier_off(netdev);
 
 	/* set rdma_netdev func pointers */
@@ -714,6 +716,11 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num,
 
 	return 0;
 
+detach:
+	prof->cleanup(epriv);
+	if (ipriv->sub_interface)
+		return err;
+	mlx5e_destroy_mdev_resources(mdev);
 destroy_ht:
 	mlx5i_pkey_qpn_ht_cleanup(netdev);
 	return err;
-- 
2.21.0


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

* Re: [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11
  2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2019-07-11 18:54 ` [net 6/6] net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn Saeed Mahameed
@ 2019-07-11 22:08 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2019-07-11 22:08 UTC (permalink / raw)
  To: saeedm; +Cc: netdev

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Thu, 11 Jul 2019 18:54:08 +0000

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

Pulled.

> For -stable v4.15
> ('net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn')
> 
> For -stable v5.1
> ('net/mlx5e: Fix port tunnel GRE entropy control')
> ('net/mlx5e: Rx, Fix checksum calculation for new hardware')
> ('net/mlx5e: Fix return value from timeout recover function')
> ('net/mlx5e: Fix error flow in tx reporter diagnose')
> 
> For -stable v5.2
> ('net/mlx5: E-Switch, Fix default encap mode')

Queued up.

> Conflict note: This pull request will produce a small conflict when
> merged with net-next.
> In drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> Take the hunk from net and replace:
> esw_offloads_steering_init(esw, vf_nvports, total_nvports);
> with:
> esw_offloads_steering_init(esw);

Thank you.

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

end of thread, other threads:[~2019-07-11 22:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 18:54 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 Saeed Mahameed
2019-07-11 18:54 ` [net 1/6] net/mlx5: E-Switch, Fix default encap mode Saeed Mahameed
2019-07-11 18:54 ` [net 2/6] net/mlx5e: Fix port tunnel GRE entropy control Saeed Mahameed
2019-07-11 18:54 ` [net 3/6] net/mlx5e: Rx, Fix checksum calculation for new hardware Saeed Mahameed
2019-07-11 18:54 ` [net 4/6] net/mlx5e: Fix return value from timeout recover function Saeed Mahameed
2019-07-11 18:54 ` [net 5/6] net/mlx5e: Fix error flow in tx reporter diagnose Saeed Mahameed
2019-07-11 18:54 ` [net 6/6] net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn Saeed Mahameed
2019-07-11 22:08 ` [pull request][net 0/6] Mellanox, mlx5 fixes 2019-07-11 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).