DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Etelson, Gregory" <getelson@nvidia.com>
To: "Van Haaren, Harry" <harry.van.haaren@intel.com>
Cc: Gregory Etelson <getelson@nvidia.com>,
	 "Richardson, Bruce" <bruce.richardson@intel.com>,
	 "dev@dpdk.org" <dev@dpdk.org>,
	"mkashani@nvidia.com" <mkashani@nvidia.com>,
	 "thomas@monjalon.net" <thomas@monjalon.net>,
	 "igootorov@gmail.com" <igootorov@gmail.com>,
	 Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH v2] rust: support raw DPDK API
Date: Fri, 14 Mar 2025 21:12:53 +0200 (IST)	[thread overview]
Message-ID: <f4d3691a-489d-6767-8246-26291564640d@nvidia.com> (raw)
In-Reply-To: <PH8PR11MB680333949B01E4316CF44E29D7D62@PH8PR11MB6803.namprd11.prod.outlook.com>


<snip>

>
> Looking at the above parts of "Port abstraction in Rust", I'm not sure it really adds anything.
> It feels a bit "middle of the road" (aka, adding some "abstraction", but not going far enough).
>

Current helloword example is a POC for the raw module usage.
It content can (should) be updated once the API will be more stable.

> What if we took an even smaller step: remove the Rust struct concepts, and just call the "dpdk::raw::*" unsafe
> functions directly, as if they were C code. No "struct Port, impl Port", and no "Iterator<DpdkPort" concepts at all.
> That would show "correct" usage of the raw generated bindings, and provide raw API unit-tests.

In cases when helloworld is activated with more than 1 port, dedicated structure helps to keep track of resources.
Maybe that example was not the best choice for "helloworld" introduction.

>
> In a future patch, we can start to build "Safe Rust" essential-basics of EAL, and Ethdev. This is to abstract over the
> "dpdk::raw::*" APIs, "compiles == correct", end-user documentation, etc all as is normal in Rust ecosystem. Example:
>
> Today: V2 patch (note the "Port" struct in Rust):
>  pub unsafe fn init_port_config(port: &mut Port) { ... }
>
> Future Raw API (note the raw u16 like C APIs):
>  unsafe fn init_port_config(port: u16) { ... }
>
> Future Safe API (mockup, this needs thought):
>  let ports = eal.get_eth_ports();
>  for p in &mut ports {
>     p.initialize(rxqs, txqs, ...)?;
>  }
>
> Thoughts?

The raw API links rust application directly with DPDK libraries.
Such application can achieve the same performance as C application.

DPDK can have additional rust module - dpdk::native, for genuine rust 
interfaces.

With 2 rust modules, DPDK users will have time to build application logic
while DPDK developers can safely experiment with new API.

I see the raw module as a temporal solution before DPDK will have native rust 
API.

Regards,
Gregory


  parent reply	other threads:[~2025-03-14 19:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 13:37 [PATCH] rust: support " Gregory Etelson
2025-03-06 19:26 ` Van Haaren, Harry
2025-03-07 16:56   ` Etelson, Gregory
2025-03-07 15:54 ` Van Haaren, Harry
2025-03-07 16:20   ` Bruce Richardson
2025-03-07 18:15     ` Etelson, Gregory
2025-03-07 18:00   ` Etelson, Gregory
2025-03-08 14:28 ` Igor Gutorov
2025-03-08 19:14   ` Etelson, Gregory
2025-03-10 15:31     ` Stephen Hemminger
2025-03-12  5:21       ` Etelson, Gregory
2025-03-08 18:50 ` [PATCH v2] rust: support raw " Gregory Etelson
2025-03-10 16:13   ` Van Haaren, Harry
2025-03-10 16:25     ` Bruce Richardson
2025-03-12 17:19       ` Thomas Monjalon
2025-03-14 19:12     ` Etelson, Gregory [this message]
2025-03-10 15:00 ` [PATCH] rust: support " Stephen Hemminger
2025-03-12  5:12   ` Etelson, Gregory
2025-03-10 16:18 ` Stephen Hemminger
2025-03-10 16:30   ` Bruce Richardson
2025-03-12 14:30   ` Etelson, Gregory
2025-03-13  7:56     ` Igor Gutorov
2025-03-12 15:29   ` Igor Gutorov
2025-03-12 17:24     ` Thomas Monjalon
2025-03-14 18:38 ` [PATCH v3] rust: support raw " Gregory Etelson

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=f4d3691a-489d-6767-8246-26291564640d@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=igootorov@gmail.com \
    --cc=mkashani@nvidia.com \
    --cc=stephen@networkplumber.org \
    --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;
as well as URLs for NNTP newsgroup(s).