From: Bruce Richardson <bruce.richardson@intel.com>
To: Raghavendra Ningoji <raghavendra.ningoji@amd.com>
Cc: <dev@dpdk.org>, <jingjing.wu@intel.com>, <rjarry@redhat.com>,
<thomas@monjalon.net>, <selwin.sebastian@amd.com>,
<bhagyada.modali@amd.com>
Subject: Re: [PATCH v1 1/3] raw/ntb: generalize framework for multiple vendors
Date: Fri, 18 Sep 2026 16:06:49 +0100 [thread overview]
Message-ID: <aq1Tie4YuRtESo30@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20260823140639.153997-2-raghavendra.ningoji@amd.com>
On Sun, Aug 23, 2026 at 07:36:37PM +0530, Raghavendra Ningoji wrote:
> The NTB rawdev framework was written around the Intel back-to-back
> topology and the built-in scratchpad handshake protocol. To allow
> other vendors to plug into the same framework, add vendor-neutral
> hooks and make the common code dispatch through them:
>
> - Add NTB_TOPO_PRI/NTB_TOPO_SEC topology types for hardware that uses
> a primary/secondary topology instead of back-to-back.
> - Add optional ntb_dev_ops hooks: interrupt_handler (vendor-specific
> MSI-X handler), dev_handshake (vendor-specific link handshake) and
> read_peer_config (vendor-specific peer-config read at start). When a
> hook is NULL the common code keeps using the existing built-in path,
> so the Intel driver is unaffected.
> - Add a pmd_private pointer to struct ntb_hw for vendor-specific state.
> - Guard the receive path against a malformed stream with no end-of-packet
> marker so it cannot overflow the descriptor ring.
>
> Signed-off-by: Raghavendra Ningoji <raghavendra.ningoji@amd.com>
> ---
> drivers/raw/ntb/ntb.c | 94 ++++++++++++++++++++++++++++---------------
> drivers/raw/ntb/ntb.h | 18 +++++++++
> 2 files changed, 80 insertions(+), 32 deletions(-)
>
<snip>
> enum ntb_link {
> @@ -100,6 +103,8 @@ enum ntb_spad_idx {
> * for those db bits.
> * @peer_db_set: Set doorbell bit to generate peer interrupt for that bit.
> * @vector_bind: Bind vector source [intr] to msix vector [msix].
> + * @interrupt_handler: Vendor-specific interrupt handler. If NULL, the
> + * built-in handler is used.
> */
> struct ntb_dev_ops {
> int (*ntb_dev_init)(const struct rte_rawdev *dev);
> @@ -119,6 +124,16 @@ struct ntb_dev_ops {
> int (*peer_db_set)(const struct rte_rawdev *dev, uint8_t db_bit);
> int (*vector_bind)(const struct rte_rawdev *dev, uint8_t intr,
> uint8_t msix);
> + void (*interrupt_handler)(void *param);
> + /* Optional vendor-specific handshake. If NULL, the built-in
> + * scratchpad handshake is used. Used by hardware (e.g. AMD) whose
> + * scratchpad layout differs from the built-in protocol.
> + */
> + int (*dev_handshake)(const struct rte_rawdev *dev);
> + /* Optional vendor-specific peer-config read at device start. If NULL,
> + * the built-in scratchpad reads are used.
> + */
> + int (*read_peer_config)(const struct rte_rawdev *dev);
> };
For these new op fields, do you foresee cases where other drivers might use
the "default" functions as you have now? Might it be better to simplify
things and always use driver-supplied ops, converting the existing
functions into intel-specific ops, rather than making them fallback
functions?
/Bruce
<snip>
next prev parent reply other threads:[~2026-09-18 15:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 14:06 [PATCH v1 0/3] raw/ntb: add AMD NTB support Raghavendra Ningoji
2026-08-23 14:06 ` [PATCH v1 1/3] raw/ntb: generalize framework for multiple vendors Raghavendra Ningoji
2026-09-18 15:06 ` Bruce Richardson [this message]
2026-09-21 6:13 ` Raghavendra Ningoji
2026-08-23 14:06 ` [PATCH v1 2/3] raw/ntb: add AMD NTB support Raghavendra Ningoji
2026-09-25 10:22 ` Bruce Richardson
2026-09-28 10:46 ` Raghavendra Ningoji
2026-08-23 14:06 ` [PATCH v1 3/3] doc: " Raghavendra Ningoji
2026-09-25 10:50 ` Bruce Richardson
2026-09-28 10:47 ` Raghavendra Ningoji
2026-09-11 18:30 ` [PATCH v1 0/3] raw/ntb: " Raghavendra Ningoji
2026-09-16 11:29 ` David Marchand
2026-09-25 9:17 ` [v1,0/3] " Bhagyada Modali
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=aq1Tie4YuRtESo30@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=bhagyada.modali@amd.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=raghavendra.ningoji@amd.com \
--cc=rjarry@redhat.com \
--cc=selwin.sebastian@amd.com \
--cc=thomas@monjalon.net \
/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