Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3030147rdb; Fri, 22 Sep 2023 16:13:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKIuZRs0CEeYCjS8xcfJQDtM9vJoj9RMhiZISgD4QU4PX28K8segk3sDsi/QVhl4B/fP3K X-Received: by 2002:a17:90a:e154:b0:276:a08e:a871 with SMTP id ez20-20020a17090ae15400b00276a08ea871mr1045995pjb.47.1695424416033; Fri, 22 Sep 2023 16:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695424416; cv=none; d=google.com; s=arc-20160816; b=RTPByRaKsEarCYOL9Ijjh0CQDWId4oZ3BQinVbwT3jogIgbg3V6uYEuAT95PfLquBs fAowVWxMcS5IUO1YBYRLiKavLT5IXlav7h8jm7NjC6YHLUkJL9Hl1MKbxamCQ2ieVlyT atA0+X5QAXns2T/wZQtZy9YDLQkUvFMN3oMc3EL9nxJAHlWW49H2wwgWhU6oJiz9UcEv mPeh3wkUbJ3cC3j2aA1vYIgXIzgZcZY9X7sFM4P/XcedBSGUzNwsoB84YJztYp2QYrtm An22b/p3Ij8xfzq6YYeGI9/ZN8NadCqB8sKyA9eGv3zyofsJDp5UMW5v7p1+TZM/shxN vq7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gQxVwDWGzICCtzIyR/1ybOxtmRno79pEfOcqjcENqi8=; fh=DckC/Kq1tXH4qKhGtdgS2wlROxNP9oRBLvRmXfCyixQ=; b=f15qWoESHTuGMwX6ehLWqw7kN8DnBJLBZUTvbn99iD/IFx6F74Sq8oBGu9Mzqbifzg hMPYXxT3CZPspTTS+eY3PhIHqrsfbsKEw6cZlZ7i+buSAwoRJlNSOkrvCacY4MIO1mtE k9xHUX+5WvgjZ3Orf5UCJVmMYf7hNEfwJ0NyIgryR+H3+Kjqkl2gKdYXQYWmaJZb/VeC BIGf5oGs+xxy1LvzmtduibpuD/+OYGlC7Q+rFrf5u37m0wiVGaFUP4MSveG9JqkPaOAP s2Rm57vDt6d4puPIEl4z2E1dXJKY+7LW75hYeX5unYn14C9l3HcQTUUsXIggEm/fSn9C w1tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k92Na7MQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id gt4-20020a17090af2c400b00262f0035181si6811991pjb.26.2023.09.22.16.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 16:13:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k92Na7MQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3DDF782B58A1; Fri, 22 Sep 2023 13:03:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbjIVUDQ (ORCPT + 56 others); Fri, 22 Sep 2023 16:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjIVUDO (ORCPT ); Fri, 22 Sep 2023 16:03:14 -0400 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A517219B; Fri, 22 Sep 2023 13:03:08 -0700 (PDT) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-59f4f80d084so2106817b3.1; Fri, 22 Sep 2023 13:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695412988; x=1696017788; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gQxVwDWGzICCtzIyR/1ybOxtmRno79pEfOcqjcENqi8=; b=k92Na7MQzZl3UDgIoik+tSsBfP/ktc3ogoXB3qSJrn0sDk6MXRExsumh4Pa346ZUP8 ZYOtGosibwfRw2yZHNX8oq3hj0heIV59XVgZg2u7FI4xFF8Jdpo912+nm6SgkxYN7+Ir EzCcozDuGMVHYax1s3W/EMXKGnJl/GI3lUFt4YVlfotlIbTB5vP+9ftFNOVbBRBArq3u 3frbYxj3gXaVDQsKzAvLHS5GQzcSkORZzglPy9hrSJ0aBQS4SY2NQt5rWQRID/Xzlcup 9x2qTmMoGcN6z6Jd3ImptClkjQVstlaej+eJje+vSOoX5AiCAN+bYwXif98Jabyz+kPm KeOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695412988; x=1696017788; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gQxVwDWGzICCtzIyR/1ybOxtmRno79pEfOcqjcENqi8=; b=NJ0o4grIzogD5CpKVo+kb5+f4MFGBkAcZ33+FO0uXlwFTZaOxAmQ7l7FN2dqgTd5FG 51Aj5uD9uYU3m9YxgAuTwmitPiWX2MZ6LT3Q10u1n2j8xC3meN0hAoZxMT09+jxmbgu6 Asi7LSCbAdqDodmWdv2nAqH3tygEK37bGA6FFZVYRywVZFdMuJeLwdddz87YlXf8Bb6l atHVk3HMbBbAdsw21M36AnodRpIYQxQ6/Qo6Id4YAiFEaW7hWZwGlDcw41folHKu7Oz8 zk0fb2ePrZb+UqT+D9kQp9rnjZLwML9Og/+bmKFbVqoJrkonGl0mTeDaktIBrsXrOQ/4 Gupg== X-Gm-Message-State: AOJu0YyyHvnhn8/6IyYJWOID9m0QLlorq1Ob3/NeQZofTLFt4Sj1avUO 8nhnr7lzp3p3HjTEFx2FVp10RLCJaat4o8id4dg= X-Received: by 2002:a81:5205:0:b0:59b:69cf:72c0 with SMTP id g5-20020a815205000000b0059b69cf72c0mr772796ywb.6.1695412987630; Fri, 22 Sep 2023 13:03:07 -0700 (PDT) MIME-Version: 1.0 References: <20230922111247.497-1-ansuelsmth@gmail.com> <20230922111247.497-3-ansuelsmth@gmail.com> <13bc074d-30c2-4bbf-8b4c-82f561c844b0@lunn.ch> <650d8af4.5d0a0220.5ce38.2c5e@mx.google.com> In-Reply-To: <650d8af4.5d0a0220.5ce38.2c5e@mx.google.com> From: Dave Taht Date: Fri, 22 Sep 2023 13:02:55 -0700 Message-ID: Subject: Re: [net-next PATCH 3/3] net: stmmac: increase TX coalesce timer to 5ms To: Christian Marangi Cc: Andrew Lunn , Vincent Whitchurch , Raju Rangoju , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Ping-Ke Shih , Kalle Valo , Simon Horman , Daniel Borkmann , Jiri Pirko , Hangbin Liu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-wireless@vger.kernel.org, dave seddon Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 13:03:12 -0700 (PDT) X-Spam-Level: ** On Fri, Sep 22, 2023 at 5:39=E2=80=AFAM Christian Marangi wrote: > > On Fri, Sep 22, 2023 at 02:28:06PM +0200, Andrew Lunn wrote: > > On Fri, Sep 22, 2023 at 01:12:47PM +0200, Christian Marangi wrote: > > > Commit 8fce33317023 ("net: stmmac: Rework coalesce timer and fix > > > multi-queue races") decreased the TX coalesce timer from 40ms to 1ms. > > > > > > This caused some performance regression on some target (regression wa= s > > > reported at least on ipq806x) in the order of 600mbps dropping from > > > gigabit handling to only 200mbps. > > > > > > The problem was identified in the TX timer getting armed too much tim= e. > > > While this was fixed and improved in another commit, performance can = be > > > improved even further by increasing the timer delay a bit moving from > > > 1ms to 5ms. I am always looking for finding ways to improve interrupt service time, rather than paper over the problem by increasing batchi-ness. http://www.taht.net/~d/broadcom_aug9_2018.pdf But also looking for hard data, particularly as to observed power savings. How much power does upping this number save? I have tried to question other assumptions more modern kernels are making, in particular I wish more folk would experience with decreasing the overlarge (IMHO) NAPI default of 64 packets to, say 8 in the mq case, benefiting from multiple arm cores still equipped with limited cache, as well as looking at the impact of TLB flushes. Other deferred multi-core processing... that is looking good on a modern xeon, but might not be so good on a more limited arm, worries me. Over here there was an enormous test series recently run against a bunch of older arm64s which appears to indicate that memory bandwidth is a source of problems: https://docs.google.com/document/d/1HxIU_TEBI6xG9jRHlr8rzyyxFEN43zMcJXUFlRu= hiUI/edit We are looking to add more devices to that testbed. > > > > > > The value is a good balance between battery saving by prevending too > > > much interrupt to be generated and permitting good performance for > > > internet oriented devices. > > > > ethtool has a settings you can use for this: > > > > ethtool -C|--coalesce devname [adaptive-rx on|off] [adaptive-tx o= n|off] > > [rx-usecs N] [rx-frames N] [rx-usecs-irq N] [rx-frames-ir= q N] > > [tx-usecs N] [tx-frames N] [tx-usecs-irq N] [tx-frames-ir= q N] > > [stats-block-usecs N] [pkt-rate-low N] [rx-usecs-low N] > > [rx-frames-low N] [tx-usecs-low N] [tx-frames-low N] > > [pkt-rate-high N] [rx-usecs-high N] [rx-frames-high N] > > [tx-usecs-high N] [tx-frames-high N] [sample-interval N] > > [cqe-mode-rx on|off] [cqe-mode-tx on|off] [tx-aggr-max-by= tes N] > > [tx-aggr-max-frames N] [tx-aggr-time-usecs N] > > > > If this is not implemented, i suggest you add support for it. > > > > Changing the default might cause regressions. Say there is a VoIP > > application which wants this low latency? It would be safer to allow > > user space to configure it as wanted. > > > > Yep stmmac already support it. Idea here was to not fallback to use > ethtool and find a good value. > > Just for reference before one commit, the value was set to 40ms and > nobody ever pointed out regression about VoIP application. Wtih some > testing I found 5ms a small increase that restore original perf and > should not cause any regression. Does this driver have BQL? > (for reference keeping this to 1ms cause a lost of about 100-200mbps) > (also the tx timer implementation was created before any napi poll logic > and before dma interrupt handling was a thing, with the later change I > expect this timer to be very little used in VoIP scenario or similar > with continuous traffic as napi will take care of handling packet) I would be pretty interested in a kernel flame graph of the before vs the a= fter. > Aside from these reason I totally get the concern and totally ok with > this not getting applied, was just an idea to push for a common value. I try to get people to run much longer and more complicated tests such as the flent rrul test to see what kind of damage bigger buffers did to latency, as well as how other problems might show up. Really notable in the above test series was how badly various devices behaved over time on that workload. Extremely notable in that test series above was how badly the jetson performed: https://github.com/randomizedcoder/cake/blob/2023_09_02/pfifo_fast/jetson.p= ng And the nanopi was weird. https://github.com/randomizedcoder/cake/blob/2023_09_02/pfifo_fast/nanopi-n= eo3.png > Just preferred to handle this here instead of script+userspace :( > (the important part is the previous patch) > > -- > Ansuel > -- Oct 30: https://netdevconf.info/0x17/news/the-maestro-and-the-music-bof.htm= l Dave T=C3=A4ht CSO, LibreQos