From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v8 18/25] app/testpmd: use VFD APIs on i40e Date: Tue, 10 Jan 2017 11:29:27 +0000 Message-ID: <8dfea289-72da-8a84-4d30-368d6d4ea4d6@intel.com> References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1484032580-60134-1-git-send-email-wenzhuo.lu@intel.com> <1484032580-60134-19-git-send-email-wenzhuo.lu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: "Chen Jing D(Mark)" , Bernard Iremonger To: Wenzhuo Lu , dev@dpdk.org Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6484420F for ; Tue, 10 Jan 2017 12:29:29 +0100 (CET) In-Reply-To: <1484032580-60134-19-git-send-email-wenzhuo.lu@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/10/2017 7:16 AM, Wenzhuo Lu wrote: > The new VF Daemon (VFD) APIs is implemented on i40e. Change > testpmd code to use them, including VF MAC anti-spoofing, > 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 > --- <...> > +#ifdef RTE_LIBRTE_IXGBE_PMD Within this ifdef, there is following call: ret = rte_pmd_ixgbe_set_all_queues_drop_en(res->port_id, is_on); It is not safe to make that call directly, port should be verified first if it is ixgbe port, as done in other functions. > /* all queues drop enable configuration */ > > /* Common result structure for all queues drop enable */ > @@ -11277,6 +11351,9 @@ struct cmd_all_queues_drop_en_result { > case -ENODEV: > printf("invalid port_id %d\n", res->port_id); > break; > + case -ENOTSUP: > + printf("function not implemented\n"); > + break; > default: > printf("programming error: (%s)\n", strerror(-ret)); > } > @@ -11381,6 +11458,7 @@ struct cmd_vf_split_drop_en_result { > NULL, > }, > }; > +#endif > <...> > @@ -11619,20 +11711,20 @@ struct cmd_set_vf_mac_addr_result { > (cmdline_parse_inst_t *)&cmd_config_e_tag_forwarding_en_dis, > (cmdline_parse_inst_t *)&cmd_config_e_tag_filter_add, > (cmdline_parse_inst_t *)&cmd_config_e_tag_filter_del, > -#ifdef RTE_LIBRTE_IXGBE_PMD > (cmdline_parse_inst_t *)&cmd_set_vf_vlan_anti_spoof, > (cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof, > (cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq, > (cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert, > (cmdline_parse_inst_t *)&cmd_set_tx_loopback, > +#ifdef RTE_LIBRTE_IXGBE_PMD Overall, since port will be verified within the function, why not remove this ifdef completely? So all functions will be visible to everyone, but only the PMDs support it will be called, others will return "not supported", as done in some functions supports bot i40e and ixgbe pmd specific APIs. > (cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en, > (cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en, > - (cmdline_parse_inst_t *)&cmd_set_vf_mac_addr, > (cmdline_parse_inst_t *)&cmd_set_vf_rxmode, > (cmdline_parse_inst_t *)&cmd_set_vf_traffic, > (cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter, > (cmdline_parse_inst_t *)&cmd_vf_rate_limit, > #endif > + (cmdline_parse_inst_t *)&cmd_set_vf_mac_addr, > NULL, > }; > >