Received: by 10.223.185.116 with SMTP id b49csp5489260wrg; Wed, 7 Mar 2018 12:40:01 -0800 (PST) X-Google-Smtp-Source: AG47ELuVPFDS6OkpdHEWbPvgfG2uVq4iJz3O89mPeLlrW2GEBbX6i5En6D8HIJ7+hAeJl/W8drMy X-Received: by 10.101.99.17 with SMTP id g17mr18788942pgv.48.1520455201744; Wed, 07 Mar 2018 12:40:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520455201; cv=none; d=google.com; s=arc-20160816; b=ZEvDV0bL4sgIl+OZ+NTZfatDzDuSg/8HIa5Lx90oL+CUmnSypYLcAURViqJCWAIOMP /DOr96aNjA94lvnpI2zMX0s0Muzxljj/CxBZ+kyjdWpgEeT4pXKrYQ0W353p9BwRs5w5 a3gpNEzYXggKkP6/Dq/cFy0POnT4hE+s/lfzpigRi88CAIaso/YaOO/IC4wRSKh24rb7 ROBHyZ42xYwwv2BGRvnlAQctlL2pHe9K5oDceXiztQPajwkhS8BezY9cjdjOyMZpQbTl KzI7n1nSoVW+PEXKmKacF/19mN1dayKh0/u+C+7yTGis/5JvtjLdYVZBpLa441KEvdKu flMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sPm1EIT6AA9p1OMqJwZB/GUWCZfililMgVwDg2C05Yo=; b=ao2/xApDyp4BGNgA+zIewXKwAAcFvCIJQyCTgFljLKKxHXdDMV9Qfm5RN0fahZ3ksI ndWZvwMnV3z5xVSIMYuljAmmgXGndZHDU3lvcFcqop4MryMKWYIRFmdhF3UJVsfxvPJU fdBPKhG/4j0k8uZZ2PCSA57XT4nLwW2BkMHMTbPf+P/HGzTU24SCwMFOO9mxtWXxIq4E dEW48kg9/7lZJ9mNUWHjUJyp6/LhedLPjfFljW4DKTI8HTA6RLh7+6IIrntjWjViwvUd UPCKg7kZEpK+020h8Rrd2BxYnqzgsiiUOPaxe19vackA6d3q3Ircy0oflUecy9Jf4gYn mH4g== ARC-Authentication-Results: i=1; mx.google.com; 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 o6-v6si13431959plh.287.2018.03.07.12.39.47; Wed, 07 Mar 2018 12:40:01 -0800 (PST) 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; 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 S964789AbeCGUi6 (ORCPT + 99 others); Wed, 7 Mar 2018 15:38:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41218 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934824AbeCGTlr (ORCPT ); Wed, 7 Mar 2018 14:41:47 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 61B601016; Wed, 7 Mar 2018 19:41:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "David S. Miller" Subject: [PATCH 4.15 062/122] net_sched: gen_estimator: fix broken estimators based on percpu stats Date: Wed, 7 Mar 2018 11:37:54 -0800 Message-Id: <20180307191738.271816350@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191729.190879024@linuxfoundation.org> References: <20180307191729.190879024@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit a5f7add332b4ea6d4b9480971b3b0f5e66466ae9 ] pfifo_fast got percpu stats lately, uncovering a bug I introduced last year in linux-4.10. I missed the fact that we have to clear our temporary storage before calling __gnet_stats_copy_basic() in the case of percpu stats. Without this fix, rate estimators (tc qd replace dev xxx root est 1sec 4sec pfifo_fast) are utterly broken. Fixes: 1c0d32fde5bd ("net_sched: gen_estimator: complete rewrite of rate estimators") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/gen_estimator.c | 1 + 1 file changed, 1 insertion(+) --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -66,6 +66,7 @@ struct net_rate_estimator { static void est_fetch_counters(struct net_rate_estimator *e, struct gnet_stats_basic_packed *b) { + memset(b, 0, sizeof(*b)); if (e->stats_lock) spin_lock(e->stats_lock);