dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Prashant Gupta <prashant.gupta_3@nxp.com>
To: dev@dpdk.org, stephen@networkplumber.org, david.marchand@redhat.com
Cc: Jun Yang <jun.yang@nxp.com>
Subject: [PATCH 14/15] net/dpaa2: add eCPRI header and message dump
Date: Tue, 14 Oct 2025 12:10:34 +0530	[thread overview]
Message-ID: <20251014064035.1312896-15-prashant.gupta_3@nxp.com> (raw)
In-Reply-To: <20251014064035.1312896-1-prashant.gupta_3@nxp.com>

From: Jun Yang <jun.yang@nxp.com>

Dump ECPRI header over ethernet/vlan/udp.
Dump message contents according to various types.
ECPRI are set to parser result areas by softparser.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 drivers/net/dpaa2/dpaa2_parse_dump.h | 124 +++++++++++++++++++++++++++
 1 file changed, 124 insertions(+)

diff --git a/drivers/net/dpaa2/dpaa2_parse_dump.h b/drivers/net/dpaa2/dpaa2_parse_dump.h
index 78fd3b768c..bcab3bf0cb 100644
--- a/drivers/net/dpaa2/dpaa2_parse_dump.h
+++ b/drivers/net/dpaa2/dpaa2_parse_dump.h
@@ -74,6 +74,122 @@ struct dpaa2_fapr_field_info support_dump_fields[] = {
 	}
 };
 
+static inline void
+dpaa2_print_ecpri(struct dpaa2_fapr_array *fapr)
+{
+	uint8_t ecpri_type;
+	struct rte_ecpri_combined_msg_hdr ecpri_msg;
+
+	ecpri_type = fapr->pr[DPAA2_FAFE_PSR_OFFSET];
+	if ((ecpri_type >> 1) > 7) {
+		DPAA2_PR_PRINT("Invalid ECPRI type(0x%02x)\r\n",
+			ecpri_type);
+	} else {
+		DPAA2_PR_PRINT("ECPRI type %d present\r\n",
+			ecpri_type >> 1);
+		if (ecpri_type == ECPRI_FAFE_TYPE_0 ||
+			ecpri_type == ECPRI_FAFE_TYPE_1) {
+			/* Type 0 is identical to type1*/
+			ecpri_msg.type0.pc_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 1];
+			ecpri_msg.type0.pc_id =
+				ecpri_msg.type0.pc_id << 8;
+			ecpri_msg.type0.pc_id |=
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET];
+
+			ecpri_msg.type0.seq_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 3];
+			ecpri_msg.type0.seq_id =
+				ecpri_msg.type0.seq_id << 8;
+			ecpri_msg.type0.seq_id |=
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 2];
+
+			DPAA2_PR_PRINT("pc_id(0x%04x) seq_id(0x%04x)\r\n",
+				rte_be_to_cpu_16(ecpri_msg.type0.pc_id),
+				rte_be_to_cpu_16(ecpri_msg.type0.seq_id));
+		} else if (ecpri_type == ECPRI_FAFE_TYPE_2) {
+			ecpri_msg.type2.rtc_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 1];
+			ecpri_msg.type2.rtc_id =
+				ecpri_msg.type2.rtc_id << 8;
+			ecpri_msg.type2.rtc_id |=
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET];
+
+			ecpri_msg.type2.seq_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 3];
+			ecpri_msg.type2.seq_id =
+				ecpri_msg.type2.seq_id << 8;
+			ecpri_msg.type2.seq_id |=
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 2];
+
+			DPAA2_PR_PRINT("rtc_id(0x%04x) seq_id(0x%04x)\r\n",
+				rte_be_to_cpu_16(ecpri_msg.type2.rtc_id),
+				rte_be_to_cpu_16(ecpri_msg.type2.seq_id));
+		} else if (ecpri_type == ECPRI_FAFE_TYPE_3) {
+			DPAA2_PR_PRINT("ECPRI type3 extract not support\r\n");
+		} else if (ecpri_type == ECPRI_FAFE_TYPE_4) {
+			ecpri_msg.type4.rma_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET];
+			ecpri_msg.type4.rw =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 1] >> 4;
+			ecpri_msg.type4.rr =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 1] & 0xf;
+
+			ecpri_msg.type4.ele_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 3];
+			ecpri_msg.type4.ele_id =
+				ecpri_msg.type4.ele_id << 8;
+			ecpri_msg.type4.ele_id |=
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 2];
+
+			DPAA2_PR_PRINT("rma_id(0x%02x) rw(0x%02x)",
+				ecpri_msg.type4.rma_id, ecpri_msg.type4.rw);
+			DPAA2_PR_PRINT(" rr(0x%02x) ele_id(0x%04x)\r\n",
+				ecpri_msg.type4.rr,
+				rte_be_to_cpu_16(ecpri_msg.type4.ele_id));
+		} else if (ecpri_type == ECPRI_FAFE_TYPE_5) {
+			ecpri_msg.type5.msr_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET];
+			ecpri_msg.type5.act_type =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 1];
+
+			DPAA2_PR_PRINT("rma_id(0x%02x) rw(0x%02x)\r\n",
+				ecpri_msg.type5.msr_id,
+				ecpri_msg.type5.act_type);
+		} else if (ecpri_type == ECPRI_FAFE_TYPE_6) {
+			ecpri_msg.type6.rst_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 1];
+			ecpri_msg.type6.rst_id =
+				ecpri_msg.type6.rst_id << 8;
+			ecpri_msg.type6.rst_id |=
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET];
+
+			ecpri_msg.type6.rst_op =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 2];
+
+			DPAA2_PR_PRINT("rst_id(0x%04x) rst_op(0x%02x)\r\n",
+				rte_be_to_cpu_16(ecpri_msg.type6.rst_id),
+				ecpri_msg.type6.rst_op);
+		} else if (ecpri_type == ECPRI_FAFE_TYPE_7) {
+			ecpri_msg.type7.evt_id =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET];
+			ecpri_msg.type7.evt_type =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 1];
+			ecpri_msg.type7.seq =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 2];
+			ecpri_msg.type7.number =
+				fapr->pr[DPAA2_ECPRI_MSG_OFFSET + 3];
+
+			DPAA2_PR_PRINT("evt_id(0x%02x) evt_type(0x%02x)",
+				ecpri_msg.type7.evt_id,
+				ecpri_msg.type7.evt_type);
+			DPAA2_PR_PRINT(" seq(0x%02x) number(0x%02x)\r\n",
+				ecpri_msg.type7.seq,
+				ecpri_msg.type7.number);
+		}
+	}
+}
+
 static inline void
 dpaa2_print_faf(struct dpaa2_fapr_array *fapr)
 {
@@ -82,6 +198,7 @@ dpaa2_print_faf(struct dpaa2_fapr_array *fapr)
 	int i, byte_pos, bit_pos, vxlan = 0, vxlan_vlan = 0;
 	struct rte_ether_hdr vxlan_in_eth;
 	uint16_t vxlan_vlan_tci;
+	int ecpri = 0;
 
 	for (i = 0; i < faf_bit_len; i++) {
 		faf_bits[i].position = i;
@@ -111,6 +228,8 @@ dpaa2_print_faf(struct dpaa2_fapr_array *fapr)
 			faf_bits[i].name = "UDP Present";
 		else if (i == FAF_TCP_FRAM)
 			faf_bits[i].name = "TCP Present";
+		else if (i == FAFE_ECPRI_FRAM)
+			faf_bits[i].name = "ECPRI Present";
 		else
 			faf_bits[i].name = "Check RM for this unusual frame";
 	}
@@ -124,6 +243,8 @@ dpaa2_print_faf(struct dpaa2_fapr_array *fapr)
 				faf_bits[i].position, faf_bits[i].name);
 			if (i == FAF_VXLAN_FRAM)
 				vxlan = 1;
+			else if (i == FAFE_ECPRI_FRAM)
+				ecpri = 1;
 		}
 	}
 
@@ -192,6 +313,9 @@ dpaa2_print_faf(struct dpaa2_fapr_array *fapr)
 				vxlan_vlan_tci);
 		}
 	}
+
+	if (ecpri)
+		dpaa2_print_ecpri(fapr);
 }
 
 static inline void
-- 
2.43.0


  parent reply	other threads:[~2025-10-14  7:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  6:40 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14  6:40 ` [PATCH 01/15] net/dpaa2: fix uninitialized variable issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 02/15] net/dpaa2: fix to free buffers from error queue Prashant Gupta
2025-10-14  6:40 ` [PATCH 03/15] net/dpaa2: fix L3/L4 csum results in packet parse Prashant Gupta
2025-10-14  6:40 ` [PATCH 04/15] net/dpaa2: fix to recv packets with additional parse errors Prashant Gupta
2025-10-14  6:40 ` [PATCH 05/15] net/dpaa2: fix error frame dump issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 06/15] net/dpaa2: fix flow rule's resizing issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 07/15] net/dpaa2: add dpmac MC header file Prashant Gupta
2025-10-14  6:40 ` [PATCH 08/15] net/dpaa2: support dpmac counters in stats Prashant Gupta
2025-10-14  6:40 ` [PATCH 09/15] net/dpaa2: setup the speed cap based on the actual MAC Prashant Gupta
2025-10-14  6:40 ` [PATCH 10/15] drivers: dpaa2 upgrade fslmc base FW to 10.39.0 Prashant Gupta
2025-10-14  6:40 ` [PATCH 11/15] net/dpaa2: replace global variable to driver flag Prashant Gupta
2025-10-14  6:40 ` [PATCH 12/15] net/dpaa2: add devargs to drop parse packets in HW Prashant Gupta
2025-10-14  6:40 ` [PATCH 13/15] net/dpaa2: optimize to prefetch next parser result Prashant Gupta
2025-10-14  6:40 ` Prashant Gupta [this message]
2025-10-14  6:40 ` [PATCH 15/15] net/dpaa2: add Policer stats for each TC Prashant Gupta
  -- strict thread matches above, loose matches on Subject: below --
2025-10-14  6:00 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14  6:00 ` [PATCH 14/15] net/dpaa2: add eCPRI header and message dump Prashant Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251014064035.1312896-15-prashant.gupta_3@nxp.com \
    --to=prashant.gupta_3@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jun.yang@nxp.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).