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 39345A00C3; Thu, 24 Nov 2022 12:41:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D858342DB7; Thu, 24 Nov 2022 12:41:25 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2086.outbound.protection.outlook.com [40.107.101.86]) by mails.dpdk.org (Postfix) with ESMTP id 7AD4542DB6 for ; Thu, 24 Nov 2022 12:41:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KjY2kBVUZydrob1XW3rodf60BOrsxMwN1LyPcNJiviJ00QupjaQSlzRFTW3sscjGEbIlzJ2e31wZn853JQvECpNEyuZmQPm5d8Ly9mHv6EWmBNBKpaJIzg3lSyKp9U1ro1kknJyz/QI9MjqXrCOsLaFmySvrZYWPGsBWtoaEm1QTUZbIfk3FXkFwPeVkutMt1M2OSblZgO0ZVLrhZ66xRK2Eyig6UpcVreB+RphfMXCX3dqB/LWxkNqpPXWge8DEU6gRacHcM1Aksv3hIckA+W38RlCIcDYrCx66AWWLvXVRB+qGWFwBEZznDIWGre2eXXgKftqYt5oG++jY6v6uzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mpdiIWGhstzsswNCZOPHUHlRGb4ctZxcjyWUG1y5iMc=; b=GnRTSWCEBYpdpufYRSJDF7vX0ZKQ7qGGw7YPWUH8VEs8ILgsTnARiGeIezN0mPFbk+n26/f4u+BxXrSGS5kD3BJzSYLz0OX6XgfWajYYoR36BtUAzl2JyYOcmaUWFOnvpjGBo5dLqEXEHbHK9C46HaK/LnOrWOOXgK9+py9uG6f0PCpJlkZeuaLu2rWx8tVATe3f6Zz8a4MN6pOtpoYjo9ZLjGYJd/nWTCXE0NtQrpYR28C2/ghnHD0Y61P6zYfI8gfOe20PwsNmI4EEB5aSZ5TOm57RlSLcLdg00lBQLezRoZEscxUSOF0OsLPfZQYbKcu739la5CFsTXdcxg8AFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=monjalon.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mpdiIWGhstzsswNCZOPHUHlRGb4ctZxcjyWUG1y5iMc=; b=VmtgKVV82gt2vH2OyE723YIP/Vk/RU9KSqzA3FQzTsk9iY8RQLH5MsAKx89OEfFMyJJlSgCqWboJ92ebGdWFL7aGv70Pb+ywJl/5uBqNnufqaFxb4qXGReXg/twotEYAQzaFiTFx7y2/xdSNZZ9b3Szz/2spSEijtFYhmAiq2x4= Received: from MW4PR04CA0039.namprd04.prod.outlook.com (2603:10b6:303:6a::14) by IA1PR12MB7760.namprd12.prod.outlook.com (2603:10b6:208:422::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19; Thu, 24 Nov 2022 11:41:22 +0000 Received: from CO1NAM11FT094.eop-nam11.prod.protection.outlook.com (2603:10b6:303:6a:cafe::78) by MW4PR04CA0039.outlook.office365.com (2603:10b6:303:6a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19 via Frontend Transport; Thu, 24 Nov 2022 11:41:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT094.mail.protection.outlook.com (10.13.174.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5834.14 via Frontend Transport; Thu, 24 Nov 2022 11:41:21 +0000 Received: from telcodpdk.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 24 Nov 2022 05:41:15 -0600 From: Ferruh Yigit To: Thomas Monjalon CC: , Olivier Matz , David Marchand , Stephen Hemminger , Elad Nachman , Igor Ryzhov , Dan Gora , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v5] doc: note KNI alternatives Date: Thu, 24 Nov 2022 11:40:40 +0000 Message-ID: <20221124114041.3169291-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211124171609.3101896-1-ferruh.yigit@intel.com> References: <20211124171609.3101896-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT094:EE_|IA1PR12MB7760:EE_ X-MS-Office365-Filtering-Correlation-Id: 1370afac-f0ff-4caa-664f-08dace10cf33 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZtGv0+mLpGJtrpnPokGzonYF5dilb3kL37lFyTMgy1heTJ11KCBnqr3O856shuiKtQGjc0ZTgGBJCkZNfeAc/RX6gTEdgeyAkL8jmAJGHdeHtZILB/89bkxW+wEAz8nnkxaMJrNiFZ7RiSzpBmHAxO4OXjBHmFNDjfWet8kngHcFg1eAGn23cq9KbPOLeScSARwlOttWL1fuvIh4HlKcfMj1NJ+RInwQUYb8UChVUvTmKxO5Etm8necMhvVlcIMCy7YztZn17bPZs/8PVRUcArXt6zN1QD0qrxAiOmB0+gN1xzY4xZdj425b5RGcxMh3DBhe6rZ7x7OC0uHEcQFPz3YEwiYPZ7CbmY+abTKsBpZX3tr1pHM26D/aYrbeZpYqGm5ZTNhJySmUmax9/8T6meC00XzB61mpYvwAJv0VKm6LHjKoCYuzRoluFfQJaLPd32Py8g0pPp9P4QqW2ieCsfnofntqXqIDm8Fbl53lq+G7e3D6Cwq/1pbuhBaMAr3vibuQuMYay+cPn4Bdec78/Oy9MkBtGKiDl8Wpyl4z/j8AsK2ywUNoZQ4DyVSDq7YhqWKM+el4onv5JAVs90HFgDZc49n29lXlVFVCL+124uIl2xUOcdHh11Nj7sr5IR1BwyZYi69r5XWi+FJtB7KC355ULqbXnZFYhICt5FVd27075wSWBOQ8G7V+kpUBgNBIc02ORemi3NB1JXs0f+67kvMW/WjxrUFvMbH4TchaZjkcBh+1ySrSVVBP0F51x0MNZYYQghP5QYtEE0a37xCV7A== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(39860400002)(396003)(346002)(451199015)(46966006)(40470700004)(36840700001)(26005)(36756003)(356005)(54906003)(81166007)(8676002)(4326008)(41300700001)(82310400005)(70586007)(86362001)(82740400003)(40460700003)(70206006)(40480700001)(36860700001)(336012)(2616005)(16526019)(186003)(1076003)(6666004)(478600001)(7696005)(6916009)(316002)(8936002)(83380400001)(47076005)(66574015)(426003)(2906002)(5660300002)(44832011)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2022 11:41:21.5834 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1370afac-f0ff-4caa-664f-08dace10cf33 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT094.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7760 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 disadvantages of KNI against these alternatives. Signed-off-by: Ferruh Yigit --- Cc: Olivier Matz Cc: David Marchand Cc: Stephen Hemminger Cc: Elad Nachman Cc: Igor Ryzhov Cc: Dan Gora Cc: Morten Brørup v5: * Rebased * Dedicated kernel core added as disadvantage --- .../prog_guide/kernel_nic_interface.rst | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) 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 + `_ + +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`. -- 2.25.1