From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 99094A0C52; Wed, 24 Nov 2021 18:21:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 350E540DF5; Wed, 24 Nov 2021 18:21:20 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id BE26A40696 for ; Wed, 24 Nov 2021 18:21:18 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10178"; a="296135641" X-IronPort-AV: E=Sophos;i="5.87,260,1631602800"; d="scan'208";a="296135641" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2021 09:16:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,260,1631602800"; d="scan'208";a="497751700" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by orsmga007.jf.intel.com with ESMTP; 24 Nov 2021 09:16:14 -0800 From: Ferruh Yigit To: Cc: Ferruh Yigit , dev@dpdk.org, Olivier Matz Olivier Matz , David Marchand David Marchand , Stephen Hemminger Stephen Hemminger , Elad Nachman , Igor Ryzhov , Dan Gora Subject: [PATCH v3 1/2] doc: note KNI alternatives Date: Wed, 24 Nov 2021 17:16:08 +0000 Message-Id: <20211124171609.3101896-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210623173142.3803801-1-ferruh.yigit@intel.com> References: <20210623173142.3803801-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add more information on alternatives of KNI and the cons of KNI against these alternatives. Signed-off-by: Ferruh Yigit --- Cc: Olivier Matz Olivier Matz Cc: David Marchand David Marchand Cc: Stephen Hemminger Stephen Hemminger Cc: Elad Nachman Cc: Igor Ryzhov Cc: Dan Gora v3: * reference tap document directly instead of adding label to it. --- .../prog_guide/kernel_nic_interface.rst | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst index 1ce03ec1a374..f5a8b7c0782c 100644 --- a/doc/guides/prog_guide/kernel_nic_interface.rst +++ b/doc/guides/prog_guide/kernel_nic_interface.rst @@ -6,16 +6,44 @@ Kernel NIC Interface ==================== +.. Note:: + + :ref:`virtio_user_as_exceptional_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. + 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_exceptional_path` + +#. :doc:`../nics/tap` as wrapper to `Linux tun/tap + `_ + +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 cons 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. -* 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`. -- 2.31.1