From patchwork Fri Oct 18 06:39:06 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: 13841250 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 58927D3C54C for ; Fri, 18 Oct 2024 06:41:42 +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=uT/jCt5QcwTbFSYi05lc89RT3DwAspW1JXtMxybafaY=; b=IZ1wS13tzkCYrvLBFWtsAVt1pO 6iePGbTgXp5OVP3syOgKWso4GesI+ufVgKJuFLI2f4DjyARD7C/aJOy5q7a1KQpP5lZCuHdA7aY3H RS8Nu1CoKA6WradWxexJPsV5vYd/DkWAH3Zv2yzq5m8gDlbAb7SSyxlrZI7Ho0+kWYjR8FQ92TAzx t0zpyVUIfYU4uljqquXQ46edKIDbv7IqV+axLjzGe4NyMpgvPmwzjuWx14CaoLsI6AwE0AdUdI45G gej1Cxis7tnUsANJvUCa4wCfNc+igoBf8ZZSxMcvBr6UJ4WCyBy729oB8KNORy7dVQRgJulTXV7lF tuBsDiiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1gfz-0000000HBLq-2QOO; Fri, 18 Oct 2024 06:41:31 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1geH-0000000HAhY-04GT for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 06:39:46 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-20c803787abso13836605ad.0 for ; Thu, 17 Oct 2024 23:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729233584; x=1729838384; 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=uT/jCt5QcwTbFSYi05lc89RT3DwAspW1JXtMxybafaY=; b=G5HgMiNmB5sBMaCI+EyLtavdOydEHFUbxIbILwPOTTpIA9gq2n89j9DPY1/3yUSAMB mCALzZyysc2l3fUl/3GQrYESz6P0cFmfY/w+GnC+2upTmQC6xCexdkBvGsEhfizDO106 G7ZbtPY0iKfiwOTvirV5RgcU1276LUNsPMRNWh5ktMn9oYQCVP9BBkc/nGfxWrMy8doj 7hoHSJnCWjCmMt0e4Jfe6CTLFEmg8e7BVu4D8tsZhsN0wLkVU3LKa0cGrzmcmhJKRoY2 UGp0BTu3NJnsoUXJMfmKLF+GaYVCRFLLic4IaC5M53/Oli33nhi5ImQRatJRbst+0imk adig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729233584; x=1729838384; 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=uT/jCt5QcwTbFSYi05lc89RT3DwAspW1JXtMxybafaY=; b=GwWAhBKOKFt7QAyqcZ0YSdjy85X8qmJUvdm2Mcrph/L/enLJjKv1XiNF5wwzDeafyv 2U3IBBpguEnRovaZgg0TfN8ZPR9JS30A6L4RS3vTqbb5Yt4SUuNaZNxkLyKq55DfxSIh 7ozY4rpOgU6OHNxTUtut44bEFia9slP0xPorkRrLVOoFL2IWxG8dvGFCv2Yw/HR4Tcbu il47YMjfC3Kx8e4mIPInRAmm6swtdyitAO9PNFQl6ianchQJbrC3eyYFyHEJ1d8nu/13 my6TUxn+016S9UZMIL10CBc+tCsZQKFZt9plThtw0e1GOfaa0jwhEjDNTkgLIW2HQqFp j4XQ== X-Forwarded-Encrypted: i=1; AJvYcCXT7EC8v3aa5SUwCWZnFn0fZhoNTQUPqLqfG/ELa8A664Ijy3Z52wUiUEfkkKEazDIaM7h/KW2DRlxptV7pavGz@lists.infradead.org X-Gm-Message-State: AOJu0YwRB2Hhoo7rDsoupKGMQkIyBknDM7uZsYCnSmDwZDDzLt5/TI2n VvegQb8LmCq3m+BR6olf733iEvkKd6q5YIhfZhvu0L1vaVYDUqW5 X-Google-Smtp-Source: AGHT+IFu4YCLEVDs8s7LlrZTMXp3Lx2+ATgY2Oc7tnIYbAbFTja+uBUgxR0QGwxjWrDfj8BFV3AdZw== X-Received: by 2002:a17:902:e749:b0:20e:567c:9d87 with SMTP id d9443c01a7336-20e567c9ddbmr31892085ad.20.1729233583765; Thu, 17 Oct 2024 23:39:43 -0700 (PDT) Received: from localhost.localdomain ([129.146.253.192]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-20e5a74766fsm6285455ad.73.2024.10.17.23.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 23:39:43 -0700 (PDT) From: Furong Xu <0x1207@gmail.com> To: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Vladimir Oltean , Andrew Lunn , Simon Horman , Serge Semin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , xfr@outlook.com, Furong Xu <0x1207@gmail.com> Subject: [PATCH net-next v2 0/8] net: stmmac: Refactor FPE as a separate module Date: Fri, 18 Oct 2024 14:39:06 +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-20241017_233945_075742_D200DBCF X-CRM114-Status: GOOD ( 14.19 ) 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 Refactor FPE implementation by moving common code for DWMAC4 and DWXGMAC into a separate FPE module. FPE implementation for DWMAC4 and DWXGMAC differs only for: 1) Offset address of MAC_FPE_CTRL_STS and MTL_FPE_CTRL_STS 2) FPRQ(Frame Preemption Residue Queue) field in MAC_RxQ_Ctrl1 3) Bit offset of Frame Preemption Interrupt Enable Tested on DWMAC CORE 5.20a and DWXGMAC CORE 3.20a Changes in v2: 1. Split patches to easily review 2. Use struct as function param to keep param list short 3. Typo fixes in commit message and title Furong Xu (8): net: stmmac: Introduce separate files for FPE implementation net: stmmac: Introduce stmmac_fpe_ops for gmac4 and xgmac net: stmmac: Rework macro definitions for gmac4 and xgmac net: stmmac: Refactor stmmac_fpe_ops functions for reuse net: stmmac: xgmac: Rename XGMAC_RQ to XGMAC_FPRQ net: stmmac: xgmac: Switch to common_fpe_configure() net: stmmac: xgmac: Complete FPE support net: stmmac: xgmac: Enable FPE for tc-mqprio/tc-taprio drivers/net/ethernet/stmicro/stmmac/Makefile | 2 +- drivers/net/ethernet/stmicro/stmmac/common.h | 1 + .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 12 - drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 150 ------ drivers/net/ethernet/stmicro/stmmac/dwmac5.h | 26 - .../net/ethernet/stmicro/stmmac/dwxgmac2.h | 7 +- .../ethernet/stmicro/stmmac/dwxgmac2_core.c | 28 -- drivers/net/ethernet/stmicro/stmmac/hwif.c | 7 + drivers/net/ethernet/stmicro/stmmac/hwif.h | 54 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 10 - .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_fpe.c | 464 ++++++++++++++++++ .../net/ethernet/stmicro/stmmac/stmmac_fpe.h | 38 ++ .../net/ethernet/stmicro/stmmac/stmmac_main.c | 149 +----- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 4 +- 15 files changed, 549 insertions(+), 405 deletions(-) create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.h