[PATCH] rust: support DPDK API

Etelson, Gregory getelson at nvidia.com
Fri Mar 7 19:15:23 CET 2025



On Fri, 7 Mar 2025, Bruce Richardson wrote:

> External email: Use caution opening links or attachments
>
>
> On Fri, Mar 07, 2025 at 03:54:33PM +0000, Van Haaren, Harry wrote:
>>> From: Gregory Etelson <getelson at nvidia.com>
>>> Sent: Thursday, March 6, 2025 1:37 PM
>>> To: dev at dpdk.org <dev at dpdk.org>
>>> Cc: getelson at nvidia.com <getelson at nvidia.com>; thomas at monjalon.net <thomas at monjalon.net>; mkashani at nvidia.com <mkashani at nvidia.com>; Richardson, Bruce <bruce.richardson at intel.com>
>>> Subject: [PATCH] rust: support DPDK API
>>
> <snip>
>
>> +
>>> +use dpdklib::rte_ethdev::{
>>
>> As per first reply, I'd like to see the end-result safe-Rust namespacing be shortened.
>>
>> This can be easily done by renaming the name= in Cargo.toml, and
>> removing the "rte_" prefix at bindgen output stage for each file.
>> dpdk::ethdev:: { RTE_ETH_NAME_MAX_LEN, ... };
>>
>> Perhaps its a good method to put the generated (unsafe, raw-C-bindings) in this
>> namespace, and build a safe crate (with the dpdk::ethdev::* namespacing) over it.
>> Thoughts?
>>
>
> I love naming discussions :-)
>
> +1 to separate namespaces for low-level DPDK wraps, and more rustic
> higher-level APIs. However, that doesn't mean that the names get to be
> ugly! Let's definitely remove the "lib" in dpdklib (or libdpdk), and the
> "rte_" prefix from libs.
>
> How about having "dpdk::raw::*" e.g. "dpdk::raw::ethdev" for low-level
> wraps and "dpdk::*" e.g. "dpdk::ethdev" for higher level apis?
>

I think that is good idea.
Application can use ether dpdk::raw::* or dpdk::* API depending on internal 
logic.

> /Bruce
>


More information about the dev mailing list