net/mlx5: fix index handling for Tx ring
authorYongseok Koh <yskoh@mellanox.com>
Tue, 9 May 2017 20:49:30 +0000 (13:49 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 10 May 2017 16:04:55 +0000 (18:04 +0200)
commitac180a21f621fd2f8c8af97d6fa1e36f8bcebc1f
tree67bf2ac499c72a08594cc915fb6b12c4169b543f
parent491681ed63d52706b4840b7379dcff2be9333203
net/mlx5: fix index handling for Tx ring

In case of resource deficiency on Tx, mlx5_tx_burst() breaks the loop
without rolling back consumed resources (txq->wqes[] and txq->elts[]). This
can make application crash because unposted mbufs can be freed while
processing completions. Other Tx functions don't have this issue.

Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
Fixes: f04f1d51564b ("net/mlx5: fix Tx WQE corruption caused by starvation")
Cc: stable@dpdk.org
Reported-by: Hanoch Haim <hhaim@cisco.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx5/mlx5_rxtx.c