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 <wenzhuo...@intel.com> > Signed-off-by: Chen Jing D(Mark) <jing.d.c...@intel.com> > Signed-off-by: Bernard Iremonger <bernard.iremon...@intel.com> > --- 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 <rte_pmd_ixgbe.h> > #endif > +#ifdef RTE_LIBRTE_I40E_PMD > +#include <rte_pmd_i40e.h> > +#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.