Commit 0e5ad75b authored by Ioana Ciornei's avatar Ioana Ciornei Committed by David S. Miller

dpaa2-eth: fix condition for number of buffer acquire retries

We should keep retrying to acquire buffers through the software portals
as long as the function returns -EBUSY and the number of retries is
__below__ DPAA2_ETH_SWP_BUSY_RETRIES.

Fixes: ef17bd7c ("dpaa2-eth: Avoid unbounded while loops")
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 37fbbdda
...@@ -1113,7 +1113,7 @@ static void drain_bufs(struct dpaa2_eth_priv *priv, int count) ...@@ -1113,7 +1113,7 @@ static void drain_bufs(struct dpaa2_eth_priv *priv, int count)
buf_array, count); buf_array, count);
if (ret < 0) { if (ret < 0) {
if (ret == -EBUSY && if (ret == -EBUSY &&
retries++ >= DPAA2_ETH_SWP_BUSY_RETRIES) retries++ < DPAA2_ETH_SWP_BUSY_RETRIES)
continue; continue;
netdev_err(priv->net_dev, "dpaa2_io_service_acquire() failed\n"); netdev_err(priv->net_dev, "dpaa2_io_service_acquire() failed\n");
return; return;
......
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