<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Hello Harry,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
I've been experimenting with lcore workers.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Please check out the new helloworld example:  <a href="https://github.com/getelson-at-mellanox/rdpdk/blob/safe-q/examples/helloworld.rs" id="OWA7a51a07b-97ea-b10c-f04a-a6e94f3d1b64" class="OWAAutoLink">
https://github.com/getelson-at-mellanox/rdpdk/blob/safe-q/examples/helloworld.rs</a></div>
<div id="appendonsend"></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
There are 2 options for the example configuration:</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
1 Start RDPDK workers on the same cores as EAL: <br>
    cargo run --example helloworld -- -a <PCI address> -l 0,1,3,5<br>
<br>
2 Start RDPDK workers on dedicated cores:<br>
    cargo run --example helloworld -- -a 0000:43:00.0 -l 0,1,3,5 -- -l 2-8</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Regards,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Gregory</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> Gregory Etelson <getelson@nvidia.com><br>
<b>Sent:</b> Sunday, April 27, 2025 21:50<br>
<b>To:</b> Van Haaren, Harry <harry.van.haaren@intel.com><br>
<b>Cc:</b> Gregory Etelson <getelson@nvidia.com>; dev@dpdk.org <dev@dpdk.org>; Richardson, Bruce <bruce.richardson@intel.com>; owen.hilyard@unh.edu <owen.hilyard@unh.edu><br>
<b>Subject:</b> Re: [PATCH] rust: RFC/demo of safe API for Dpdk Eal, Eth and Rxq</span>
<div> </div>
</div>
<div style="font-size: 11pt;">Hello Harry,<br>
<br>
> > I implemented a working echo server with your API.<br>
> > The code is here: <a href="https://github.com/getelson-at-mellanox/rdpdk/tree/safe-q" id="OWA7afd59b3-9b37-32bc-9bc0-16ca5a27245c" class="OWAAutoLink" data-auth="NotApplicable">
https://github.com/getelson-at-mellanox/rdpdk/tree/safe-q</a><br>
><br>
> Ah cool! Great to see the API working.<br>
><br>
> Reviewing the "echo.rs" code, the MbuffMempoolHandle ergonomics can perhaps be improved,<br>
> I'll try work on that and have some API suggestions to the mailing list soon.<br>
><br>
> I see the echo.rs code uses a normal "std::thread::spawn" (not DPDK lcores), there is<br>
> some design to do here to ensuring that best practices are used;<br>
> - any dataplane threads are registered as lcores (for best performance, mempool caches etc)<br>
> - registered lcores are also unregistered when a thread ends (potentially allowing lcore-id reuse??)<br>
> I haven't thought about this much, but had a brief discussion with Bruce (who is on holidays now).<br>
><br>
> Suggesting that mempools & lcores are the two next up API sets to "Rustify" :)<br>
><br>
<br>
I see 2 issues with the DPDK lcore API:<br>
<br>
Unsafe "extern" lcore callback is not considered as new thread and compiler<br>
will not run arguments Send verifications.<br>
<br>
Also lcore arguments use generic 'void *' pointer.<br>
<br>
Maybe Rust DPDK library needs native lcore implementation.<br>
<br>
Differnet thread agrument types can we wrapped with a macro call.<br>
Example is here:<br>
<a href="https://github.com/getelson-at-mellanox/rdpdk/blob/37494bcae1fcf06bb4338519f931c2130105e576/examples/echo.rs#L88" id="OWA7e93c2eb-d2f9-0dea-b07b-d81f00fcbd6b" class="OWAAutoLink" data-auth="NotApplicable">https://github.com/getelson-at-mellanox/rdpdk/blob/37494bcae1fcf06bb4338519f931c2130105e576/examples/echo.rs#L88</a><br>
<br>
Regards,<br>
Gregory<br>
<br>
</div>
 
</body>
</html>