app/testpmd: fix protocol headers display for Rx buffer split
Checks
Commit Message
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(-)
Comments
> -----Original Message-----
> From: Wang, YuanX <yuanx.wang@intel.com>
> Sent: Tuesday, October 18, 2022 1:41 AM
> To: Singh, Aman Deep <aman.deep.singh@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>
> Cc: andrew.rybchenko@oktetlabs.ru; dev@dpdk.org; Ding, Xuan
> <xuan.ding@intel.com>; Tang, Yaqi <yaqi.tang@intel.com>; Wang, YuanX
> <yuanx.wang@intel.com>
> Subject: [PATCH] app/testpmd: fix protocol headers display for Rx buffer split
>
> 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>
> ---
Tested-by: Yaqi Tang <yaqi.tang@intel.com>
@@ -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)