From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8A39C58CF for ; Fri, 2 Dec 2016 12:22:15 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 02 Dec 2016 03:22:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,729,1477983600"; d="scan'208";a="907949336" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.29]) ([10.237.220.29]) by orsmga003.jf.intel.com with ESMTP; 02 Dec 2016 03:22:13 -0800 To: Wenzhuo Lu , dev@dpdk.org References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1480637533-37425-21-git-send-email-wenzhuo.lu@intel.com> Cc: "Chen Jing D(Mark)" , Bernard Iremonger From: Ferruh Yigit Message-ID: <4583507c-7cf8-5943-5321-f92b5207bf8e@intel.com> Date: Fri, 2 Dec 2016 11:22:12 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1480637533-37425-21-git-send-email-wenzhuo.lu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 20/31] app/testpmd: use VFD APIs on i40e 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, 02 Dec 2016 11:22:16 -0000 On 12/2/2016 12:12 AM, Wenzhuo Lu wrote: > The new VF Daemon (VFD) APIs is implemented on i40e. Change > testpmd code to use them, inlcuding VF MAC anti-spoofing, s/inlcuding/including > VF VLAN anti-spoofing, TX loopback, VF VLAN strip, VF VLAN > insert. > > Signed-off-by: Wenzhuo Lu > Signed-off-by: Chen Jing D(Mark) > Signed-off-by: Bernard Iremonger > --- For shared library compilation, i40e library should be linked against, this requires testpmd Makefile modification [1], otherwise throwing compiler error [2]. [1] diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index 891b85a..87cbaf9 100644 --- a/app/test-pmd/Makefile +++ b/app/test-pmd/Makefile @@ -59,6 +59,7 @@ SRCS-y += icmpecho.c SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e [2] cmdline.o: In function `cmd_set_vf_vlan_anti_spoof_parsed': .../app/test-pmd/cmdline.c:(.text+0x76dc): undefined reference to `rte_pmd_i40e_set_vf_vlan_anti_spoof' cmdline.o: In function `cmd_set_vf_mac_anti_spoof_parsed': .../app/test-pmd/cmdline.c:(.text+0x7854): undefined reference to `rte_pmd_i40e_set_vf_mac_anti_spoof' cmdline.o: In function `cmd_set_vf_vlan_stripq_parsed': .../app/test-pmd/cmdline.c:(.text+0x79d4): undefined reference to `rte_pmd_i40e_set_vf_vlan_stripq' cmdline.o: In function `cmd_set_vf_vlan_insert_parsed': .../app/test-pmd/cmdline.c:(.text+0x7b1e): undefined reference to `rte_pmd_i40e_set_vf_vlan_insert' cmdline.o: In function `cmd_set_tx_loopback_parsed': .../app/test-pmd/cmdline.c:(.text+0x7c94): undefined reference to `rte_pmd_i40e_set_tx_loopback' cmdline.o: In function `cmd_set_vf_unicast_promisc_parsed': .../app/test-pmd/cmdline.c:(.text+0x7f44): undefined reference to `rte_pmd_i40e_set_vf_unicast_promisc' cmdline.o: In function `cmd_set_vf_multicast_promisc_parsed': .../app/test-pmd/cmdline.c:(.text+0x7fe4): undefined reference to `rte_pmd_i40e_set_vf_multicast_promisc' cmdline.o: In function `cmd_set_vf_broadcast_parsed': .../app/test-pmd/cmdline.c:(.text+0x8086): undefined reference to `rte_pmd_i40e_set_vf_broadcast' cmdline.o: In function `cmd_set_vf_vlan_tag_parsed': .../app/test-pmd/cmdline.c:(.text+0x8146): undefined reference to `rte_pmd_i40e_set_vf_vlan_tag' config.o: In function `set_vf_rx_vlan': .../app/test-pmd/config.c:(.text+0x518d): undefined reference to `rte_pmd_i40e_set_vf_vlan_filter' clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation) > app/test-pmd/cmdline.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 85 insertions(+), 7 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 63b55dc..1284d6c 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -90,6 +90,9 @@ > #ifdef RTE_LIBRTE_IXGBE_PMD > #include > #endif > +#ifdef RTE_LIBRTE_I40E_PMD > +#include > +#endif > #include "testpmd.h" > > static struct cmdline *testpmd_cl; > @@ -10806,9 +10809,22 @@ struct cmd_vf_vlan_anti_spoof_result { > struct cmd_vf_vlan_anti_spoof_result *res = parsed_result; > int ret = 0; > int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0; > + struct rte_eth_dev_info dev_info; > + > + memset(&dev_info, 0, sizeof(dev_info)); > + rte_eth_dev_info_get(res->port_id, &dev_info); > + > + if (strstr(dev_info.driver_name, "ixgbe") != NULL) > + ret = rte_pmd_ixgbe_set_vf_vlan_anti_spoof(res->port_id, > + res->vf_id, > + is_on); > + else if (strstr(dev_info.driver_name, "i40e") != NULL) > + ret = rte_pmd_i40e_set_vf_vlan_anti_spoof(res->port_id, > + res->vf_id, > + is_on); > + else > + ret = -ENOSYS; Same checkpatch warning, for all ENOSYS usage, WARNING:ENOSYS: ENOSYS means 'invalid syscall nr' and nothing else If the intention is not matching error type, we may change it.