From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7315D7E23 for ; Tue, 29 Sep 2015 07:31:55 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 28 Sep 2015 22:31:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,606,1437462000"; d="scan'208";a="570279661" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 28 Sep 2015 22:31:53 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t8T5Vpa7019507; Tue, 29 Sep 2015 13:31:51 +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 t8T5VmcB017815; Tue, 29 Sep 2015 13:31:50 +0800 Received: (from wenzhuol@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t8T5Vlrb017811; Tue, 29 Sep 2015 13:31:48 +0800 From: Wenzhuo Lu To: dev@dpdk.org Date: Tue, 29 Sep 2015 13:31:20 +0800 Message-Id: <1443504682-17752-5-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1443504682-17752-1-git-send-email-wenzhuo.lu@intel.com> References: <1443161125-1035-1-git-send-email-wenzhuo.lu@intel.com> <1443504682-17752-1-git-send-email-wenzhuo.lu@intel.com> Subject: [dpdk-dev] [PATCH v2 4/6] app/testpmd: modify the output of the CLI show port fdir 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: , X-List-Received-Date: Tue, 29 Sep 2015 05:31:56 -0000 There're fdir mask and supported flow type in the output of the CLI, show port fdir. But not every parameter has meaning for all the fdir modes, and the supported flow type is meaningless for mac vlan and tunnel modes. So, we output different thing for different mode. Signed-off-by: Wenzhuo Lu --- app/test-pmd/config.c | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cf2aa6e..bc70ec4 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1829,18 +1829,27 @@ 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, src_ipv4: 0x%08x, dst_ipv4: 0x%08x," - " src_port: 0x%04x, dst_port: 0x%04x", - mask->vlan_tci_mask, mask->ipv4_mask.src_ip, - mask->ipv4_mask.dst_ip, - mask->src_port_mask, mask->dst_port_mask); - - printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x," - " dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x", - mask->ipv6_mask.src_ip[0], mask->ipv6_mask.src_ip[1], - mask->ipv6_mask.src_ip[2], mask->ipv6_mask.src_ip[3], - mask->ipv6_mask.dst_ip[0], mask->ipv6_mask.dst_ip[1], - mask->ipv6_mask.dst_ip[2], mask->ipv6_mask.dst_ip[3]); + 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_mask); + else 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_mask, mask->tunnel_type_mask,mask->tunnel_id_mask); + else { + 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); + + printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x," + " dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x", + mask->ipv6_mask.src_ip[0], mask->ipv6_mask.src_ip[1], + mask->ipv6_mask.src_ip[2], mask->ipv6_mask.src_ip[3], + mask->ipv6_mask.dst_ip[0], mask->ipv6_mask.dst_ip[1], + mask->ipv6_mask.dst_ip[2], mask->ipv6_mask.dst_ip[3]); + } + printf("\n"); } @@ -1966,12 +1975,19 @@ fdir_get_infos(portid_t port_id) printf(" MODE: "); if (fdir_info.mode == RTE_FDIR_MODE_PERFECT) printf(" PERFECT\n"); + else if (fdir_info.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) + printf(" PERFECT-MAC-VLAN\n"); + else if (fdir_info.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) + printf(" PERFECT-TUNNEL\n"); else if (fdir_info.mode == RTE_FDIR_MODE_SIGNATURE) printf(" SIGNATURE\n"); else printf(" DISABLE\n"); - printf(" SUPPORTED FLOW TYPE: "); - print_fdir_flow_type(fdir_info.flow_types_mask[0]); + if (fdir_info.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN + && fdir_info.mode != RTE_FDIR_MODE_PERFECT_TUNNEL) { + printf(" SUPPORTED FLOW TYPE: "); + print_fdir_flow_type(fdir_info.flow_types_mask[0]); + } printf(" FLEX PAYLOAD INFO:\n"); printf(" max_len: %-10"PRIu32" payload_limit: %-10"PRIu32"\n" " payload_unit: %-10"PRIu32" payload_seg: %-10"PRIu32"\n" -- 1.9.3