From patchwork Wed Mar 5 13:00:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Faizal Rahim X-Patchwork-Id: 14002633 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 86230C282EC for ; Wed, 5 Mar 2025 13:06:57 +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: Content-Type:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=iUAyRS7wbIuuKwXsIga9RyCeJ0nbtwHctXhnLfZv/dU=; b=MfbFaWwq9MAE4h0nUl6ktVBPDX +ech0Qywc7QOEzuLZUaeFsmJwdig7C4yeXlY7sMN1p5KVAPD3ITLsOQQLidMjxrxXT31ytqf7rVAh tBiMDXtxHNrSHc9rX9jk9/2Y+JU36aaQBTEEBzRYjboi1M2FLfrIEB4Ns8BQShYeYTQjan/Ma8moK 5d20zj6vxHw3k98JuRTZ4b2CEeEm5uS58QOuskkLL4PJRz7xg8kXDTHTH6Vb2Pcl3qVaSn0zY10oO k9yrzIAbcBs8RJ94L5cVLQuvmF27VDh/kKvn/5bhyjbjf5avWcihnBX2X5EIPeJRYJ6Fj/tRfRwC+ 5cEpxFoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tpoST-000000087p7-0t1M; Wed, 05 Mar 2025 13:06:45 +0000 Received: from mgamail.intel.com ([198.175.65.15]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tpoMy-000000086KG-28Q5 for linux-arm-kernel@lists.infradead.org; Wed, 05 Mar 2025 13:01:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1741179665; x=1772715665; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=4k7kwN4AqJlVKmrp2Yod/QkXM7lhVfFtvH+5ef1HGyI=; b=YX7iFu2EJNzXY+JrEF4UY+pbaNJsaF0RtUF9GHXGIwJgtQgYE3ntE66q 5z4H0hhA0JH/0nbclAVQwwKcETrV4S6iH1zJD1wDgEblqyYt4y6M1bQjl +L3iup/Vj4BrrKvDkFJVmoI6lkfVYD7D7Y4sjq8bzxQ6SuVut3C8K0YWL i5oodI73lFiWi+9r2o+04TEO6wd11IDoVZfeT6w3QvEx9nKT8VpfEAKt/ pzbsoULSeTIWvD2UgNoqa8itmfv4dxKeGLESnrKrprFJZCO7w1mpdtaT9 +hPK9sKv501ulcfR9/ZpljBaXhuF8pRlp3nDgGolkhdlPdtIfs6CUaWrX w==; X-CSE-ConnectionGUID: bEh4Y+gbTkCuCxi4RRM2yQ== X-CSE-MsgGUID: SE25uP4USvqftFfFX+ofQA== X-IronPort-AV: E=McAfee;i="6700,10204,11363"; a="45794861" X-IronPort-AV: E=Sophos;i="6.14,223,1736841600"; d="scan'208";a="45794861" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2025 05:01:01 -0800 X-CSE-ConnectionGUID: 9hKDbxC1SKyWsTJ3mEnEyw== X-CSE-MsgGUID: wPxV4mkUSZKtt2DdvlGUhA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,223,1736841600"; d="scan'208";a="123276899" Received: from mohdfai2-ilbpg12-1.png.intel.com ([10.88.227.73]) by fmviesa005.fm.intel.com with ESMTP; 05 Mar 2025 05:00:52 -0800 From: Faizal Rahim To: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Simon Horman , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Furong Xu <0x1207@gmail.com>, Russell King , Vladimir Oltean , Serge Semin , Xiaolei Wang , Suraj Jaiswal , Kory Maincent , Gal Pressman , Jesper Nilsson , Choong Yong Liang , Chwee-Lin Choong , Faizal Rahim , Kunihiko Hayashi , Vinicius Costa Gomes , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org Subject: [PATCH iwl-next v8 00/11] igc: Add support for Frame Preemption feature in IGC Date: Wed, 5 Mar 2025 08:00:15 -0500 Message-Id: <20250305130026.642219-1-faizal.abdul.rahim@linux.intel.com> 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-20250305_050104_591945_D14BD462 X-CRM114-Status: GOOD ( 18.42 ) 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 Introduces support for the FPE feature in the IGC driver. The patches aligns with the upstream FPE API: https://patchwork.kernel.org/project/netdevbpf/cover/20230220122343.1156614-1-vladimir.oltean@nxp.com/ https://patchwork.kernel.org/project/netdevbpf/cover/20230119122705.73054-1-vladimir.oltean@nxp.com/ It builds upon earlier work: https://patchwork.kernel.org/project/netdevbpf/cover/20220520011538.1098888-1-vinicius.gomes@intel.com/ The patch series adds the following functionalities to the IGC driver: a) Configure FPE using `ethtool --set-mm`. b) Display FPE settings via `ethtool --show-mm`. c) View FPE statistics using `ethtool --include-statistics --show-mm'. e) Block setting preemptible tc in taprio since it is not supported yet. Existing code already blocks it in mqprio. Tested: Enabled CONFIG_PROVE_LOCKING, CONFIG_DEBUG_ATOMIC_SLEEP, CONFIG_DMA_API_DEBUG, and CONFIG_KASAN 1) selftests 2) netdev down/up cycles 3) suspend/resume cycles 4) fpe verification No bugs or unusual dmesg logs were observed. Ran 1), 2) and 3) with and without the patch series, compared dmesg and selftest logs — no differences found. Change Log: v7 -> v8: - Reject SMD-V and SMD-R if the payload contains non-zero values (Vladimir, Chwee Lin) - Move resetting verification state when link is down to a new patch 3/11 (Vladimir) - Move frag_size related handling outside of spin_lock_irq_save(), patch 1/11 (Vladimir) - Renamed IGC_PRMEXPRCNT to IGC_PRMEXCPRCNT, to align with i226 SW User Manual, patch 11/11 (Chwee Lin) - Use IGC_PRMEXPRCNT_OOO_SMDC for frame smd errors instead of frame assembly errors, 11/11 (Chwee Lin) v6 -> v7: - Squash the cpu param to the prev line (Przemek Kitszel) - Use igc_ prefix for fpe_t (Przemek Kitszel) - Move new ops to different line in igc_ethtool_ops (Przemek Kitszel) - Documentation for igc_enable_empty_addr_recv (): rx -> Rx (Przemek Kitszel) - Documentation for igc_enable_empty_addr_recv (): s/IGC/the driver/ (Przemek Kitszel) - Change preferred style of init, from { }, to {} (Przemek Kitszel) - Remove inclusion of umbrella header in igc_tsn.c (Przemek Kitszel) - End enum with "," in igc_txd_popts_type (Przemek Kitszel) - Remove unnecessary braces in igc_fpe_is_verify_or_response() (Przemek Kitszel) v5 -> v6: - Added Tested-by: Furong Xu for patch 1/9 (Vladimir, Furong Xu) - Updated logic in ethtool_mmsv_link_state_handle() (Vladimir, Furong Xu) - Swap sequence of function call in stmmac_set_mm() (Furong Xu) - Log an error if igc_enable_empty_addr_recv() fails (Vladimir) - Move the patch ".. Block setting preemptible traffic .." before ".. Add support to get MAC Merge data .." (Vladimir) - Move mmsv function kernel-doc from .h to .c file (Vladimir) v4 -> v5: - Remove "igc: Add support for preemptible traffic class in taprio" patch (Vladimir) - Add a new patch "igc: Block setting preemptible traffic classes in taprio" (Vladimir) - Add kernel-doc for mmsv api (Vladimir) - olininfo_status to use host byte order (Simon) - status_error should host byte type (Simon) - Some code was misplaced in the wrong patch (Vladimir) - Mix of tabs and spaces in patch description (Vladimir) - Created igc_is_pmac_enabled() to reduce code repetition (Vladimir) v3 -> v4: - Fix compilation warnings introduced by this patch series v2 -> v3: - Implement configure_tx() mmsv callback (Vladimir) - Use static_branch_inc() and static_branch_dec() (Vladimir) - Add adapter->fpe.mmsv.pmac_enabled as extra check (Vladimir) - Remove unnecessary error check in igc_fpe_init_tx_descriptor() (Vladimir) - Additional places to use FIELD_PREP() instead of manual bit manipulation (Vladimir) - IGC_TXD_POPTS_SMD_V and IGC_TXD_POPTS_SMD_R type change to enum (Vladimir) - Remove unnecessary netif_running() check in igc_fpe_xmit_frame (Vladimir) - Rate limit print in igc_fpe_send_mpacket (Vladimir) v1 -> v2: - Extract the stmmac verification logic into a common library (Vladimir) - igc to use common library for verification (Vladimir) - Fix syntax for kernel-doc to use "Return:" (Vladimir) - Use FIELD_GET instead of manual bit masking (Vladimir) - Don't assign 0 to statistics counter in igc_ethtool_get_mm_stats() (Vladimir) - Use pmac-enabled as a condition to allow MAC address value 0 (Vladimir) - Define macro register value in increasing value order (Vladimir) - Fix tx-min-frag-size handling for igc (Vladimir) - Handle link state changes with verification in igc (Vladimir) - Add static key for fast path code (Vladimir) - rx_min_frag_size get from constant (Vladimir) v1: https://patchwork.kernel.org/project/netdevbpf/cover/20241216064720.931522-1-faizal.abdul.rahim@linux.intel.com/ v2: https://patchwork.kernel.org/project/netdevbpf/cover/20250205100524.1138523-1-faizal.abdul.rahim@linux.intel.com/ v3: https://patchwork.kernel.org/project/netdevbpf/cover/20250207165649.2245320-1-faizal.abdul.rahim@linux.intel.com/ v4: https://patchwork.kernel.org/project/netdevbpf/cover/20250210070207.2615418-1-faizal.abdul.rahim@linux.intel.com/ v5: https://patchwork.kernel.org/project/netdevbpf/cover/20250220025349.3007793-1-faizal.abdul.rahim@linux.intel.com/ v6: https://patchwork.kernel.org/project/netdevbpf/cover/20250227140158.2129988-1-faizal.abdul.rahim@linux.intel.com/ v7: https://patchwork.kernel.org/project/netdevbpf/cover/20250303102658.3580232-1-faizal.abdul.rahim@linux.intel.com/ Faizal Rahim (10): net: stmmac: move frag_size handling out of spin_lock net: ethtool: mm: reset verification status when link is down igc: rename xdp_get_tx_ring() for non-xdp usage igc: optimize the TX packet buffer utilization igc: set the RX packet buffer size for TSN mode igc: add support for frame preemption verification igc: add support to set tx-min-frag-size igc: block setting preemptible traffic class in taprio igc: add support to get MAC Merge data via ethtool igc: add support to get frame preemption statistics via ethtool Vladimir Oltean (1): net: ethtool: mm: extract stmmac verification logic into common library drivers/net/ethernet/intel/igc/igc.h | 15 +- drivers/net/ethernet/intel/igc/igc_base.h | 1 + drivers/net/ethernet/intel/igc/igc_defines.h | 15 +- drivers/net/ethernet/intel/igc/igc_ethtool.c | 79 +++++ drivers/net/ethernet/intel/igc/igc_main.c | 66 +++- drivers/net/ethernet/intel/igc/igc_regs.h | 16 + drivers/net/ethernet/intel/igc/igc_tsn.c | 192 +++++++++++- drivers/net/ethernet/intel/igc/igc_tsn.h | 54 ++++ drivers/net/ethernet/stmicro/stmmac/stmmac.h | 16 +- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 41 +-- .../net/ethernet/stmicro/stmmac/stmmac_fpe.c | 174 +++-------- .../net/ethernet/stmicro/stmmac/stmmac_fpe.h | 5 - .../net/ethernet/stmicro/stmmac/stmmac_main.c | 8 +- include/linux/ethtool.h | 73 +++++ net/ethtool/mm.c | 281 +++++++++++++++++- 15 files changed, 819 insertions(+), 217 deletions(-) --- 2.34.1