netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>, kuba@kernel.org
Cc: netdev@vger.kernel.org, Moshe Shemesh <moshe@mellanox.com>,
	Tariq Toukan <tariqt@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 11/13] net/mlx5e: Update netdev txq on completions during closure
Date: Fri, 22 May 2020 17:40:47 -0700	[thread overview]
Message-ID: <20200523004049.34832-12-saeedm@mellanox.com> (raw)
In-Reply-To: <20200523004049.34832-1-saeedm@mellanox.com>

From: Moshe Shemesh <moshe@mellanox.com>

On sq closure when we free its descriptors, we should also update netdev
txq on completions which would not arrive. Otherwise if we reopen sqs
and attach them back, for example on fw fatal recovery flow, we may get
tx timeout.

Fixes: 29429f3300a3 ("net/mlx5e: Timeout if SQ doesn't flush during close")
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_tx.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index fd6b2a1898c5..119a5c6cc167 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -537,10 +537,9 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
 void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
 {
 	struct mlx5e_tx_wqe_info *wi;
+	u32 dma_fifo_cc, nbytes = 0;
+	u16 ci, sqcc, npkts = 0;
 	struct sk_buff *skb;
-	u32 dma_fifo_cc;
-	u16 sqcc;
-	u16 ci;
 	int i;
 
 	sqcc = sq->cc;
@@ -565,11 +564,15 @@ void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
 		}
 
 		dev_kfree_skb_any(skb);
+		npkts++;
+		nbytes += wi->num_bytes;
 		sqcc += wi->num_wqebbs;
 	}
 
 	sq->dma_fifo_cc = dma_fifo_cc;
 	sq->cc = sqcc;
+
+	netdev_tx_completed_queue(sq->txq, npkts, nbytes);
 }
 
 #ifdef CONFIG_MLX5_CORE_IPOIB
-- 
2.25.4


  parent reply	other threads:[~2020-05-23  0:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23  0:40 [pull request][net 00/13] mlx5 fixes 2020-05-22 Saeed Mahameed
2020-05-23  0:40 ` [net 01/13] net/mlx5: Add command entry handling completion Saeed Mahameed
2020-05-23  0:40 ` [net 02/13] net/mlx5: Fix a race when moving command interface to events mode Saeed Mahameed
2020-05-23  0:40 ` [net 03/13] net/mlx5: Avoid processing commands before cmdif is ready Saeed Mahameed
2020-05-23  0:40 ` [net 04/13] net/mlx5e: Fix allowed tc redirect merged eswitch offload cases Saeed Mahameed
2020-05-23  0:40 ` [net 05/13] net/mlx5e: kTLS, Destroy key object after destroying the TIS Saeed Mahameed
2020-05-23  0:40 ` [net 06/13] net/mlx5e: Fix inner tirs handling Saeed Mahameed
2020-05-23  0:40 ` [net 07/13] net/mlx5: Fix memory leak in mlx5_events_init Saeed Mahameed
2020-05-23  0:40 ` [net 08/13] net/mlx5: Fix cleaning unmanaged flow tables Saeed Mahameed
2020-05-23  0:40 ` [net 09/13] net/mlx5: Don't maintain a case of del_sw_func being null Saeed Mahameed
2020-05-23  0:40 ` [net 10/13] net/mlx5: Annotate mutex destroy for root ns Saeed Mahameed
2020-05-23  0:40 ` Saeed Mahameed [this message]
2020-05-23  0:40 ` [net 12/13] net/mlx5e: CT: Correctly get flow rule Saeed Mahameed
2020-05-23  0:40 ` [net 13/13] net/mlx5: Fix error flow in case of function_setup failure Saeed Mahameed
2020-05-23 23:47 ` [pull request][net 00/13] mlx5 fixes 2020-05-22 David Miller

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=20200523004049.34832-12-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=moshe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@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;
as well as URLs for NNTP newsgroup(s).