From patchwork Thu Sep 5 07:02:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Furong Xu <0x1207@gmail.com> X-Patchwork-Id: 13791814 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 B8F6ECD4F59 for ; Thu, 5 Sep 2024 07:04: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=gGPyaa+1WDEMchRcuy5C5zdpNT7E1IN97l7V6rYpwAQ=; b=LKatJLOYTMZl1xF1Kj8nXx7Cdp 7jUzSNJA0gXlA4csU0eqsFm5CtURgAWWUs/vONT5wMh3UMWCaF0Zo76MTwm4RCwSHSFjZnQTxAO1v Obnk40aboM5ceFnBGMOqpM00ATPZ0tDzMENx71kuma00sulfJRQz6dz/uEyXcWhhKD/y26GAHAuyv 0CK9Q+N9ldObtFL5NEY+JuXn3SoufBIXCklQLLvyB0V4pgcZXwjT0HO2LJSprIkfnkifPMhFRRLPD Q5UKxu8uuEFAZKjIQWntWNm45PWhe0feLvKP93WCbW8FUMlPYouV6En0WH/rY1BPn7kTIa+GVOzM0 g/WVWEDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm6XP-00000007ISD-3Rba; Thu, 05 Sep 2024 07:04:16 +0000 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm6WB-00000007HrB-13xr for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 07:03:00 +0000 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-5d5f24d9df8so260870eaf.2 for ; Thu, 05 Sep 2024 00:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725519778; x=1726124578; 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=gGPyaa+1WDEMchRcuy5C5zdpNT7E1IN97l7V6rYpwAQ=; b=J7OOp7dIcsJ8OCvQ9RwZH0j3ed1zdgKenQxZbAdmHWfg9k84V066Os0eBB7GJeSWvm 1MCsVgBb4/qK/qLvQMroOcMKHMH1qqYM7E5AH/8YT5VQkBoPrxKfWYsmZaGXj87lqKxV 5ffy0q2+5WhWa61gipJ9jE6dj7YaoEaQGOllCku1y4Fs7MmXSlC57m+xa+cbuqYrC/Ne GJkHsoFnco1v5b/Tgs5AXak+aM9oCs9sjBobYkO5DcGn74ojYZFvZxBcXE69mSaveMQx Cue284TGr5HYTp/eYiUXbdyf55qvUhEgq4PUrQhYQNbIE65r8AnUVhqq6XwlROg+fAnS fOww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725519778; x=1726124578; 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=gGPyaa+1WDEMchRcuy5C5zdpNT7E1IN97l7V6rYpwAQ=; b=RpfaS27DnSJvklY4n4mZVLp2i4Tzs45rtdwaGQLdOLf6ZpZsTb5h5/xW/+xx3KY7L2 LOy00qKR5TU1xPzcKz+KQJVrV2to7nCzTHNtk9oqmBP5JCW9x/wB1dc2JJE1iWPmrZbq V8N4kz+xi23g+fDJv79yvQ5dCMSm3c9gG0GNYhsrOAzkxnZ0wNZw60EhBdrJwctHe9Lj 0+bsb0vVxfjdu3HD3imIsi2vDheW9ddL8wcDjrxUFIn3hOSLgUar7O85xhsxeQnFC/xT 58BZdQmn9L06GvmxrjyBIhDOl1UUDlWo72RYJbd2FVx27sXXfW8vr8fafPwTudC6/66K +4WA== X-Forwarded-Encrypted: i=1; AJvYcCW6oI1VgEtbUvbEUQSppAxGBlFxPAs7fOBRLpc9S1NK5qNlKGyO8u4YDOU7bgAo84P1Ni1V/bhGKj7GG6gsgStY@lists.infradead.org X-Gm-Message-State: AOJu0Yxb94WYB/B90j2SCvrTS8DYzpaahG56E+CpkNIXe5DWySBR0tBk UixFe7EFPLv9LoEn+rZrVesEHQWwcGkmI1hSQtMEOU4h6EH3ewyi X-Google-Smtp-Source: AGHT+IFEQpZl3ZnRXG3Y8a3KH8gtlt/4cKxL4Zrb6w6RD/CEHqKTJ40bzqvmaOsEUf2ErIgac3XQsw== X-Received: by 2002:a05:6358:590f:b0:1b7:fc1f:5b95 with SMTP id e5c5f4694b2df-1b81240f229mr926884155d.14.1725519777913; Thu, 05 Sep 2024 00:02:57 -0700 (PDT) Received: from localhost.localdomain ([129.146.253.192]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-71778595107sm2604897b3a.150.2024.09.05.00.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 00:02:57 -0700 (PDT) From: Furong Xu <0x1207@gmail.com> To: Vladimir Oltean , Alexander Lobakin , Serge Semin , "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rmk+kernel@armlinux.org.uk, linux@armlinux.org.uk, xfr@outlook.com, Furong Xu <0x1207@gmail.com> Subject: [PATCH net-next v8 0/7] net: stmmac: FPE via ethtool + tc Date: Thu, 5 Sep 2024 15:02:21 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_000259_316219_4F99F358 X-CRM114-Status: GOOD ( 11.49 ) 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 Move the Frame Preemption(FPE) over to the new standard API which uses ethtool-mm/tc-mqprio/tc-taprio. Changes in v8: 1. use timer_delete_sync() instead of deprecated del_timer_sync() 2. check netif_running() to guarantee synchronization rules between mod_timer() and timer_delete_sync() 3. split up stmmac_tc_ops of dwmac4, dwmac4+ and dwxgmac to give user more descriptive error message 4. fix wrong indentation about switch-case 5. delete more unbalanced logs Changes in v7: 1. code style fixes and clean up warnings reported by patchwork netdev checks, no functional change intended Changes in v6: 1. new FPE verification process based on Vladimir Oltean's proposal 2. embed ethtool_mm_state into stmmac_fpe_cfg 3. convert some bit ops to u32_replace_bits 4. register name and function name update to be more descriptive 5. split up stmmac_tc_ops of dwmac4+ and dwxgmac, they have different implementations about mqprio 6. some code style fixes Changes in v5: 1. fix typo in commit message 2. drop FPE capability check in tc-mqprio/tc-taprio Changes in v4: 1. reorder FPE-related declarations and definitions into clean groups 2. move mm_lock to stmmac_fpe_cfg.lock 3. protect user configurations across NIC up/down 4. block stmmac_set_mm() when fpe_task is in progress to finish 5. convert to ethtool_dev_mm_supported() to check FPE capability in tc-mqprio/tc-taprio 6. silence FPE workqueue start/stop logs Changes in v3: 1. avoid races among ISR, workqueue, link update and register configuration. 2. update FPE verification retry logic, so it retries and fails as expected. Changes in v2: 1. refactor FPE verification process 2. suspend/resume and kselftest-ethtool_mm, all test cases passed 3. handle TC:TXQ remapping for DWMAC CORE4+ Furong Xu (7): net: stmmac: move stmmac_fpe_cfg to stmmac_priv data net: stmmac: drop stmmac_fpe_handshake net: stmmac: refactor FPE verification process net: stmmac: configure FPE via ethtool-mm net: stmmac: support fp parameter of tc-mqprio net: stmmac: support fp parameter of tc-taprio net: stmmac: silence FPE kernel logs .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 10 +- drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 96 +++++- drivers/net/ethernet/stmicro/stmmac/dwmac5.h | 12 +- .../ethernet/stmicro/stmmac/dwxgmac2_core.c | 9 +- drivers/net/ethernet/stmicro/stmmac/hwif.c | 6 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 22 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 30 +- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 91 ++++++ .../net/ethernet/stmicro/stmmac/stmmac_main.c | 276 ++++++++---------- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 153 +++++++--- include/linux/stmmac.h | 28 -- 11 files changed, 491 insertions(+), 242 deletions(-)