From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 34CDD3B2A4 for ; Fri, 8 Jul 2022 12:04:34 -0400 (EDT) Received: by mail-wm1-x334.google.com with SMTP id o16-20020a05600c379000b003a02eaea815so1143628wmr.0 for ; Fri, 08 Jul 2022 09:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=TWATY/dG5F0OxZOXGFmnA1EI6/+vvssbPR305jj11g4=; b=WNFZLzeiWjqMiqzq7Fd4v7vvhQ/3q/OQedt8TQxlIjeRFkgbUMS6XwjeN1bNMTGVYH xtY07u0Y5+JMfoS0aQxrrhhPyWWI2HvkifYlLqa36sh4Rzj+hAMGZ7LHDGnu44Xt47i1 lFY9r+QcYnrfDAiSMOpeR3AtkPemuobOMD72AiQRwSQdBjaSqryF108kYycKBWq4Fy/1 84AwKlfsR0WQ4xsAD5u15qmWegR/EHgbGsG/vmxffZRl/MzN/Jgj3sSw9tWyzef61wuN fySt3i55hg9iEnE7IBTQ0oQSnInvUEJfqQCq0ut0m8Q4Z8n0rEy6h1oRKnYI/9vW5kc8 CLcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=TWATY/dG5F0OxZOXGFmnA1EI6/+vvssbPR305jj11g4=; b=DuiLsQ0l5eE8RmhLAd93BI3FKfYi1c6bU9mkEbn90kqI2P/eZQA2rD7YNiMmmBLs5X XgUNIWNwhnAE/Jni1ixZbSp6TFFtgEEigK9tXvr9EvxIN+Uv5rbLryWGV/i0oQCwq3Gu uV6TLYuTF3YWzO67lYQsD+ad2+53joCT+/s20IpO5qhZ78FO4oWqz9BJBqvYmccLLPwM VS0G1YKcxzRwTvby9gnVDuJEX+ndCdmHVLpI9LokWrUIuKzSUgBxf1BR8guTCQRyHMgF M/lbqd2jlJXewWKskR2xcNCv5TBtme2k6V5OEu3YIWP6bYICFIwUvaS1MH9/yJwj6h0q ufdQ== X-Gm-Message-State: AJIora/XNZh4nEPIWWf4hbNuyYbXgivPF9yKh2KjWqWTzSwOQFwTfc1d LBKtkd+JOFZAALvG9AY6Viyl3Umh41r1QmkSLVmUV+EuDxc= X-Google-Smtp-Source: AGRyM1vOiKMskK3AJRNsbolURpAI7Peoxl89R687t/P/3FozU/6529GN1+63BI109p7yz7OpnVqfenKIAEZd0kbbpYg= X-Received: by 2002:a05:600c:48a:b0:3a2:ce31:a150 with SMTP id d10-20020a05600c048a00b003a2ce31a150mr597722wme.48.1657296272776; Fri, 08 Jul 2022 09:04:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Taht Date: Fri, 8 Jul 2022 09:04:18 -0700 Message-ID: To: cerowrt-devel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [Cerowrt-devel] Fwd: [PATCH net] pktgen: Fix the inaccurate bps calculation X-BeenThere: cerowrt-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Development issues regarding the cerowrt test router project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2022 16:04:34 -0000 heh. Fastest way to change the observed speed of the internet I've yet seen= . ---------- Forwarded message --------- From: Date: Fri, Jul 8, 2022 at 8:51 AM Subject: [PATCH net] pktgen: Fix the inaccurate bps calculation To: , , , , Cc: , Gao Feng From: Gao Feng The prior codes use 1000000 as divisor to convert to the Mbps. But it isn't accurate, because the NIC uses 1024*1024 from bps to Mbps. The result of the codes is 1.05 times as the real value, even it may cause the result is more than the nic's physical rate. Signed-off-by: Gao Feng --- net/core/pktgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 84b62cd7bc57..e5cd3da63035 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -3305,7 +3305,7 @@ static void show_results(struct pktgen_dev *pkt_dev, int nr_frags) } mbps =3D bps; - do_div(mbps, 1000000); + do_div(mbps, 1024 * 1024); p +=3D sprintf(p, " %llupps %lluMb/sec (%llubps) errors: %llu", (unsigned long long)pps, (unsigned long long)mbps, -- 2.20.1 --=20 FQ World Domination pending: https://blog.cerowrt.org/post/state_of_fq_code= l/ Dave T=C3=A4ht CEO, TekLibre, LLC