Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Alex Vesker <valex@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 05/14] net/mlx5e: IPoIB, Modify add/remove underlay QPN flows
Date: Thu, 27 Jul 2017 13:25:23 +0300	[thread overview]
Message-ID: <20170727102532.2317-6-saeedm@mellanox.com> (raw)
In-Reply-To: <20170727102532.2317-1-saeedm@mellanox.com>

From: Alex Vesker <valex@mellanox.com>

On interface remove, the clean-up was done incorrectly causing
an error in the log:
"SET_FLOW_TABLE_ROOT(0x92f) op_mod(0x0) failed...syndrome (0x7e9f14)"

This was caused by the following flow:
-ndo_uninit:
 Move QP state to RST (this disconnects the QP from FT),
 the QP cannot be attached to any FT unless it is in RTS.

-mlx5_rdma_netdev_free:
 cleanup_rx: Destroy FT
 cleanup_tx: Destroy QP and remove QPN from FT

This caused a problem when destroying current FT we tried to
re-attach the QP to the next FT which is not needed.

The correct flow is:
-mlx5_rdma_netdev_free:
	cleanup_rx: remove QPN from FT & Destroy FT
	cleanup_tx: Destroy QP

Fixes: 508541146af1 ("net/mlx5: Use underlay QPN from the root name space")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
index 1ee5bce85901..85298051a3e4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
@@ -178,8 +178,6 @@ static int mlx5i_create_underlay_qp(struct mlx5_core_dev *mdev, struct mlx5_core
 
 static void mlx5i_destroy_underlay_qp(struct mlx5_core_dev *mdev, struct mlx5_core_qp *qp)
 {
-	mlx5_fs_remove_rx_underlay_qpn(mdev, qp->qpn);
-
 	mlx5_core_destroy_qp(mdev, qp);
 }
 
@@ -194,8 +192,6 @@ static int mlx5i_init_tx(struct mlx5e_priv *priv)
 		return err;
 	}
 
-	mlx5_fs_add_rx_underlay_qpn(priv->mdev, ipriv->qp.qpn);
-
 	err = mlx5e_create_tis(priv->mdev, 0 /* tc */, ipriv->qp.qpn, &priv->tisn[0]);
 	if (err) {
 		mlx5_core_warn(priv->mdev, "create tis failed, %d\n", err);
@@ -253,6 +249,7 @@ static void mlx5i_destroy_flow_steering(struct mlx5e_priv *priv)
 
 static int mlx5i_init_rx(struct mlx5e_priv *priv)
 {
+	struct mlx5i_priv *ipriv  = priv->ppriv;
 	int err;
 
 	err = mlx5e_create_indirect_rqt(priv);
@@ -271,12 +268,18 @@ static int mlx5i_init_rx(struct mlx5e_priv *priv)
 	if (err)
 		goto err_destroy_indirect_tirs;
 
-	err = mlx5i_create_flow_steering(priv);
+	err = mlx5_fs_add_rx_underlay_qpn(priv->mdev, ipriv->qp.qpn);
 	if (err)
 		goto err_destroy_direct_tirs;
 
+	err = mlx5i_create_flow_steering(priv);
+	if (err)
+		goto err_remove_rx_underlay_qpn;
+
 	return 0;
 
+err_remove_rx_underlay_qpn:
+	mlx5_fs_remove_rx_underlay_qpn(priv->mdev, ipriv->qp.qpn);
 err_destroy_direct_tirs:
 	mlx5e_destroy_direct_tirs(priv);
 err_destroy_indirect_tirs:
@@ -290,6 +293,9 @@ static int mlx5i_init_rx(struct mlx5e_priv *priv)
 
 static void mlx5i_cleanup_rx(struct mlx5e_priv *priv)
 {
+	struct mlx5i_priv *ipriv  = priv->ppriv;
+
+	mlx5_fs_remove_rx_underlay_qpn(priv->mdev, ipriv->qp.qpn);
 	mlx5i_destroy_flow_steering(priv);
 	mlx5e_destroy_direct_tirs(priv);
 	mlx5e_destroy_indirect_tirs(priv);
-- 
2.13.0

  parent reply	other threads:[~2017-07-27 10:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 10:25 [pull request][net 00/14] Mellanox, mlx5 fixes 2017-07-27 Saeed Mahameed
2017-07-27 10:25 ` [net 01/14] net/mlx5: Clean SRIOV eswitch resources upon VF creation failure Saeed Mahameed
2017-07-27 10:25 ` [net 02/14] net/mlx5: Consider tx_enabled in all modes on remap Saeed Mahameed
2017-07-27 11:55   ` Sergei Shtylyov
2017-07-27 13:33     ` Saeed Mahameed
2017-07-27 10:25 ` [net 03/14] net/mlx5: Fix command completion after timeout access invalid structure Saeed Mahameed
2017-07-27 10:25 ` [net 04/14] net/mlx5: Fix command bad flow on command entry allocation failure Saeed Mahameed
2017-07-27 10:25 ` Saeed Mahameed [this message]
2017-07-27 10:25 ` [net 06/14] net/mlx5e: Fix outer_header_zero() check size Saeed Mahameed
2017-07-27 10:25 ` [net 07/14] net/mlx5: Fix mlx5_ifc_mtpps_reg_bits structure size Saeed Mahameed
2017-07-27 10:25 ` [net 08/14] net/mlx5e: Add field select to MTPPS register Saeed Mahameed
2017-07-27 10:25 ` [net 09/14] net/mlx5e: Fix broken disable 1PPS flow Saeed Mahameed
2017-07-27 10:25 ` [net 10/14] net/mlx5e: Change 1PPS out scheme Saeed Mahameed
2017-07-27 10:25 ` [net 11/14] net/mlx5e: Add missing support for PTP_CLK_REQ_PPS request Saeed Mahameed
2017-07-27 10:25 ` [net 12/14] net/mlx5e: Fix wrong delay calculation for overflow check scheduling Saeed Mahameed
2017-07-27 10:25 ` [net 13/14] net/mlx5e: Schedule overflow check work to mlx5e workqueue Saeed Mahameed
2017-07-27 10:25 ` [net 14/14] net/mlx5: Fix mlx5_add_flow_rules call with correct num of dests Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170727102532.2317-6-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=valex@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox