summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_trigger.c
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2017-12-14 17:59:18 -0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-16 18:47:49 +0100
commitde48f16525e23cd04ee4c1c5b74392123529758a (patch)
tree42309a3142ca6d3e1b621fd3751dd4dfa2ad55b9 /drivers/net/mlx5/mlx5_trigger.c
parent3a6f2eb8c5c597d6675a8fbb9563010c0c546521 (diff)
downloaddpdk-de48f16525e23cd04ee4c1c5b74392123529758a.zip
dpdk-de48f16525e23cd04ee4c1c5b74392123529758a.tar.gz
dpdk-de48f16525e23cd04ee4c1c5b74392123529758a.tar.xz
net/mlx5: fix overflow of Memory Region cache
If there're more MR(Memroy Region)'s than the size of per-queue cache, the cache can be overflowed and corrupt the following data structure in mlx5_txq_data. Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_trigger.c')
-rw-r--r--drivers/net/mlx5/mlx5_trigger.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index ed80a6b..88f60a0 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -64,8 +64,11 @@ priv_txq_start(struct priv *priv)
if (!txq_ctrl)
continue;
- LIST_FOREACH(mr, &priv->mr, next)
+ LIST_FOREACH(mr, &priv->mr, next) {
priv_txq_mp2mr_reg(priv, &txq_ctrl->txq, mr->mp, idx++);
+ if (idx == MLX5_PMD_TX_MP_CACHE)
+ break;
+ }
txq_alloc_elts(txq_ctrl);
txq_ctrl->ibv = mlx5_priv_txq_ibv_new(priv, i);
if (!txq_ctrl->ibv) {