Rx/Tx queue initialization routine for VFs is same
as that of phys function. define separate ops structure
for VF devices.
Signed-off-by: Aman Kumar <aman.kumar@vvdntech.in>
---
drivers/net/qdma/qdma_vf_ethdev.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
@@ -94,6 +94,13 @@ static int qdma_ethdev_offline(struct rte_eth_dev *dev)
return rv;
}
+static struct eth_dev_ops qdma_vf_eth_dev_ops = {
+ .rx_queue_setup = qdma_dev_rx_queue_setup,
+ .tx_queue_setup = qdma_dev_tx_queue_setup,
+ .rx_queue_release = qdma_dev_rx_queue_release,
+ .tx_queue_release = qdma_dev_tx_queue_release,
+};
+
/**
* DPDK callback to register a PCI device.
*
@@ -129,8 +136,10 @@ static int eth_qdma_vf_dev_init(struct rte_eth_dev *dev)
/* for secondary processes, we don't initialise any further as primary
* has already done this work.
*/
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ dev->dev_ops = &qdma_vf_eth_dev_ops;
return 0;
+ }
if (once) {
RTE_LOG(INFO, PMD, "QDMA PMD VERSION: %s\n", QDMA_PMD_VERSION);
@@ -160,6 +169,8 @@ static int eth_qdma_vf_dev_init(struct rte_eth_dev *dev)
dma_priv->c2h_bypass_mode = RTE_PMD_QDMA_RX_BYPASS_NONE;
dma_priv->h2c_bypass_mode = 0;
+ dev->dev_ops = &qdma_vf_eth_dev_ops;
+
dma_priv->config_bar_idx = DEFAULT_VF_CONFIG_BAR;
dma_priv->bypass_bar_idx = BAR_ID_INVALID;
dma_priv->user_bar_idx = BAR_ID_INVALID;