From patchwork Wed Sep 4 09:21:15 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: 13790299 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 92AD6CA0ED3 for ; Wed, 4 Sep 2024 09:57:11 +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=xdbrukLjPRrEeDE2KtUX1s95Lzj5JQAy01g2Kp/GPkM=; b=Z/z5NDLC2zMjRAnX39cGdJ/GGQ EzXt7ua2hyRlXFF8cDza+Qlm2vGC+VcqY/mDHgtlNjsGjLHSSzVxN4tOeGHY/VerK2FdVKeOyNbCu pK+C48V9G9Ng3nVp9YJWhoczHkDwxZRhsare1GJXGztVStJmyWeqA4oEkf3Y6KhMZ02BnK4f2gGK3 cZgfSVRbwfmE8p7o4v0Sm2SwqFogrhk6Dok1FPPWMcAv95a+rc8HQvm3Fwok1gfgpU651inUr2loT UpcSjz3Lpe8RpbDPprw9rrQRYN16g16H9/7RQKJKnlGTP17jR5eFPvS6933bN05N21qcCQ7MHtgbt pADFWMFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slml2-00000003nCe-0I48; Wed, 04 Sep 2024 09:57:00 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slmDK-00000003eL7-43lX for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 09:22:12 +0000 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-7177a85d092so436832b3a.3 for ; Wed, 04 Sep 2024 02:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725441729; x=1726046529; 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=xdbrukLjPRrEeDE2KtUX1s95Lzj5JQAy01g2Kp/GPkM=; b=lWWbrvl0coB6LgMon8UPPm57BnLPsjMuI3FCT0ZupKaTebu8qLCoGfaBIhjZHtC38X gTHVZrBZSJdAvwe8isRZRxh+DHc3FtZgs8F0BgKH3fxe+rsrI+YQfX9tdLS0qdOLzoG9 aL8Egc+bTAf549EvwoA45HJjlIdra1P2Ze/CBwKYdLuRaWpHfprhkNIK6xpEoN0JG0cS 12dVBK0ACMa44ZrTUly3Jat/+5M7Be9B/URBygJG1X5P9JHb7fHD0IuXoKCZfY+WTvvx 8adEtP1g4gntdNyh8mpZ7HCDVrzAPGEq1YX4/y0nKaMF9nj5X2VmO1OcEUf6nWNMtXi1 XMDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725441729; x=1726046529; 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=xdbrukLjPRrEeDE2KtUX1s95Lzj5JQAy01g2Kp/GPkM=; b=G6VhH5mY+je+7+CEsdyeGaYdcacivUeWzpJkDf6YbvOzguXBKYWDVhOqDITQRbFcu8 12VtApQ+S+ZjG+9fJYM9yfZ2I3CxOeN2VFVx4LZkpya8Qjd0p2DU1rBvGwiZDQUYDDPQ /AV4OHa+ilwDzg4+KxbY3VVekEm6Ah0i3sS9/bIK9Qdmyoiib3DcAGU5Whlu3hbbO0Ri LX1pFxhSxTezXKnDtKxshojlmFz+u4cLkClgpA3hdBTzONLAnX5Rle5v/5T4UvzzaIN/ cRR+ZhEarY9RRJhBK5w2gVyVXwKojgOV63VrtDIApofy4N+pHBjzvMYig79W1aVMB8wl gbhg== X-Forwarded-Encrypted: i=1; AJvYcCXncxZEuHayq0LruQWB31ysl+Pwj2t8ZL5AUgL/GhivyQEPqRsooRkwXS3oP/A03hGyNOrGjWwtz2qAaL8Lwdgw@lists.infradead.org X-Gm-Message-State: AOJu0YyolEpMyV0trgEBnot5Glz6Q1fEyS6xAeiM98QLrCcRldaDz2PV npfyeCbF8Sa/nBDnW5kAQ9EIEC0rF6QPGi1DefiYfDpk3TIAccuG X-Google-Smtp-Source: AGHT+IHZoPSnLfOD0195kXHp8FwhTb/QlnwaX/dwZNMNqywXzjijSFZLEA80Dx6SgU0+jMbZWZ9AEQ== X-Received: by 2002:a05:6a00:2789:b0:70a:f576:beeb with SMTP id d2e1a72fcca58-715dfc3a15emr24155318b3a.15.1725441729432; Wed, 04 Sep 2024 02:22:09 -0700 (PDT) Received: from localhost.localdomain ([129.146.253.192]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-7177859968csm1232048b3a.146.2024.09.04.02.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 02:22:08 -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 v7 0/7] net: stmmac: FPE via ethtool + tc Date: Wed, 4 Sep 2024 17:21:15 +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-20240904_022211_042987_7CF792C5 X-CRM114-Status: GOOD ( 12.35 ) 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 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 | 4 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 21 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 30 +- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 91 ++++++ .../net/ethernet/stmicro/stmmac/stmmac_main.c | 275 ++++++++---------- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 130 ++++++--- include/linux/stmmac.h | 28 -- 11 files changed, 467 insertions(+), 239 deletions(-)