net/dpaa: prevent multiple mempool config
authorNipun Gupta <nipun.gupta@nxp.com>
Wed, 24 Feb 2021 12:43:06 +0000 (18:13 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 24 Feb 2021 17:03:30 +0000 (18:03 +0100)
The current driver only support single buffer pool on a given
PMD instance. Return error, if trying to configure more.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/mempool/dpaa/dpaa_mempool.c
drivers/net/dpaa/dpaa_ethdev.c

index e6b06f0..1ee7ffb 100644 (file)
@@ -134,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;
        }
 }
index 0996edf..a3a3e7c 100644 (file)
@@ -969,6 +969,12 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
                }
        }
 
+       if (dpaa_intf->bp_info && dpaa_intf->bp_info->bp &&
+           dpaa_intf->bp_info->mp != mp) {
+               DPAA_PMD_WARN("Multiple pools on same interface not supported");
+               return -EINVAL;
+       }
+
        /* Max packet can fit in single buffer */
        if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) {
                ;