From patchwork Mon Mar 15 06:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 12138477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80AA7C433DB for ; Mon, 15 Mar 2021 06:43:22 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E8EDC64E3F for ; Mon, 15 Mar 2021 06:43:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8EDC64E3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=pFW9uYh6QvXgJQfEp4TGyMVps9OMLmsueoUsgxL6+0E=; b=kig8dGlUAW4B0X5jiZwh/BMVI7 NYTD5W113MJ6UD8VmTRd5jDjKrgr4bnooOkgLPr7DJKGShBxlOrSRYrXKd4i1np/ssM3M7ULmB8MU AnuFnRVvzTpPt4zD26fZtmdqjT9CkHuBU0X09zxzgGh87n7WljEV5smXnMoSvR/HYzTsWKsL6c/MN Ich4VrnwfQK+dFzUow3LaJz6TpWBOYTf2Wo5Umiq8U9/9PKpnXEvnjiPWUt9Wvrbxt4FD2Cy0E4AN m+OsEsNfClOVbcraWkxLpIla+HjGRCYqeDu+6pqe3QZudHms8fC5fw25JBk37fzHFo/pi0BKuB39/ 0/h3Xl7Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLguy-00F3NA-CY; Mon, 15 Mar 2021 06:41:32 +0000 Received: from mga07.intel.com ([134.134.136.100]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLguU-00F3A2-6F for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 06:41:09 +0000 IronPort-SDR: Vi2HTywk3h7UuQ5UXofhC8wEHLYakzqwoIYU5v3C3mKEKlX8BMhRuvYT4q+MX3Gkp1ylnSwMNT F6oT3hnvhfzg== X-IronPort-AV: E=McAfee;i="6000,8403,9923"; a="253060049" X-IronPort-AV: E=Sophos;i="5.81,249,1610438400"; d="scan'208";a="253060049" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2021 23:40:58 -0700 IronPort-SDR: A7rqz74PYV7+BE/8VXwnXIoaGSSyVCYgUXNeHtD6MOZyetXIws/wfmY3CWj243ZK6/GigoJsEM Z2eTfNb0pHhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,249,1610438400"; d="scan'208";a="604742500" Received: from glass.png.intel.com ([10.158.65.59]) by fmsmga005.fm.intel.com with ESMTP; 14 Mar 2021 23:40:53 -0700 From: Ong Boon Leong To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ong Boon Leong Subject: [PATCH net-next 0/1] net: stmmac: add per-q coalesce support Date: Mon, 15 Mar 2021 14:44:47 +0800 Message-Id: <20210315064448.16391-1-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_064106_785041_4E48F10C X-CRM114-Status: UNSURE ( 8.14 ) X-CRM114-Notice: Please train this message. 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 Hi, This patch adds per-queue RX & TX coalesce control so that user can adjust the RX & TX interrupt moderation per queue. This is beneficial for mixed criticality control (according to VLAN priority) by user application. The patch as been tested with following steps and results and the from the output of ethtool, it looks good. ######################################################################## > ethtool --show-coalesce eth0 Coalesce parameters for eth0: Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 > ethtool --per-queue eth0 queue_mask 0xFF --show-coalesce Queue: 0 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 1 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 2 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 3 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 4 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 5 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 6 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 7 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 > ethtool --per-queue eth0 queue_mask 0x02 --coalesce rx-usecs 100 rx-frames 5 > ethtool --per-queue eth0 queue_mask 0x20 --coalesce rx-usecs 100 rx-frames 5 > ethtool --per-queue eth0 queue_mask 0x22 --show-coalesce Queue: 1 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 99 rx-frames: 5 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 5 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 99 rx-frames: 5 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 > ethtool --per-queue eth0 queue_mask 0x04 --coalesce tx-usecs 156 tx-frames 26 > ethtool --per-queue eth0 queue_mask 0x40 --coalesce tx-usecs 156 tx-frames 26 > ethtool --per-queue eth0 queue_mask 0x44 --show-coalesce Queue: 2 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 200 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 156 tx-frames: 26 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 6 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 200 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 156 tx-frames: 26 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 > ethtool --per-queue eth0 queue_mask 0xFF --coalesce rx-usecs 204 rx-frames 0 rx-frames unmodified, ignoring rx-frames unmodified, ignoring rx-frames unmodified, ignoring rx-frames unmodified, ignoring rx-frames unmodified, ignoring rx-frames unmodified, ignoring > ethtool --per-queue eth0 queue_mask 0xFF --coalesce tx-usecs 1000 tx-frames 25 tx-usecs unmodified, ignoring tx-frames unmodified, ignoring Queue 0, no coalesce parameters changed tx-usecs unmodified, ignoring tx-frames unmodified, ignoring Queue 1, no coalesce parameters changed tx-usecs unmodified, ignoring tx-frames unmodified, ignoring Queue 3, no coalesce parameters changed tx-usecs unmodified, ignoring tx-frames unmodified, ignoring Queue 4, no coalesce parameters changed tx-usecs unmodified, ignoring tx-frames unmodified, ignoring Queue 5, no coalesce parameters changed tx-usecs unmodified, ignoring tx-frames unmodified, ignoring Queue 7, no coalesce parameters changed > ethtool --show-coalesce eth0 Coalesce parameters for eth0: Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 > ethtool --per-queue eth0 queue_mask 0xFF --show-coalesce Queue: 0 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 1 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 2 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 3 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 4 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 5 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 6 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 Queue: 7 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 202 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 0 tx-usecs: 1000 tx-frames: 25 tx-usecs-irq: 0 tx-frames-irq: 0 rx-usecs-low: 0 rx-frames-low: 0 tx-usecs-low: 0 tx-frames-low: 0 rx-usecs-high: 0 rx-frames-high: 0 tx-usecs-high: 0 tx-frames-high: 0 ######################################################################## Thanks, Boon Leong Ong Boon Leong (1): net: stmmac: add per-queue TX & RX coalesce ethtool support .../ethernet/stmicro/stmmac/dwmac1000_dma.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac4_dma.c | 7 +- .../ethernet/stmicro/stmmac/dwxgmac2_dma.c | 7 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 8 +- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 132 ++++++++++++++++-- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 48 ++++--- 7 files changed, 157 insertions(+), 49 deletions(-)