From patchwork Wed Oct 18 12:35:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 15545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4756819vqb; Wed, 18 Oct 2023 05:36:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IForyanXDhawSRs3QdgqGGgiEtvDuZNbw9ytI0kJqxUqfVmBawK5VlNBUi+RXxbXlRReOsi X-Received: by 2002:a05:6a00:1d12:b0:6b2:51a0:e1c9 with SMTP id a18-20020a056a001d1200b006b251a0e1c9mr5200878pfx.1.1697632575123; Wed, 18 Oct 2023 05:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697632575; cv=none; d=google.com; s=arc-20160816; b=RCQTBAEisroeNJKODVRrunuGlErdoAjM5vp2urC9QY/MpqMek+kgWZVhBsmf+IXHkS tQ/2EPyvQ/z861XdBw53WUIvDro8QJMhSwqLSQraokNSJKK7dbrSvtI9ZTOWtNlJX97M HGFsh81t79GndRqliVrNLlanURV1B9V3jja95UXS0oAHeicHs9yqIUM8Vq/FY/rvpsjC uoVz0FME8jWzzG43szlr17Xim/r4P7xPDoXrluoEejAdbadQqupN8pmjFSS3sQGZCvNw f2xVA12XBbXV8VxvejVwh1C9AQ4L2uAxj/9stHZV8Vv114X4qisPns6VJVKyNzbtZ7+f lzdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+z2DeuWbLpI7AEzz9he/oetq9pODDYK4Bo2MZwm1LlY=; fh=jvZ7yAidasmFREPdFLzcn6X72yjJtrVlKHskOtM6Gso=; b=LPnCnUhwOFAeE2k5FsHhHtOHK4/9Ko6l+oZG89EX1nSK71jHSGgyQeYbJ9eQAXOSQf FE7hRYsok7Y5hxaiy/cXNLLhfcvDhTFsHpyZiEHtY67Y2zzLDj3yHnxdDjpOHpj+MUcp DLZ7JXfGcjlMXai/ehMg4ajSKyE26K/JnEPAYGuclC5Bom68KCaxyab+kjKXoCBoUSGB q6Q6gVXLHC+J0jtsUPBAQObzkWVP3yq0MTwIQQaASympNGJjdAju6b1FAzfcHXlLvNF8 83y3afHJMgacx4y8cost3l+vCVsUR7tW9QgSjU7/Kk6w2hsowcbyLt1LhAeTNl99JimI 9ypg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kznUucxN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id a10-20020a65640a000000b005ac39221cc8si1877250pgv.567.2023.10.18.05.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 05:36:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kznUucxN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-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 morse.vger.email (Postfix) with ESMTP id A286E80BDE30; Wed, 18 Oct 2023 05:36:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344649AbjJRMgD (ORCPT + 23 others); Wed, 18 Oct 2023 08:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344518AbjJRMgB (ORCPT ); Wed, 18 Oct 2023 08:36:01 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C00D710F; Wed, 18 Oct 2023 05:35:58 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4081ccf69dcso10049875e9.0; Wed, 18 Oct 2023 05:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697632557; x=1698237357; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+z2DeuWbLpI7AEzz9he/oetq9pODDYK4Bo2MZwm1LlY=; b=kznUucxN6CW1QLdzL9Q9cLnndx4jBo8J/iAytD6q6kEyJCUN/o6yzcImP3lQvZ93ri 9130pjTDDxhA0Q5Cxm+Im2vENF2tlQRlIEEYdsDcdcnI1+PNwAA/r7XtUbPHQqmGf9+J yMSsQ84WSU+imrHsKbuaRRtoBFyjJ0RX1sxpjJ1M+52XiguiPbfrmRZR410lKLkTO8Ni yNJp8gItC0nb3NFnfTS1WQluVdenO/nLWGbtybqpaCW6pZbpfXgFFPVCAOhU2f+DFZ6B FTk6y7xQ8V4wg5M3VcnALZTprrM7z6xZtexIGYpxRi7XKAXRoar85wb1T7TTXl+Ztp4C u/4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697632557; x=1698237357; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+z2DeuWbLpI7AEzz9he/oetq9pODDYK4Bo2MZwm1LlY=; b=OwGgJ/iA//+hhTRhZxry9khxURYndmFIsZhV6sipskl/LaN2tt37N3T9w0NrbxV2J9 sn8yqmN3kh0+3w4uMRkImNtEjNOMWDnKDmLzMYCJR+mrOP6hrm+3Amd2hbQVXyW4uHlf 3bZYBz6WqBpISBCe7/unXn9Wm70DgMR7dFDIbM/2uMieiG8ApraHJUYnRZNDiAVa3V+U Saiu8w9pLl54kvv3shKnuKuSHpDX9A7BuYJCpYKUFj0+fs8A1uc0z722eAPc1kijb/88 tNP6/CHRqkkTBJ3Y1npaP1BacHQDIAYJQExskQb8f8sqPKoX3pm3uCHALlT//ud1FRhb Moyw== X-Gm-Message-State: AOJu0Ywy9/hXPi71bkDBwbcssCGNyBAbAe1lxwaMcVpVJ6jEDIB0equH CG2S/xDBHIwNIcbC99Va7kE= X-Received: by 2002:adf:9b95:0:b0:31f:fc9a:a03 with SMTP id d21-20020adf9b95000000b0031ffc9a0a03mr4367013wrc.20.1697632556892; Wed, 18 Oct 2023 05:35:56 -0700 (PDT) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id q28-20020adfab1c000000b003248a490e3asm2048211wrc.39.2023.10.18.05.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 05:35:56 -0700 (PDT) From: Christian Marangi To: 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 Cc: Christian Marangi Subject: [net-next PATCH v4 0/4] net: stmmac: improve tx timer logic Date: Wed, 18 Oct 2023 14:35:46 +0200 Message-Id: <20231018123550.27110-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 05:36:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780096775333701635 X-GMAIL-MSGID: 1780096775333701635 This series comes with the intention of restoring original performance of stmmac on some router/device that used the stmmac driver to handle gigabit traffic. More info are present in patch 3. This cover letter is to show results and improvements of the following change. The move to hr_timer for tx timer and commit 8fce33317023 ("net: stmmac: Rework coalesce timer and fix multi-queue races") caused big performance regression on these kind of device. This was observed on ipq806x that after kernel 4.19 couldn't handle gigabit speed anymore. The following series is currently applied and tested in OpenWrt SNAPSHOT and have great performance increase. (the scenario is qca8k switch + stmmac dwmac1000) Some good comparison can be found here [1]. The difference is from a swconfig scenario (where dsa tagging is not used so very low CPU impact in handling traffic) and DSA scenario where tagging is used and there is a minimal impact in the CPU. As can be notice even with DSA in place we have better perf. It was observed by other user that also SQM scenario with cake scheduler were improved in the order of 100mbps (this scenario is CPU limited and any increase of perf is caused by removing load on the CPU) Been at least 15 days that this is in use without any complain or bug reported about queue timeout. (was the case with v1 before the additional patch was added, only appear on real world tests and not on iperf tests) [1] https://forum.openwrt.org/t/netgear-r7800-exploration-ipq8065-qca9984/285/3427?u=ansuel Changes v4: - Fix W=1 warning for missing define of pending_packets Changes v3: - Fix compilation error for missing comma Changes v2: - Add patch to move tx timer arm outside tx clean. Christian Marangi (4): net: introduce napi_is_scheduled helper net: stmmac: improve TX timer arm logic net: stmmac: move TX timer arm after DMA enable net: stmmac: increase TX coalesce timer to 5ms drivers/net/ethernet/chelsio/cxgb3/sge.c | 8 ---- drivers/net/ethernet/stmicro/stmmac/common.h | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 40 +++++++++++++++---- drivers/net/wireless/realtek/rtw89/core.c | 2 +- include/linux/netdevice.h | 23 +++++++++++ net/core/dev.c | 2 +- 6 files changed, 59 insertions(+), 18 deletions(-)