|
@@ -38,29 +38,6 @@
|
|
|
#define MLX5E_SQ_STOP_ROOM (MLX5_SEND_WQE_MAX_WQEBBS +\
|
|
|
MLX5E_SQ_NOPS_ROOM)
|
|
|
|
|
|
-void mlx5e_send_nop(struct mlx5e_sq *sq, bool notify_hw)
|
|
|
-{
|
|
|
- struct mlx5_wq_cyc *wq = &sq->wq;
|
|
|
-
|
|
|
- u16 pi = sq->pc & wq->sz_m1;
|
|
|
- struct mlx5e_tx_wqe *wqe = mlx5_wq_cyc_get_wqe(wq, pi);
|
|
|
-
|
|
|
- struct mlx5_wqe_ctrl_seg *cseg = &wqe->ctrl;
|
|
|
-
|
|
|
- memset(cseg, 0, sizeof(*cseg));
|
|
|
-
|
|
|
- cseg->opmod_idx_opcode = cpu_to_be32((sq->pc << 8) | MLX5_OPCODE_NOP);
|
|
|
- cseg->qpn_ds = cpu_to_be32((sq->sqn << 8) | 0x01);
|
|
|
-
|
|
|
- sq->pc++;
|
|
|
- sq->stats.nop++;
|
|
|
-
|
|
|
- if (notify_hw) {
|
|
|
- cseg->fm_ce_se = MLX5_WQE_CTRL_CQ_UPDATE;
|
|
|
- mlx5e_tx_notify_hw(sq, &wqe->ctrl);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
static inline void mlx5e_tx_dma_unmap(struct device *pdev,
|
|
|
struct mlx5e_sq_dma *dma)
|
|
|
{
|
|
@@ -331,21 +308,21 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
|
|
|
if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP))
|
|
|
skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
|
|
|
|
|
|
- if (unlikely(!mlx5e_sq_has_room_for(sq, MLX5E_SQ_STOP_ROOM))) {
|
|
|
+ if (unlikely(!mlx5e_wqc_has_room_for(&sq->wq, sq->cc, sq->pc,
|
|
|
+ MLX5E_SQ_STOP_ROOM))) {
|
|
|
netif_tx_stop_queue(sq->txq);
|
|
|
sq->stats.stopped++;
|
|
|
}
|
|
|
|
|
|
sq->stats.xmit_more += skb->xmit_more;
|
|
|
- if (!skb->xmit_more || netif_xmit_stopped(sq->txq)) {
|
|
|
- cseg->fm_ce_se = MLX5_WQE_CTRL_CQ_UPDATE;
|
|
|
- mlx5e_tx_notify_hw(sq, &wqe->ctrl);
|
|
|
- }
|
|
|
+ if (!skb->xmit_more || netif_xmit_stopped(sq->txq))
|
|
|
+ mlx5e_notify_hw(wq, sq->pc, sq->uar_map, cseg);
|
|
|
|
|
|
/* fill sq edge with nops to avoid wqe wrap around */
|
|
|
while ((pi = (sq->pc & wq->sz_m1)) > sq->edge) {
|
|
|
sq->db.txq.skb[pi] = NULL;
|
|
|
- mlx5e_send_nop(sq, false);
|
|
|
+ mlx5e_post_nop(&sq->wq, sq->sqn, &sq->pc);
|
|
|
+ sq->stats.nop++;
|
|
|
}
|
|
|
|
|
|
return NETDEV_TX_OK;
|
|
@@ -456,7 +433,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
|
|
|
netdev_tx_completed_queue(sq->txq, npkts, nbytes);
|
|
|
|
|
|
if (netif_tx_queue_stopped(sq->txq) &&
|
|
|
- mlx5e_sq_has_room_for(sq, MLX5E_SQ_STOP_ROOM)) {
|
|
|
+ mlx5e_wqc_has_room_for(&sq->wq, sq->cc, sq->pc, MLX5E_SQ_STOP_ROOM)) {
|
|
|
netif_tx_wake_queue(sq->txq);
|
|
|
sq->stats.wake++;
|
|
|
}
|