Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4341659pxu; Mon, 12 Oct 2020 16:52:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk84vJy8C7bF+ACJPRZRqMSEqQ2nk5hgz0T/xLfFBkgRvyq0qVAHxTpGUPZz+RQfm6MHcN X-Received: by 2002:aa7:c2ca:: with SMTP id m10mr1006514edp.255.1602546731780; Mon, 12 Oct 2020 16:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602546731; cv=none; d=google.com; s=arc-20160816; b=o314P8/7FVykIyrBpMJSJE4Mk/hJWDazJ5bqTqqghphJj7ypvXSNbgW/LhVRRzAovg qx7506qYC73/Gl4jFZvvyN5zjq4V+gBjkVBr87nPnfDOv2LHbVE4trAdi8zjMJRFvbmr bRQosDN/OE0G4aQm5yBVr9phO1BvvBpnrbEf5GJQopkgXqFeNG8hevQgkheq5TkcpQQd tUuG3IudAKupyPAE8MHLT2Iq2Hh3XcHlfrktnfvwL1H58FIjDtLrevQrGEhyOP0msJqk lPi0685LhT4PMg9fOFI0vxoKN3LGgAc4YwrT8MIyGRNVieacYzci2+5wrwHUQW98r7/F DzZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hk3GzKqCLsF+bDNYsb3m7M7FgC/xWtBm4vjCtbwC+/8=; b=k9LSAITmHZTjeirrY2Pt73Yn0kXkufvpnUoZQB0wUfMtsbCMv+mVfuqVixFJaPFJzb Q3nZrfgOdhWpzDLiQkH0xYSI+sK5WhQZrFg5sBxJ7m+437yIbaMOsv9nWVZwA56gmBpV tNmEGnPXBy6Km5UZ2jE4EOQA3xVfUB1OUWh5Se6u88PFqbE32Pm1E2ZEOE9Vg0qAo5/5 SUHAJdlFr0bMzxWCjjvqOcpzZqoXocSqWiIP4bLSl91yTt+H5zkclW5irJ6xlmNoNnTg n8snGZNIKaXT9e9S04NrY8Ep3sfYsB0gkZOvw+cTHd38cE42UiNbrXzrsT55B16uTdQ6 TH2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uH2bKUdE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si15481594edf.140.2020.10.12.16.51.49; Mon, 12 Oct 2020 16:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uH2bKUdE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731158AbgJLNpA (ORCPT + 99 others); Mon, 12 Oct 2020 09:45:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:46218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731551AbgJLNmt (ORCPT ); Mon, 12 Oct 2020 09:42:49 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 94F5B22227; Mon, 12 Oct 2020 13:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510157; bh=A1jcSsf8w89XJvJHo4za3hRNOQ9EBXCrildb1koHq1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uH2bKUdEmrtNpSBwWeh/Y50zaBZZ0OKBWKdeAsUCPouiya8SVxaeV2X1jCGcWJd86 AA9zwLeP1rNYjBXfyxlvYVQExEz1Eto4Em+ZtIpXEgaEwFqMfQk6VWWG0bgNw6ytuV G1Wx7rN+fTv+vyiXXqgiy8MgKL60Ou5oIByBUMek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Willem de Bruijn , Tonghao Zhang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 64/85] virtio-net: dont disable guest csum when disable LRO Date: Mon, 12 Oct 2020 15:27:27 +0200 Message-Id: <20201012132635.922502288@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132632.846779148@linuxfoundation.org> References: <20201012132632.846779148@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tonghao Zhang [ Upstream commit 1a03b8a35a957f9f38ecb8a97443b7380bbf6a8b ] Open vSwitch and Linux bridge will disable LRO of the interface when this interface added to them. Now when disable the LRO, the virtio-net csum is disable too. That drops the forwarding performance. Fixes: a02e8964eaf9 ("virtio-net: ethtool configurable LRO") Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Willem de Bruijn Signed-off-by: Tonghao Zhang Acked-by: Willem de Bruijn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/virtio_net.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 030d30603c295..99e1a7bc06886 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -63,6 +63,11 @@ static const unsigned long guest_offloads[] = { VIRTIO_NET_F_GUEST_CSUM }; +#define GUEST_OFFLOAD_LRO_MASK ((1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ + (1ULL << VIRTIO_NET_F_GUEST_TSO6) | \ + (1ULL << VIRTIO_NET_F_GUEST_ECN) | \ + (1ULL << VIRTIO_NET_F_GUEST_UFO)) + struct virtnet_stat_desc { char desc[ETH_GSTRING_LEN]; size_t offset; @@ -2572,7 +2577,8 @@ static int virtnet_set_features(struct net_device *dev, if (features & NETIF_F_LRO) offloads = vi->guest_offloads_capable; else - offloads = 0; + offloads = vi->guest_offloads_capable & + ~GUEST_OFFLOAD_LRO_MASK; err = virtnet_set_guest_offloads(vi, offloads); if (err) -- 2.25.1