From: Wenzhuo Lu Date: Thu, 17 Aug 2017 18:33:43 +0000 (+0800) Subject: app/testpmd: fix wrong API of adding VF MAC X-Git-Tag: spdx-start~2094 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5f866488dd3f411f9c0490eee33dc1a584c81dd6;p=dpdk.git app/testpmd: fix wrong API of adding VF MAC When adding a VF MAC address, rte_eth_dev_mac_addr_add is called. It's not right, because this API is used to add a MAC address for a VMDq pool not a VF. Although it can work on ixgbe as VMDq pool and VF mean the same thing on ixgbe. Fixes: 7741e4cf16c0 ("app/testpmd: VMDq and DCB updates") Signed-off-by: Wenzhuo Lu --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index ccdf239d6b..ccf883743f 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -7213,11 +7213,22 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result, __attribute__((unused)) void *data) { struct cmd_vf_mac_addr_result *res = parsed_result; - int ret = 0; + int ret = -ENOTSUP; + + if (strcmp(res->what, "add") != 0) + return; + +#ifdef RTE_LIBRTE_I40E_PMD + if (ret == -ENOTSUP) + ret = rte_pmd_i40e_add_vf_mac_addr(res->port_num, res->vf_num, + &res->address); +#endif +#ifdef RTE_LIBRTE_BNXT_PMD + if (ret == -ENOTSUP) + ret = rte_pmd_bnxt_mac_addr_add(res->port_num, &res->address, + res->vf_num); +#endif - if (strcmp(res->what, "add") == 0) - ret = rte_eth_dev_mac_addr_add(res->port_num, - &res->address, res->vf_num); if(ret < 0) printf("vf_mac_addr_cmd error: (%s)\n", strerror(-ret));