diff mbox

[dpdk-dev,v4,23/29] app/testpmd: handle i40e in VF VLAN filter command

Message ID 20161216143919.4909-24-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation fail Compilation issues

Commit Message

Ferruh Yigit Dec. 16, 2016, 2:39 p.m. UTC
From: Bernard Iremonger <bernard.iremonger@intel.com>

modify set_vf_rx_vlan function to handle the i40e PMD.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index fc0424a..c5da9b1 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@ 
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
+#ifdef RTE_LIBRTE_I40E_PMD
+#include <rte_pmd_i40e.h>
+#endif
 #ifdef RTE_LIBRTE_IXGBE_PMD
 #include <rte_pmd_ixgbe.h>
 #endif
@@ -2353,12 +2356,22 @@  void
 set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 {
 	int diag;
+	struct rte_eth_dev_info dev_info;
+
+	rte_eth_dev_info_get(port_id, &dev_info);
 
-	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+#ifdef RTE_LIBRTE_I40E_PMD
+	if (strstr(dev_info.driver_name, "i40e") != NULL)
+		diag = rte_pmd_i40e_set_vf_vlan_filter(port_id, vlan_id,
+						       vf_mask, on);
+	else
+#endif
+		diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id,
+						      vf_mask, on);
 
 	if (diag == 0)
 		return;
-	printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
+	printf("rte_pmd_xxx_set_vf_vlan_filter for port_id=%d failed "
 	       "diag=%d\n", port_id, diag);
 }
 #endif