DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Leroy <maxime@leroys.fr>
To: dev@dpdk.org
Cc: hemant.agrawal@nxp.com, sachin.saxena@nxp.com,
	david.marchand@redhat.com, Maxime Leroy <maxime@leroys.fr>
Subject: [PATCH v3 4/6] bus/fslmc/mc: implement dpcon_set_notification
Date: Tue, 30 Jun 2026 16:43:27 +0200	[thread overview]
Message-ID: <20260630144329.457643-5-maxime@leroys.fr> (raw)
In-Reply-To: <20260630144329.457643-1-maxime@leroys.fr>

The DPCON_CMDID_SET_NOTIFICATION command id and its wire struct were
already present in the flib, but the dpcon_set_notification() function and
the public dpcon_notification_cfg were never implemented. Add them so a
DPCON channel can be pointed at a DPIO for CDAN delivery, which the
net/dpaa2 Rx-queue-interrupt path needs.

Signed-off-by: Maxime Leroy <maxime@leroys.fr>
---
 drivers/bus/fslmc/mc/dpcon.c     | 31 +++++++++++++++++++++++++++++++
 drivers/bus/fslmc/mc/fsl_dpcon.h | 18 ++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/drivers/bus/fslmc/mc/dpcon.c b/drivers/bus/fslmc/mc/dpcon.c
index cd909fcac4..3ab2a12637 100644
--- a/drivers/bus/fslmc/mc/dpcon.c
+++ b/drivers/bus/fslmc/mc/dpcon.c
@@ -338,3 +338,34 @@ int dpcon_get_api_version(struct fsl_mc_io *mc_io,
 
 	return 0;
 }
+
+/**
+ * dpcon_set_notification() - Set the DPCON notification destination
+ * @mc_io:	Pointer to MC portal's I/O object
+ * @cmd_flags:	Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:	Token of DPCON object
+ * @cfg:	Notification parameters (DPIO, priority, user context)
+ *
+ * Return:	'0' on Success; Error code otherwise
+ */
+RTE_EXPORT_INTERNAL_SYMBOL(dpcon_set_notification)
+int dpcon_set_notification(struct fsl_mc_io *mc_io,
+			   uint32_t cmd_flags,
+			   uint16_t token,
+			   const struct dpcon_notification_cfg *cfg)
+{
+	struct dpcon_cmd_set_notification *dpcon_cmd;
+	struct mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPCON_CMDID_SET_NOTIFICATION,
+					  cmd_flags,
+					  token);
+	dpcon_cmd = (struct dpcon_cmd_set_notification *)cmd.params;
+	dpcon_cmd->dpio_id = cpu_to_le32(cfg->dpio_id);
+	dpcon_cmd->priority = cfg->priority;
+	dpcon_cmd->user_ctx = cpu_to_le64(cfg->user_ctx);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
diff --git a/drivers/bus/fslmc/mc/fsl_dpcon.h b/drivers/bus/fslmc/mc/fsl_dpcon.h
index f2668da1b1..3bef97f6f5 100644
--- a/drivers/bus/fslmc/mc/fsl_dpcon.h
+++ b/drivers/bus/fslmc/mc/fsl_dpcon.h
@@ -95,4 +95,22 @@ int dpcon_get_api_version(struct fsl_mc_io *mc_io,
 			  uint16_t *major_ver,
 			  uint16_t *minor_ver);
 
+/**
+ * struct dpcon_notification_cfg - Notification parameters
+ * @dpio_id:	DPIO object id that receives the channel's CDAN
+ * @priority:	Priority within the DPIO channel (0-7)
+ * @user_ctx:	User context provided with each CDAN message
+ */
+struct dpcon_notification_cfg {
+	int dpio_id;
+	uint8_t priority;
+	uint64_t user_ctx;
+};
+
+__rte_internal
+int dpcon_set_notification(struct fsl_mc_io *mc_io,
+			   uint32_t cmd_flags,
+			   uint16_t token,
+			   const struct dpcon_notification_cfg *cfg);
+
 #endif /* __FSL_DPCON_H */
-- 
2.43.0


  parent reply	other threads:[~2026-06-30 14:44 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 15:49 [PATCH 0/9] net/dpaa2: NAPI-style Rx queue interrupts Maxime Leroy
2026-06-11 15:49 ` [PATCH 1/9] net/dpaa2: implement RSS RETA query and update Maxime Leroy
2026-06-11 15:49 ` [PATCH 2/9] eal/interrupts: keep real errno on epoll error Maxime Leroy
2026-06-16  8:02   ` David Marchand
2026-06-16  9:29     ` David Marchand
2026-06-11 15:49 ` [PATCH 3/9] bus/fslmc: move DPCON management from event driver to bus Maxime Leroy
2026-06-11 15:49 ` [PATCH 4/9] bus/fslmc/dpio: make the portal DQRI epoll optional Maxime Leroy
2026-06-11 15:49 ` [PATCH 5/9] net/dpaa2: support Rx queue interrupts Maxime Leroy
2026-06-16  8:05   ` David Marchand
2026-06-11 15:49 ` [PATCH 6/9] bus/fslmc/dpio: tune DQRI interrupt coalescing holdoff Maxime Leroy
2026-06-11 15:49 ` [PATCH 7/9] net/dpaa2: fix Rx queue count for primary process Maxime Leroy
2026-06-11 15:49 ` [PATCH 8/9] ethdev: keep fast-path ops valid after port stop Maxime Leroy
2026-06-11 16:01   ` Morten Brørup
2026-06-11 18:39     ` Maxime Leroy
2026-06-12 15:00       ` Thomas Monjalon
2026-06-14 19:30   ` Stephen Hemminger
2026-06-15  9:26   ` David Marchand
2026-06-16  9:23     ` Maxime Leroy
2026-06-16  9:33       ` David Marchand
2026-06-11 15:49 ` [PATCH 9/9] net/dpaa2: drop the fake software VLAN strip offload Maxime Leroy
2026-06-11 15:56   ` Morten Brørup
2026-06-11 16:13     ` Morten Brørup
2026-06-11 16:58     ` Maxime Leroy
2026-06-11 17:30   ` Stephen Hemminger
2026-06-12  5:42     ` Maxime Leroy
2026-06-16 10:27 ` [PATCH v2 0/6] net/dpaa2: NAPI-style Rx queue interrupts Maxime Leroy
2026-06-16 10:27   ` [PATCH v2 1/6] bus/fslmc: move DPCON management from event driver to bus Maxime Leroy
2026-06-16 10:27   ` [PATCH v2 2/6] bus/fslmc/dpio: make the portal DQRI epoll optional Maxime Leroy
2026-06-16 10:27   ` [PATCH v2 3/6] net/dpaa2: support Rx queue interrupts Maxime Leroy
2026-06-18  8:46     ` David Marchand
2026-06-16 10:27   ` [PATCH v2 4/6] bus/fslmc/dpio: tune DQRI interrupt coalescing holdoff Maxime Leroy
2026-06-16 10:27   ` [PATCH v2 5/6] net/dpaa2: fix Rx queue count for primary process Maxime Leroy
2026-06-16 10:27   ` [PATCH v2 6/6] net/dpaa2: drop the fake software VLAN strip offload Maxime Leroy
2026-06-16 14:11     ` Stephen Hemminger
2026-06-16 15:40       ` Hemant Agrawal
2026-06-21  4:33   ` [PATCH v2 0/6] net/dpaa2: NAPI-style Rx queue interrupts Hemant Agrawal
2026-06-29 13:13     ` Maxime Leroy
2026-06-30 14:43   ` [PATCH v3 " Maxime Leroy
2026-06-30 14:43     ` [PATCH v3 1/6] event/dpaa2: disable channel before closing it Maxime Leroy
2026-07-03 17:21       ` Hemant Agrawal
2026-07-06  9:11         ` Maxime Leroy
2026-06-30 14:43     ` [PATCH v3 2/6] bus/fslmc: move DPCON management from event driver to bus Maxime Leroy
2026-06-30 14:43     ` [PATCH v3 3/6] bus/fslmc/dpio: make the portal DQRI epoll optional Maxime Leroy
2026-06-30 14:43     ` Maxime Leroy [this message]
2026-06-30 14:43     ` [PATCH v3 5/6] net/dpaa2: support Rx queue interrupts Maxime Leroy
2026-07-03 17:21       ` Hemant Agrawal
2026-07-06 10:36         ` Maxime Leroy
2026-06-30 14:43     ` [PATCH v3 6/6] net/dpaa2: pin Rx queue interrupt to the polling core Maxime Leroy
2026-07-03 16:03     ` [PATCH v3 0/6] net/dpaa2: NAPI-style Rx queue interrupts Stephen Hemminger
2026-07-03 18:56       ` Maxime Leroy
2026-07-03 20:26         ` Stephen Hemminger

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=20260630144329.457643-5-maxime@leroys.fr \
    --to=maxime@leroys.fr \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=sachin.saxena@nxp.com \
    /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