From patchwork Sat Oct 14 09:29:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13421955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B99FCDB465 for ; Sat, 14 Oct 2023 09:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3RSAnapIaWz63Bjd8BFoT5AIY+/9QYrnv4gqR/DMWfY=; b=ah4HYmhzYs+MQL IJVOL2umnqORBEH4uq0voGSlvjVe/YpQ65BTmrsFoE8cputsLnI4LKjrEU41lrARSyf9XFV8knATt wZwJC4SddzYT4zwHSk8jXxgcOPXK8AJn3MTSuGhqv6bVjkfBbS0bz/wrg2oW6pHh+yvofG1jZoU/i DtmX/wRPPwL0DgByYW8+ddJG+4Q5DyivVi7c+CijCzDIoFhcAZb4XiVrd2IXfLQcZZSieqrBMn6GO KckMF/vDBJpKBxGh6GAsysbMPaZHXd7z136IDkn3SF+ZcVWUKogCtdQrV5L9eh8ytir/2GdMAGxYj Zb+DsJPfNaALCevriczw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qrayj-0052hp-2S; Sat, 14 Oct 2023 09:30:37 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qrayg-0052fv-19 for linux-arm-kernel@lists.infradead.org; Sat, 14 Oct 2023 09:30:36 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507a3b8b113so352370e87.0 for ; Sat, 14 Oct 2023 02:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697275827; x=1697880627; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vVgxHCn/B7V074W174vEDwqS68k37Kzh+EyWr5cIE3M=; b=CKztcqNTkVcRrCFis8g49BQN+vE3CvSdGz7qKmbMPFxCOmo5HAnUk+yN8QU/JIRMn0 ipKq3I557NMCkR3yj233fqSC5qUwd5e4FHGVZ4lW/SXrIdIJ0Z1yNFMdHDujVHsEb8kt erEM4TlynW4O1elixWMM141ugsBW/Log0Uc+PiogY5RPuMxR6bgSTKnpxUfEzU6bci/d 8fNuI/9gNAKvaLmoT4/yadotR1fhnKLCITPLw34B4fuE3sMig7IIlwDo/QWhdjbcy1I1 kyelVeMRmb+1SWs39bFiMYW96ggqg8L5VH/frJ7HgFnMfvvFBmlpunoSsn3hwIGjhQYn M2xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697275827; x=1697880627; 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=vVgxHCn/B7V074W174vEDwqS68k37Kzh+EyWr5cIE3M=; b=VDm3iCVYNKoy1tYuBlDDY53bcJno0Ri75rgfgzFIllA9kDn6qJHpt5hwtEqIThGdSL PdfaNSEv519DZF9Noyr97PnkWEUiCZcr97XGP4RS1oCl0xXOiYVHbuCbY4kr4hoyp99y /hTEiM8S0QNWkflbdbiyOAVu+8eLmgPdDwsiqB4wDHLNMsKzZyVc1suDS/dqp6IYTATx shKnVsDnPFHTiXZ56nu6Rs44sVNeIeGj4rGc9mLh4RX2ONd/HI1pq9y0h9fyrnxEzBfl oQkZXk0n4zg0M6/F/Nv7qsFWDBvelWUAMZgolZ6PAL5rglIT9SsiZYUz+zw6qtfodL9x C2mw== X-Gm-Message-State: AOJu0YxaMIvcqkfI7hB+MGR3GthuD+QVg6XgVMP0IiWrQbPeohI0qNgz EgVuTay0oEUSce5yoK/aLHA= X-Google-Smtp-Source: AGHT+IGJJJQm7yfJhqss5S4XY8Bm6bfFs0fCEocRUTeiHfSNoKjAzN8d4DstSYgAxtzxjhfGDA7Lxg== X-Received: by 2002:a05:6512:695:b0:503:28cb:c087 with SMTP id t21-20020a056512069500b0050328cbc087mr37064060lfe.29.1697275826447; Sat, 14 Oct 2023 02:30:26 -0700 (PDT) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id u12-20020adff88c000000b0032d9a1f2ec3sm3691564wrp.27.2023.10.14.02.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 02:30:26 -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 v3 0/4] net: stmmac: improve tx timer logic Date: Sat, 14 Oct 2023 11:29:50 +0200 Message-Id: <20231014092954.1850-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231014_023035_244512_B025ACFD X-CRM114-Status: GOOD ( 15.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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 | 37 +++++++++++++++---- drivers/net/wireless/realtek/rtw89/core.c | 2 +- include/linux/netdevice.h | 23 ++++++++++++ net/core/dev.c | 2 +- 6 files changed, 56 insertions(+), 18 deletions(-)