mempool/dpaa2: fix error code for allocation failure
In case the alloc api is not able to allocate the required number of buffer, it can return '0', which will not indicate the failure to the calling function. This patch fix the return value to indicate the failure. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Reviewed-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
This commit is contained in:
parent
6a60f7de06
commit
6ed4390e5e
@ -300,7 +300,7 @@ rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool,
|
|||||||
/* Releasing all buffers allocated */
|
/* Releasing all buffers allocated */
|
||||||
rte_dpaa2_mbuf_release(pool, obj_table, bpid,
|
rte_dpaa2_mbuf_release(pool, obj_table, bpid,
|
||||||
bp_info->meta_data_size, n);
|
bp_info->meta_data_size, n);
|
||||||
return ret;
|
return -ENOBUFS;
|
||||||
}
|
}
|
||||||
/* assigning mbuf from the acquired objects */
|
/* assigning mbuf from the acquired objects */
|
||||||
for (i = 0; (i < ret) && bufs[i]; i++) {
|
for (i = 0; (i < ret) && bufs[i]; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user