DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix protocol headers display for Rx buffer split
@ 2022-10-17 17:40 Yuan Wang
  2022-10-17 10:03 ` Tang, Yaqi
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Yuan Wang @ 2022-10-17 17:40 UTC (permalink / raw)
  To: Aman Singh, Yuying Zhang
  Cc: andrew.rybchenko, dev, xuan.ding, yaqi.tang, Yuan Wang

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.

Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
---
 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 dec16a9049..e5fbc3a491 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -4922,15 +4922,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";
@@ -4940,18 +4931,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)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-11-10  8:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 17:40 [PATCH] app/testpmd: fix protocol headers display for Rx buffer split Yuan Wang
2022-10-17 10:03 ` Tang, Yaqi
2022-10-18 14:50 ` [PATCH v2] " Yuan Wang
2022-10-28  2:04   ` Wang, YuanX
2022-11-06  9:58   ` Andrew Rybchenko
2022-11-07  5:55     ` Wang, YuanX
2022-11-07  8:45 ` [PATCH v3] app/testpmd: fix protocol header " Yuan Wang
2022-11-07  8:51   ` Tang, Yaqi
2022-11-07 11:31   ` Andrew Rybchenko
2022-11-08 13:53     ` Wang, YuanX
2022-11-09  1:37 ` [PATCH v4] " Yuan Wang
2022-11-10  6:55   ` Andrew Rybchenko
2022-11-10  7:49     ` Wang, YuanX
2022-11-10  8:20 ` [PATCH v5] " Yuan Wang
2022-11-10  8:54   ` Andrew Rybchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).