On 5/27/2020 2:22 PM, Hemant Agrawal wrote: > From: Nipun Gupta <nipun.gu...@nxp.com> > > The patch reworks the portal allocation which was previously > being done on per lcore basis to a per thread basis. > Now user can also create its own threads and use DPAA2 portals > for packet I/O. > > Signed-off-by: Nipun Gupta <nipun.gu...@nxp.com>
<...> > @@ -229,7 +264,7 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, > int lcoreid) > return 0; > } > > -static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int lcoreid) > +static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void) > { > struct dpaa2_dpio_dev *dpio_dev = NULL; > int ret; > @@ -245,108 +280,83 @@ static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int > lcoreid) > DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %lu", > dpio_dev, dpio_dev->index, syscall(SYS_gettid)); > > - ret = dpaa2_configure_stashing(dpio_dev, lcoreid); > - if (ret) > + ret = dpaa2_configure_stashing(dpio_dev); > + if (ret) { > DPAA2_BUS_ERR("dpaa2_configure_stashing failed"); > + 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; > } > > +static void dpaa2_put_qbman_swp(struct dpaa2_dpio_dev *dpio_dev) > +{ > +#ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV > + dpaa2_dpio_intr_deinit(dpio_dev); > +#endif > + if (dpio_dev) > + rte_atomic16_clear(&dpio_dev->ref_count); > +} There is a build error on patch by patch build [1], just moving 'dpaa2_put_qbman_swp()' static function above the 'dpaa2_get_qbman_swp()' (where it is used) solves it, and indeed next patch does it. If you will make a new version can you please fix it, if there will be no new version I can do while merging. [1] .../drivers/bus/fslmc/portal/dpaa2_hw_dpio.c:292:3: error: implicit declaration of function 'dpaa2_put_qbman_swp' is invalid in C99 [-Werror,-Wimplicit-function-declaration] dpaa2_put_qbman_swp(dpio_dev); ^ .../drivers/bus/fslmc/portal/dpaa2_hw_dpio.c:292:3: note: did you mean 'dpaa2_get_qbman_swp'? .../drivers/bus/fslmc/portal/dpaa2_hw_dpio.c:267:31: note: 'dpaa2_get_qbman_swp' declared here static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void) ^ .../drivers/bus/fslmc/portal/dpaa2_hw_dpio.c:299:13: error: static declaration of 'dpaa2_put_qbman_swp' follows non-static declaration static void dpaa2_put_qbman_swp(struct dpaa2_dpio_dev *dpio_dev) ^ .../drivers/bus/fslmc/portal/dpaa2_hw_dpio.c:292:3: note: previous implicit declaration is here dpaa2_put_qbman_swp(dpio_dev); <...>