Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2462896imd; Fri, 2 Nov 2018 11:50:34 -0700 (PDT) X-Google-Smtp-Source: AJdET5e9eG+8CzGKv12225nzm789a4JQMkn//HbxZ/7ADP87xCaKkE5yLzxA9++0yXM0pDenSciu X-Received: by 2002:a62:8a0d:: with SMTP id y13-v6mr12878034pfd.142.1541184634764; Fri, 02 Nov 2018 11:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184634; cv=none; d=google.com; s=arc-20160816; b=wb1jR+YDsS8G/pMccGKqj8E8P2zQyyY7LxwT9fyhkMKONTZ4V9ep4vfMOW7oJEIFPC B1EaRMu0Gpc0OSkBCVBWuLfZzrvPj1t+G3nQ3HohFxpVxen7TEL8xVORwVdEIy3GOu0c mOGVAk3OZL2HUpES0GvqPpXlAYN0J3CF1x4/Q5qTl6cjiDV4FkEshUZX7oUXSazZ5O4o xJBAUpZKvvXOvjs8I3NRx3cGikervIEGIHM5jMIUSgew7yfHTD/wtOUu0PydOVzw6JHf ckH1GATLFza1n9cgurU0B87pcIb0A28Oy2NOM/zIY2EjN/+uq3nwpJBfu+9GYqBpZJhH as1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=auwj6A5Hn+Cl1WFU+Y08aBmDNeJqP60lL5Ue4DgG4DY=; b=CLDsjL/tjREHhH0HAma/cZ3KFk7y3Iedl/OxkiFG3ImQ+/DC5pS0KJ8t3vewAxIfQs ciyzzoXk2s/lBmg2nXbMbgPLYU7fbKe3cd2AOpNAZW4UsQp71s9txNIIHfUdpYZBgV2f VtEgQdQlLHjlzBoW2F0nx0YShjf0gmW4SIP36fxLlv3ltTwEPdXE/rrhzdhifP3kl/g8 JbiAb59gNoete4k1Wo6bWxaxmBOfYWM0s8nA/rd7L2WifoBu2v8QMAApBDfTmTaHzC5h O56oIIAHThBno2YabU4D4XUMUJEHZslgQXSEB5Dmn4gaXunCl4KPfDQefv4z4n5DeK0V IS5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HalTI9z+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si33495931pln.368.2018.11.02.11.50.19; Fri, 02 Nov 2018 11:50:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HalTI9z+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730743AbeKCD6M (ORCPT + 99 others); Fri, 2 Nov 2018 23:58:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:53950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728280AbeKCD6M (ORCPT ); Fri, 2 Nov 2018 23:58:12 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7C962082D; Fri, 2 Nov 2018 18:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184597; bh=SSTtRrQzf5Xuq/0UonM11WeF60ZAKIVTuPbwLqLIwrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HalTI9z+TnIqkhiJLCYMkpNhVxQ1c81CwRV0JmipvnfMMBFxZ9+/NM8SCFJuIyqil iNYMn1O1Z/+dxxi8XIvi17BUbDu4+WcB0il8ajMoV97KCqHY9khtN0xCFjNmsheIMR DTVobtN9Hfq/rE6lXlO1cgfm0rp90ku3p/4wzxaE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Davide Caratti , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 046/143] be2net: dont flip hw_features when VXLANs are added/deleted Date: Fri, 2 Nov 2018 19:33:51 +0100 Message-Id: <20181102182900.729769807@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182857.064326086@linuxfoundation.org> References: <20181102182857.064326086@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 2d52527e80c2dc0c5f43f50adf183781262ec565 ] the be2net implementation of .ndo_tunnel_{add,del}() changes the value of NETIF_F_GSO_UDP_TUNNEL bit in 'features' and 'hw_features', but it forgets to call netdev_features_change(). Moreover, ethtool setting for that bit can potentially be reverted after a tunnel is added or removed. GSO already does software segmentation when 'hw_enc_features' is 0, even if VXLAN offload is turned on. In addition, commit 096de2f83ebc ("benet: stricter vxlan offloading check in be_features_check") avoids hardware segmentation of non-VXLAN tunneled packets, or VXLAN packets having wrong destination port. So, it's safe to avoid flipping the above feature on addition/deletion of VXLAN tunnels. Fixes: 630f4b70567f ("be2net: Export tunnel offloads only when a VxLAN tunnel is created") Signed-off-by: Davide Caratti Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/emulex/benet/be_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 7e2b70c2bba3..39f399741647 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -3900,8 +3900,6 @@ static int be_enable_vxlan_offloads(struct be_adapter *adapter) netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_GSO_UDP_TUNNEL; - netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL; - netdev->features |= NETIF_F_GSO_UDP_TUNNEL; dev_info(dev, "Enabled VxLAN offloads for UDP port %d\n", be16_to_cpu(port)); @@ -3923,8 +3921,6 @@ static void be_disable_vxlan_offloads(struct be_adapter *adapter) adapter->vxlan_port = 0; netdev->hw_enc_features = 0; - netdev->hw_features &= ~(NETIF_F_GSO_UDP_TUNNEL); - netdev->features &= ~(NETIF_F_GSO_UDP_TUNNEL); } static void be_calculate_vf_res(struct be_adapter *adapter, u16 num_vfs, @@ -5215,6 +5211,7 @@ static void be_netdev_init(struct net_device *netdev) struct be_adapter *adapter = netdev_priv(netdev); netdev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_GSO_UDP_TUNNEL | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX; if ((be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS)) -- 2.17.1