igc: Add support for Frame Preemption feature in IGC
| From: | Faizal Rahim <faizal.abdul.rahim-AT-linux.intel.com> | |
| To: | Tony Nguyen <anthony.l.nguyen-AT-intel.com>, Przemek Kitszel <przemyslaw.kitszel-AT-intel.com>, Andrew Lunn <andrew+netdev-AT-lunn.ch>, "David S . Miller" <davem-AT-davemloft.net>, Eric Dumazet <edumazet-AT-google.com>, Jakub Kicinski <kuba-AT-kernel.org>, Paolo Abeni <pabeni-AT-redhat.com>, Maxime Coquelin <mcoquelin.stm32-AT-gmail.com>, Alexandre Torgue <alexandre.torgue-AT-foss.st.com>, Simon Horman <horms-AT-kernel.org>, Russell King <linux-AT-armlinux.org.uk>, Alexei Starovoitov <ast-AT-kernel.org>, Daniel Borkmann <daniel-AT-iogearbox.net>, Jesper Dangaard Brouer <hawk-AT-kernel.org>, John Fastabend <john.fastabend-AT-gmail.com>, Furong Xu <0x1207-AT-gmail.com>, Russell King <rmk+kernel-AT-armlinux.org.uk>, Vladimir Oltean <vladimir.oltean-AT-nxp.com>, Serge Semin <fancer.lancer-AT-gmail.com>, Xiaolei Wang <xiaolei.wang-AT-windriver.com>, Suraj Jaiswal <quic_jsuraj-AT-quicinc.com>, Kory Maincent <kory.maincent-AT-bootlin.com>, Gal Pressman <gal-AT-nvidia.com>, Jesper Nilsson <jesper.nilsson-AT-axis.com>, Andrew Halaney <ahalaney-AT-redhat.com>, Choong Yong Liang <yong.liang.choong-AT-linux.intel.com>, Faizal Rahim <faizal.abdul.rahim-AT-linux.intel.com>, Kunihiko Hayashi <hayashi.kunihiko-AT-socionext.com>, Vinicius Costa Gomes <vinicius.gomes-AT-intel.com>, intel-wired-lan-AT-lists.osuosl.org, netdev-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-stm32-AT-st-md-mailman.stormreply.com, linux-arm-kernel-AT-lists.infradead.org, bpf-AT-vger.kernel.org | |
| Subject: | [PATCH iwl-next v6 0/9] igc: Add support for Frame Preemption feature in IGC | |
| Date: | Thu, 27 Feb 2025 09:01:48 -0500 | |
| Message-ID: | <20250227140158.2129988-1-faizal.abdul.rahim@linux.intel.com> | |
| Archive-link: | Article |
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/2023... https://patchwork.kernel.org/project/netdevbpf/cover/2023... It builds upon earlier work: https://patchwork.kernel.org/project/netdevbpf/cover/2022... 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: 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/2024... v2: https://patchwork.kernel.org/project/netdevbpf/cover/2025... v3: https://patchwork.kernel.org/project/netdevbpf/cover/2025... v4: https://patchwork.kernel.org/project/netdevbpf/cover/2025... v5: https://patchwork.kernel.org/project/netdevbpf/cover/2025... Faizal Rahim (8): 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 | 76 +++++ drivers/net/ethernet/intel/igc/igc_main.c | 67 ++++- drivers/net/ethernet/intel/igc/igc_regs.h | 16 + drivers/net/ethernet/intel/igc/igc_tsn.c | 193 +++++++++++- drivers/net/ethernet/intel/igc/igc_tsn.h | 52 ++++ 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, 816 insertions(+), 217 deletions(-) -- 2.34.1
