Skip to content

octeontx2-af: npc: cn20k: MCAM fixes

Ratheesh Kannoth lkml netdev 4 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest10 patches 5 repliesApplied 10/10
  2. v410 patches 5 repliesSuperseded
  3. v311 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v211 patches7 repliesSuperseded

Changes in v5 from the cover letter

Patches in v5 All 10 applied

#Subject and filesSizeRepliesApplied
1/10octeontx2-af: npc: cn20k: Propagate MCAM key-type errors on cn20kdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +1 more+124 -561 replyApplied
2/10octeontx2-af: npc: cn20k: Drop debugfs_create_file() error checks in initdrivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c+10 -230 repliesApplied
3/10octeontx2-af: npc: cn20k: Propagate errors in defrag MCAM alloc rollbackdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+8 -41 replyApplied
4/10octeontx2-af: npc: cn20k: Fix target map and ruledrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+15 -11 replyApplied
5/10octeontx2-af: npc: cn20k: Clear MCAM entries by index and key widthdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c+48 -90 repliesApplied
6/10octeontx2-af: npc: cn20k: Fix bank valuedrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+37 -550 repliesApplied
7/10octeontx2-af: npc: cn20k: Fix MCAM actions readdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+13 -130 repliesApplied
8/10octeontx2-af: npc: cn20k: Initialize default-rule index outputs up frontdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+7 -30 repliesApplied
9/10octeontx2-af: npc: cn20k: Tear down default MCAM rules explicitly on freedrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c+82 -281 replyApplied
10/10octeontx2-af: npc: cn20k: Reject missing default-rule MCAM indicesdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +2 more+155 -101 replyApplied

Reviews trailers per patch

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

PatchSimon Horman
1/10
2/10R-b
3/10R-b
4/10
5/10
6/10
7/10
8/10
9/10
10/10

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

Read the v5 thread

Cover letter [PATCH v5 net 00/10] octeontx2-af: npc: cn20k: MCAM fixes

This series tightens Marvell OcteonTX2 AF NPC support for CN20K silicon around MCAM key typing, optional debugfs setup, defrag allocation rollback, defrag entry relocation bookkeeping, logical MCAM clear and programming, default-rule index handling with explicit teardown, and NIXLF reserved-slot lookup when default rules are missing.

Patches 1 through 3 focus on AF error handling: propagate npc_mcam_idx_2_key_type() failures through cn20k MCAM enable, config, copy, and read paths; treat cn20k NPC debugfs nodes as optional so probe does not fail when debugfs is unavailable; and fix defrag MCAM allocation rollback so allocation errno is not overwritten during subbank index resolution.

Patch 4 fixes npc_defrag_move_vdx_to_free(): when an MCAM line is moved to a new physical index, move entry2target_pffunc[] association to the new slot, clear the old slot, and retarget the matching mcam_rules entry so software state matches hardware after defrag.

Patches 5 through 7 refine cn20k MCAM programming: clear entries using the logical MCAM index and resolved key width, fix bank/CFG sequencing in npc_cn20k_config_mcam_entry(), and read action metadata from the correct bank in npc_cn20k_read_mcam_entry().

Patches 8 through 10 complete default-rule lifecycle handling: initialize default-rule index outputs eagerly, tear down reserved default MCAM rules explicitly (coordinated with npc_mcam_free_all_entries()), and reject USHRT_MAX sentinel indices from npc_get_nixlf_mcam_index() on cn20k.

Ratheesh Kannoth (10):
octeontx2-af: npc: cn20k: Propagate MCAM key-type errors on cn20k
octeontx2-af: npc: cn20k: Drop debugfs_create_file() error checks in init
octeontx2-af: npc: cn20k: Propagate errors in defrag MCAM alloc rollback
octeontx2-af: npc: cn20k: Fix target map and rule
octeontx2-af: npc: cn20k: Clear MCAM entries by index and key width
octeontx2-af: npc: cn20k: Fix bank value
octeontx2-af: npc: cn20k: Fix MCAM actions read
octeontx2-af: npc: cn20k: Initialize default-rule index outputs up front
octeontx2-af: npc: cn20k: Tear down default MCAM rules explicitly on free
octeontx2-af: npc: cn20k: Reject missing default-rule MCAM indices

---
v4 -> v5:

	https://lore.kernel.org/all/[email protected]/

v3 -> v4:
- Add patch fixing entry2target_pffunc[] and mcam_rules when defrag relocates an MCAM entry (npc_defrag_move_vdx_to_free()).
- Drop the standalone default-entry x4 preference and x2-profile flow- install rejection patches from this series (10 patches total).
Link:
https://lore.kernel.org/netdev/
[email protected]/

v2 -> v3:
Addresses Simon and Paolo comments.
Link:
https://lore.kernel.org/netdev/
[email protected]/

v1 -> v2:
Address Simon comments and add further cn20k NPC correctness fixes. Link:
https://lore.kernel.org/netdev/
[email protected]/

2.43.0