From patchwork Wed Feb 14 23:18:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 873566 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=gmail.com header.i=@gmail.com header.b="Nbxd89EN"; 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 3zhb2C6Htlz9t2l for ; Thu, 15 Feb 2018 10:18:59 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E5BC7F0F; Wed, 14 Feb 2018 23:18:28 +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 3D48EEFE for ; Wed, 14 Feb 2018 23:18:27 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8D8B21C0 for ; Wed, 14 Feb 2018 23:18:26 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id j9so2799904pgv.3 for ; Wed, 14 Feb 2018 15:18:26 -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:in-reply-to:references; bh=0xmWgAYrb+ljE1k+sXZUo6yi3hxMtfxjnXLEVkG1Bac=; b=Nbxd89ENCAKV5nxI1mwZJ/+LKQf4Yef4g72alk4rGZEru+PKJtpLA5k5Pe0CUU9VF7 +X4h33yYXfZVl+v94KOKb9lgM38hMfoZMEoAmZqCy8KJg442ZoC03ccT+ZyEiZbVFuaB KMLEd5Hhm0cSY/CTn1lcMKiAobofmn19OO0wUwNBsPoAhUX2qvKI5Z4LLMHss9wVEbdH yjSZoW8G605M0Yy5Vb55bXUsrIqJZEItI5QPlr7UOTsK4HY3Qoq78wX3+WyjabIKPjZd CcJf11jmVvuJl5yR1k6fPk7jVkEYkW/vijx2QrHQrPG2LCLe02EHNo2gDiL7siVURxRk iLaw== 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:in-reply-to :references; bh=0xmWgAYrb+ljE1k+sXZUo6yi3hxMtfxjnXLEVkG1Bac=; b=jrePuZLuHWuz2zSSPv+AvVBU7aI8f1KUiHz/SEdJy9OQOSD6Pp2VzBD21ePYfPR9bp 4WtfTNfbK9mm9gFBDKfMf+gWv66uZ/5pXubDAgbbrLUmYkeeSJbrei1ppNvbz0QiTeXx qAwANqIQw1pRT1na3GMJGdeDXhDakhGZSsPx68NzUbXkzAh0gw5OK9pyMWjmerBvyw41 sbK/gfbXwZmeK197xgQJOm0r1vjmI+D2QtafQ5voNIvUW0A0mG+40fcZTAoe0YVW/qRz qNUbT6eofs/JhqKFgw/bd6v2uxgcK/4glZw65PP/1haog60wNpufdIvslhpcn3btKpDX pR2w== X-Gm-Message-State: APf1xPAID6W5mRc5LeolFG4Pt91bTGsnC6+5KKBbhOK202FnY4dKVasx CdjJcV8YBtBHZ1iPlEpNO1U4wQ== X-Google-Smtp-Source: AH8x224KiSrOHbfUgrmhnTMqodhezvAbOoKQU0EGF2NZsdw4N/z0ydPOQNxbdXlrB1abZCNCo8uo2A== X-Received: by 10.99.124.91 with SMTP id l27mr516972pgn.298.1518650305774; Wed, 14 Feb 2018 15:18:25 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id v1sm34681912pfg.33.2018.02.14.15.18.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 15:18:24 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 14 Feb 2018 15:18:03 -0800 Message-Id: <1518650290-31536-2-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518650290-31536-1-git-send-email-gvrose8192@gmail.com> References: <1518650290-31536-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: paolo abeni Subject: [ovs-dev] [PATCH 1/8] datapath: do not propagate headroom updates to internal port 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 From: paolo abeni Upstream commit: commit 183dea5818315c0a172d21ecbcd2554894bf01e3 Author: Paolo Abeni Date: Thu Nov 30 15:35:33 2017 +0100 openvswitch: do not propagate headroom updates to internal port After commit 3a927bc7cf9d ("ovs: propagate per dp max headroom to all vports") the need_headroom for the internal vport is updated accordingly to the max needed headroom in its datapath. That avoids the pskb_expand_head() costs when sending/forwarding packets towards tunnel devices, at least for some scenarios. We still require such copy when using the ovs-preferred configuration for vxlan tunnels: br_int / \ tap vxlan (remote_ip:X) br_phy \ NIC where the route towards the IP 'X' is via 'br_phy'. When forwarding traffic from the tap towards the vxlan device, we will call pskb_expand_head() in vxlan_build_skb() because br-phy->needed_headroom is equal to tun->needed_headroom. With this change we avoid updating the internal vport needed_headroom, so that in the above scenario no head copy is needed, giving 5% performance improvement in UDP throughput test. As a trade-off, packets sent from the internal port towards a tunnel device will now experience the head copy overhead. The rationale is that the latter use-case is less relevant performance-wise. Signed-off-by: paolo abeni Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Cc: paolo abeni Signed-off-by: Greg Rose --- datapath/vport-internal_dev.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 0aa331a..9bb8751 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -149,13 +149,6 @@ internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) } } -#ifdef HAVE_IFF_PHONY_HEADROOM -static void internal_set_rx_headroom(struct net_device *dev, int new_hr) -{ - dev->needed_headroom = new_hr < 0 ? 0 : new_hr; -} -#endif - static const struct net_device_ops internal_dev_netdev_ops = { .ndo_open = internal_dev_open, .ndo_stop = internal_dev_stop, @@ -165,13 +158,6 @@ static const struct net_device_ops internal_dev_netdev_ops = { .ndo_change_mtu = internal_dev_change_mtu, #endif .ndo_get_stats64 = (void *)internal_get_stats, -#ifdef HAVE_IFF_PHONY_HEADROOM -#ifndef HAVE_NET_DEVICE_OPS_WITH_EXTENDED - .ndo_set_rx_headroom = internal_set_rx_headroom, -#else - .extended.ndo_set_rx_headroom = internal_set_rx_headroom, -#endif -#endif }; static struct rtnl_link_ops internal_dev_link_ops __read_mostly = { @@ -189,7 +175,7 @@ static void do_setup(struct net_device *netdev) netdev->priv_flags &= ~IFF_TX_SKB_SHARING; netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_OPENVSWITCH | - IFF_PHONY_HEADROOM | IFF_NO_QUEUE; + IFF_NO_QUEUE; #ifndef HAVE_NEEDS_FREE_NETDEV netdev->destructor = internal_dev_destructor; #else @@ -239,9 +225,6 @@ static struct vport *internal_dev_create(const struct vport_parms *parms) goto error_free_netdev; } -#ifdef HAVE_IFF_PHONY_HEADROOM - vport->dev->needed_headroom = vport->dp->max_headroom; -#endif dev_net_set(vport->dev, ovs_dp_get_net(vport->dp)); internal_dev = internal_dev_priv(vport->dev); internal_dev->vport = vport;