[dpdk-dev] [PATCH v8 18/25] app/testpmd: use VFD APIs on i40e

Ferruh Yigit ferruh.yigit at intel.com
Tue Jan 10 12:29:27 CET 2017


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 <wenzhuo.lu at intel.com>
> Signed-off-by: Chen Jing D(Mark) <jing.d.chen at intel.com>
> Signed-off-by: Bernard Iremonger <bernard.iremonger at intel.com>
> ---

<...>

> +#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,
>  };
>  
> 



More information about the dev mailing list