From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81FAD465A7; Wed, 16 Apr 2025 13:42:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71C6B40B98; Wed, 16 Apr 2025 13:42:22 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) by mails.dpdk.org (Postfix) with ESMTP id 9F0E3406B8 for ; Wed, 16 Apr 2025 13:42:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HkZOdmX4CbHW84cI/oeKFd8r+BZfhdiEJ9D8lxhrYyuSGhHEb9khdMoVmqyh58OdccU7BvKiqW0toqEANMgB+0t0hX+7VEpGsazgPEt5Eb5NKVEQpcaxQtBWKJIUYibSZuWUICFuO1WIeFzc040nUV+6URYWiGMCTIt4Af6h9mC999zIdR3z5c6p3LvGs/Zn8aGORbgeYVZQ8IOYmquZWd4/kku0zJ6q7W5wDWhM6u6RvRY1iNqspxSHpkPLG+V0ovwHh/z6L/DJTq+hep4YbSFyl2ItvRrRinp7zO6Z1fiuLgpvVZXcHchPh7EUbqhfn0OuIv+mofVwCP/H5dC8vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gaQzL9VRddbfXR9yFX9AVAEapSXf73D5SnB1G+Z7mps=; b=Ula0XCOrkkaVvzllNuevUJV0W8vlXUsuEamg+2e1frGy8C7mi7Slx4kFq3rRqhwm/oFKQKGDVTu+3T+VtAf0yqCVTYEwj36dEPtlQgg0WkSuU522hFUXAo7xNBNPVZ/fGISAYKidZ6BBhiBoYQtgUYBk7XwrkPgTr2WA4wQhb8r72bWkUpD1bwp0YX0KSrERtbPW5xESUXi4fDWdB3fuuDflB1alQA8qCssfX6S3lQGlrirg1Mw1GJj2VEjRNzNIOR/5GiDr93ZftHPCjxrJV6+dVuO7hHnkbN+PBgyDn/rZXgzQ3APmKZRcZPq9HftceBgE+W8CSi+NN+/C2X0GDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gaQzL9VRddbfXR9yFX9AVAEapSXf73D5SnB1G+Z7mps=; b=idXkoEVQE0iG/eVuKJtzB95/yFVbdID3GCw38s3l3FbGQw0S/jVnSWUDfzlWnl3D3xbKZxmeMcVmhyfbVfl1HaMJtQQiG0SUb4hGZ4t+PFmqREcgaBst6EgA60IAq3jjhY1xlzY0V+j3kXrwFAd7dFGlZ4OfDz3zlu0PHRrcC59ZMVuSQBooXOhJTt4zEYEp+FtCM5Nr6OMgDoqEPqjRj/+YAQj4tdjHvb3UFcE9TPSd9rrMBdVqrjAOs1dkKwmuHgsrpYQzUbKwktgxuoWH3KE6GJ6D5CczGQDwLRaawrvPvgOLrXU3QCk4M8dVGFyEjH/+ZMznn14bFAlCE2Yvqg== Received: from IA1PR12MB6330.namprd12.prod.outlook.com (2603:10b6:208:3e4::22) by SN7PR12MB7021.namprd12.prod.outlook.com (2603:10b6:806:262::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.32; Wed, 16 Apr 2025 11:42:18 +0000 Received: from IA1PR12MB6330.namprd12.prod.outlook.com ([fe80::bffb:daa0:6f62:f5de]) by IA1PR12MB6330.namprd12.prod.outlook.com ([fe80::bffb:daa0:6f62:f5de%6]) with mapi id 15.20.8632.030; Wed, 16 Apr 2025 11:42:17 +0000 From: Gregory Etelson To: "Harry\"" , "Bruce\"" CC: "dev@dpdk.org" Subject: [RFC] add Rust API for basic port operations Thread-Topic: [RFC] add Rust API for basic port operations Thread-Index: AQHbrr+LK/ZTHNB7W0+EGKQZdXJ9pQ== Date: Wed, 16 Apr 2025 11:42:17 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA1PR12MB6330:EE_|SN7PR12MB7021:EE_ x-ms-office365-filtering-correlation-id: 32b466cc-017a-4c9f-379f-08dd7cdbbdb1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018|8096899003|13003099007; x-microsoft-antispam-message-info: =?iso-8859-1?Q?hS2uCH9/pbUrzlk/nKLTd6c2656EOPWyUrm0d8StxaoaK9EYAOS6dkJI4w?= =?iso-8859-1?Q?7REtFLoFpmMETM9sWzKBcaABsCeEQvItRXvxJ3OpqHkG7HDoofJUMXM7kY?= =?iso-8859-1?Q?ymaJIjnDdrtkLI7VSMlqHa5DzGCYUx9te5zfEMVAewKSgjfSLp+eYx6L/k?= =?iso-8859-1?Q?K97gmDEYFDrrQHPI6v7NnMXxo91TNh29dQcJC1GGET6ufAl/LS+5AwH0QX?= =?iso-8859-1?Q?+zDYfIFkTqnh/2VmKf0mFs2jGkjr1qwV96sP6WxjLItFF+Lsx8mrpmyJkX?= =?iso-8859-1?Q?pxoJ+j9Dw2d+AMEALnTgN0ExkSIzLle7JgxDlHo+VEy+Hj9mpci4OZo17q?= =?iso-8859-1?Q?MO2IFWIhrN1pcDwhQQCaaRE1pC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so-8859-1?Q?lX9qoLGJSoCUbCwRCQE+WRKR6tWMok2i745j1iJ8O4e7ar3fxzEnadgMmM?= =?iso-8859-1?Q?qF8FXp/Rdl2sezobyBrqyigaPSoiQphX8P9rXg1zHmomndajZa2wCKvTg8?= =?iso-8859-1?Q?56P9jM4giy4LJYuVoAsD5ZiefWP9JyvpAt5TcCPFV9vrm/4fj+e94ukYu7?= =?iso-8859-1?Q?h0RNpMtHIBBNjKjTISwfzFyv70CubyrdmJ6ntmkZaAbP2kUbrSX8yQHT3t?= =?iso-8859-1?Q?BR1TLRlSBsUPcevopevDxlcFZFGUPjWwswZr7uPubW8BEO4KmP1baxdpyG?= =?iso-8859-1?Q?JaWUH88=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR12MB6330.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018)(8096899003)(13003099007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?zNsHV9jrzCsm6UCDWTzNpLbzwu6kerx9URt2peZj7uw7AoZwoqkXfQnjHF?= =?iso-8859-1?Q?83vfM4VmVs/W0nTDLtv+lu5h8l/eTPj7pZOAXlV9ByLNUj6qtL8kCiWvCl?= =?iso-8859-1?Q?3YKkVOmZzrcOhoDmINlOuJcQWlpXK0nrksqTkHwFK2WrnkmX6VztEwuZjc?= =?iso-8859-1?Q?L9airNWGlcwIYZ/hsycSqk2Jh7XNGsuntP8PcCf4mRuqXahnxqfYm3YugH?= =?iso-8859-1?Q?qqRdUVn9Gf07tYMUDJjkBACsUhArkSLFvhICpBYqt0iThMbZxVnxHA6tT1?= =?iso-8859-1?Q?eWCiIg897S1ZwG3I3BmcU3IDKFeDvMjkLj8PCiKsuwQO4ZlsHsYOQnZnNk?= =?iso-8859-1?Q?gWvLj7K/JpweBI/T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iso-8859-1?Q?IoGUfy1jWgKH8CtF1OtRk3jvbIqq+xHYQTs/NlMtL909zWWyfEaVU721cB?= =?iso-8859-1?Q?JCVf+T/Am36v/K94BgVSo7TaoACic7aNj7Ew7UcAPvfq8dUkV8MJDF2vbQ?= =?iso-8859-1?Q?gn+VYheobHuyJHpLDgpq87Yx+E/iw4zpCUz/PBZeyDhDn0YnxF9uFR+jdg?= =?iso-8859-1?Q?fnaZfBOi1rU8Bn5sxwwD318R6zMFAP6mrsEXuqpMkTErDOyDGxTw6agEbH?= =?iso-8859-1?Q?1lZqtxIeS2++VFiIkif4Fv6ZXt0Q0C3yL+0XIf662RvNewJiUP0kDHiI8Y?= =?iso-8859-1?Q?If3ZXKRdIWXJ+Th5nweMlzg9ZSdvCC6K6rHaPcwmp5ekTV8ZI4oLyXpNaD?= =?iso-8859-1?Q?gqSG36R0kqV8s=3D?= Content-Type: multipart/alternative; boundary="_000_IA1PR12MB633009C4430CF2081D824D3AA5BD2IA1PR12MB6330namp_" MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6330.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32b466cc-017a-4c9f-379f-08dd7cdbbdb1 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2025 11:42:17.8298 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 77FmLAih8RXsmG+dCwpjSUme5+gBeJI3SPbqS80KXxJtLzTvSgUe3i8ZQiv4yFu0MRkLhJ2IPeXJr8S1Y40Hxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7021 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_IA1PR12MB633009C4430CF2081D824D3AA5BD2IA1PR12MB6330namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This RFC proposes Rust API for basic DPDK port management and IO operations= . ```rust /// Configuration details for a DPDK port. /// /// # Overview /// /// `DpdkPortConf` is used to initialize and configure ports in a DPDK envi= ronment. It includes: /// - Device information (`dev_info`) pulled from DPDK. /// - Transmit and receive configurations, including queue settings and mem= ory pools. /// - Details about the number of queues and descriptors for transmission a= nd reception. /// /// This struct is typically instantiated using the [`DpdkPortConf::new_fro= m`] method. /// /// # Example /// /// ``` /// let conf =3D DpdkPortConf::new_from( /// port_id, /// dev_conf, /// tx_conf, /// rx_conf, /// 8, // Number of RX queues /// 8, // Number of TX queues /// 512, // RX descriptors /// 512, // TX descriptors /// 0, // RX queue socket ID /// 0, // TX queue socket ID /// Some(rx_mempool) // RX queue mempool /// ).unwrap(); /// ``` /// #[derive(Clone)] pub struct DpdkPortConf { /// Information about the DPDK Ethernet device (e.g., driver, capabilit= ies, etc.). pub dev_info: rte_eth_dev_info, /// Configuration for the Ethernet device. Determines the overall behav= ior of the device. pub dev_conf: rte_eth_conf, /// Configuration for transmitting (Tx) packets on the Ethernet device. pub tx_conf: rte_eth_txconf, /// Configuration for receiving (Rx) packets on the Ethernet device. pub rx_conf: rte_eth_rxconf, /// Number of receive (Rx) queues configured on this port. pub rxq_num: u16, /// Number of transmit (Tx) queues configured on this port. pub txq_num: u16, /// Number of descriptors for each transmit (Tx) queue. /// Descriptors represent items in a queue to handle packets. pub tx_desc_num: u16, /// Number of descriptors for each receive (Rx) queue. pub rx_desc_num: u16, /// NUMA socket ID associated with the memory used by receive (Rx) queu= es. pub rxq_socket_id: u32, /// NUMA socket ID associated with the memory used by transmit (Tx) que= ues. pub txq_socket_id: u32, /// Memory pool associated with receive (Rx) queues. /// This manages the buffers used for storing incoming packets. pub rxq_mempool: Option>, } /// A trait defining basic operations for managing and interacting with a D= PDK port. /// /// # Overview /// /// The `DpdkPort` trait standardizes how to operate on DPDK ports, making = it possible to: /// - Configure the Ethernet device using [`configure`]. /// - Start the device using [`start`]. /// - Handle Rx and Tx bursts of packets using [`rx_burst`] and [`tx_burst`= ]. /// pub trait DpdkPort: Send + Sync { /// Returns the port ID of the DPDK port. /// /// # Return Value /// A `u16` that uniquely identifies the DPDK port. /// /// # Example /// ``` /// let port_id =3D dpdk_port.port_id(); /// println!("DPDK port ID: {}", port_id); /// ``` fn port_id(&self) -> u16; /// Returns a reference to the configuration object of the DPDK port. /// /// # Return Value /// A reference to [`DpdkPortConf`], which contains various settings li= ke Rx/Tx queue configurations, /// memory pools, and NUMA socket IDs. /// /// # Example /// ``` /// let port_config =3D dpdk_port.port_conf(); /// println!("Rx queues: {}", port_config.rxq_num); /// ``` fn port_conf(&self) -> &DpdkPortConf; /// Configures the DPDK Ethernet device with the settings specified in = the port configuration. /// /// This method is typically called before starting the port to ensure = it is prepared for Rx and Tx operations. /// /// # Return Value /// - `Ok(())` if the configuration was applied successfully. /// - `Err(String)` with a descriptive error message if the configurati= on failed. /// /// # Example /// ``` /// let result =3D dpdk_port.configure(); /// if let Err(err) =3D result { /// eprintln!("Failed to configure the port: {}", err); /// } /// ``` fn configure(&mut self) -> Result<(), String>; /// Starts the DPDK Ethernet device. /// /// This method initializes the Rx and Tx queues, making the port ready= for data transmission /// and reception. /// /// # Return Value /// - `Ok(())` if the port was started successfully. /// - `Err(String)` if the startup process failed, with a descriptive e= rror message. /// /// # Example /// ``` /// let result =3D dpdk_port.start(); /// if let Err(err) =3D result { /// eprintln!("Failed to start the port: {}", err); /// } /// ``` fn start(&mut self) -> Result<(), String>; /// Receives a burst of packets on the specified Rx queue. /// /// # Parameters /// - `queue_id`: The ID of the Rx queue to receive packets from. /// - `pkts`: A mutable reference to an array of packet buffers (`*mut = rte_mbuf`) where received packets /// will be written. /// /// # Return Value /// - `Ok(u16)` containing the number of packets successfully received. /// - `Err(String)` if the operation failed. /// /// # Example /// ``` /// let pkts: Vec<*mut rte_mbuf> =3D vec![std::ptr::null_mut(); 32]; /// let received =3D dpdk_port.rx_burst(0, &pkts); /// match received { /// Ok(count) =3D> println!("Received {} packets", count), /// Err(err) =3D> eprintln!("Rx burst failed: {}", err), /// } /// ``` fn rx_burst(&mut self, queue_id: u16, pkts: &[*mut rte_mbuf]) -> Result= ; /// Sends a burst of packets on the specified Tx queue. /// /// # Parameters /// - `queue_id`: The ID of the Tx queue to send packets on. /// - `pkts`: A reference to an array of packet buffers (`*mut rte_mbuf= `) to send. /// /// # Return Value /// - `Ok(u16)` containing the number of packets successfully sent. /// - `Err(String)` if the operation failed. /// /// # Example /// ``` /// let pkts: Vec<*mut rte_mbuf> =3D vec![some_packet_ptr1, some_packet= _ptr2]; /// let sent =3D dpdk_port.tx_burst(0, &pkts); /// match sent { /// Ok(count) =3D> println!("Sent {} packets", count), /// Err(err) =3D> eprintln!("Tx burst failed: {}", err), /// } /// ``` fn tx_burst(&mut self, queue_id: u16, pkts: &[*mut rte_mbuf]) -> Result= ; } ``` The API uses raw FFI pointers in DpdkPort rx_burst() and tx_burst() to pres= erve DPDK performance. The API implementation is here: API definition: https://github.com/getelson-at-mellanox/rdpdk/blob/main/lib/port/port.rs API implementation with RTE function calls: https://github.com/getelson-at-mellanox/rdpdk/blob/main/lib/port/raw_port.r= s Implement direct calls to mlx5 Rx/Tx IO functions: https://github.com/getelson-at-mellanox/rdpdk/blob/main/port/mlx5/mlx5_port= .rs Signed-off-by: Gregory Etelson --_000_IA1PR12MB633009C4430CF2081D824D3AA5BD2IA1PR12MB6330namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
This RFC proposes Rust API for basic DPDK port management and IO operations= .

```rust
/// Configuration details for a DPDK port.
///<= br>/// # Overview
///
/// `DpdkPortConf` is used to initialize and co= nfigure ports in a DPDK environment. It includes:
/// - Device informati= on (`dev_info`) pulled from DPDK.
/// - Transmit and receive configurati= ons, including queue settings and memory pools.
/// - Details about the = number of queues and descriptors for transmission and reception.
///
= /// This struct is typically instantiated using the [`DpdkPortConf::new_fro= m`] method.
///
/// # Example
///
/// ```
/// let conf =3D D= pdkPortConf::new_from(
///     port_id,
///     d= ev_conf,
///     tx_conf,
///     rx_conf,
///=     8,               // Numbe= r of RX queues
///     8,           &= nbsp;   // Number of TX queues
///     512,    =         // RX descriptors
///     512, &n= bsp;           // TX descriptors
///   &nb= sp; 0,               // RX queue socket = ID
///     0,              = // TX queue socket ID
///     Some(rx_mempool) // RX queue me= mpool
/// ).unwrap();
/// ```
///
#[derive(Clone)]
pub = struct DpdkPortConf {
   /// Information about the DPDK Et= hernet device (e.g., driver, capabilities, etc.).
   
pub = dev_info: rte_eth_dev_info,

   /// Configuration for t= he Ethernet device. Determines the overall behavior of the device.
&nbs= p;  
pub dev_conf: rte_eth_conf,

   /// Config= uration for transmitting (Tx) packets on the Ethernet device.
  &n= bsp;
pub tx_conf: rte_eth_txconf,

   /// Configurat= ion for receiving (Rx) packets on the Ethernet device.
   pub rx_conf: rte_eth_rxconf,

   /// Number of receive= (Rx) queues configured on this port.
   
pub rxq_num: u16= ,

   /// Number of transmit (Tx) queues configured on = this port.
   
pub txq_num: u16,

   /= // Number of descriptors for each transmit (Tx) queue.
   ///= Descriptors represent items in a queue to handle packets.
   = ;
pub tx_desc_num: u16,

   /// Number of descriptor= s for each receive (Rx) queue.
   
pub rx_desc_num: u16,
   /// NUMA socket ID associated with the memory used b= y receive (Rx) queues.
   
pub rxq_socket_id: u32,

=    /// NUMA socket ID associated with the memory used by tran= smit (Tx) queues.
   
pub txq_socket_id: u32,

&nbs= p;  /// Memory pool associated with receive (Rx) queues.
 =  /// This manages the buffers used for storing incoming packets.
=    
pub rxq_mempool: Option<Arc<DpdkMempool>>,
= }

```

The API uses raw FFI pointers in DpdkPort rx_burst() and tx_burst() to pres= erve DPDK performance.

The API implementation is here:

API definition:

API implementation with RTE function calls:

Implement direct calls to mlx5 Rx/Tx IO functions: 


Signed-off-by: Gregory Etelson <getelson@nvidia.com>





--_000_IA1PR12MB633009C4430CF2081D824D3AA5BD2IA1PR12MB6330namp_--