common/cnxk: fix nibble parsing order when dumping MCAM

Message ID 20211124075528.10293-1-psatheesh@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series common/cnxk: fix nibble parsing order when dumping MCAM |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Satheesh Paul Antonysamy Nov. 24, 2021, 7:55 a.m. UTC
  From: Satheesh Paul <psatheesh@marvell.com>

Fix the order in which layer flags and layer type fields
are parsed when dumping the MCAM data.

Fixes: 9869c39918 ("common/cnxk: support flow entry dump")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/common/cnxk/roc_npc_mcam_dump.c | 40 ++++++++++++-------------
 1 file changed, 20 insertions(+), 20 deletions(-)
  

Comments

Jerin Jacob Dec. 21, 2021, 11:24 a.m. UTC | #1
On Wed, Nov 24, 2021 at 1:43 PM <psatheesh@marvell.com> wrote:
>
> From: Satheesh Paul <psatheesh@marvell.com>
>
> Fix the order in which layer flags and layer type fields
> are parsed when dumping the MCAM data.
>
> Fixes: 9869c39918 ("common/cnxk: support flow entry dump")
> Cc: stable@dpdk.org
>
> Signed-off-by: Satheesh Paul <psatheesh@marvell.com>


Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks

> ---
>  drivers/common/cnxk/roc_npc_mcam_dump.c | 40 ++++++++++++-------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c
> index 19b4901a52..278056591e 100644
> --- a/drivers/common/cnxk/roc_npc_mcam_dump.c
> +++ b/drivers/common/cnxk/roc_npc_mcam_dump.c
> @@ -159,6 +159,12 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> +       if (rx_parse->laflags) {
> +               data = npc_get_nibbles(flow, 2, offset);
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LA_FLAGS:%#02X\n", data);
> +               offset += 8;
> +       }
> +
>         if (rx_parse->latype) {
>                 data = npc_get_nibbles(flow, 1, offset);
>                 fprintf(file, "\tNPC_PARSE_NIBBLE_LA_LTYPE:%s\n",
> @@ -166,9 +172,9 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> -       if (rx_parse->laflags) {
> +       if (rx_parse->lbflags) {
>                 data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LA_FLAGS:%#02X\n", data);
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LB_FLAGS:%#02X\n", data);
>                 offset += 8;
>         }
>
> @@ -179,9 +185,9 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> -       if (rx_parse->lbflags) {
> +       if (rx_parse->lcflags) {
>                 data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LB_FLAGS:%#02X\n", data);
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LC_FLAGS:%#02X\n", data);
>                 offset += 8;
>         }
>
> @@ -192,9 +198,9 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> -       if (rx_parse->lcflags) {
> +       if (rx_parse->ldflags) {
>                 data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LC_FLAGS:%#02X\n", data);
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LD_FLAGS:%#02X\n", data);
>                 offset += 8;
>         }
>
> @@ -205,9 +211,9 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> -       if (rx_parse->ldflags) {
> +       if (rx_parse->leflags) {
>                 data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LD_FLAGS:%#02X\n", data);
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LE_FLAGS:%#02X\n", data);
>                 offset += 8;
>         }
>
> @@ -218,9 +224,9 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> -       if (rx_parse->leflags) {
> +       if (rx_parse->lfflags) {
>                 data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LE_FLAGS:%#02X\n", data);
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LF_FLAGS:%#02X\n", data);
>                 offset += 8;
>         }
>
> @@ -231,9 +237,9 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> -       if (rx_parse->lfflags) {
> +       if (rx_parse->lgflags) {
>                 data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LF_FLAGS:%#02X\n", data);
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LG_FLAGS:%#02X\n", data);
>                 offset += 8;
>         }
>
> @@ -244,10 +250,9 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                 offset += 4;
>         }
>
> -       if (rx_parse->lgflags) {
> +       if (rx_parse->lhflags) {
>                 data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LG_FLAGS:%#02X\n", data);
> -               offset += 8;
> +               fprintf(file, "\tNPC_PARSE_NIBBLE_LH_FLAGS:%#02X\n", data);
>         }
>
>         if (rx_parse->lhtype) {
> @@ -256,11 +261,6 @@ npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
>                         ltype_str[NPC_LID_LH][data]);
>                 offset += 4;
>         }
> -
> -       if (rx_parse->lhflags) {
> -               data = npc_get_nibbles(flow, 2, offset);
> -               fprintf(file, "\tNPC_PARSE_NIBBLE_LH_FLAGS:%#02X\n", data);
> -       }
>  }
>
>  static void
> --
> 2.25.4
>
  

Patch

diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c
index 19b4901a52..278056591e 100644
--- a/drivers/common/cnxk/roc_npc_mcam_dump.c
+++ b/drivers/common/cnxk/roc_npc_mcam_dump.c
@@ -159,6 +159,12 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
+	if (rx_parse->laflags) {
+		data = npc_get_nibbles(flow, 2, offset);
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LA_FLAGS:%#02X\n", data);
+		offset += 8;
+	}
+
 	if (rx_parse->latype) {
 		data = npc_get_nibbles(flow, 1, offset);
 		fprintf(file, "\tNPC_PARSE_NIBBLE_LA_LTYPE:%s\n",
@@ -166,9 +172,9 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
-	if (rx_parse->laflags) {
+	if (rx_parse->lbflags) {
 		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LA_FLAGS:%#02X\n", data);
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LB_FLAGS:%#02X\n", data);
 		offset += 8;
 	}
 
@@ -179,9 +185,9 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
-	if (rx_parse->lbflags) {
+	if (rx_parse->lcflags) {
 		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LB_FLAGS:%#02X\n", data);
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LC_FLAGS:%#02X\n", data);
 		offset += 8;
 	}
 
@@ -192,9 +198,9 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
-	if (rx_parse->lcflags) {
+	if (rx_parse->ldflags) {
 		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LC_FLAGS:%#02X\n", data);
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LD_FLAGS:%#02X\n", data);
 		offset += 8;
 	}
 
@@ -205,9 +211,9 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
-	if (rx_parse->ldflags) {
+	if (rx_parse->leflags) {
 		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LD_FLAGS:%#02X\n", data);
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LE_FLAGS:%#02X\n", data);
 		offset += 8;
 	}
 
@@ -218,9 +224,9 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
-	if (rx_parse->leflags) {
+	if (rx_parse->lfflags) {
 		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LE_FLAGS:%#02X\n", data);
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LF_FLAGS:%#02X\n", data);
 		offset += 8;
 	}
 
@@ -231,9 +237,9 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
-	if (rx_parse->lfflags) {
+	if (rx_parse->lgflags) {
 		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LF_FLAGS:%#02X\n", data);
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LG_FLAGS:%#02X\n", data);
 		offset += 8;
 	}
 
@@ -244,10 +250,9 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 		offset += 4;
 	}
 
-	if (rx_parse->lgflags) {
+	if (rx_parse->lhflags) {
 		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LG_FLAGS:%#02X\n", data);
-		offset += 8;
+		fprintf(file, "\tNPC_PARSE_NIBBLE_LH_FLAGS:%#02X\n", data);
 	}
 
 	if (rx_parse->lhtype) {
@@ -256,11 +261,6 @@  npc_flow_print_parse_nibbles(FILE *file, struct roc_npc_flow *flow,
 			ltype_str[NPC_LID_LH][data]);
 		offset += 4;
 	}
-
-	if (rx_parse->lhflags) {
-		data = npc_get_nibbles(flow, 2, offset);
-		fprintf(file, "\tNPC_PARSE_NIBBLE_LH_FLAGS:%#02X\n", data);
-	}
 }
 
 static void