From: Raghavendra Ningoji <raghavendra.ningoji@amd.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, Jingjing Wu <jingjing.wu@intel.com>,
Bhagyada Modali <bhagyada.modali@amd.com>,
Robin Jarry <rjarry@redhat.com>,
Thomas Monjalon <thomas@monjalon.net>,
David Marchand <david.marchand@redhat.com>,
"Sachin Saxena" <sachin.saxena@oss.nxp.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: Re: [PATCH v1 1/3] raw/ntb: generalize framework for multiple vendors
Date: Mon, 21 Sep 2026 11:43:46 +0530 [thread overview]
Message-ID: <20260921061346.1889320-1-raghavendra.ningoji@amd.com> (raw)
In-Reply-To: <aq1Tie4YuRtESo30@bricha3-mobl1.ger.corp.intel.com>
On Thu, Sep 18, 2026 at 03:06:49PM +0000, Bruce Richardson wrote:
> > + 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?
Thanks Bruce, that makes sense - I agree the uniform "always call the op"
style is cleaner than the NULL-fallback branches.
But the built-in handshake (ntb_handshake_work) and the peer-config read
in ntb_dev_start implement the scratchpad protocol considering Intel-specific scratchpad layout
- vendor with similar intel scratchpad layout could reuse them . AMD is the exception because
it has only 8 usable scratchpad registers per side and needs its own
packed layout. - Future vendors with similar AMD scratchpad layout would reuse them.
If you think still it's essentially necessary will take up in next iteration/v2:
Rather than hiding them as fallbacks, keep them as named,
reusable default ops and wire them into the Intel driver explicitly:
- export ntb_handshake_work and set .dev_handshake in intel_ntb_ops;
- factor the inline peer-config read in ntb_dev_start() into
ntb_spad_read_peer_config() and set .read_peer_config for Intel;
- set .interrupt_handler = ntb_dev_intr_handler for Intel;
- drop the "if (op != NULL) ... else ..." branches so the common code
always calls the op.
That removes the implicit fallbacks you are flagging while still letting any
future standard-scratchpad vendor opt into the generic implementations.
Thanks,
Raghavendra
next prev parent reply other threads:[~2026-09-21 6:14 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
2026-09-21 6:13 ` Raghavendra Ningoji [this message]
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=20260921061346.1889320-1-raghavendra.ningoji@amd.com \
--to=raghavendra.ningoji@amd.com \
--cc=bhagyada.modali@amd.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=jingjing.wu@intel.com \
--cc=rjarry@redhat.com \
--cc=sachin.saxena@oss.nxp.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