From patchwork Thu Dec 15 21:05:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 18028 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 3AE91FA64; Fri, 16 Dec 2016 05:10:20 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 13451377C for ; Fri, 16 Dec 2016 05:09:04 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 15 Dec 2016 20:09:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,355,1477983600"; d="scan'208";a="43202039" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.129.189]) by fmsmga006.fm.intel.com with ESMTP; 15 Dec 2016 20:09:03 -0800 From: Qi Zhang To: jingjing.wu@intel.com, helin.zhang@intel.com Cc: dev@dpdk.org, Bernard Iremonger Date: Thu, 15 Dec 2016 16:05:13 -0500 Message-Id: <1481835919-36488-24-git-send-email-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481835919-36488-1-git-send-email-qi.z.zhang@intel.com> References: <1481835919-36488-1-git-send-email-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v3 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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