From patchwork Wed Oct 12 06:24:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenzhuo Lu X-Patchwork-Id: 16501 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id CEA036CD7; Wed, 12 Oct 2016 08:25:00 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 1C9006CCF for ; Wed, 12 Oct 2016 08:24:58 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP; 11 Oct 2016 23:24:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,332,1473145200"; d="scan'208";a="19182110" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2016 23:24:33 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u9C6OVuE010765; Wed, 12 Oct 2016 14:24:31 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u9C6OSwU013049; Wed, 12 Oct 2016 14:24:30 +0800 Received: (from wenzhuol@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u9C6OSvM013045; Wed, 12 Oct 2016 14:24:28 +0800 From: Wenzhuo Lu To: dev@dpdk.org Cc: Wenzhuo Lu Date: Wed, 12 Oct 2016 14:24:21 +0800 Message-Id: <1476253462-13000-3-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1476253462-13000-1-git-send-email-wenzhuo.lu@intel.com> References: <1476085594-32325-1-git-send-email-wenzhuo.lu@intel.com> <1476253462-13000-1-git-send-email-wenzhuo.lu@intel.com> Subject: [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix wrong flow director mask X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- app/test-pmd/cmdline.c | 5 +---- app/test-pmd/config.c | 13 ++++++------- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 6e95ca2..259090a 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -720,7 +720,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" @@ -9075,7 +9075,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"); @@ -9206,8 +9205,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 83bebfe..238c4fd 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2045,16 +2045,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 f87e0c2..ed04532 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1844,8 +1844,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) \