[06/16] bus/fslmc: limit pthread destructor called for dpaa2 only
Checks
Commit Message
From: Nipun Gupta <nipun.gupta@nxp.com>
The destructor was being called for non-dpaa2 as well
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
@@ -299,6 +299,13 @@ static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void)
return NULL;
}
+ ret = pthread_setspecific(dpaa2_portal_key, (void *)dpio_dev);
+ if (ret) {
+ DPAA2_BUS_ERR("pthread_setspecific failed with ret: %d", ret);
+ dpaa2_put_qbman_swp(dpio_dev);
+ return NULL;
+ }
+
return dpio_dev;
}
@@ -346,12 +353,14 @@ dpaa2_affine_qbman_ethrx_swp(void)
return 0;
}
-static void __attribute__((destructor(102))) dpaa2_portal_finish(void *arg)
+static void dpaa2_portal_finish(void *arg)
{
RTE_SET_USED(arg);
dpaa2_put_qbman_swp(RTE_PER_LCORE(_dpaa2_io).dpio_dev);
dpaa2_put_qbman_swp(RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev);
+
+ pthread_setspecific(dpaa2_portal_key, NULL);
}
/*