From patchwork Mon Dec 14 02:19:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1415727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=rILbQEhe; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CvQBy3HqFz9sTX for ; Mon, 14 Dec 2020 13:22:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 33329871DF; Mon, 14 Dec 2020 02:22:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7+M+4XfocU2m; Mon, 14 Dec 2020 02:22:12 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 41990871BE; Mon, 14 Dec 2020 02:22:12 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 287D6C088E; Mon, 14 Dec 2020 02:22:12 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5863CC013B for ; Mon, 14 Dec 2020 02:22:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4A75486B28 for ; Mon, 14 Dec 2020 02:22:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j-ERKJyiSKxh for ; Mon, 14 Dec 2020 02:22:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id 82B6D86B26 for ; Mon, 14 Dec 2020 02:22:09 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id s2so7813434plr.9 for ; Sun, 13 Dec 2020 18:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WT1IGLvgPI6/apBFYiVQeLodXjrPEMkgbOcjZ+ieouU=; b=rILbQEheMcrIXBWrxerv6xlUSP6tNasnUhvR/5MMNRYAvKf46my1n7HVV7redgAn7T N92SVFtrRFS4CUt28xdbzkVSFaJxkRsqtl7/3SA6QRBXsJMTiJtmbCt9HdmjFbjjsz62 P2uBHCAFoPz5X9AC1m7aacySADOEReK4ecldjxbcx6sz/SayZxxPk16aEknCZlelL2kI W3eJDIvdCrFP95uWaHjUal1yYq7Gd6ciTvhlmHava49tUpNsjF3Cb6R1N8SzMKZqkA1i eUxCmEo7E5+6M98ykNX9A036k7VNAsf57QuMfC0d0mJrBV1xj3uBKPRaJbk24v8/A9zh kVYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WT1IGLvgPI6/apBFYiVQeLodXjrPEMkgbOcjZ+ieouU=; b=hbrLaLUkES6MkiifOHTXXVF7Sm57XkuQxO4/xScj2WXbNMxz2sOnmDKs2cgOaZjQxz ch2WVu3B0cxPuM6Bh8qEZp67X/jSj2FwxqFNLhbN4WhJjxO/JYa3lkTYc3AbKbct4yOY fMhHbWA+UCAiYO22sLd8wys0uld/jOgNEvdm2WLTQSrs8Cho6puBAzUOkrjr8z771Z0P 9VadwtueMEb2hFcr8JR7CPd89qhf7uf036EsrDBYnTFF6Qca6qrmsb+DvUCg5j8KY2Sb d1PWUd+jIEnKMAm4w4jDslmKxWYoSqj63DkrPVPTXKV6HbBP9ekVN10XaH8//ytpf64m mKfw== X-Gm-Message-State: AOAM533NdCf0Tuica1ZEHug9QEDWvMgSr39cm50OuG81qL2wtcurKnuz f+Uu7EvTX9GKA6bQ36WGALE= X-Google-Smtp-Source: ABdhPJymgOjzObnmrfGzrTUonlKonAl464W0PdUrqjrsxLmX7Bw92Y+7nVKDea8yn2uMxWqp1WB3KA== X-Received: by 2002:a17:902:fe91:b029:da:6bf3:7ba0 with SMTP id x17-20020a170902fe91b02900da6bf37ba0mr18656087plm.2.1607912529012; Sun, 13 Dec 2020 18:22:09 -0800 (PST) Received: from localhost.localdomain ([50.236.19.102]) by smtp.gmail.com with ESMTPSA id z7sm18019540pfq.193.2020.12.13.18.22.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 18:22:08 -0800 (PST) From: xiangxia.m.yue@gmail.com To: blp@ovn.org, i.maximets@ovn.org, u9012063@gmail.com, elibr@nvidia.com Date: Mon, 14 Dec 2020 10:19:57 +0800 Message-Id: <20201214022001.84273-1-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 2.15.0 Cc: dev@openvswitch.org Subject: [ovs-dev] [PATCH ovs v1 0/4] Support Flow Bifurcation X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang Flow Bifurcation is a mechanism which uses hardware capable Ethernet devices to split traffic between Linux user space and kernel space. Since it is a hardware assisted feature this approach can provide line rate processing capability. Other than KNI, the software is just required to enable device configuration, there is no need to take care of the packet movement during the traffic split. This can yield better performance with less CPU overhead. The Flow Bifurcation splits the incoming data traffic to user space applications (such as DPDK applications) and/or kernel space programs (such as the Linux kernel stack). It can direct some traffic, for example data plane traffic, to DPDK, while directing some other traffic, for example control plane traffic, to the traditional Linux networking stack. There are a number of technical options to achieve this. A typical example is to combine the technology of SR-IOV and packet classification filtering. Open vSwitch used in this case: 1: +----------+ +----------+ | kernel | | ovs-dpdk | (no address assigned) +----+-----+ +----+-----+ ^ ^ | PF(1.1.1.1/24) |VF0 | | +----+------------------+-----+ | SRIOV NIC | +-----------------------------+ In this case, we can use patch 3, 4 to learn neigh entries(1.1.1.0/24) from linux kernel, to install routes: $ ovs-vsctl --no-wait set Open_vSwitch . other_config:tnl-neigh-event-enabled=true $ ovs-appctl ovs/route/add 1.1.1.1/32 br-int src_addr=1.1.1.1 $ ovs-appctl ovs/route/add 1.1.1.0/24 br-int src_addr=1.1.1.1 $ ovs-appctl ovs/route/add 0.0.0.0/0 br-int src_addr=1.1.1.1 2: +----------+ +----------+ | kernel | | ovs-dpdk | (no address assigned) +----+-----+ +----+-----+ ^ ^ | PF(1.1.1.1/24) | PF | | +----+------------------+-----+ | SRIOV NIC | +-----------------------------+ In sriov nic, we can add flows which matching tunnel packets to ovs-dpdk, and others packets to linux kenrel (patch 1, 2). When sending tunnel packets, ovs can use neigh entries learned from system. More details: http://doc.dpdk.org/guides-20.11/howto/flow_bifurcation.html https://doc.dpdk.org/guides/prog_guide/rte_flow.html # 12.4. Flow isolated mode Tonghao Zhang (4): netdev-dpdk: Allow to config isolate offload mode. dpctl: Add --consistent option. tnl-neigh-cache: Allow openvswitch learning neigh entries. ovs-router: Allow openvswitch installing fake routes. lib/dpctl.c | 24 ++++ lib/dpctl.h | 3 + lib/dpif-netdev.c | 1 + lib/netdev-dpdk.c | 23 ++++ lib/odp-util.c | 11 ++ lib/odp-util.h | 1 + lib/ovs-router.c | 121 +++++++++------- lib/tnl-neigh-cache.c | 312 ++++++++++++++++++++++++++++++++++++++++-- lib/tnl-neigh-cache.h | 2 + lib/uuid.h | 3 + ofproto/ofproto-dpif-upcall.c | 7 + vswitchd/bridge.c | 2 + vswitchd/vswitch.xml | 17 +++ 13 files changed, 468 insertions(+), 59 deletions(-)