|
|
Log in / Subscribe / Register

Add CN20K NIX and NPA contexts

From:  Subbaraya Sundeep <sbhatta-AT-marvell.com>
To:  <andrew+netdev-AT-lunn.ch>, <davem-AT-davemloft.net>, <edumazet-AT-google.com>, <kuba-AT-kernel.org>, <pabeni-AT-redhat.com>, <horms-AT-kernel.org>
Subject:  [net-next v4 00/11] Add CN20K NIX and NPA contexts
Date:  Sat, 25 Oct 2025 16:02:36 +0530
Message-ID:  <1761388367-16579-1-git-send-email-sbhatta@marvell.com>
Cc:  <gakula-AT-marvell.com>, <hkelam-AT-marvell.com>, <bbhushan2-AT-marvell.com>, <jerinj-AT-marvell.com>, <lcherian-AT-marvell.com>, <sgoutham-AT-marvell.com>, <saikrishnag-AT-marvell.com>, <netdev-AT-vger.kernel.org>, Subbaraya Sundeep <sbhatta-AT-marvell.com>
Archive-link:  Article

The hardware contexts of blocks NIX and NPA in CN20K silicon are
different than that of previous silicons CN10K and CN9XK. This
patchset adds the new contexts of CN20K in AF and PF drivers.
A new mailbox for enqueuing contexts to hardware is added.

Patch 1 simplifies context writing and reading by using max context
size supported by hardware instead of using each context size.
Patch 2 and 3 adds NIX block contexts in AF driver and extends
debugfs to display those new contexts
Patch 4 and 5 adds NPA block contexts in AF driver and extends
debugfs to display those new contexts
Patch 6 omits NDC configuration since CN20K NPA does not use NDC
for caching its contexts
Patch 7 and 8 uses the new NIX and NPA contexts in PF/VF driver.
Patch 9, 10 and 11 are to support more bandwidth profiles present in
CN20K for RX ratelimiting and to display new profiles in debugfs

v4 changes:
 As suggested by Simon
 	Added static_assert to all context structures
	Fixed line wraps
	constrained #ifdef to small helper in patch 7
	Used FIELD_PREP and FIELD_GET in patch 9
 As suggested by Jakub
	Used order instead of page count for pp_params.order
v3 changes:
 Added static_assert as suggested by Michal Swiatkowski
v2 changes:
 Fixed string fortifier warnings by padding structures

Link till v3:
https://lore.kernel.org/all/1752772063-6160-1-git-send-em...

Thanks,
Sundeep

Linu Cherian (4):
  octeontx2-af: Add cn20k NPA block contexts
  octeontx2-af: Extend debugfs support for cn20k NPA
  octeontx2-af: Skip NDC operations for cn20k
  octeontx2-pf: Initialize cn20k specific aura and pool contexts

Subbaraya Sundeep (7):
  octeontx2-af: Simplify context writing and reading to hardware
  octeontx2-af: Add cn20k NIX block contexts
  octeontx2-af: Extend debugfs support for cn20k NIX
  octeontx2-pf: Initialize new NIX SQ context for cn20k
  octeontx2-af: Accommodate more bandwidth profiles for cn20k
  octeontx2-af: Display new bandwidth profiles too in debugfs
  octeontx2-pf: Use new bandwidth profiles in receive queue

 .../ethernet/marvell/octeontx2/af/Makefile    |   3 +-
 .../marvell/octeontx2/af/cn20k/debugfs.c      | 218 +++++++++++
 .../marvell/octeontx2/af/cn20k/debugfs.h      |  28 ++
 .../ethernet/marvell/octeontx2/af/cn20k/nix.c |  20 ++
 .../ethernet/marvell/octeontx2/af/cn20k/npa.c |  21 ++
 .../marvell/octeontx2/af/cn20k/struct.h       | 340 ++++++++++++++++++
 .../net/ethernet/marvell/octeontx2/af/mbox.h  |  73 ++++
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |  15 +-
 .../marvell/octeontx2/af/rvu_debugfs.c        |  39 +-
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |  76 ++--
 .../ethernet/marvell/octeontx2/af/rvu_npa.c   |  29 +-
 .../marvell/octeontx2/af/rvu_struct.h         |  31 +-
 .../ethernet/marvell/octeontx2/nic/cn10k.c    |  10 +
 .../ethernet/marvell/octeontx2/nic/cn20k.c    | 220 +++++++++++-
 .../marvell/octeontx2/nic/otx2_common.c       |  14 +
 .../marvell/octeontx2/nic/otx2_common.h       |  10 +
 16 files changed, 1092 insertions(+), 55 deletions(-)
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.h
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/nix.c
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cn20k/npa.c

-- 
2.48.1




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds