Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8133167imu; Tue, 4 Dec 2018 03:34:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xim5KIK+p4f1UjVkW7vux7oAPr8qKwdLoXpXXI63cCIbXOOfgziyzVgeFYa5XwtbALNXar X-Received: by 2002:a17:902:108a:: with SMTP id c10mr19994410pla.131.1543923292212; Tue, 04 Dec 2018 03:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543923292; cv=none; d=google.com; s=arc-20160816; b=VKg1njDzcnsJ4AQZRVD7Mx8NjqQyEeS+rq2sgndANvyam/7k8AhuZvpaOM7Mm024bh 2FkUVJb5z4VNpXkUrtNQk20rNRMRnnhx8P9hyMxgFFK3dNZ0nOCSTE2BU+PDOu4/dTJy i6FHvgVybUY31USiRgjoB5diCpMeYO26ux8dCmIvVWdgHaz72afSH8nRLSxvAKEpk+D/ Vcp9SL8en9EFJUvihLmi/qosTV3o6sUIEUnySnvd8olcyJdJJjtEmJ9VTUEDlxKEI/jo 53LRpuzZzqeX1qJ/NsQ5iWSdKMxXGcC+OSn6TRgP5PnbOCbBK7XkS+lih03nridRII9n QVNQ== 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=g1nHygv/Wi+KWp3qjN4pvcq2xtXCbVFtuNCDZ+QklTQ=; b=SCi7YDjsspqiODDXQzrxNzSNbTnjK0+3lpc2js9qdnr8QWjBuhF31CiXuEgaSRdQi9 U6jWvoAssel5UxwOlc5bmT5XHchWdbltJqSMcvh45eSlsDdJxUDpfkVcVOgf9X3WptHt 0y+D/S+U7XD8wsP/PWRaa3h0Fzvvl+ay906sAyjsK7ik0eo9wMPkpVeJ69JQGy8gTjkT JAORnO4xArwb9f1RpWgxkuaEQbOY0RXZuAJTCokoMEwlT73b3VGd3i9HSImOZixldm0H ErJJipzcUr6wOQ4wqgpbbau+pUIgbbpLjx6IsuqliIVRffWYzFLRAvnOqky884OJiRR9 VlOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u64yVJK6; 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 az5si15811803plb.166.2018.12.04.03.34.37; Tue, 04 Dec 2018 03:34:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b=u64yVJK6; 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 S1726503AbeLDLcx (ORCPT + 99 others); Tue, 4 Dec 2018 06:32:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:38854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbeLDKzw (ORCPT ); Tue, 4 Dec 2018 05:55:52 -0500 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 02981214D9; Tue, 4 Dec 2018 10:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543920952; bh=qop8BhrjJAnvhd/UHRRzaR8sJKsnyGw1/RLDgBaXy9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u64yVJK6VIdLwHfT0Z/6tqDCIlVo60ngUF8yhAIsZTQZ6NGdrneQRojoZCu0QrYYw t2tBPbOHSiUNj2hHQ85P8geTdTAEa6T8OtVnJZ9mZcXpz1G+QoEZfkFZ9o0vmMwohL 8X4AMJvZQLO2NI1AZnOkKo8Djss5vrGtZpDNGeWw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tal Gilboa , Tariq Toukan , "David S. Miller" Subject: [PATCH 4.19 023/139] net/dim: Update DIM start sample after each DIM iteration Date: Tue, 4 Dec 2018 11:48:24 +0100 Message-Id: <20181204103650.932471064@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tal Gilboa [ Upstream commit 0211dda68a4f6531923a2f72d8e8959207f59fba ] On every iteration of net_dim, the algorithm may choose to check for the system state by comparing current data sample with previous data sample. After each of these comparison, regardless of the action taken, the sample used as baseline is needed to be updated. This patch fixes a bug that causes DIM to take wrong decisions, due to never updating the baseline sample for comparison between iterations. This way, DIM always compares current sample with zeros. Although this is a functional fix, it also improves and stabilizes performance as the algorithm works properly now. Performance: Tested single UDP TX stream with pktgen: samples/pktgen/pktgen_sample03_burst_single_flow.sh -i p4p2 -d 1.1.1.1 -m 24:8a:07:88:26:8b -f 3 -b 128 ConnectX-5 100GbE packet rate improved from 15-19Mpps to 19-20Mpps. Also, toggling between profiles is less frequent with the fix. Fixes: 8115b750dbcb ("net/dim: use struct net_dim_sample as arg to net_dim") Signed-off-by: Tal Gilboa Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/linux/net_dim.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/linux/net_dim.h +++ b/include/linux/net_dim.h @@ -406,6 +406,8 @@ static inline void net_dim(struct net_di } /* fall through */ case NET_DIM_START_MEASURE: + net_dim_sample(end_sample.event_ctr, end_sample.pkt_ctr, end_sample.byte_ctr, + &dim->start_sample); dim->state = NET_DIM_MEASURE_IN_PROGRESS; break; case NET_DIM_APPLY_NEW_PROFILE: