summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemy Horton <remy.horton@intel.com>2018-05-11 13:28:44 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:32:11 +0100
commit8973508a0cb3af9178c532c8073784800804e918 (patch)
treedecaf7a704e78675a0b4752874ed911bac85c8dc
parentb447e89e33336324e7b4729cd35b5a017fe5dd82 (diff)
downloaddpdk-8973508a0cb3af9178c532c8073784800804e918.zip
dpdk-8973508a0cb3af9178c532c8073784800804e918.tar.gz
dpdk-8973508a0cb3af9178c532c8073784800804e918.tar.xz
net/i40e: fix missing port representor data-path
This patch adds Rx and Tx burst functions to the i40e Port Representors, so that the implementation within this PMD can be tested using applications such as testpmd which require data-path functionality. Fixes: e0cb96204b71 ("net/i40e: add support for representor ports") Signed-off-by: Remy Horton <remy.horton@intel.com> Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
-rw-r--r--drivers/net/i40e/i40e_vf_representor.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c
index 96b3787..6026ec9 100644
--- a/drivers/net/i40e/i40e_vf_representor.c
+++ b/drivers/net/i40e/i40e_vf_representor.c
@@ -337,6 +337,20 @@ struct eth_dev_ops i40e_representor_dev_ops = {
};
+static uint16_t
+i40e_vf_representor_rx_burst(__rte_unused void *rx_queue,
+ __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts)
+{
+ return 0;
+}
+
+static uint16_t
+i40e_vf_representor_tx_burst(__rte_unused void *tx_queue,
+ __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
+{
+ return 0;
+}
+
int
i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
{
@@ -365,9 +379,11 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
/* Set representor device ops */
ethdev->dev_ops = &i40e_representor_dev_ops;
- /* No data-path so no RX/TX functions */
- ethdev->rx_pkt_burst = NULL;
- ethdev->tx_pkt_burst = NULL;
+ /* No data-path, but need stub Rx/Tx functions to avoid crash
+ * when testing with the likes of testpmd.
+ */
+ ethdev->rx_pkt_burst = i40e_vf_representor_rx_burst;
+ ethdev->tx_pkt_burst = i40e_vf_representor_tx_burst;
vf = &pf->vfs[representor->vf_id];