linux/drivers/net/ethernet/marvell
Ratheesh Kannoth bc968f61bf octeontx2-af: npc: cn20k: Reject missing default-rule MCAM indices
When cn20k default L2 rules are not installed,
npc_cn20k_dft_rules_idx_get() leaves broadcast, multicast, promiscuous, and
unicast slots at USHRT_MAX. npc_get_nixlf_mcam_index() previously returned
that sentinel as a valid MCAM index, so callers could program hardware with
an invalid index.

Return -EINVAL from the cn20k branches of npc_get_nixlf_mcam_index() when
the requested slot is still USHRT_MAX. Harden cn20k NPC MCAM entry helpers
to reject out-of-range indices before touching hardware.

Drop the early bounds check in npc_enable_mcam_entry() for cn20k so invalid
indices are validated inside npc_cn20k_enable_mcam_entry() instead of being
silently ignored.

In rvu_npc_update_flowkey_alg_idx(), treat negative MCAM indices like
out-of-range values, and only update RSS actions for promiscuous and
all-multi paths when the resolved index is non-negative.

Cc: Suman Ghosh <sumang@marvell.com>
Fixes: 6d1e70282f ("octeontx2-af: npc: cn20k: Use common APIs")
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://patch.msgid.link/20260429022722.1110289-11-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-04-30 18:50:17 -07:00
..
mvpp2 net: mvpp2: guard flow control update with global_tx_fc in buffer switching 2026-03-19 10:31:19 +01:00
octeon_ep octeon_ep: Remove unnecessary semicolons in octep_oq_drop_rx() 2026-04-12 13:50:13 -07:00
octeon_ep_vf octeon_ep_vf: add NULL check for napi_build_skb() 2026-04-13 15:40:49 -07:00
octeontx2 octeontx2-af: npc: cn20k: Reject missing default-rule MCAM indices 2026-04-30 18:50:17 -07:00
prestera Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
Kconfig net: phy: remove Kconfig symbol MDIO_DEVRES 2025-05-14 19:12:19 -07:00
Makefile octeon_ep_vf: Add driver framework and device initialization 2024-02-12 09:01:52 +00:00
mv643xx_eth.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mvmdio.c net: ethernet: Switch back to struct platform_driver::remove() 2024-10-04 16:39:56 -07:00
mvneta_bm.c net: ethernet: Switch back to struct platform_driver::remove() 2024-10-04 16:39:56 -07:00
mvneta_bm.h net: Fix typos 2025-07-25 10:29:07 -07:00
mvneta.c net: mvneta: support EPROBE_DEFER when reading MAC address 2026-03-10 19:02:25 -07:00
pxa168_eth.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
skge.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
skge.h
sky2.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
sky2.h sky2: Make sure there is at least one frag_addr available 2023-10-02 08:03:52 +01:00