<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks for the feedback.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText elementToProof"><span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255);display:inline !important">>> Example of the new API:</span><br style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255)">
</div>
<div class="PlainText elementToProof"><span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255);display:inline !important">>> struct rte_bpf *</span><br style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255)">
</div>
<div class="PlainText elementToProof"><span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255);display:inline !important">>> rte_bpf_elf_image_load(const struct rte_bpf_prm *prm, char *image,</span><br style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255)">
</div>
<div class="PlainText elementToProof"><span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255);display:inline !important">>> size_t size, const char *sname);</span><br style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255)">
</div>
<div class="PlainText elementToProof">>></div>
<div class="PlainText elementToProof">> Did you look at rte_bpf_load()?<br>
> Basically it works with already pre-loaded into memory bpf program.<br>
> In fact, rte_bpf_elf_load() calls it internally after reading elf <br>
> sections, resolving external references, etc.<br>
> Would it meet your needs?<br>
<br>
</div>
<div class="PlainText elementToProof">Yes, I think we could create our own elf_image_load() function that uses rte_bpf_load().</div>
<div class="PlainText elementToProof">I understand that we don't want to have a bunch of specific variants of load-functions in dpdk,</div>
<div class="PlainText elementToProof">specially if they are not used in any example or usecase.</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof"><span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255);display:inline !important">> AFAIK linux BPF is restricted to work with a single argument only.</span><br style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255)">
</div>
<div class="PlainText elementToProof"><span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, 255);display:inline !important">> I don't want DPDK version to fork too far away from 'canonical' version.</span></div>
<div class="PlainText elementToProof">> Though, as I said above, nothing prevents you to create a struct<br>
> with several fields, and pass pointer to that struct to your BPF program.<br>
> Would such approach work for you?<br>
<br>
</div>
<div class="PlainText elementToProof">Good alternative idea. We will test this approach.</div>
<div class="PlainText elementToProof">I guess we will use the <span style="background-color:rgb(255, 255, 255);display:inline !important">RTE_BPF_ARG_PTR </span>as an argument for the program in this case.</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof">Just as sidenote: we have also had a glance at<br>
<a href="https://github.com/iovisor/ubpf" id="LPNoLPOWALinkPreview">https://github.com/iovisor/ubpf</a><br>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
as an alternative. This is a standalone BPF VM lib, but with Apache 2.0 license and it's not bound to the dpdk log framework.</div>
<div class="PlainText elementToProof"><span style="background-color:rgb(255, 255, 255);display:inline !important">I have no views on benefits using this in dpdk, but it</span> might be an input for future talks about a common library / collaboration.</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof">Thanks again.</div>
<div class="PlainText elementToProof">Bjorn<br>
</div>
<div class="PlainText elementToProof"></div>
</span></font></div>
</body>
</html>