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 99AC3A00C2; Thu, 24 Nov 2022 18:15:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40D2742DD2; Thu, 24 Nov 2022 18:15:39 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2050.outbound.protection.outlook.com [40.107.223.50]) by mails.dpdk.org (Postfix) with ESMTP id 2BEC342DBF for ; Thu, 24 Nov 2022 18:15:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QtqJPlp9ai7iTbu82epmuql32u7viJu/oYzzTApAP+8HQE/5iFZflzCTD4m/mIqQ5O6uUZ0YQa5/tteuKgugd7N7sh9UgleC0nwBfCB3ICA5BUwR9az0vwOPwgQd0dvhFG941CEENO3xl2W/GZDHrDtwZ8cRMu8dW4umptfGEMBnO1aX2a1I7IofiNqhomY0W4zZmSZ/SByZ6QoiAAKZI8fTONniad0wiD7Khakth3HNnpo/3u+8b5Q+pFcDaUi27Px26XiYOvz5PhEMjjPjUO6xmS56EMAxCc+G1SOwBk/2PKWd9VBJy7NETH1owbNcBATyG6COnJF4a7BqtAcCyg== 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=pnQBJxs4Ox9kIi7swR5+wPxsk9Z7w8/RjyMmIebUjPk=; b=fsq/Cr2PhDGIMUKoQMGv8r+ZcHtDqYUyqeTMeaFubUpB8Hp8FG8KncYnUO74Dc/TxrRCpj+IFr8CTrTt26CVGE23bfxfDOXnIlOuZRzP8GDoklfoTHVtX1NdPazQl3uNWiAkh5W3AqSD6RD7GJoN7X6OpOpdoWU281AvFXVtpbRyIL3FlEAvohMuD0Cl5GLXIxgGvKV5uWrovK0cZoyd1pvXA2xdp3CJhQq3FzdiZySXmepnVZKQZf3yorHM1N6DArysbZUxea52oydPlDiIHq1TJiHuOn/UPjzZYsF/WBU0kJeMS29rwlOGrQD9dGI+fDD71SZt37VHmc3c6TrMJA== 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=pnQBJxs4Ox9kIi7swR5+wPxsk9Z7w8/RjyMmIebUjPk=; b=Jpzzpq3InSBTUla7WDvDQndbwngrB5kz0+x7LOBagz4glCnerrUGc/HngtgaAClNCCFGL5oMj5SIKzVbQ89moxizU6wzAbPDRF3egcde9d15waXxVUqe1KkXIyyE6BLs6Ig2FA12UG15xo8cAxeUH7s29/ioVUcFMwshP4rBoI0= Received: from BN9PR03CA0326.namprd03.prod.outlook.com (2603:10b6:408:112::31) by SN7PR12MB7203.namprd12.prod.outlook.com (2603:10b6:806:2aa::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Thu, 24 Nov 2022 17:15:35 +0000 Received: from BN8NAM11FT091.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::66) by BN9PR03CA0326.outlook.office365.com (2603:10b6:408:112::31) 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 17:15:33 +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 BN8NAM11FT091.mail.protection.outlook.com (10.13.176.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5857.17 via Frontend Transport; Thu, 24 Nov 2022 17:15:32 +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 11:15:31 -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 v6] doc: note KNI alternatives Date: Thu, 24 Nov 2022 17:15:24 +0000 Message-ID: <20221124171524.3372345-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221124114041.3169291-1-ferruh.yigit@amd.com> References: <20221124114041.3169291-1-ferruh.yigit@amd.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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT091:EE_|SN7PR12MB7203:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d70b9bb-6d25-45e7-11ba-08dace3f7e8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UKjyh1j514sunyTUL4pJEZRPVeXRDxYfWzWvchbPYeWaPNjq5u219k5CX3rFqCam9qX+n0jUjCvnItFgZvoKWxS/ImvD7iODcOBp7fqe0hIoqO25ZW3m0fS4/VsFKxJW/pjNGEtOY7ngRFDMi7v3wOTtTxTZHupwfLk21c0vTyetdk+jYZVsx8LNoeQUWtCsVodMZmpWv3WCmAljNaPcPQPbfRtqPhj2CvYU/v2mmQTlKUr5ItNvnKDltObBhNjB2W8ceKX43uj3pEoeXAjSnUuU0WmlUbqHgxPA6/H8byMMau0+UDTMs5D05gmQLGf7Q/k5DLV+H9jU3l7ewY9UvjRFnS0B/cXnR48MsfmNB3Xw+Ipf7rRZNcawI9Ix+WnUsqKXwGn0xJWPBIVYk7yRQDMnx1B3SPTvTGAuAAll3TwZERljreMwIEqqWkTSDXQ5PhIgioGSVDa6d2dw6R/S1Ha5aqYBuoHRNXTM8q27qjUcP5lOJ5GHj/GI41c0z5rf/veASzvmiaIn8dvByhWG6Y3pafTv5k07ZQvCykrvR+qSF9Ib9BwAn+o1TvLvOPjiy4vRsHN8w4ljvst5ajIA3adVzUxPWxj7s6pX/3Ns3syjzwjXoFOYbQLFjoNELnyg6+xU3J93CEDiS/3CO84TO1kazC61OujibYe5LjW2HvtCQiLUtDz2wkU5wwN+FNTSRfRbqm//mrQTNNw6+Xdr0Ov3ILzicdlN2ZSBuLZSVbArNfp9J3Tgi1nnCvWjXIXAWRprrRBhI1TvTFkEpDa+SA== 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)(346002)(396003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(6666004)(82310400005)(478600001)(7696005)(82740400003)(86362001)(2906002)(83380400001)(356005)(26005)(81166007)(8676002)(54906003)(41300700001)(70206006)(70586007)(6916009)(316002)(4326008)(336012)(426003)(36860700001)(47076005)(1076003)(66574015)(5660300002)(2616005)(44832011)(36756003)(186003)(40480700001)(8936002)(40460700003)(16526019)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2022 17:15:32.7444 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d70b9bb-6d25-45e7-11ba-08dace3f7e8f 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: BN8NAM11FT091.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7203 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 v6: * s/ifconfig/iproute2/ * reword distributing binary module disadvantage 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..fe088f0c4508 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``, ``iproute2`` 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 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. + +* 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