[PATCH net-next v9 00/13] NPC HW block support for cn20k

Ratheesh Kannoth posted 13 patches 1 month, 1 week ago
.../ethernet/marvell/octeontx2/af/Makefile    |    2 +-
.../marvell/octeontx2/af/cn20k/debugfs.c      |  273 +
.../marvell/octeontx2/af/cn20k/debugfs.h      |    3 +
.../marvell/octeontx2/af/cn20k/mbox_init.c    |   17 +
.../ethernet/marvell/octeontx2/af/cn20k/npc.c | 4421 +++++++++++++++++
.../ethernet/marvell/octeontx2/af/cn20k/npc.h |  340 ++
.../ethernet/marvell/octeontx2/af/cn20k/reg.h |   65 +
.../ethernet/marvell/octeontx2/af/common.h    |    4 -
.../net/ethernet/marvell/octeontx2/af/mbox.h  |  172 +-
.../net/ethernet/marvell/octeontx2/af/npc.h   |    2 +
.../marvell/octeontx2/af/npc_profile.h        |   84 +-
.../net/ethernet/marvell/octeontx2/af/rvu.c   |   94 +-
.../net/ethernet/marvell/octeontx2/af/rvu.h   |   18 +-
.../marvell/octeontx2/af/rvu_debugfs.c        |   76 +-
.../marvell/octeontx2/af/rvu_devlink.c        |   90 +-
.../ethernet/marvell/octeontx2/af/rvu_nix.c   |    1 -
.../ethernet/marvell/octeontx2/af/rvu_npc.c   |  580 ++-
.../ethernet/marvell/octeontx2/af/rvu_npc.h   |   21 +
.../marvell/octeontx2/af/rvu_npc_fs.c         |  693 ++-
.../marvell/octeontx2/af/rvu_npc_fs.h         |   14 +-
.../marvell/octeontx2/af/rvu_npc_hash.c       |  128 +-
.../marvell/octeontx2/af/rvu_npc_hash.h       |    2 +-
.../ethernet/marvell/octeontx2/nic/cn20k.c    |  265 +
.../ethernet/marvell/octeontx2/nic/cn20k.h    |   13 +
.../marvell/octeontx2/nic/otx2_common.h       |   35 +
.../marvell/octeontx2/nic/otx2_flows.c        |  267 +-
.../ethernet/marvell/octeontx2/nic/otx2_tc.c  |   77 +-
27 files changed, 7286 insertions(+), 471 deletions(-)
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.h
[PATCH net-next v9 00/13] NPC HW block support for cn20k
Posted by Ratheesh Kannoth 1 month, 1 week ago
This patchset adds comprehensive support for the CN20K NPC
architecture. CN20K introduces significant changes in MCAM layout,
parser design, KPM/KPU mapping, index management, virtual index handling,
and dynamic rule installation. The patches update the AF, PF/VF, and
common layers to correctly support these new capabilities while
preserving compatibility with previous silicon variants.

MCAM on CN20K differs from older designs: the hardware now contains
two vertical banks of depth 8192, and thirty-two horizontal subbanks of
depth 256. Each subbank can be configured as x2 or x4, enabling
256-bit or 512-bit key storage. Several allocation models are added to
support this layout, including contiguous and non-contiguous allocation
with or without reference ranges and priorities.

Parser and extraction logic are also enhanced. CN20K introduces a new
profile model where up to twenty-four extractors may be configured for
each parsing profile. A new KPM profile scheme is added, grouping
sixteen KPUs into eight KPM profiles, each formed by two KPUs.

Support is added for default index allocation for CN20K-specific
MCAM entry structures, virtual index allocation, improved defragmentation,
and TC rule installation by allowing the AF driver to determine
required x2/x4 rule width during flow install.

Ratheesh Kannoth (7):
  octeontx2-af: npc: cn20k: Index management
  Add CN20K MCAM allocation support. Implements contiguous and
  non-contiguous allocation models with ref, limit, contig,
  priority, and count support.

  octeontx2-af: npc: cn20k: Allocate default MCAM indexes
  Allocate default MCAM entries dynamically in descending index
  order during NIX LF attach, reducing MCAM wastage

  octeontx2-af: npc: cn20k: Prepare for new SoC
  Introduce MCAM metadata structure so low-level functions no
  longer receive SoC-specific structures directly.

  octeontx2-af: npc: cn20k: virtual index support
  Add virtual MCAM index allocation and improve CN20K MCAM
  defragmentation handling. Track virtual indexes and restore
  statistics correctly.

  octeontx2-af: npc: cn20k: Allocate MCAM entry for flow installation
  Extend install_flow mailbox so AF can determine rule width and
  complete allocation and installation in a single exchange.

  octeontx2-af: npc: cn20k: add debugfs support
  Debugfs entries to show mcam layout and default mcam entry allocations
  Legacy debugfs entries are modified to show hardware priority on cn20k
  SoC.

  octeontx-af: npc: Use common structures
  Low level functions should use maximum mcam size array and modify cam0
  and cam1. This is a cleanup patch.

Subbaraya Sundeep (1):
  octeontx2-pf: cn20k: Add TC rules support
  Add full TC dynamic rule support for CN20K. Handle x2/x4 rule
  widths, dynamic allocation, and shifting restrictions when
  mixed rule sizes exist.

Suman Ghosh (5):
  octeontx2-af: npc: cn20k: KPM profile changes
  Add support for CN20K KPM profiles. Sixteen KPUs are grouped
  into eight KPM configurations to improve resource usage

  octeontx2-af: npc: cn20k: Add default profile
  Update mkex profile for CN20K and mark unused objects with
  may_be_unused to silence compiler warnings.

  ocetontx2-af: npc: cn20k: MKEX profile support
  Add support for the new CN20K parser profile. Introduces the
  extractor-based model with up to twenty-four extractors per
  profile.

  octeontx2-af: npc: cn20k: Use common APIs
  Update common MCAM APIs for CN20K. Add new register handling,
  new access algorithms, and CN20K-specific index management.

  octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon
  Add CN20K-specific MCAM mailbox messages for updated mcam_entry
  layout and avoid breaking backward compatibility.

 .../ethernet/marvell/octeontx2/af/Makefile    |    2 +-
 .../marvell/octeontx2/af/cn20k/debugfs.c      |  273 +
 .../marvell/octeontx2/af/cn20k/debugfs.h      |    3 +
 .../marvell/octeontx2/af/cn20k/mbox_init.c    |   17 +
 .../ethernet/marvell/octeontx2/af/cn20k/npc.c | 4421 +++++++++++++++++
 .../ethernet/marvell/octeontx2/af/cn20k/npc.h |  340 ++
 .../ethernet/marvell/octeontx2/af/cn20k/reg.h |   65 +
 .../ethernet/marvell/octeontx2/af/common.h    |    4 -
 .../net/ethernet/marvell/octeontx2/af/mbox.h  |  172 +-
 .../net/ethernet/marvell/octeontx2/af/npc.h   |    2 +
 .../marvell/octeontx2/af/npc_profile.h        |   84 +-
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |   94 +-
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   18 +-
 .../marvell/octeontx2/af/rvu_debugfs.c        |   76 +-
 .../marvell/octeontx2/af/rvu_devlink.c        |   90 +-
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |    1 -
 .../ethernet/marvell/octeontx2/af/rvu_npc.c   |  580 ++-
 .../ethernet/marvell/octeontx2/af/rvu_npc.h   |   21 +
 .../marvell/octeontx2/af/rvu_npc_fs.c         |  693 ++-
 .../marvell/octeontx2/af/rvu_npc_fs.h         |   14 +-
 .../marvell/octeontx2/af/rvu_npc_hash.c       |  128 +-
 .../marvell/octeontx2/af/rvu_npc_hash.h       |    2 +-
 .../ethernet/marvell/octeontx2/nic/cn20k.c    |  265 +
 .../ethernet/marvell/octeontx2/nic/cn20k.h    |   13 +
 .../marvell/octeontx2/nic/otx2_common.h       |   35 +
 .../marvell/octeontx2/nic/otx2_flows.c        |  267 +-
 .../ethernet/marvell/octeontx2/nic/otx2_tc.c  |   77 +-
 27 files changed, 7286 insertions(+), 471 deletions(-)
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.h

--
v1 -> v2: Addressed comments
v2 -> v3: Resolved build errors, addressed comments
v3 -> v4: Address comments from Jakub
	 https://lore.kernel.org/netdev/20260109054828.1822307-12-rkannoth@marvell.com/T/#t
v4 -> v5: Addressed comments from Jakub
	https://lore.kernel.org/netdev/20260113101658.4144610-6-rkannoth@marvell.com/
v5 -> v6: Addressed Jakub comments.
	https://lore.kernel.org/netdev/20260126123254.1000480-11-rkannoth@marvell.com/T/#t
v6 -> v7: Addressed Jakub comments.
	https://lore.kernel.org/netdev/20260128071235.3577206-2-rkannoth@marvell.com/T/#t
v7 -> v8: Addressed Jakub comments.
	https://lore.kernel.org/netdev/20260129083339.264386-12-rkannoth@marvell.com/T/#t
v8 -> v9: Addressed Jakub comments.
	https://lore.kernel.org/netdev/20260204182428.05a77b13@kernel.org/

2.43.0
Re: [PATCH net-next v9 00/13] NPC HW block support for cn20k
Posted by Jakub Kicinski 1 month ago
On Tue, 24 Feb 2026 13:29:56 +0530 Ratheesh Kannoth wrote:
> v8 -> v9: Addressed Jakub comments.
> 	https://lore.kernel.org/netdev/20260204182428.05a77b13@kernel.org/

v8 was 20 days ago. You replied to the review comments _today_ and then
immediately posted v9. This is very frustrating, because corrections
I suggested in the reply to v8 obviously can't be part of v9. Making v9
pretty much useless. If you can't follow common sense rules of
engagement with the community we will not merge any of your code.
Re: [PATCH net-next v9 00/13] NPC HW block support for cn20k
Posted by Ratheesh Kannoth 1 month ago
On 2026-02-25 at 00:05:37, Jakub Kicinski (kuba@kernel.org) wrote:
> On Tue, 24 Feb 2026 13:29:56 +0530 Ratheesh Kannoth wrote:
> > v8 -> v9: Addressed Jakub comments.
> > 	https://lore.kernel.org/netdev/20260204182428.05a77b13@kernel.org/
>
> v8 was 20 days ago. You replied to the review comments _today_ and then
> immediately posted v9. This is very frustrating, because corrections
> I suggested in the reply to v8 obviously can't be part of v9. Making v9
> pretty much useless. If you can't follow common sense rules of
> engagement with the community we will not merge any of your code.

I understand your frustration, and I apologize for posting v9 immediately
after replying to the v8 review comments.  My intention was to keep the
process moving forward, as new AI generated review comments are generated each time.
I had asked the same question in v7
(https://lore.kernel.org/netdev/20260129083339.264386-12-rkannoth@marvell.com/T/#m0681b88b55f80b0f58fc1e6e9be2220220111224).

But I see now that doing so prevented your latest suggestions from being incorporated and disrupted the expected
review workflow. That was not my intent. I appreciate the time and effort you put into reviewing the patches,
and I certainly do not want to undermine that process.

Going forward, I will wait for feedback after replying to review comments before posting a new version,
 to ensure that all suggested corrections are properly addressed. If there are additional changes you would like
included beyond what was already discussed, I am happy to incorporate them in the next revision.

Thank you again for the review and for your guidance on community expectations.