From: Jakub Kicinski Date: Sat, 13 Jun 2026 23:17:01 +0000 (-0700) Subject: Merge branch 'octeontx2-af-npc-enhancements' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a446c6bce946a17cf45c033500efa29915fd2f4;p=thirdparty%2Flinux.git Merge branch 'octeontx2-af-npc-enhancements' Ratheesh Kannoth says: ==================== octeontx2-af: npc: Enhancements. This series extends Marvell octeontx2-af support for CN20K NPC (MCAM debuggability, allocation policy, default-rule lifetime, optional KPU profiles from firmware files, X2/X4 MCAM keyword handling in flows and defaults, and dynamic CN20K NPC private state), adds a devlink mechanism for multi-value parameters, and moves devlink_nl_param_fill() temporaries to the heap so stack usage stays reasonable once union devlink_param_value grows (patch 3). Patch 1 enforces a single RVU admin-function PCI device in the kernel. On Octeon series SoCs, hardware resources such as NPC, NIX and related blocks are global and coordinated by the AF driver; PFs and VFs request them through AF mailbox messages. Firmware exposes only one AF PCI function at boot, so two AF driver instances cannot both own that state. rvu_probe() rejects a second bind with -EBUSY, logs a warning, clears the probe gate on early allocation failures, and aligns the driver model with hardware so reviewers and automation can rely on exactly one bound AF. Patch 2 improves CN20K MCAM visibility in debugfs: mcam_layout marks enabled entries, dstats reports per-entry hit deltas (baseline updated in software after each read; hardware counters are not cleared), and mismatch lists enabled entries without a PF mapping. Patch 3 allocates the per-configuration-mode union devlink_param_value buffers and struct devlink_param_gset_ctx used by devlink_nl_param_fill() with kcalloc()/kzalloc_obj() and funnels failures through a single cleanup path so the netlink reply path stays safe as the union grows. Patch 4 (Saeed) introduces DEVLINK_PARAM_TYPE_U64_ARRAY and nested DEVLINK_ATTR_PARAM_VALUE_DATA attributes so drivers and user space can exchange bounded u64 arrays; YAML, uapi, and netlink validation are updated. Patch 5 adds a runtime devlink parameter srch_order to reorder CN20K subbank search during MCAM allocation (the param uses the u64 array type from patch 4). Patch 6 ties default MCAM entries to NIX LF alloc/free on CN20K, adds NIX_LF_DONT_FREE_DFT_IDXS for PF teardown paths that must not drop default NPC indexes while the driver still owns state, and tightens nix_lf_alloc error propagation. Patch 7 allows loading a custom KPU profile from /lib/firmware/kpu via module parameter kpu_profile, with cam2 / ptype_mask wiring and helpers that share firmware-sourced vs filesystem-sourced profile layouts. Patch 8 makes default-rule allocation, AF flow install, and PF-side RSS, defaults, and ethtool flows respect the active CN20K MCAM keyword width (X2 vs X4), including X4 reference-index masking and -EOPNOTSUPP when a flow needs X4 keys on an X2-only profile. Patch 9 replaces file-scope npc_priv and static dstats with allocation sized from discovered bank/subbank geometry, threads npc_priv_get() through CN20K NPC paths, and allocates dstats via devm_kzalloc for the debugfs helper. Patch 1 is ordered first so later patches assume a single bound AF. Heap-backed devlink_nl_param_fill() sits immediately before the U64 array param work so incremental builds stay stack-safe as the union grows; the CN20K patches keep srch_order ahead of NIX LF coordination, optional KPU profile load from firmware files, X2/X4 handling, and the npc_priv refactor that touches the same files heavily. ==================== Link: https://patch.msgid.link/20260609040453.711932-1-rkannoth@marvell.com Signed-off-by: Jakub Kicinski --- 7a446c6bce946a17cf45c033500efa29915fd2f4