From patchwork Tue Oct 18 14:50:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, YuanX" X-Patchwork-Id: 118354 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8AAA2A0560; Tue, 18 Oct 2022 09:04:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78D494021D; Tue, 18 Oct 2022 09:04:59 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id AF72140143 for ; Tue, 18 Oct 2022 09:04:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666076698; x=1697612698; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=K30NUWCSr+jtuyW+FPCrae/QS45uwvJ5PAHYj1C5Jgo=; b=RPCPl6mraMMWUh7D+1Z6dDnGupivPVFj1CdJPUsRwMKVin8xOl4g0fOj uUiI1bFRJcC7asZ6K/VTzWzrE0uEOcOHC7H5csRwQ0hmockLfYBLBISmp +2IMoNESwNUzorzjR9VesiP+A03IEc7unlAOhmrBoUVflb4nR+0qgK/qL AJn/TyxV8mvmTdaiS6S2QGCdSFx7QIbGE9fham0T5t483/rqW07ngF5uU TNGqzJft2Lh9XujonJvwjPaSEGEQhJXBSX5qq+KbY0Tfm6braTxqZ6wC6 Gh4ro/uE8dPpCDmox7gXZE/WCksvNpaJr3zdNaMwDeK1lsSZwVU89Vihz Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="307104918" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="307104918" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 00:04:47 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="873772062" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="873772062" Received: from unknown (HELO localhost.localdomain) ([10.239.252.55]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 00:04:44 -0700 From: Yuan Wang To: andrew.rybchenko@oktetlabs.ru, Aman Singh , Yuying Zhang Cc: dev@dpdk.org, xuan.ding@intel.com, yaqi.tang@intel.com, Yuan Wang Subject: [PATCH v2] app/testpmd: fix protocol headers display for Rx buffer split Date: Tue, 18 Oct 2022 22:50:12 +0800 Message-Id: <20221018145012.914586-1-yuanx.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221017174054.800259-1-yuanx.wang@intel.com> References: <20221017174054.800259-1-yuanx.wang@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The "show config rxhdrs" cmd displays the configured protocol headers that are used for protocol-based buffer split. However, it shows "inner-ipv6" as "inner-ipv4". This patch fixes that by adjusting the order of condition judgments. Fixes: 52e2e7edcf48 ("app/testpmd: add protocol-based buffer split") Signed-off-by: Yuan Wang Tested-by: Yaqi Tang --- v2: add fixline. --- app/test-pmd/config.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 0f7dbd698f..82fbbc9944 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -4937,15 +4937,6 @@ static const char *get_ptype_str(uint32_t ptype) else if ((ptype & RTE_PTYPE_L2_ETHER) == RTE_PTYPE_L2_ETHER) return "eth"; - else if ((ptype & (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_TCP)) == - (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_TCP)) - return "inner-ipv4-tcp"; - else if ((ptype & (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_UDP)) == - (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_UDP)) - return "inner-ipv4-udp"; - else if ((ptype & (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_SCTP)) == - (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_SCTP)) - return "inner-ipv4-sctp"; else if ((ptype & (RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_TCP)) == (RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_TCP)) return "inner-ipv6-tcp"; @@ -4955,18 +4946,27 @@ static const char *get_ptype_str(uint32_t ptype) else if ((ptype & (RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_SCTP)) == (RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_SCTP)) return "inner-ipv6-sctp"; + else if ((ptype & (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_TCP)) == + (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_TCP)) + return "inner-ipv4-tcp"; + else if ((ptype & (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_UDP)) == + (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_UDP)) + return "inner-ipv4-udp"; + else if ((ptype & (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_SCTP)) == + (RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_SCTP)) + return "inner-ipv4-sctp"; else if ((ptype & RTE_PTYPE_INNER_L4_TCP) == RTE_PTYPE_INNER_L4_TCP) return "inner-tcp"; else if ((ptype & RTE_PTYPE_INNER_L4_UDP) == RTE_PTYPE_INNER_L4_UDP) return "inner-udp"; else if ((ptype & RTE_PTYPE_INNER_L4_SCTP) == RTE_PTYPE_INNER_L4_SCTP) return "inner-sctp"; + else if ((ptype & RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN) == + RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN) + return "inner-ipv6"; else if ((ptype & RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN) == RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN) return "inner-ipv4"; - else if ((ptype & RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN) == - RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN) - return "inner-ipv6"; else if ((ptype & RTE_PTYPE_INNER_L2_ETHER) == RTE_PTYPE_INNER_L2_ETHER) return "inner-eth"; else if ((ptype & RTE_PTYPE_TUNNEL_GRENAT) == RTE_PTYPE_TUNNEL_GRENAT)