Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3285950ybb; Tue, 31 Mar 2020 02:06:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vud9F65v16DwJ6CFgHMyKaWyJcowhGeoQOtlg9oclmJPYxMMrLzZnMq6CeK5n7ixB8Ily8q X-Received: by 2002:aca:1303:: with SMTP id e3mr1367086oii.36.1585645612211; Tue, 31 Mar 2020 02:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645612; cv=none; d=google.com; s=arc-20160816; b=SHlJTRjvjnsHBmT5VrRO8XsOJgH4zGAMZNEzsCmHR0ifnF43SmfPxM1/rg/ZGlrlhe ftPNP5XLY6O9WNOsyc0u2Ddmn8sgf77RJbE3duW/PWuOdKE8roP4DmrtTmz2H2+HRPsK ArquojF0Em1EyEC9Q57zE9sVaewDCjS2phkfc/LotIT+q6Ng4er7MVGk1LIOeR+zT+rW BC3/ggx5CdAop89n+bZkgkL51lRYPGMdhBjyWxltJSBLztrtON3vu0HuMS+GqaU8+K76 X3WL6EfQ3bcNJI/BaGpGY1rAXRfyxNVYlmJQplorjDtuSwwAmVkowoC+OPhYlwRRWxew Oggw== 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=na5tAXLPVXq49H0v5TIKoJz2J6FoLUxbeh32E7564wU=; b=AqISVJZasaD45+Ii7x50KP0cw9SKEhMa9jJU6LTio4y8ypLwhis5Q+iusqQI71p3Sm 1gPIRdOmRtisL6bP423OFPtOUsTOrC2kV2v3W5eEwLiy2ZuLkvmgE/gsyxLUolkZq9Wp FmGW7mcCIBNfuUP2qydHREr3dwy9jxgwILlVjE8v6zhGTVuiUUXiUGeUBB3Y6ekIKQ0s 3u21kdHOTYFkjeP8vCgLIbXIG9/D0DiPFihRgwHwtXEWJzF9KL1rZ7NbshNstIp26HCZ ob0QwGZBKihMXz3vQ/q8VrMAZjvtwKzjzcd5NWb/UINe+nizd9367PST8dkRau1hjgxI WEDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p4AKkkWj; 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 a19si8892495otk.60.2020.03.31.02.06.40; Tue, 31 Mar 2020 02:06:52 -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=p4AKkkWj; 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 S1731048AbgCaJFN (ORCPT + 99 others); Tue, 31 Mar 2020 05:05:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730728AbgCaJFL (ORCPT ); Tue, 31 Mar 2020 05:05:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 3D233208E0; Tue, 31 Mar 2020 09:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645510; bh=WIUDeeKpTGl5MXeTpSN3kNuE9hv1uES+opG8N5XZN8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p4AKkkWjUEbGYpBr2f6SPLzq+5pCKEKrAkBUBJCRx/CrqlimMVWd+yQlXGyB9Mqzl NGGFwow1vfscEz4lFPiVRTz3JE9ftzzaSzHvUD3vq5JkHN6G2EAncZLRjSv2xZncpc wFOYn00a8vAqNMrb7mSDYLHhtAhyv3ppW5ZOVkOc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiang Lidong , "David S. Miller" , Sasha Levin Subject: [PATCH 5.5 069/170] veth: ignore peer tx_dropped when counting local rx_dropped Date: Tue, 31 Mar 2020 10:58:03 +0200 Message-Id: <20200331085431.741779499@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Jiang Lidong [ Upstream commit e25d5dbcffae62c9a7fa03517dfa4b8e67670e3d ] When local NET_RX backlog is full due to traffic overrun, peer veth tx_dropped counter increases. At that time, list local veth stats, rx_dropped has double value of peer tx_dropped, even bigger than transmit packets by peer. In NET_RX softirq process, if any packet drop case happens, it increases dev's rx_dropped counter and returns NET_RX_DROP. At veth tx side, it records any error returned from peer netif_rx into local dev tx_dropped counter. In veth get stats process, it puts local dev rx_dropped and peer dev tx_dropped into together as local rx_drpped value. So that it shows double value of real dropped packets number in this case. This patch ignores peer tx_dropped when counting local rx_dropped, since peer tx_dropped is duplicated to local rx_dropped at most cases. Signed-off-by: Jiang Lidong Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/veth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index a552df37a347c..bad9e03cd32e7 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -328,7 +328,7 @@ static void veth_get_stats64(struct net_device *dev, rcu_read_lock(); peer = rcu_dereference(priv->peer); if (peer) { - tot->rx_dropped += veth_stats_tx(peer, &packets, &bytes); + veth_stats_tx(peer, &packets, &bytes); tot->rx_bytes += bytes; tot->rx_packets += packets; -- 2.20.1