Skip to content

net: enetc: SR-IOV improvements and ENETC v4 VF support

[email protected] imx lkml netdev sashiko-reviews 4 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest15 patches 13 repliesApplied 15/15
  2. v315 patches 18 repliesSuperseded
  3. v215 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v115 patches5 repliesSuperseded

Changes in v4 from the cover letter · 20 lines

1. Use the existing si->gen_lock instead of pf->msg_lock
2. Link status notification sending is now deferred to an ordered workqueue, instead of sending inline under a mutex
3. enetc_pf_send_link_status_msg() with a retry loop (up to 200ms) polling the MS bits, and a per-VF msg_fail_cnt that clears a VF's link_status_ms_mask bit after 10 consecutive failures
4. Remove a stray blank line in enetc_sriov_configure
5. enetc_vf_set_mac_promisc() now takes separate promisc and flush_macs booleans
6. Refactor enetc_vf_set_mac_hash_filter(), now it takes explicit uc/mc presence, builds mac_filter_type/tbl_cnt incrementally, and no longer reads ndev->flags directly
7. Restructure rx_mode logic into three helpers:
enetc_vf_enable_iff_promisc(), enetc_vf_disable_iff_promisc(), enetc_vf_enable_iff_allmulti(), with detailed per-step error logging
8. Add a separate enetc4_ndev_ops for ENETC v4 VFs
9. Disable promisc and clears MAC filters on VF removal
10. enetc_phylink_connect() moved to after Tx/Rx resource allocation
11. Remove the ENETC_LINK_STATUS_NOTIFIER_REGISTERED flag
12. MR interrupt handler now explicitly writes VSIIDR_MR and reads VSIMSGRR to ACK the PF
13. netif_carrier_off() and enetc_vf_enable_mr_int() are moved before register_netdev()
14. Guard spoofchk reporting with is_enetc_rev1()
15. Refine commit messages
v3 link: https://lore.kernel.org/imx/[email protected]/
v2 link: https://lore.kernel.org/imx/[email protected]/
v1 link: https://lore.kernel.org/imx/[email protected]/
---

Patches in v4 All 15 applied

#Subject and filesSizeRepliesApplied
1/15net: enetc: add trusted VF supportdrivers/net/ethernet/freescale/enetc/enetc4_pf.c drivers/net/ethernet/freescale/enetc/enetc_msg.c drivers/net/ethernet/freescale/enetc/enetc_pf.c +3 more+61 -101 replyApplied
2/15net: enetc: move msg_task and msg_int_name to struct enetc_sidrivers/net/ethernet/freescale/enetc/enetc.h drivers/net/ethernet/freescale/enetc/enetc_msg.c drivers/net/ethernet/freescale/enetc/enetc_pf.h+13 -131 replyApplied
3/15net: enetc: add link status message support to PF driverdrivers/net/ethernet/freescale/enetc/enetc.h drivers/net/ethernet/freescale/enetc/enetc4_pf.c drivers/net/ethernet/freescale/enetc/enetc_hw.h +4 more+347 -102 repliesApplied
4/15net: enetc: add link speed message support to PF driverdrivers/net/ethernet/freescale/enetc/enetc_mailbox.h drivers/net/ethernet/freescale/enetc/enetc_msg.c+131 -02 repliesApplied
5/15net: enetc: use enetc_set_si_hw_addr() to set VF MAC addressdrivers/net/ethernet/freescale/enetc/enetc_pf.c+1 -10 repliesApplied
6/15net: enetc: relocate enetc_pf_set_vf_mac() for common PF supportdrivers/net/ethernet/freescale/enetc/enetc_pf.c drivers/net/ethernet/freescale/enetc/enetc_pf_common.c drivers/net/ethernet/freescale/enetc/enetc_pf_common.h+24 -220 repliesApplied
7/15net: enetc: add .ndo_set_vf_mac() to the enetc v4 driverdrivers/net/ethernet/freescale/enetc/enetc4_pf.c+1 -00 repliesApplied
8/15net: enetc: move mac_filter from struct enetc_pf to struct enetc_sidrivers/net/ethernet/freescale/enetc/enetc.h drivers/net/ethernet/freescale/enetc/enetc4_pf.c drivers/net/ethernet/freescale/enetc/enetc_pf.c +1 more+13 -140 repliesApplied
9/15net: enetc: add MAC address filtering support for VFs of ENETC v4drivers/net/ethernet/freescale/enetc/enetc4_debugfs.c drivers/net/ethernet/freescale/enetc/enetc4_pf.c drivers/net/ethernet/freescale/enetc/enetc_mailbox.h +4 more+300 -351 replyApplied
10/15net: enetc: simplify and rename PSIIER enable/disable helpersdrivers/net/ethernet/freescale/enetc/enetc_msg.c+12 -180 repliesApplied
11/15net: enetc: restore VF MAC promiscuous mode after FLR for ENETC v4drivers/net/ethernet/freescale/enetc/enetc4_pf.c drivers/net/ethernet/freescale/enetc/enetc_hw.h drivers/net/ethernet/freescale/enetc/enetc_msg.c +2 more+88 -12 repliesApplied
12/15net: enetc: add VF support for i.MX94 and i.MX95drivers/net/ethernet/freescale/enetc/Kconfig drivers/net/ethernet/freescale/enetc/enetc.c drivers/net/ethernet/freescale/enetc/enetc4_hw.h +3 more+46 -11 replyApplied
13/15net: enetc: implement ndo_set_rx_mode_async for ENETC v4 VFdrivers/net/ethernet/freescale/enetc/enetc_vf.c+213 -12 repliesApplied
14/15net: enetc: add PSI-to-VSI link status notification support for VFdrivers/net/ethernet/freescale/enetc/enetc.c drivers/net/ethernet/freescale/enetc/enetc.h drivers/net/ethernet/freescale/enetc/enetc_hw.h +1 more+261 -90 repliesApplied
15/15net: enetc: add ndo_get_vf_config() supportdrivers/net/ethernet/freescale/enetc/enetc4_pf.c drivers/net/ethernet/freescale/enetc/enetc_pf.c drivers/net/ethernet/freescale/enetc/enetc_pf.h +2 more+65 -00 repliesApplied

Reviews trailers per patch

4 of 15 patches have a Reviewed-by or Acked-by.

PatchClaudiu Manoil
1/15
2/15R-b
3/15R-b
4/15R-b
5/15
6/15
7/15
8/15
9/15
10/15
11/15R-b
12/15
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 net-next 00/15] net: enetc: SR-IOV improvements and ENETC v4 VF support

From: Wei Fang <[email protected]>

This series enhances SR-IOV support for ENETC v1 and adds VF support for ENETC v4. For ENETC v1, the trusted VF management and per-VF configuration query via ndo_get_vf_config() are added. For ENETC v4, preliminary VF support is introduced for i.MX94 and i.MX95 platforms.

On the PF side, the series introduces trust level management and MAC address assignment for VFs, and implements ndo_get_vf_config() so that userspace tools such as 'ip link show' can query the current per-VF configuration. The PSI-to-VSI messaging infrastructure is extended to handle link status and link speed queries from VFs, enabling DPDK-owned VFs to obtain accurate link information from the PF.

On the VF side, MAC address filtering is implemented via the VSI-to-PSI mailbox, supporting both unicast/multicast hash filters and promiscuous mode control. Since the ndo_set_rx_mode callback is invoked with BH disabled and is incompatible with the mailbox polling path, ndo_set_rx_mode_async is used instead. Link status notifications are also
supported: the VF registers with the PF and receives PSI-to-VSI messages on every PF link transition, keeping the VF carrier state in sync without polling.

VF Function Level Reset is handled explicitly to restore the PF-managed MAC promiscuous policy after each reset, since the hardware default after FLR enables promiscuous mode regardless of the policy set by the PF driver.

Several preparatory refactors are included to share infrastructure between the PF and VF drivers, such as moving msg_task and mac_filter from struct enetc_pf into the common struct enetc_si.

---
v4:
1. Use the existing si->gen_lock instead of pf->msg_lock
2. Link status notification sending is now deferred to an ordered workqueue, instead of sending inline under a mutex
3. enetc_pf_send_link_status_msg() with a retry loop (up to 200ms) polling the MS bits, and a per-VF msg_fail_cnt that clears a VF's link_status_ms_mask bit after 10 consecutive failures
4. Remove a stray blank line in enetc_sriov_configure
5. enetc_vf_set_mac_promisc() now takes separate promisc and flush_macs booleans
6. Refactor enetc_vf_set_mac_hash_filter(), now it takes explicit uc/mc presence, builds mac_filter_type/tbl_cnt incrementally, and no longer reads ndev->flags directly
7. Restructure rx_mode logic into three helpers:
enetc_vf_enable_iff_promisc(), enetc_vf_disable_iff_promisc(), enetc_vf_enable_iff_allmulti(), with detailed per-step error logging
8. Add a separate enetc4_ndev_ops for ENETC v4 VFs
9. Disable promisc and clears MAC filters on VF removal
10. enetc_phylink_connect() moved to after Tx/Rx resource allocation
11. Remove the ENETC_LINK_STATUS_NOTIFIER_REGISTERED flag
12. MR interrupt handler now explicitly writes VSIIDR_MR and reads VSIMSGRR to ACK the PF
13. netif_carrier_off() and enetc_vf_enable_mr_int() are moved before register_netdev()
14. Guard spoofchk reporting with is_enetc_rev1()
15. Refine commit messages
v3 link: https://lore.kernel.org/imx/[email protected]/
v2 link: https://lore.kernel.org/imx/[email protected]/
v1 link: https://lore.kernel.org/imx/[email protected]/
---

Claudiu Manoil (1):
net: enetc: add trusted VF support

Wei Fang (14):
net: enetc: move msg_task and msg_int_name to struct enetc_si
net: enetc: add link status message support to PF driver
net: enetc: add link speed message support to PF driver
net: enetc: use enetc_set_si_hw_addr() to set VF MAC address
net: enetc: relocate enetc_pf_set_vf_mac() for common PF support
net: enetc: add .ndo_set_vf_mac() to the enetc v4 driver
net: enetc: move mac_filter from struct enetc_pf to struct enetc_si
net: enetc: add MAC address filtering support for VFs of ENETC v4
net: enetc: simplify and rename PSIIER enable/disable helpers
net: enetc: restore VF MAC promiscuous mode after FLR for ENETC v4
net: enetc: add VF support for i.MX94 and i.MX95
net: enetc: implement ndo_set_rx_mode_async for ENETC v4 VF
net: enetc: add PSI-to-VSI link status notification support for VF
net: enetc: add ndo_get_vf_config() support

 drivers/net/ethernet/freescale/enetc/Kconfig  |   1 +
 drivers/net/ethernet/freescale/enetc/enetc.c  |  63 +-
 drivers/net/ethernet/freescale/enetc/enetc.h  |  11 +-
 .../ethernet/freescale/enetc/enetc4_debugfs.c |  51 +-
 .../net/ethernet/freescale/enetc/enetc4_hw.h  |   1 +
 .../net/ethernet/freescale/enetc/enetc4_pf.c  |  85 ++-
 .../ethernet/freescale/enetc/enetc_ethtool.c  |   6 +
 .../net/ethernet/freescale/enetc/enetc_hw.h   |  26 +
 .../ethernet/freescale/enetc/enetc_mailbox.h  | 109 ++-
 .../net/ethernet/freescale/enetc/enetc_msg.c  | 643 ++++++++++++++++--
 .../net/ethernet/freescale/enetc/enetc_pf.c   |  64 +-
 .../net/ethernet/freescale/enetc/enetc_pf.h   |  21 +-
 .../freescale/enetc/enetc_pf_common.c         | 146 +++-
 .../freescale/enetc/enetc_pf_common.h         |  19 +
 .../net/ethernet/freescale/enetc/enetc_vf.c   | 449 +++++++++++-
 15 files changed, 1568 insertions(+), 127 deletions(-)
Signature · 1 line
2.34.1