Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4342783pxu; Mon, 12 Oct 2020 16:54:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOcDtoktO+1W9MFvW9Bzl9jpZ1CN9LGKJivH1AzT48s/Lmes8Z9XkZGdCfV533Ysf22cRE X-Received: by 2002:a17:906:6409:: with SMTP id d9mr30088567ejm.344.1602546892352; Mon, 12 Oct 2020 16:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602546892; cv=none; d=google.com; s=arc-20160816; b=zHRI6buyqJZVtqILNWJrOfIYWvK4RCSg1hO1VKJeVB0e3au3soOOB1ZUFT/XBCsCa5 IwijF7eQW5LZ/tp9MwBIIWj6BLMMU0j9N5GTSfRbLAWyKy9mjPqGBDHb/qzMyw6/c7HV v/E6XxEQIPdHzSGdSybDQ9jJzZtSlfr7BRP5nhV9E4hPBUN90F5FlfK4oZww+EwdwZIK 8bHIoXz7ik5P96xwvIqa+j8ie0Wg0vn5ScHEy4ODpJMDPJ0BR7jo7JsmCzIkyMhKTh68 gZPuE5JkKGzTtfLqg5QWqUGVuYTvdexlIyrEaJwhAf0Muv81FcDEftOGs097hDhdS5sF NlOg== 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=vAPT91yJaYVhu074krkRs1JLMQXFDUzb5CBPNF651zE=; b=rsHTwKxXJwieX58l+uXQcWAWLqryOfDPRro9fAhcwhE+/AcDHoxNqtZXXmxq4TzmN9 DXHp5/2+Do7RYljLL0zAhw2tBzF/tJ/It5nOj7z0BwDmjIrzl4OtyZkOCOYFsU/Rm8AA bmUVU0In01tKc+F9Gb235Ts5/HF2vXPadi7sJrjQxIRmIpy2xttd0ei0JJcIGLNgLL/s kIWz6QRiFtd38E3LZeLJbQpeBRzrPX9rVpx7fHfunwCFnC1feAdJ1mf0oG1OJ0ECtD7a ouACwkZn2nJX51sMs7AR88L4cVPpmXFv5d/YwS8MAMpaO066sg+dwkhWbfUCm/7l3J/N zJzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Aa3jmvD+; 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 x61si10113680ede.571.2020.10.12.16.54.29; Mon, 12 Oct 2020 16:54:52 -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=Aa3jmvD+; 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 S2390303AbgJLNxf (ORCPT + 99 others); Mon, 12 Oct 2020 09:53:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:53860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731398AbgJLNq4 (ORCPT ); Mon, 12 Oct 2020 09:46:56 -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 23E2C20878; Mon, 12 Oct 2020 13:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510387; bh=0CMrJjWFHQ/Vh6o6OlG25LLmyoGua1YSTFewTOGmhw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aa3jmvD+mTuuvML/gdlgcVPc5G3VQPSMM1gWm5bQ1ob76/a9ADPDXaAdpCDYFnMK6 zD3Qht6XNK8ardllv46FGIZfByRJl+THSLAUvL1YkHifoIIz5ss4EeM8KmcBcAtGW6 0qsj29o5/OS21e3puNsZagh7oqnsxE4qcOcLPAEI= 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.8 077/124] virtio-net: dont disable guest csum when disable LRO Date: Mon, 12 Oct 2020 15:31:21 +0200 Message-Id: <20201012133150.586204035@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@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 ba38765dc4905..c34927b1d806e 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; @@ -2547,7 +2552,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