Skip to content

igc: Add support for Frame Preemption feature in IGC

Faizal Rahim bpf intel-wired-lan linux-arm-kernel lkml netdev 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest14 patches 11 repliesIn review
  2. v914 patches 11 repliesSuperseded
  3. v811 patches 11 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v79 patches3 repliesSuperseded
v69 patches2 repliesSuperseded
v59 patches12 repliesSuperseded
v49 patches25 repliesSuperseded
v39 patches0 repliesSuperseded
v29 patches4 repliesSuperseded
v19 patches15 repliesSuperseded

Changes in v10 from the cover letter

- Add Vladimir Reviewed-by for patch 2, 3, 6, 8, 10-14
- Add Fu Rong Reviewed-by for patch 3
- Fix compilation error in intel lkp-test, snippet of error:
"aarch64-linux-ld: drivers/net/ethernet/intel/igc/igc_main.o: in function `igc_clean_tx_irq':
drivers/net/ethernet/intel/igc/igc_main.c:3157:(.text+0xec44): undefined reference to `ethtool_mmsv_event_handle" which randomize .config options (CONFIG_IGC=y, disable CONFIG_ETHTOOL_NETLINK).
config -> https://download.01.org/0day-ci/archive/20250314/[email protected]/config
Fix at patch 2 and 10 by adding "depends on ETHTOOL_NETLINK" in stmmac and igc Kconfig.

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14net: stmmac: move frag_size handling out of spin_lockdrivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c+6 -50 replies
2/14net: ethtool: mm: extract stmmac verification logic into common librarydrivers/net/ethernet/stmicro/stmmac/Kconfig drivers/net/ethernet/stmicro/stmmac/stmmac.h drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +5 more+392 -2020 replies
3/14net: ethtool: mm: reset verification status when link is downnet/ethtool/mm.c+4 -00 replies
4/14igc: rename xdp_get_tx_ring() for non-xdp usagedrivers/net/ethernet/intel/igc/igc.h drivers/net/ethernet/intel/igc/igc_main.c+5 -61 reply
5/14igc: rename I225_RXPBSIZE_DEFAULT and I225_TXPBSIZE_DEFAULTdrivers/net/ethernet/intel/igc/igc_defines.h drivers/net/ethernet/intel/igc/igc_main.c drivers/net/ethernet/intel/igc/igc_tsn.c+7 -61 reply
6/14igc: use FIELD_PREP and GENMASK for existing TX packet buffer sizedrivers/net/ethernet/intel/igc/igc_defines.h+21 -21 reply
7/14igc: optimize TX packet buffer utilization for TSN modedrivers/net/ethernet/intel/igc/igc_defines.h+2 -21 reply
8/14igc: use FIELD_PREP and GENMASK for existing RX packet buffer sizedrivers/net/ethernet/intel/igc/igc_defines.h+14 -31 reply
9/14igc: set the RX packet buffer size for TSN modedrivers/net/ethernet/intel/igc/igc_defines.h drivers/net/ethernet/intel/igc/igc_tsn.c+30 -01 reply
10/14igc: add support for frame preemption verificationdrivers/net/ethernet/intel/Kconfig drivers/net/ethernet/intel/igc/igc.h drivers/net/ethernet/intel/igc/igc_base.h +5 more+286 -51 reply
11/14igc: add support to set tx-min-frag-sizedrivers/net/ethernet/intel/igc/igc.h drivers/net/ethernet/intel/igc/igc_defines.h drivers/net/ethernet/intel/igc/igc_ethtool.c +2 more+43 -31 reply
12/14igc: block setting preemptible traffic class in tapriodrivers/net/ethernet/intel/igc/igc_main.c+4 -01 reply
13/14igc: add support to get MAC Merge data via ethtooldrivers/net/ethernet/intel/igc/igc_ethtool.c drivers/net/ethernet/intel/igc/igc_tsn.h+15 -01 reply
14/14igc: add support to get frame preemption statistics via ethtooldrivers/net/ethernet/intel/igc/igc_ethtool.c drivers/net/ethernet/intel/igc/igc_regs.h+56 -01 reply

Reviews trailers per patch

10 of 14 patches have a Reviewed-by or Acked-by.

PatchVladimir OlteanFurong XuChoong Yong LiangMor Bar-Gabay
1/14R-b R-b
2/14R-b T-b T-b
3/14R-b R-b
4/14T-b
5/14T-b
6/14R-b T-b
7/14T-b
8/14R-b T-b
9/14T-b
10/14R-b T-b
11/14R-b T-b
12/14R-b T-b
13/14R-b T-b
14/14R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v10 thread

Cover letter [PATCH iwl-next v10 00/14] igc: Add support for Frame Preemption feature in IGC

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/[email protected]/
https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/

It builds upon earlier work:
https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/

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:
v10:
- Add Vladimir Reviewed-by for patch 2, 3, 6, 8, 10-14
- Add Fu Rong Reviewed-by for patch 3
- Fix compilation error in intel lkp-test, snippet of error:
"aarch64-linux-ld: drivers/net/ethernet/intel/igc/igc_main.o: in function `igc_clean_tx_irq':
drivers/net/ethernet/intel/igc/igc_main.c:3157:(.text+0xec44): undefined reference to `ethtool_mmsv_event_handle" which randomize .config options (CONFIG_IGC=y, disable CONFIG_ETHTOOL_NETLINK).
config -> https://download.01.org/0day-ci/archive/20250314/[email protected]/config
Fix at patch 2 and 10 by adding "depends on ETHTOOL_NETLINK" in stmmac and igc Kconfig.

v8 -> v9:
- Add Vladimir and Fu Rong Reviewed-by, patch 1
- Remove Faizal Co-developed-by for patch 2
- Remove code that reset verification state when link is down, patch 2 (Vladimir)
- Refactor TX buffer and RX buffer magic constants with macro for each field. patch 5-9 (Vladimir)
- s/Rest adapter/Adapter reset/ in commit description, patch 10 (Vladimir)
- Replace igc_fpe_is_verify_or_response() and igc_fpe_lp_event_status() with igc_fpe_handle_mpacket(), patch 10 (Vladimir)
- Comments on separate lines from code in igc_fpe_get_supported_frag_size(), patch 11 (Vladimir)
- Remove mistakenly added igc_fpe_get_supported_frag_size(), patch 10 (Vladimir)
- Remove max limit 256 of tx-min-size changes, patch 11 (Vladimir)

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 <linux/kernel.h> 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/[email protected]/
v2: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
v3: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
v4: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
v5: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
v6: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
v7: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
v8: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
v9: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/

Faizal Rahim (13):
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: rename I225_RXPBSIZE_DEFAULT and I225_TXPBSIZE_DEFAULT
igc: use FIELD_PREP and GENMASK for existing TX packet buffer size
igc: optimize TX packet buffer utilization for TSN mode
igc: use FIELD_PREP and GENMASK for existing RX packet buffer size
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/Kconfig            |   1 +
 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  |  55 +++-
 drivers/net/ethernet/intel/igc/igc_ethtool.c  |  80 +++++
 drivers/net/ethernet/intel/igc/igc_main.c     |  69 ++++-
 drivers/net/ethernet/intel/igc/igc_regs.h     |  16 +
 drivers/net/ethernet/intel/igc/igc_tsn.c      | 207 ++++++++++++-
 drivers/net/ethernet/intel/igc/igc_tsn.h      |  52 ++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |   1 +
 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                              | 279 +++++++++++++++++-
 17 files changed, 872 insertions(+), 221 deletions(-)

--
2.34.1