Add basic Rx support in split queue mode and single queue mode.
Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
---
drivers/net/cpfl/cpfl_ethdev.c | 2 ++
drivers/net/cpfl/cpfl_rxtx.c | 18 ++++++++++++++++++
drivers/net/cpfl/cpfl_rxtx.h | 1 +
3 files changed, 21 insertions(+)
@@ -252,6 +252,8 @@ cpfl_dev_start(struct rte_eth_dev *dev)
return ret;
}
+ cpfl_set_rx_function(dev);
+
ret = idpf_vc_vport_ena_dis(vport, true);
if (ret != 0) {
PMD_DRV_LOG(ERR, "Failed to enable vport");
@@ -734,3 +734,21 @@ cpfl_stop_queues(struct rte_eth_dev *dev)
PMD_DRV_LOG(WARNING, "Fail to stop Tx queue %d", i);
}
}
+
+void
+cpfl_set_rx_function(struct rte_eth_dev *dev)
+{
+ struct idpf_vport *vport = dev->data->dev_private;
+
+ if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) {
+ PMD_DRV_LOG(NOTICE,
+ "Using Split Scalar Rx (port %d).",
+ dev->data->port_id);
+ dev->rx_pkt_burst = idpf_dp_splitq_recv_pkts;
+ } else {
+ PMD_DRV_LOG(NOTICE,
+ "Using Single Scalar Rx (port %d).",
+ dev->data->port_id);
+ dev->rx_pkt_burst = idpf_dp_singleq_recv_pkts;
+ }
+}
@@ -37,4 +37,5 @@ int cpfl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
int cpfl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
void cpfl_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
void cpfl_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
+void cpfl_set_rx_function(struct rte_eth_dev *dev);
#endif /* _CPFL_RXTX_H_ */