app/testpmd: fix L4 checksum in multi-segments
[dpdk.git] / drivers / mempool / dpaa / dpaa_mempool.c
index c371d3a..32639a3 100644 (file)
@@ -37,6 +37,8 @@ struct dpaa_memseg_list rte_dpaa_memsegs
 
 struct dpaa_bp_info *rte_dpaa_bpid_info;
 
+RTE_LOG_REGISTER_DEFAULT(dpaa_logtype_mempool, NOTICE);
+
 static int
 dpaa_mbuf_create_pool(struct rte_mempool *mp)
 {
@@ -51,7 +53,7 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp)
 
        MEMPOOL_INIT_FUNC_TRACE();
 
-       if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+       if (unlikely(!DPAA_PER_LCORE_PORTAL)) {
                ret = rte_dpaa_portal_init((void *)0);
                if (ret) {
                        DPAA_MEMPOOL_ERR(
@@ -132,6 +134,7 @@ dpaa_mbuf_free_pool(struct rte_mempool *mp)
                DPAA_MEMPOOL_INFO("BMAN pool freed for bpid =%d",
                                  bp_info->bpid);
                rte_free(mp->pool_data);
+               bp_info->bp = NULL;
                mp->pool_data = NULL;
        }
 }
@@ -167,7 +170,7 @@ dpaa_mbuf_free_bulk(struct rte_mempool *pool,
        DPAA_MEMPOOL_DPDEBUG("Request to free %d buffers in bpid = %d",
                             n, bp_info->bpid);
 
-       if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+       if (unlikely(!DPAA_PER_LCORE_PORTAL)) {
                ret = rte_dpaa_portal_init((void *)0);
                if (ret) {
                        DPAA_MEMPOOL_ERR("rte_dpaa_portal_init failed with ret: %d",
@@ -222,7 +225,7 @@ dpaa_mbuf_alloc_bulk(struct rte_mempool *pool,
                return -1;
        }
 
-       if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+       if (unlikely(!DPAA_PER_LCORE_PORTAL)) {
                ret = rte_dpaa_portal_init((void *)0);
                if (ret) {
                        DPAA_MEMPOOL_ERR("rte_dpaa_portal_init failed with ret: %d",
@@ -255,7 +258,7 @@ dpaa_mbuf_alloc_bulk(struct rte_mempool *pool,
                }
                /* assigning mbuf from the acquired objects */
                for (i = 0; (i < ret) && bufs[i].addr; i++) {
-                       /* TODO-errata - objerved that bufs may be null
+                       /* TODO-errata - observed that bufs may be null
                         * i.e. first buffer is valid, remaining 6 buffers
                         * may be null.
                         */
@@ -298,8 +301,6 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs,
        struct dpaa_bp_info *bp_info;
        unsigned int total_elt_sz;
 
-       MEMPOOL_INIT_FUNC_TRACE();
-
        if (!mp || !mp->pool_data) {
                DPAA_MEMPOOL_ERR("Invalid mempool provided\n");
                return 0;
@@ -311,7 +312,7 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs,
        bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp);
        total_elt_sz = mp->header_size + mp->elt_size + mp->trailer_size;
 
-       DPAA_MEMPOOL_DEBUG("Req size %" PRIx64 " vs Available %u\n",
+       DPAA_MEMPOOL_DPDEBUG("Req size %" PRIx64 " vs Available %u\n",
                           (uint64_t)len, total_elt_sz * mp->size);
 
        /* Detect pool area has sufficient space for elements in this memzone */
@@ -343,8 +344,8 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs,
         */
        TAILQ_INSERT_HEAD(&rte_dpaa_memsegs, ms, next);
 
-       return rte_mempool_op_populate_default(mp, max_objs, vaddr, paddr, len,
-                                              obj_cb, obj_cb_arg);
+       return rte_mempool_op_populate_helper(mp, 0, max_objs, vaddr, paddr,
+                                              len, obj_cb, obj_cb_arg);
 }
 
 static const struct rte_mempool_ops dpaa_mpool_ops = {
@@ -357,4 +358,4 @@ static const struct rte_mempool_ops dpaa_mpool_ops = {
        .populate = dpaa_populate,
 };
 
-MEMPOOL_REGISTER_OPS(dpaa_mpool_ops);
+RTE_MEMPOOL_REGISTER_OPS(dpaa_mpool_ops);