git: 81ac9c66edbf - main - dpaa/qman: Make `show fqid <N>` actually work

Justin Hibbits <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a87c3f9.3aff4.186a368e__2397.05699948303$1787282449$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=81ac9c66edbfda05f347448828619c0f47af1be3

commit 81ac9c66edbfda05f347448828619c0f47af1be3
Author:     Justin Hibbits <[email protected]>
AuthorDate: 2026-08-20 03:39:48 +0000
Commit:     Justin Hibbits <[email protected]>
CommitDate: 2026-08-21 03:15:08 +0000

    dpaa/qman: Make `show fqid <N>` actually work
    
    Set the verb correctly so the query works.  Also print out the
    programmable FQID fields as well.
---
 sys/dev/dpaa/qman.c         | 38 --------------------------------------
 sys/dev/dpaa/qman_portals.c | 23 +++++++++++++++++++++++
 sys/dev/dpaa/qman_var.h     | 39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 38 deletions(-)

diff --git a/sys/dev/dpaa/qman.c b/sys/dev/dpaa/qman.c
index fe609711f413..6e16ae96257b 100644
--- a/sys/dev/dpaa/qman.c
+++ b/sys/dev/dpaa/qman.c
@@ -111,44 +111,6 @@
 
 /* Software portals.  Cache-enabled registers */
 
-#define	QCSP_VERB_INIT_FQ_PARK		0x40
-#define	QCSP_VERB_INIT_FQ_SCHED		0x41
-#define	QCSP_VERB_QUERY_FQ		0x44
-#define	QCSP_VERB_QUERY_FQ_NP		0x45
-#define	QCSP_VERB_ALTER_FQ_SCHED	0x48
-#define	QCSP_VERB_ALTER_FQ_FE		0x49
-#define	QCSP_VERB_ALTER_FQ_RETIRE	0x4a
-#define	QCSP_VERB_ALTER_FQ_TAKE_OUT	0x4b
-#define	QCSP_VERB_ALTER_FQ_RETIRE_CTXB	0x4c
-#define	QCSP_VERB_ALTER_FQ_XON		0x4d
-#define	QCSP_VERB_ALTER_FQ_XOFF		0x4e
-
-/* Init FQ */
-#define	QCSP_INIT_FQ_WE_OAC		0x0100
-#define	QCSP_INIT_FQ_WE_ORPC		0x0080
-#define	QCSP_INIT_FQ_WE_CGID		0x0040
-#define	QCSP_INIT_FQ_WE_FQ_CTRL		0x0020
-#define	QCSP_INIT_FQ_WE_DEST_WQ		0x0010
-#define	QCSP_INIT_FQ_WE_ICS_CRED	0x0008
-#define	QCSP_INIT_FQ_WE_TD_THRESH	0x0004
-#define	QCSP_INIT_FQ_WE_CONTEXT_B	0x0002
-#define	QCSP_INIT_FQ_WE_CONTEXT_A	0x0001
-
-#define	QMAN_MC_RES_OK			0xf0
-
-#define	QMAN_MC_AFQS_NE			0x01
-
-/* Init FQ options */
-#define	QM_FQCTRL_CGE			0x0400
-#define	QM_FQCTRL_TDE			0x0200
-#define	QM_FQCTRL_ORP			0x0100
-#define	QM_FQCTRL_CTXASTASH		0x0080
-#define	QM_FQCTRL_CPCSTASH		0x0040
-#define	QM_FQCTRL_FORCESFDR		0x0008
-#define	QM_FQCTRL_AVOIDBLOCK		0x0004
-#define	QM_FQCTRL_HOLDACTIVE		0x0002
-#define	QM_FQCTRL_LIC			0x0001
-
 /*
  * Context_A stashing config.
  */
diff --git a/sys/dev/dpaa/qman_portals.c b/sys/dev/dpaa/qman_portals.c
index e0a67410884e..1b90951ee229 100644
--- a/sys/dev/dpaa/qman_portals.c
+++ b/sys/dev/dpaa/qman_portals.c
@@ -488,6 +488,7 @@ DB_SHOW_COMMAND(fqid, qman_show_fqid)
 		return;
 
 	bzero(&cmd, sizeof(cmd));
+	cmd.query_fq_np.verb = QCSP_VERB_QUERY_FQ_NP;
 	cmd.query_fq_np.fqid = addr;
 
 	/* Ensure we have got QMan port initialized */
@@ -500,6 +501,7 @@ DB_SHOW_COMMAND(fqid, qman_show_fqid)
 	/* Dump all NP fields */
 	if (res != NULL && save_res.query_fq_np.rslt == 0xf0) {
 		db_printf("FQID: %d\n", (int)addr);
+		db_printf("  Non-programmable:\n");
 		db_printf("  State: %x\n", save_res.query_fq_np.state);
 		db_printf("  Link: %x\n", save_res.query_fq_np.fqd_link);
 		db_printf("  ODP_SEQ: %x\n", save_res.query_fq_np.odp_seq);
@@ -524,4 +526,25 @@ DB_SHOW_COMMAND(fqid, qman_show_fqid)
 		db_printf("  od2_sfdr: %x\n", save_res.query_fq_np.od2_sfdr);
 		db_printf("  od3_sfdr: %x\n", save_res.query_fq_np.od3_sfdr);
 	}
+
+	bzero(&cmd, sizeof(cmd));
+	cmd.query_fq.verb = QCSP_VERB_QUERY_FQ;
+	cmd.query_fq.fqid = addr;
+
+	res = qman_portal_mc_send_raw(portal, &cmd);
+	if (res != NULL)
+		save_res = *res;
+
+	if (res != NULL && save_res.query_fq.rslt == 0xf0) {
+		db_printf("  Programmable:\n");
+		db_printf("  ORPC: %02x\n", save_res.query_fq.orpc);
+		db_printf("  CGID: %02x\n", save_res.query_fq.cgid);
+		db_printf("  FQ_CTRL: %04x\n", save_res.query_fq.fq_ctrl);
+		db_printf("  DEST_WQ: %04x\n", save_res.query_fq.dest_wq);
+		db_printf("  ICS_CRED: %04x\n", save_res.query_fq.ics_cred);
+		db_printf("  TD_thresh: %04x\n", save_res.query_fq.td_thresh);
+		db_printf("  Context_B: %08x\n", save_res.query_fq.context_b);
+		db_printf("  Context_A: %16lx\n", save_res.query_fq.context_a);
+		db_printf("  OAC: %04x\n", save_res.query_fq.oac);
+	}
 }
diff --git a/sys/dev/dpaa/qman_var.h b/sys/dev/dpaa/qman_var.h
index 6d13340ca365..8e30314688c0 100644
--- a/sys/dev/dpaa/qman_var.h
+++ b/sys/dev/dpaa/qman_var.h
@@ -133,6 +133,45 @@ union qman_mc_result {
 _Static_assert(sizeof(union qman_mc_command) == 64, "MC command mis-sized");
 _Static_assert(sizeof(union qman_mc_result) == 64, "MC result mis-sized");
 
+#define	QCSP_VERB_INIT_FQ_PARK		0x40
+#define	QCSP_VERB_INIT_FQ_SCHED		0x41
+#define	QCSP_VERB_QUERY_FQ		0x44
+#define	QCSP_VERB_QUERY_FQ_NP		0x45
+#define	QCSP_VERB_ALTER_FQ_SCHED	0x48
+#define	QCSP_VERB_ALTER_FQ_FE		0x49
+#define	QCSP_VERB_ALTER_FQ_RETIRE	0x4a
+#define	QCSP_VERB_ALTER_FQ_TAKE_OUT	0x4b
+#define	QCSP_VERB_ALTER_FQ_RETIRE_CTXB	0x4c
+#define	QCSP_VERB_ALTER_FQ_XON		0x4d
+#define	QCSP_VERB_ALTER_FQ_XOFF		0x4e
+
+/* Init FQ */
+#define	QCSP_INIT_FQ_WE_OAC		0x0100
+#define	QCSP_INIT_FQ_WE_ORPC		0x0080
+#define	QCSP_INIT_FQ_WE_CGID		0x0040
+#define	QCSP_INIT_FQ_WE_FQ_CTRL		0x0020
+#define	QCSP_INIT_FQ_WE_DEST_WQ		0x0010
+#define	QCSP_INIT_FQ_WE_ICS_CRED	0x0008
+#define	QCSP_INIT_FQ_WE_TD_THRESH	0x0004
+#define	QCSP_INIT_FQ_WE_CONTEXT_B	0x0002
+#define	QCSP_INIT_FQ_WE_CONTEXT_A	0x0001
+
+#define	QMAN_MC_RES_OK			0xf0
+
+#define	QMAN_MC_AFQS_NE			0x01
+
+/* Init FQ options */
+#define	QM_FQCTRL_CGE			0x0400
+#define	QM_FQCTRL_TDE			0x0200
+#define	QM_FQCTRL_ORP			0x0100
+#define	QM_FQCTRL_CTXASTASH		0x0080
+#define	QM_FQCTRL_CPCSTASH		0x0040
+#define	QM_FQCTRL_FORCESFDR		0x0008
+#define	QM_FQCTRL_AVOIDBLOCK		0x0004
+#define	QM_FQCTRL_HOLDACTIVE		0x0002
+#define	QM_FQCTRL_LIC			0x0001
+
+
 struct qman_mc {
 	uint8_t polarity;
 	bool busy;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.