Skip to content

Commit 5e911e2

Browse files
Moshe ShemeshSaeed Mahameed
authored andcommitted
net/mlx5e: Update netdev txq on completions during closure
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: 29429f3 ("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>
1 parent 9ca4153 commit 5e911e2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,9 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
537537
void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
538538
{
539539
struct mlx5e_tx_wqe_info *wi;
540+
u32 dma_fifo_cc, nbytes = 0;
541+
u16 ci, sqcc, npkts = 0;
540542
struct sk_buff *skb;
541-
u32 dma_fifo_cc;
542-
u16 sqcc;
543-
u16 ci;
544543
int i;
545544

546545
sqcc = sq->cc;
@@ -565,11 +564,15 @@ void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
565564
}
566565

567566
dev_kfree_skb_any(skb);
567+
npkts++;
568+
nbytes += wi->num_bytes;
568569
sqcc += wi->num_wqebbs;
569570
}
570571

571572
sq->dma_fifo_cc = dma_fifo_cc;
572573
sq->cc = sqcc;
574+
575+
netdev_tx_completed_queue(sq->txq, npkts, nbytes);
573576
}
574577

575578
#ifdef CONFIG_MLX5_CORE_IPOIB

0 commit comments

Comments
 (0)