summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadu Bulie <radu-andrei.bulie@nxp.com>2019-11-05 19:53:19 +0530
committerThomas Monjalon <thomas@monjalon.net>2019-11-06 01:14:28 +0100
commitf0617163b8d2678371d0c93926cebb6c1e7981d7 (patch)
treedef9b89e30be4d0b6a26d9b8b15a9899164f87d1
parent0da362b8f9236e32c3ca70ac3e1b32d1110f37e8 (diff)
downloaddpdk-f0617163b8d2678371d0c93926cebb6c1e7981d7.zip
dpdk-f0617163b8d2678371d0c93926cebb6c1e7981d7.tar.gz
dpdk-f0617163b8d2678371d0c93926cebb6c1e7981d7.tar.xz
mempool/dpaa2: report error on endless loop in mbuf release
When BMAN is not able to accept more buffers, it could be that there are no FBPR's (internal mem provided to bman) left. Report error in such condition. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
-rw-r--r--drivers/mempool/dpaa2/dpaa2_hw_mempool.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index f26c30b..cc4f837 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
struct qbman_release_desc releasedesc;
struct qbman_swp *swp;
int ret;
- int i, n;
+ int i, n, retry_count;
uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL];
if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
@@ -225,9 +225,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
}
/* feed them to bman */
- do {
- ret = qbman_swp_release(swp, &releasedesc, bufs, n);
- } while (ret == -EBUSY);
+ retry_count = 0;
+ while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) ==
+ -EBUSY) {
+ retry_count++;
+ if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+ DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
+ return;
+ }
+ }
aligned:
/* if there are more buffers to free */
@@ -243,10 +249,15 @@ aligned:
#endif
}
- do {
- ret = qbman_swp_release(swp, &releasedesc, bufs,
- DPAA2_MBUF_MAX_ACQ_REL);
- } while (ret == -EBUSY);
+ retry_count = 0;
+ while ((ret = qbman_swp_release(swp, &releasedesc, bufs,
+ DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) {
+ retry_count++;
+ if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+ DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
+ return;
+ }
+ }
n += DPAA2_MBUF_MAX_ACQ_REL;
}
}