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: 13426989 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 C9EF8CDB47E for ; Wed, 18 Oct 2023 12:36:26 +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=bM6shalw3W1CYLVhZhyYKmDDu1Apqhpo8jvOAGfbqKA=; b=3gM5RtXDcUdeos E9Iv89jmjXVv0xaHEWR4zy03MgbWyhiA5IbfVJytnQErwqnri6PWjjvKnWKCGYO0Jid0pKC/ItCr6 vRxHzbhK2iNdcs5ZDTOMK2g1T7XLslJWu3k2mHGfZpBZ3WMJqdJSqD30v7mqp+IWQfkG4tKX5zK3V N9k0Th+O1hvSr+VDXGdpNy/nrmFbtIvkDV3ZJoY84Mz7DlZOsXPVUDQrWYv/CZKjT99xyT7nXL4vG SdYf8T84h6O77YtIBFk2nfpZJ4kpHqG8XfHhLbuXx3h+5l4+dnD9M/fRbTUGG4JY9/O0IuObWyBfg DhbzN2+VdKfWZTjLhFWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qt5mN-00EfeG-2x; Wed, 18 Oct 2023 12:36:03 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qt5mL-00EfdF-01 for linux-arm-kernel@lists.infradead.org; Wed, 18 Oct 2023 12:36:02 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40675f06f1fso48390785e9.1 for ; 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=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=+z2DeuWbLpI7AEzz9he/oetq9pODDYK4Bo2MZwm1LlY=; b=Sk1wD9l62LsolKhjClkQLjrIYwbERTD74QBIfa/N9MMHCf7AcTqzno/5lRVcVoapTn haX+Y6nnl3rua5D9nBDs6jNdVH3PEmB71+8loOcLhaxiN1hX3fURQunpK6TGBq0YItUC rsv+DFkoaNHf4AZv5wBtLA/PrguTisw4tQAGNl0c3QJV1DwSeLgCyTBJ2y/UAeAPMhGP dgEf/oI9PnIh2gKwAcKbvMWtDKvUkGd5F5GQQREVP9AKIponkydr/B2G6kvD9Qif06Lx mk6GylXC7VqGG09cQf1VLXf/DpBZhIRIcFZEjxH7WtfxejtsCwZwKzCLjdD/S9JfPA6N uKZg== 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=SHLg5Bcavq1PFkhKUWM0hyMrSKujWIVMpA71jsw+jBzr1MzsvSF5gaZgiI9eRhmIoD bP4gAdUzXoK8EYcowO8C7ithUGY4wTayTDNzccrY9YEbpdIQhxvgl5JTqRSFhUAmktPO vjBl58ngYVrKTZo/q81tUFIVy7D87vfKcY741nCvuo10TOEqppgB0XX/hyMRO8XcnTDG svC7IZNeysRbenPSRfFoHFxC7See/vn4gZz0puRokRAbhrTlMdW/Pcow4tBu6QV9/85g Y8koXdyQMsYScrUbVgNVmLjd7ivlQfr8viG/sSyMehUfPEjQoFUaR9BltYsEadX6grjP 4jew== X-Gm-Message-State: AOJu0YxRt9kVQ1qWh+Q65j1QBjFP207UJS6IqqVh6BwNNkXkD1x3aakE refPJv/lzC/B3oeDnOYIoek= X-Google-Smtp-Source: AGHT+IHi7O1ZsGGb+3ZGVPAoATB5PmPAZWxpAXGDGRKLUdLuB4yOu6xE3tV0+2ka93mWmWLL4vJhfw== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231018_053601_048355_17C9E16F X-CRM114-Status: GOOD ( 15.91 ) 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 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(-)