From: Wenzhuo Lu Date: Wed, 19 Oct 2016 01:22:59 +0000 (+0800) Subject: app/testpmd: fix flow director mask X-Git-Tag: spdx-start~5479 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=21f3fc4664463500ed96882738574a43d1b68f98;p=dpdk.git app/testpmd: fix flow director mask In mac-vlan mode, MAC address mask is not supported by HW. The MAC address mask should not be set in mac-vlan mode. Remove this parameter from the CLI. Remove MAC address from mask print too. Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands") Signed-off-by: Wenzhuo Lu Acked-by: Pablo de Lara --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 6376225d96..a82b4cc0ca 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -752,7 +752,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Set flow director IP mask.\n\n" "flow_director_mask (port_id) mode MAC-VLAN" - " vlan (vlan_value) mac (mac_value)\n" + " vlan (vlan_value)\n" " Set flow director MAC-VLAN mask.\n\n" "flow_director_mask (port_id) mode Tunnel" @@ -9126,7 +9126,6 @@ cmd_flow_director_mask_parsed(void *parsed_result, } mask->vlan_tci_mask = res->vlan_mask; - mask->mac_addr_byte_mask = res->mac_addr_byte_mask; } else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { if (strcmp(res->mode_value, "Tunnel")) { printf("Please set mode to Tunnel.\n"); @@ -9257,8 +9256,6 @@ cmdline_parse_inst_t cmd_set_flow_director_mac_vlan_mask = { (void *)&cmd_flow_director_mask_mode_mac_vlan, (void *)&cmd_flow_director_mask_vlan, (void *)&cmd_flow_director_mask_vlan_value, - (void *)&cmd_flow_director_mask_mac, - (void *)&cmd_flow_director_mask_mac_value, NULL, }, }; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index c97efdee1b..7854b7210f 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2057,16 +2057,15 @@ set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value) static inline void print_fdir_mask(struct rte_eth_fdir_masks *mask) { - printf("\n vlan_tci: 0x%04x, ", mask->vlan_tci_mask); + printf("\n vlan_tci: 0x%04x", mask->vlan_tci_mask); - if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) - printf("mac_addr: 0x%02x", mask->mac_addr_byte_mask); - else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) - printf("mac_addr: 0x%02x, tunnel_type: 0x%01x, tunnel_id: 0x%08x", + if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) + printf(", mac_addr: 0x%02x, tunnel_type: 0x%01x," + " tunnel_id: 0x%08x", mask->mac_addr_byte_mask, mask->tunnel_type_mask, mask->tunnel_id_mask); - else { - printf("src_ipv4: 0x%08x, dst_ipv4: 0x%08x," + else if (fdir_conf.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN) { + printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x," " src_port: 0x%04x, dst_port: 0x%04x", mask->ipv4_mask.src_ip, mask->ipv4_mask.dst_ip, mask->src_port_mask, mask->dst_port_mask); diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index c04805bc34..b1b9736c81 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1906,8 +1906,7 @@ Set flow director's input masks:: src_mask (ipv4_src) (ipv6_src) (src_port) \ dst_mask (ipv4_dst) (ipv6_dst) (dst_port) - flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value) \ - mac (mac_value) + flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value) flow_director_mask (port_id) mode Tunnel vlan (vlan_value) \ mac (mac_value) tunnel-type (tunnel_type_value) \