Skip to content

Commit 839443f

Browse files
Binary-Eatersmb49
authored andcommitted
net/mlx5e: Fix SQ wake logic in ptp napi_poll context
BugLink: https://bugs.launchpad.net/bugs/2028979 commit 7aa5038 upstream. Check in the mlx5e_ptp_poll_ts_cq context if the ptp tx sq should be woken up. Before change, the ptp tx sq may never wake up if the ptp tx ts skb fifo is full when mlx5e_poll_tx_cq checks if the queue should be woken up. Fixes: 1880bc4 ("net/mlx5e: Add TX port timestamp support") Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent ce7274b commit 839443f

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ static bool mlx5e_ptp_poll_ts_cq(struct mlx5e_cq *cq, int budget)
175175
/* ensure cq space is freed before enabling more cqes */
176176
wmb();
177177

178+
mlx5e_txqsq_wake(&ptpsq->txqsq);
179+
178180
return work_done == budget;
179181
}
180182

drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ static inline u16 mlx5e_txqsq_get_next_pi(struct mlx5e_txqsq *sq, u16 size)
177177
return pi;
178178
}
179179

180+
void mlx5e_txqsq_wake(struct mlx5e_txqsq *sq);
181+
180182
static inline u16 mlx5e_shampo_get_cqe_header_index(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
181183
{
182184
return be16_to_cpu(cqe->shampo.header_entry_index) & (rq->mpwqe.shampo->hd_per_wq - 1);

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,17 @@ static void mlx5e_tx_wi_consume_fifo_skbs(struct mlx5e_txqsq *sq, struct mlx5e_t
777777
}
778778
}
779779

780+
void mlx5e_txqsq_wake(struct mlx5e_txqsq *sq)
781+
{
782+
if (netif_tx_queue_stopped(sq->txq) &&
783+
mlx5e_wqc_has_room_for(&sq->wq, sq->cc, sq->pc, sq->stop_room) &&
784+
mlx5e_ptpsq_fifo_has_room(sq) &&
785+
!test_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) {
786+
netif_tx_wake_queue(sq->txq);
787+
sq->stats->wake++;
788+
}
789+
}
790+
780791
bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
781792
{
782793
struct mlx5e_sq_stats *stats;
@@ -876,13 +887,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
876887

877888
netdev_tx_completed_queue(sq->txq, npkts, nbytes);
878889

879-
if (netif_tx_queue_stopped(sq->txq) &&
880-
mlx5e_wqc_has_room_for(&sq->wq, sq->cc, sq->pc, sq->stop_room) &&
881-
mlx5e_ptpsq_fifo_has_room(sq) &&
882-
!test_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) {
883-
netif_tx_wake_queue(sq->txq);
884-
stats->wake++;
885-
}
890+
mlx5e_txqsq_wake(sq);
886891

887892
return (i == MLX5E_TX_CQ_POLL_BUDGET);
888893
}

0 commit comments

Comments
 (0)