net: enetc: refactor NTMP table handling and add generic helpers
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest14 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | net: enetc: use an ID-indexed array to track NTMP table versionsdrivers/ drivers/ drivers/ +1 more | +43 | 0 replies | |
| 2/14 | net: enetc: decouple MAFT logical config from hardware wire formatdrivers/ drivers/ drivers/ +2 more | +133 | 0 replies | |
| 3/14 | net: enetc: decouple IPFT logical config from hardware wire formatdrivers/ drivers/ drivers/ +2 more | +210 | 0 replies | |
| 4/14 | net: enetc: decouple FDBT logical config from hardware wire formatdrivers/ drivers/ drivers/ +2 more | +167 | 0 replies | |
| 5/14 | net: enetc: decouple VFT logical config from hardware wire formatdrivers/ drivers/ drivers/ +2 more | +161 | 0 replies | |
| 6/14 | net: enetc: decouple ETT logical config from hardware wire formatdrivers/ drivers/ drivers/ +1 more | +92 | 0 replies | |
| 7/14 | net: enetc: decouple BPT logical config from hardware wire formatdrivers/ drivers/ drivers/ +2 more | +106 | 0 replies | |
| 8/14 | net: enetc: add generic ntmp_add_entry_by_id() helperdrivers/ | +96 | 0 replies | |
| 9/14 | net: enetc: simplify callers of ntmp_query_entry_by_id()drivers/ drivers/ | +56 | 0 replies | |
| 10/14 | net: enetc: add kernel-doc for ntmp_delete_entry_by_id()drivers/ | +10 | 0 replies | |
| 11/14 | net: enetc: add a generic helper to update an NTMP entry by entry IDdrivers/ | +63 | 0 replies | |
| 12/14 | net: enetc: convert ntmp_ect_update_entry() to the generic update helperdrivers/ | +29 | 0 replies | |
| 13/14 | net: enetc: add a generic helper to add an NTMP entry by keydrivers/ | +95 | 0 replies | |
| 14/14 | net: enetc: convert the RSST to the generic NTMP entry helpersdrivers/ | +46 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH net-next 00/14] net: enetc: refactor NTMP table handling and add generic helpers
From: Wei Fang <[email protected]>
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(-)
Signature · 1 line
2.34.1