DPDK usage discussions
 help / color / mirror / Atom feed
From: Juan Pablo L. <jpablolorenzetti@hotmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: DPDK KNI vs io_uring
Date: Sun, 26 Jun 2022 03:35:21 +0000	[thread overview]
Message-ID: <AM0PR04MB6692DBF4D2F88F4F7149CEB9D9B69@AM0PR04MB6692.eurprd04.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3886 bytes --]

Hi Stephen, please see my comments below ...


> Hello folks, I am about to embark on the networking low level parts of my project,
> 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) ...

Mature and robust and open source SCTP seems unlikely. The closest you might get working is some of
the projects that ran FreeBSD network stack in userspace; but haven't heard about them in several years.

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.
The only mature and robust implementation of SCTP I am aware of is, actually, the linux kernel implementation ...

>
> 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.

No. io_uring is about bulk socket access; KNI is for pushing packets from DPDK into kernel.
Different API's different formats, different effect.

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 ...


>
> I have no experience with KNI or io_uring, so I will be starting from scratch with either one of them.
>
> Has anyone had any experience with io_uring ? is it better, the same, worse than KNI ? any advice ?

io_uring is done by experienced kernel developers and merged into mainline kernel.
KNI is being deprecated and was never reviewed by the kernel community.

io_uring is driven of of socket send/recv.
KNI is based on dedicated kernel thread(s) doing polling.

> 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 ?
> If it is indeed the case, is anyone using anything as a KNI replacement ?
>

There is documentation already on how to use virtio_user as better replacement for KNI.

I saw this somewhere in the forums but everything I find about virtio_user is about virtual machines etc ... will look again ...

If you want to use SCTP why are you so interested in DPDK.
It would be better to just use OS stack for that.

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 🙂 ....


thank you very much for your comments.

[-- Attachment #2: Type: text/html, Size: 5478 bytes --]

             reply	other threads:[~2022-06-26  3:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26  3:35 Juan Pablo L. [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-24 20:32 Juan Pablo L.
2022-06-25 21:09 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR04MB6692DBF4D2F88F4F7149CEB9D9B69@AM0PR04MB6692.eurprd04.prod.outlook.com \
    --to=jpablolorenzetti@hotmail.com \
    --cc=stephen@networkplumber.org \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).