diff mbox series

[07/20] net/dpaa2: fix device init for secondary process

Message ID 20181227062233.30781-8-hemant.agrawal@nxp.com
State New
Headers show
Series NXP DPAA2 fixes and enhancements | expand

Commit Message

Hemant Agrawal Dec. 27, 2018, 6:23 a.m. UTC
In order to support I/O from secondary process, the
burst APIs and OPS APIs shall be mapped/plugged.

Fixes: c147eae01cb3 ("net/dpaa2: introduce NXP DPAA2 driver")
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

---
 drivers/net/dpaa2/dpaa2_ethdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8d4ea1bca..39f85ae7b 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1918,8 +1918,15 @@  dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 	PMD_INIT_FUNC_TRACE();
 
 	/* For secondary processes, the primary has done all the work */
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+		/* In case of secondary, only burst and ops API need to be
+		 * plugged.
+		 */
+		eth_dev->dev_ops = &dpaa2_ethdev_ops;
+		eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx;
+		eth_dev->tx_pkt_burst = dpaa2_dev_tx;
 		return 0;
+	}
 
 	dpaa2_dev = container_of(dev, struct rte_dpaa2_device, device);