From patchwork Tue Sep 5 09:22:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuanhan Liu X-Patchwork-Id: 810031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=fridaylinux-org.20150623.gappssmtp.com header.i=@fridaylinux-org.20150623.gappssmtp.com header.b="bbJeO17A"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xmh9B1Fy8z9sNr for ; Tue, 5 Sep 2017 19:23:41 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 44482A85; Tue, 5 Sep 2017 09:23:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6F651A84 for ; Tue, 5 Sep 2017 09:23:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f45.google.com (mail-pg0-f45.google.com [74.125.83.45]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0812EE5 for ; Tue, 5 Sep 2017 09:23:37 +0000 (UTC) Received: by mail-pg0-f45.google.com with SMTP id d8so8055589pgt.4 for ; Tue, 05 Sep 2017 02:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ai/B11IDgCisLXktDRKVVG03CemNroj1fKSqqyZAnGI=; b=bbJeO17AUXjZMfxilmO5L9TKjjxLYnwEpf8xSsWzOoYz6ilun4TqPRNL8Kv0oPGdU7 l3O5lwkujIVRu8H3+T8y18jGdVwXIBRRdF+PPQobMaCH1DwqBEuWFfzkucwOg9QrXGDG RB760DgKrxDwqueW3vR9Vs+VhIXHYDdmPuAAOh2XeyPnduL3wxOO+ocIMcHB6FETQ2tE rf3T+hn08CKc/n0Fq+iv7r2KeKZstXr2Ao8ONpF4ioIFQyg/w76Dq8c6EvGSe5u+9xul cProhZB9nDxPomvIdgEDF1T+WG86a+cjKkbdOruZabjXyaFsmd1XAxNkhxJWNDnFWPNa ejAw== 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=ai/B11IDgCisLXktDRKVVG03CemNroj1fKSqqyZAnGI=; b=KeUWl1qoFRSSPPS16KgAISimK+/N8eqG6xzVXHMY61TaJY6HhFWzUUdIdvkz6cN8Zd lENGhUwtlXwuwMEbL2LY2YnL1fslr+J6mhlcA8OWpb9TcplwkAvEo/GnY+ES+EyYzTNF NdJ8KUPCX2iPKC9L6GprCd49WfyeTTIamVWVtustPS5K1h9AqsQe5DjKxzB1TLjKWVTy KH6Kjvpx6wuy9QHVU4TYCQsRgSk2Ik9ykXEfQKAp1Cj0aE+qFdrpkdM6MvGs+pgGZJaS sPsKLChBdQ71i24we06IEVTo9mpBCikjpRjPiAXBT18ywhZwWothbEzfO7/c6SEGxr9X 4ryA== X-Gm-Message-State: AHPjjUixgQXIL0YQ2PrnyBgGlGps1I++l8bANHD/9o9SzInWNT2byeUm wKel2dJFruWxYGZ2KtoC0Q== X-Google-Smtp-Source: ADKCNb6TfK3cjEKWyMm0JiI/1Lz6j+J2Yw5iRPf4ba6QPZB0x7Cd/a5vYedCUX6b3rpZ7GH+fucmhA== X-Received: by 10.98.30.65 with SMTP id e62mr3000168pfe.309.1504603417214; Tue, 05 Sep 2017 02:23:37 -0700 (PDT) Received: from localhost.localdomain ([101.228.204.163]) by smtp.gmail.com with ESMTPSA id i187sm295921pfe.71.2017.09.05.02.23.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 02:23:36 -0700 (PDT) From: Yuanhan Liu To: dev@openvswitch.org Date: Tue, 5 Sep 2017 17:22:53 +0800 Message-Id: <1504603381-30071-1-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v2 0/8] OVS-DPDK flow offload with rte_flow X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Hi, Here is a joint work from Mellanox and Napatech, to enable the flow hw offload with the DPDK generic flow interface (rte_flow). The basic idea is to associate the flow with a mark id (a unit32_t number). Later, we then get the flow directly from the mark id, bypassing the heavy emc processing, including miniflow_extract. The association is done with CMAP in patch 1. It also reuses the flow APIs introduced while adding the tc offloads. The emc bypassing is done in patch 2. The flow offload is done in patch 4, which mainly does two things: - translate the ovs match to DPDK rte flow patterns - bind those patterns with a MARK action. Afterwards, the NIC will set the mark id in every pkt's mbuf when it matches the flow. That's basically how we could get the flow directly from the received mbuf. While testing with PHY-PHY forwarding with one core and one queue, I got about 54% performance boost. For PHY-vhost forwarding, I got about 41% performance boost. The reason it's lower than v1 is I added the logic to get the correct tcp_flags, which examines all packets recieved. The major issue mentioned in last version is also workarounded: the queue index is never set to 0 blindly anymore, but set to the rxq that first receives the upcall pkt. Note that it's disabled by default, which can be enabled by: $ ovs-vsctl set Open_vSwitch . other_config:hw-offload=true v2: - workaround the queue action issue - fixed the tcp_flags being skipped issue, which also fixed the build warnings - fixed l2 patterns for Intel nic - Converted some macros to functions - did not hardcode the max number of flow/action - rebased on top of the lastest code Thanks. --yliu --- Finn Christensen (3): netdev-dpdk: implement flow put with rte flow netdev-dpdk: retry with queue action netdev-dpdk: set FDIR config Shachar Beiser (1): dpif-netdev: record rx queue id for the upcall Yuanhan Liu (4): dpif-netdev: associate flow with a mark id dpif-netdev: retrieve flow directly from the flow mark netdev-dpdk: convert ufid to dpdk flow netdev-dpdk: remove offloaded flow on deletion lib/dp-packet.h | 14 ++ lib/dpif-netdev.c | 132 +++++++++++-- lib/flow.c | 78 ++++++++ lib/flow.h | 1 + lib/netdev-dpdk.c | 574 +++++++++++++++++++++++++++++++++++++++++++++++++++++- lib/netdev.c | 1 + lib/netdev.h | 7 + 7 files changed, 795 insertions(+), 12 deletions(-)