<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Stephen, please see my comments below ...<br>
</div>
<div id="appendonsend"></div>
<div><br>
</div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof">> Hello folks, I am about to embark on the networking low level parts of my project,<br>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText elementToProof">> where I will be implementing a SCTP server for AAA for a 4G/5G telecom so I need to squeeze as much performance as possible .. I am looking at how to setup KNI and friends (unless anyone knows about a mature and robust
SCTP stack in user space please let me know) ...<br>
<br>
Mature and robust and open source SCTP seems unlikely. The closest you might get working is some of<br>
the projects that ran FreeBSD network stack in userspace; but haven't heard about them in several years.</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof">Yes i have seen those projects using FreeBSD stack in user space but I m not sure about that ... I have not seen anyone using the SCTP stack though, only TCP.
<br>
</div>
<div class="PlainText elementToProof">The only mature and robust implementation of SCTP I am aware of is, actually, the linux kernel implementation ...<br>
</div>
<div class="PlainText elementToProof"><br>
> <br>
> I have spent several days reading about io_uring, and I can see that accomplishes exactly the same role as the KNI module (or so I believe) with the advantage that is part of the kernel, etc etc.<br>
<br>
No. io_uring is about bulk socket access; KNI is for pushing packets from DPDK into kernel.<br>
Different API's different formats, different effect.</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof">I could be wrong here, but io_uring is for pushing packets into the kernel and pulling from it with zero copies and zero syscalls (if you configure the kernel polling mode) ... according to my understanding of KNI and io_uring,
both work in similar manner (hence my original question) .. you set up shared memory between kernel and userspace, you set up up 2 queues (submission queue/completion queue) and you start pushing buffers into the kernel (submission queue) together with file
descriptor (socket in this case, it supports file system ops too) and an opcode of the action you want performed (READ/WRITE/CONNECT etc) and then the kernel notifies you when it is ready on the completion queue (you are polling this queue) ... you can even
enqueue several operations and then make a single syscall or if you configured io_uring. the kernel will be polling the submission queue so no syscall needed at all ...<br>
</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof"><br>
> <br>
> I have no experience with KNI or io_uring, so I will be starting from scratch with either one of them.<br>
> <br>
> Has anyone had any experience with io_uring ? is it better, the same, worse than KNI ? any advice ?<br>
<br>
io_uring is done by experienced kernel developers and merged into mainline kernel.<br>
KNI is being deprecated and was never reviewed by the kernel community.<br>
<br>
io_uring is driven of of socket send/recv.<br>
KNI is based on dedicated kernel thread(s) doing polling.<br>
<br>
> On a different note, I have read in the forums and mailing list that KNI is on its way out, that it will be deprecated sometime in the future, is my understanding correct ?<br>
> If it is indeed the case, is anyone using anything as a KNI replacement ?<br>
> <br>
<br>
There is documentation already on how to use virtio_user as better replacement for KNI.</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof">I saw this somewhere in the forums but everything I find about virtio_user is about virtual machines etc ... will look again ...<br>
</div>
<div class="PlainText elementToProof"><br>
If you want to use SCTP why are you so interested in DPDK.<br>
It would be better to just use OS stack for that.</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof">Right from the beginning I knew I would not be using the kernel bypass feature from DPDK because I need a TCP/SCTP stack, but DPDK is a wonderful and great library to support high performance package processing, it has
all the elements necessary that otherwise I would have to develop myself a.k.a multicore support (cache management, locality etc etc), mempools, memory management, pipelines, hashing tables, lock free ring buffers, hugepages, etc etc it takes care of many
things I do not have to worry about anymore, honestly KNI was a bonus on top of that that I discovered much later
<span id="🙂">🙂</span> .... <br>
</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof"><br>
</div>
<div class="PlainText elementToProof">thank you very much for your comments. <br>
</div>
</span></font></div>
</body>
</html>