Commit b8180392 authored by Tariq Toukan's avatar Tariq Toukan Committed by Saeed Mahameed

net/mlx5e: XDP, Replace boolean doorbell indication with segment pointer

Instead of calculating the control segment to be used upon an
XDP xmit doorbell, save it in SQ structure.
Nullify when no pending doorbell.
Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent db02a308
...@@ -413,7 +413,7 @@ struct mlx5e_xdpsq { ...@@ -413,7 +413,7 @@ struct mlx5e_xdpsq {
/* dirtied @xmit */ /* dirtied @xmit */
u16 pc ____cacheline_aligned_in_smp; u16 pc ____cacheline_aligned_in_smp;
bool doorbell; struct mlx5_wqe_ctrl_seg *doorbell_cseg;
struct mlx5e_cq cq; struct mlx5e_cq cq;
......
...@@ -126,11 +126,8 @@ bool mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xdp_info *xdpi) ...@@ -126,11 +126,8 @@ bool mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xdp_info *xdpi)
} }
if (unlikely(!mlx5e_wqc_has_room_for(wq, sq->cc, sq->pc, 1))) { if (unlikely(!mlx5e_wqc_has_room_for(wq, sq->cc, sq->pc, 1))) {
if (sq->doorbell) { /* SQ is full, ring doorbell */
/* SQ is full, ring doorbell */ mlx5e_xmit_xdp_doorbell(sq);
mlx5e_xmit_xdp_doorbell(sq);
sq->doorbell = false;
}
stats->full++; stats->full++;
return false; return false;
} }
...@@ -158,7 +155,7 @@ bool mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xdp_info *xdpi) ...@@ -158,7 +155,7 @@ bool mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xdp_info *xdpi)
sq->db.xdpi[pi] = *xdpi; sq->db.xdpi[pi] = *xdpi;
sq->pc++; sq->pc++;
sq->doorbell = true; sq->doorbell_cseg = cseg;
stats->xmit++; stats->xmit++;
return true; return true;
...@@ -309,10 +306,7 @@ void mlx5e_xdp_rx_poll_complete(struct mlx5e_rq *rq) ...@@ -309,10 +306,7 @@ void mlx5e_xdp_rx_poll_complete(struct mlx5e_rq *rq)
{ {
struct mlx5e_xdpsq *xdpsq = &rq->xdpsq; struct mlx5e_xdpsq *xdpsq = &rq->xdpsq;
if (xdpsq->doorbell) { mlx5e_xmit_xdp_doorbell(xdpsq);
mlx5e_xmit_xdp_doorbell(xdpsq);
xdpsq->doorbell = false;
}
if (xdpsq->redirect_flush) { if (xdpsq->redirect_flush) {
xdp_do_flush_map(); xdp_do_flush_map();
......
...@@ -51,13 +51,10 @@ int mlx5e_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames, ...@@ -51,13 +51,10 @@ int mlx5e_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
static inline void mlx5e_xmit_xdp_doorbell(struct mlx5e_xdpsq *sq) static inline void mlx5e_xmit_xdp_doorbell(struct mlx5e_xdpsq *sq)
{ {
struct mlx5_wq_cyc *wq = &sq->wq; if (sq->doorbell_cseg) {
struct mlx5e_tx_wqe *wqe; mlx5e_notify_hw(&sq->wq, sq->pc, sq->uar_map, sq->doorbell_cseg);
u16 pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc - 1); /* last pi */ sq->doorbell_cseg = NULL;
}
wqe = mlx5_wq_cyc_get_wqe(wq, pi);
mlx5e_notify_hw(wq, sq->pc, sq->uar_map, &wqe->ctrl);
} }
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment