Skip to content

Commit aaab619

Browse files
dtatuleaSaeed Mahameed
authored andcommitted
net/mlx5e: XDP, Fix XDP_REDIRECT mpwqe page fragment leaks on shutdown
When mlx5e_xdp_xmit is called without the XDP_XMIT_FLUSH set it is possible that it leaves a mpwqe session open. That is ok during runtime: the session will be closed on the next call to mlx5e_xdp_xmit. But having a mpwqe session still open at XDP sq close time is problematic: the pc counter is not updated before flushing the contents of the xdpi_fifo. This results in leaking page fragments. The fix is to always close the mpwqe session at the end of mlx5e_xdp_xmit, regardless of the XDP_XMIT_FLUSH flag being set or not. Fixes: 5e0d2ee ("net/mlx5e: XDP, Support Enhanced Multi-Packet TX WQE") Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent ef9369e commit aaab619

File tree

1 file changed

+4
-4
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -874,11 +874,11 @@ int mlx5e_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
874874
}
875875

876876
out:
877-
if (flags & XDP_XMIT_FLUSH) {
878-
if (sq->mpwqe.wqe)
879-
mlx5e_xdp_mpwqe_complete(sq);
877+
if (sq->mpwqe.wqe)
878+
mlx5e_xdp_mpwqe_complete(sq);
879+
880+
if (flags & XDP_XMIT_FLUSH)
880881
mlx5e_xmit_xdp_doorbell(sq);
881-
}
882882

883883
return nxmit;
884884
}

0 commit comments

Comments
 (0)