<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">
Hi all,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<div>I hope this is the correct maillist for this topic.</div>
<div><br>
</div>
<div>DPDK provides the nice library `librte_bpf` to load and execute eBPF bytecode</div>
<div>and we would like to broaden our usage of this library.</div>
<div><br>
</div>
<div>Today there are hints that this library might have been purpose built to enable inspection or modification of packets;</div>
<div>for example the eBPF program is expected to only use a single input argument, pointing to data of some sort.</div>
<div>We believe it would be beneficial to be able to use this library to run generic eBPF programs as well,</div>
<div>as an alternative to run them as RX- TX-port/queue callbacks (i.e. generic programs which only uses supported features)</div>
<div><br>
</div>
<div>I have seen some discussions regarding moving towards using a common library with the kernel implementation of bpf,</div>
<div>but I couldn't figure out the outcome.</div>
<div>My question is if there any plans to evolve this library or would improvements possibly be accepted?</div>
<div><br>
</div>
<div>Here are some improvements we are interested to look into:</div>
<div><br>
</div>
<div>* Add additional API for loading eBPF code.</div>
<div> Today it's possible to load eBPF code from an ELF file, but having an API to load code from an ELF image from memory</div>
<div> would open up for other ways to manage eBPF code.</div>
<div><br>
</div>
<div> Example of the new API:</div>
<div> struct rte_bpf *</div>
<div> rte_bpf_elf_image_load(const struct rte_bpf_prm *prm, char *image,</div>
<div> size_t size, const char *sname);</div>
<div><br>
</div>
<div>* Add support of more than a single input argument.</div>
<div> There are cases when additional information is needed. Being able to use more than a single input argument</div>
<div> would help when running generic eBPF programs.</div>
<div><br>
</div>
<div> Example of change:</div>
<div> struct rte_bpf_prm {</div>
<div> ...</div>
<div> - struct rte_bpf_arg prog_arg; /**< eBPF program input arg description */</div>
<div> + uint32_t nb_args;</div>
<div> + struct rte_bpf_arg prog_args[EBPF_FUNC_MAX_ARGS]; /**< eBPF program input args */</div>
<div> };</div>
<div><br>
</div>
<div>Any feedback regarding this is welcomed.</div>
<div>Best regard</div>
<div>Bjorn</div>
<br>
</div>
</body>
</html>