[v5] doc: note KNI alternatives

Message ID 20221124114041.3169291-1-ferruh.yigit@amd.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [v5] doc: note KNI alternatives |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional fail Functional Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Ferruh Yigit Nov. 24, 2022, 11:40 a.m. UTC
  Add more information on alternatives of KNI and the disadvantages of KNI
against these alternatives.

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: Olivier Matz <olivier.matz@6wind.com>
Cc: David Marchand <david.marchand@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Elad Nachman <eladv6@gmail.com>
Cc: Igor Ryzhov <iryzhov@nfware.com>
Cc: Dan Gora <dg@adax.com>
Cc: Morten Brørup <mb@smartsharesystems.com>

v5:
* Rebased
* Dedicated kernel core added as disadvantage
---
 .../prog_guide/kernel_nic_interface.rst       | 35 ++++++++++++++++---
 1 file changed, 30 insertions(+), 5 deletions(-)
  

Comments

Stephen Hemminger Nov. 24, 2022, 4:55 p.m. UTC | #1
On Thu, 24 Nov 2022 11:40:40 +0000
Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> +* It is out-of-tree Linux kernel module and it can't be distributed as binary as
> +  part of operating system vendor DPDK packages. This makes it harder to
> +  consume, although it is always possible to compile it from the source code.

To be precise, there is no legal restriction here. Maybe something that describes
why the process is awkward.

* It is out-of-tree Linux kernel module which makes updating and distributing the
  driver more difficult. Most users end up building the KNI driver from source
  which requires the packages and tools to build kernel modules.
  
Ferruh Yigit Nov. 24, 2022, 5:08 p.m. UTC | #2
On 11/24/2022 4:55 PM, Stephen Hemminger wrote:
> On Thu, 24 Nov 2022 11:40:40 +0000
> Ferruh Yigit <ferruh.yigit@amd.com> wrote:
> 
>> +* It is out-of-tree Linux kernel module and it can't be distributed as binary as
>> +  part of operating system vendor DPDK packages. This makes it harder to
>> +  consume, although it is always possible to compile it from the source code.
> 
> To be precise, there is no legal restriction here. Maybe something that describes
> why the process is awkward.
> 
> * It is out-of-tree Linux kernel module which makes updating and distributing the
>   driver more difficult. Most users end up building the KNI driver from source
>   which requires the packages and tools to build kernel modules.

ack, I will use above paragraph
  

Patch

diff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst
index 6a564f61cad8..cac0ab0cb278 100644
--- a/doc/guides/prog_guide/kernel_nic_interface.rst
+++ b/doc/guides/prog_guide/kernel_nic_interface.rst
@@ -11,8 +11,9 @@  Kernel NIC Interface
    KNI is deprecated and will be removed in future.
    See :doc:`../rel_notes/deprecation`.
 
-   For an alternative to KNI, that does not require any out-of-tree Linux kernel modules,
-   or a custom library, see :ref:`virtio_user_as_exception_path`.
+   :ref:`virtio_user_as_exception_path` alternative is the preferred way for
+   interfacing with the Linux network stack as it is an in-kernel solution and
+   has similar performance expectations.
 
 .. note::
 
@@ -21,14 +22,38 @@  Kernel NIC Interface
 
 The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
 
-The benefits of using the DPDK KNI are:
+KNI provides an interface with the kernel network stack and allows management of
+DPDK ports using standard Linux net tools such as ``ethtool``, ``ifconfig`` and
+``tcpdump``.
+
+The main use case of KNI is to get/receive exception packets from/to Linux network
+stack while main datapath IO is done bypassing the networking stack.
+
+There are other alternatives to KNI, all are available in the upstream Linux:
+
+#. :ref:`virtio_user_as_exception_path`
+
+#. :doc:`../nics/tap` as wrapper to `Linux tun/tap
+   <https://www.kernel.org/doc/Documentation/networking/tuntap.txt>`_
+
+The benefits of using the KNI against alternatives are:
 
 *   Faster than existing Linux TUN/TAP interfaces
     (by eliminating system calls and copy_to_user()/copy_from_user() operations.
 
-*   Allows management of DPDK ports using standard Linux net tools such as ethtool, ifconfig and tcpdump.
+The disadvantages of the KNI are:
+
+* It is out-of-tree Linux kernel module and it can't be distributed as binary as
+  part of operating system vendor DPDK packages. This makes it harder to
+  consume, although it is always possible to compile it from the source code.
+
+* As it shares memory between userspace and kernelspace, and kernel part
+  directly uses input provided by userspace, it is not safe. This makes hard to
+  upstream the module.
+
+* Requires dedicated kernel cores.
 
-*   Allows an interface with the kernel network stack.
+* Only a subset of net devices control commands are supported by KNI.
 
 The components of an application using the DPDK Kernel NIC Interface are shown in :numref:`figure_kernel_nic_intf`.