From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 59843FA6E for ; Fri, 16 Dec 2016 15:42:42 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 16 Dec 2016 06:42:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,358,1477983600"; d="scan'208";a="43278080" Received: from sivswdev02.ir.intel.com ([10.237.217.46]) by fmsmga005.fm.intel.com with ESMTP; 16 Dec 2016 06:42:40 -0800 From: Ferruh Yigit To: dev@dpdk.org Cc: Jingjing Wu ; Helin Zhang , Bernard Iremonger Date: Fri, 16 Dec 2016 14:39:13 +0000 Message-Id: <20161216143919.4909-24-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20161216143919.4909-1-ferruh.yigit@intel.com> References: <1481835919-36488-1-git-send-email-qi.z.zhang@intel.com> <20161216143919.4909-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v4 23/29] app/testpmd: handle i40e in VF VLAN filter command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 14:42:42 -0000 From: Bernard Iremonger modify set_vf_rx_vlan function to handle the i40e PMD. Signed-off-by: Bernard Iremonger --- app/test-pmd/config.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 #include #include +#ifdef RTE_LIBRTE_I40E_PMD +#include +#endif #ifdef RTE_LIBRTE_IXGBE_PMD #include #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 -- 2.9.3