Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/14] net: enetc: refactor NTMP table handling and add generic helpers
@ 2026-12-04  7:13 wei.fang
  2026-12-04  7:13 ` [PATCH net-next 01/14] net: enetc: use an ID-indexed array to track NTMP table versions wei.fang
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: wei.fang @ 2026-12-04  7:13 UTC (permalink / raw)
  To: xiaoning.wang, claudiu.manoil, vladimir.oltean, andrew, olteanv,
	davem, edumazet, kuba, pabeni, chleroy, richardcochran
  Cc: wei.fang, imx, netdev, linuxppc-dev, linux-arm-kernel

From: Wei Fang <wei.fang@nxp.com>

This series refactors the NTMP infrastructure to improve maintainability
and future-proof the driver.

1. Introduce a public enum ntmp_tbl_id and an indexed tbl_ver array,
   removing per-table version fields and redundant arguments.
2. Add generic ntmp_add_entry_by_id() and ntmp_update_entry_by_id()
   helpers that encapsulate common add/update boilerplate.
3. Provide ntmp_add_entry_by_key() for tables that allocate IDs in
   hardware, reducing duplicated logic across IPFT, FDBT and VFT.
4. Implement ntmp_query_entry_by_id() as a unified query path,
   eliminating per-table query duplication.
5. Convert specific table update functions (ECT, FDBT, ETT, BPT) to use
   the generic update helper.
6. Decouple logical configuration structs from hardware wire format for
   MAFT, IPFT, FDBT, VFT, ETT and BPT tables. New version-agnostic
   *_entry_data structs use native CPU types; wire structures are moved
   to ntmp_private.h and accessed via ntmp_tbl_ops callbacks.
7. Add kernel-doc for ntmp_delete_entry_by_id() to keep documentation
   consistent.
8. Register table specific ops in ntmp_table_ops() and expose helper
   getters (ntmp_get_*_ops()).
9. Update callers throughout the driver to work with the logical config
   structs and generic helpers, simplifying code paths and reducing
   boilerplate.

These changes make NTMP table code easier to extend for future hardware
revisions, improve code reuse, and provide clearer documentation.

Wei Fang (14):
  net: enetc: use an ID-indexed array to track NTMP table versions
  net: enetc: decouple MAFT logical config from hardware wire format
  net: enetc: decouple IPFT logical config from hardware wire format
  net: enetc: decouple FDBT logical config from hardware wire format
  net: enetc: decouple VFT logical config from hardware wire format
  net: enetc: decouple ETT logical config from hardware wire format
  net: enetc: decouple BPT logical config from hardware wire format
  net: enetc: add generic ntmp_add_entry_by_id() helper
  net: enetc: simplify callers of ntmp_query_entry_by_id()
  net: enetc: add kernel-doc for ntmp_delete_entry_by_id()
  net: enetc: add a generic helper to update an NTMP entry by entry ID
  net: enetc: convert ntmp_ect_update_entry() to the generic update
    helper
  net: enetc: add a generic helper to add an NTMP entry by key
  net: enetc: convert the RSST to the generic NTMP entry helpers

 drivers/net/dsa/netc/netc_main.c              |  231 ++-
 drivers/net/dsa/netc/netc_ptp.c               |   28 +-
 drivers/net/dsa/netc/netc_switch.h            |    9 +-
 .../ethernet/freescale/enetc/enetc4_debugfs.c |   10 +-
 .../net/ethernet/freescale/enetc/enetc4_pf.c  |   19 +-
 drivers/net/ethernet/freescale/enetc/ntmp.c   | 1247 ++++++++++-------
 .../ethernet/freescale/enetc/ntmp_private.h   |  149 +-
 include/linux/fsl/ntmp.h                      |  219 ++-
 8 files changed, 1129 insertions(+), 783 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-12-04  7:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  7:13 [PATCH net-next 00/14] net: enetc: refactor NTMP table handling and add generic helpers wei.fang
2026-12-04  7:13 ` [PATCH net-next 01/14] net: enetc: use an ID-indexed array to track NTMP table versions wei.fang
2026-12-04  7:13 ` [PATCH net-next 02/14] net: enetc: decouple MAFT logical config from hardware wire format wei.fang
2026-12-04  7:13 ` [PATCH net-next 03/14] net: enetc: decouple IPFT " wei.fang
2026-12-04  7:14 ` [PATCH net-next 04/14] net: enetc: decouple FDBT " wei.fang
2026-12-04  7:14 ` [PATCH net-next 05/14] net: enetc: decouple VFT " wei.fang
2026-12-04  7:14 ` [PATCH net-next 06/14] net: enetc: decouple ETT " wei.fang
2026-12-04  7:14 ` [PATCH net-next 07/14] net: enetc: decouple BPT " wei.fang
2026-12-04  7:14 ` [PATCH net-next 08/14] net: enetc: add generic ntmp_add_entry_by_id() helper wei.fang
2026-12-04  7:14 ` [PATCH net-next 09/14] net: enetc: simplify callers of ntmp_query_entry_by_id() wei.fang
2026-12-04  7:14 ` [PATCH net-next 10/14] net: enetc: add kernel-doc for ntmp_delete_entry_by_id() wei.fang
2026-12-04  7:14 ` [PATCH net-next 11/14] net: enetc: add a generic helper to update an NTMP entry by entry ID wei.fang
2026-12-04  7:14 ` [PATCH net-next 12/14] net: enetc: convert ntmp_ect_update_entry() to the generic update helper wei.fang
2026-12-04  7:14 ` [PATCH net-next 13/14] net: enetc: add a generic helper to add an NTMP entry by key wei.fang
2026-12-04  7:14 ` [PATCH net-next 14/14] net: enetc: convert the RSST to the generic NTMP entry helpers wei.fang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox