Skip to content

octeontx2-af: Fix smatch reported errors

Ratheesh Kannoth lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3octeontx2-af: npc: cn20k: Handle npc_mcam_idx_2_key_type() failuresdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+15 -52 replies
2/3octeontx2-af: npc: cn20k: Drop debugfs_create_file() error checks in initdrivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c+10 -231 reply
3/3octeontx2-af: npc: cn20k: Return error when defrag rollback free failsdrivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+1 -01 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchSimon Horman
1/3
2/3R-b
3/3

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

Read the v1 thread

Cover letter [PATCH net 0/3] octeontx2-af: Fix smatch reported errors

This series tightens error handling in the Marvell OcteonTX2 AF CN20K NPC
layer: MCAM paths now respect npc_mcam_idx_2_key_type() failures, debugfs setup follows the usual "optional, do not fail init" convention, and defrag rollback reports failure when freeing slots after a partial allocation does not complete cleanly.

Patch 1 returns early when resolving an MCAM index to a key type fails, so enable, configure, copy, and read paths do not program or interpret hardware with a stale or undefined key type.

Patch 2 removes dentry and allocation-failure checks around debugfs_create_file() in npc_cn20k_debugfs_init(). Debugfs entries are diagnostic; callers should not abort probe or subsystem init when they cannot be created (including when debugfs is disabled).

Patch 3 sets the error code when __npc_subbank_free() fails inside the rollback loop in npc_defrag_alloc_free_slots(), so the function does not return success after a failed cleanup.

Ratheesh Kannoth (3):
octeontx2-af: npc: cn20k: Handle npc_mcam_idx_2_key_type() failures
octeontx2-af: npc: cn20k: Drop debugfs_create_file() error checks in
init
octeontx2-af: npc: cn20k: Return error when defrag rollback free fails

---
 .../marvell/octeontx2/af/cn20k/debugfs.c      | 33 ++++++-------------
 .../ethernet/marvell/octeontx2/af/cn20k/npc.c | 21 +++++++++---
 2 files changed, 26 insertions(+), 28 deletions(-)

--
2.43.0