* [PATCH] net/mlx5: fix device stop with multiple regions
@ 2017-10-25 14:04 Nelio Laranjeiro
2017-10-25 21:56 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Nelio Laranjeiro @ 2017-10-25 14:04 UTC (permalink / raw)
To: dev; +Cc: Yongseok Koh, Adrien Mazarguil, Shahaf Shuler
LIST macro are not safe when inside a LIST_FOREACH() a LIST_REMOVE() is
called to remove an entry, this behavior is undefined causing some entries
to disappear from the list.
Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
drivers/net/mlx5/mlx5_trigger.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 982d0a24d..5de2d026e 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -188,7 +188,7 @@ mlx5_dev_start(struct rte_eth_dev *dev)
error:
/* Rollback. */
dev->data->dev_started = 0;
- LIST_FOREACH(mr, &priv->mr, next)
+ for (mr = LIST_FIRST(&priv->mr); mr; mr = LIST_FIRST(&priv->mr))
priv_mr_release(priv, mr);
priv_flow_stop(priv, &priv->flows);
priv_dev_traffic_disable(priv, dev);
@@ -230,9 +230,8 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
priv_dev_interrupt_handler_uninstall(priv, dev);
priv_txq_stop(priv);
priv_rxq_stop(priv);
- LIST_FOREACH(mr, &priv->mr, next) {
+ for (mr = LIST_FIRST(&priv->mr); mr; mr = LIST_FIRST(&priv->mr))
priv_mr_release(priv, mr);
- }
priv_flow_delete_drop_queue(priv);
priv_unlock(priv);
}
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net/mlx5: fix device stop with multiple regions
2017-10-25 14:04 [PATCH] net/mlx5: fix device stop with multiple regions Nelio Laranjeiro
@ 2017-10-25 21:56 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-10-25 21:56 UTC (permalink / raw)
To: Nelio Laranjeiro, dev; +Cc: Yongseok Koh, Adrien Mazarguil, Shahaf Shuler
On 10/25/2017 7:04 AM, Nelio Laranjeiro wrote:
> LIST macro are not safe when inside a LIST_FOREACH() a LIST_REMOVE() is
> called to remove an entry, this behavior is undefined causing some entries
> to disappear from the list.
>
> Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")
>
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-25 21:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-25 14:04 [PATCH] net/mlx5: fix device stop with multiple regions Nelio Laranjeiro
2017-10-25 21:56 ` Ferruh Yigit
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.