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 <yuanx.w...@intel.com> Tested-by: Yaqi Tang <yaqi.t...@intel.com> --- 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) -- 2.25.1