summaryrefslogtreecommitdiff
path: root/drivers/mempool
diff options
context:
space:
mode:
authorNipun Gupta <nipun.gupta@nxp.com>2018-01-23 17:57:06 +0530
committerThomas Monjalon <thomas@monjalon.net>2018-01-31 13:44:54 +0100
commit5d944582d0282f0d133619cff7515d89bc4ed216 (patch)
treeaaa8ad740ee4a4052550d61c30339c9a31894597 /drivers/mempool
parent41c9ee8d113a6c55d19248d20ec517d2bf3be043 (diff)
downloaddpdk-5d944582d0282f0d133619cff7515d89bc4ed216.zip
dpdk-5d944582d0282f0d133619cff7515d89bc4ed216.tar.gz
dpdk-5d944582d0282f0d133619cff7515d89bc4ed216.tar.xz
bus/dpaa: check portal presence in the caller function
In the I/O path we were calling rte_dpaa_portal_init which internally checks if a portal is affined to the core. But this lead to calling of that non-static API in every call. Instead check the portal affinity in the caller itself for performance reasons Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Diffstat (limited to 'drivers/mempool')
-rw-r--r--drivers/mempool/dpaa/dpaa_mempool.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index c880d4f..fb3b6ba 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -139,11 +139,13 @@ dpaa_mbuf_free_bulk(struct rte_mempool *pool,
DPAA_MEMPOOL_DPDEBUG("Request to free %d buffers in bpid = %d",
n, bp_info->bpid);
- ret = rte_dpaa_portal_init((void *)0);
- if (ret) {
- DPAA_MEMPOOL_ERR("rte_dpaa_portal_init failed with ret: %d",
- ret);
- return 0;
+ if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+ ret = rte_dpaa_portal_init((void *)0);
+ if (ret) {
+ DPAA_MEMPOOL_ERR("rte_dpaa_portal_init failed with ret: %d",
+ ret);
+ return 0;
+ }
}
while (i < n) {
@@ -193,11 +195,13 @@ dpaa_mbuf_alloc_bulk(struct rte_mempool *pool,
return -1;
}
- ret = rte_dpaa_portal_init((void *)0);
- if (ret) {
- DPAA_MEMPOOL_ERR("rte_dpaa_portal_init failed with ret: %d",
- ret);
- return -1;
+ if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+ ret = rte_dpaa_portal_init((void *)0);
+ if (ret) {
+ DPAA_MEMPOOL_ERR("rte_dpaa_portal_init failed with ret: %d",
+ ret);
+ return -1;
+ }
}
while (n < count) {