[v2,15/30] bus/fslmc: add support to check dpbp presence

Message ID 1504860327-18451-16-git-send-email-hemant.agrawal@nxp.com
State Superseded
Headers show
Series
  • NXP DPAA2 PMD updates
Related show

Commit Message

Hemant Agrawal Sept. 8, 2017, 8:45 a.m.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c    | 7 +++++++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h     | 1 +
 drivers/bus/fslmc/rte_bus_fslmc_version.map | 1 +
 3 files changed, 9 insertions(+)

-- 
2.7.4

Patch

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index 1ddd280..7e96115 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -129,6 +129,13 @@  void dpaa2_free_dpbp_dev(struct dpaa2_dpbp_dev *dpbp)
 	}
 }
 
+int dpaa2_dpbp_supported(void)
+{
+	if (TAILQ_EMPTY(&dpbp_dev_list))
+		return -1;
+	return 0;
+}
+
 static struct rte_dpaa2_object rte_dpaa2_dpbp_obj = {
 	.dev_type = DPAA2_BPOOL,
 	.create = dpaa2_create_dpbp_device,
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index bb52a15..8f39cfb 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -366,6 +366,7 @@  void set_swp_active_dqs(uint16_t dpio_index, struct qbman_result *dqs)
 }
 struct dpaa2_dpbp_dev *dpaa2_alloc_dpbp_dev(void);
 void dpaa2_free_dpbp_dev(struct dpaa2_dpbp_dev *dpbp);
+int dpaa2_dpbp_supported(void);
 
 struct dpaa2_dpci_dev *rte_dpaa2_alloc_dpci_dev(void);
 void rte_dpaa2_free_dpci_dev(struct dpaa2_dpci_dev *dpci);
diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map
index 3cc7dad..7b25248 100644
--- a/drivers/bus/fslmc/rte_bus_fslmc_version.map
+++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map
@@ -83,6 +83,7 @@  DPDK_17.08 {
 DPDK_17.11 {
 	global:
 
+	dpaa2_dpbp_supported;
 	rte_dpaa2_dev_type;
 
 } DPDK_17.08;