All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Kardach <skardach@marvell.com>
To: <kuba@kernel.org>, <davem@davemloft.net>, <sgoutham@marvell.com>,
	<netdev@vger.kernel.org>
Cc: <kda@semihalf.com>, Stanislaw Kardach <skardach@marvell.com>
Subject: [PATCH net-next 0/3] octeontx2-af: add support for KPU profile customization
Date: Mon, 21 Sep 2020 19:54:39 +0200	[thread overview]
Message-ID: <20200921175442.16789-1-skardach@marvell.com> (raw)

Marvell octeontx2 NPC device contains a configurable Kanguroo Parser Unit
(KPU) and CAM match key data extraction (MKEX). The octeontx2-af driver
configures them both to parse a list of standard protocol headers which
are used by netdev driver and other potential applications (i.e.
userspace through VFIO).
The problem arises when users have some custom protocol headers which
they'd like to use in CAM flow matching. If such protocols are publicly
known, they can be added to the built-in KPU configuration (called
"profile" - in npc_profile.h). If not, then there's more benefit in
keeping such changes local to the user.
For that case a mechanism which would allow users to produce a KPU
profile and load it along with octeontx2-af driver is needed. At the same
time such customization has to take care not to break the netdev driver
operation or other applications (that is be discoverable).

Therefore introduce a mechanism for a limited customization of the
built-in KPU profile via a firmware file (layout and contents described
by struct npc_kpu_profile_fwdata). It allows user modification of only a
limited number of top priority KPU entries, while others are configured
from the built-in KPU profile. Additionally by convention users should
only use NPC_LT_Lx_CUSTOMx LTYPE entries in their profiles to change the
meaning of built-in LTYPEs. This way the baseline protocol support is
always available and the impact of potential user errors is minimized.
As MKEX also needs to be modified to take into account any user
protocols, the KPU profile firmware binary contains also that. Netdev
driver and applications have a way to discover applied MKEX settings by
querying RVU AF device via NPC_GET_KEX_CFG MBOX message.
Finally some users might need to modify hardware packet data alignment
behavior and profile contains settings for that too.

First patch ensures that CUSTOMx LTYPEs are not aliased with meaningful
LTYPEs where possible.

Second patch gathers all KPU profile related data into a single struct
and creates an adapter structure which provides an interface to the KPU
profile for the octeontx2-af driver.

Third patch adds logic for loading the KPU profile through kernel
firmware APIs, filling in the customizable entries in the adapter
structure and programming the MKEX from KPU profile.

Changes from v1:
* Remove unnecessary __packed attributes. All structures in profile are
  naturally aligned and only struct npc_kpu_profile_fwdata is padded
  1B at the end, which is expected.
* Make npc_lt_defaults and npc_mkex_default const as they are read-only.
* Save custom KPU entries in separate struct npc_kpu_profile so that the
  default profile can remain read-only and there's no need to allocate
  and memcpy 25kB of default profile when customizations are present.
  The drawbacks are weaker profile abstraction and slightly more
  complicated programming steps.
  This is a result of:
  4a681bf3456f octeontx2-af: Constify npc_kpu_profile_{action,cam}
* Describe in last commit the reason for using a module parameter
  instead of an arbitrary firmware name.

Stanislaw Kardach (3):
  octeontx2-af: fix LD CUSTOM LTYPE aliasing
  octeontx2-af: prepare for custom KPU profiles
  octeontx2-af: add support for custom KPU entries

 .../net/ethernet/marvell/octeontx2/af/npc.h   |  76 +++-
 .../marvell/octeontx2/af/npc_profile.h        | 244 +++++++++++-
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |   6 +
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |  22 ++
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |  36 +-
 .../ethernet/marvell/octeontx2/af/rvu_npc.c   | 368 +++++++++++-------
 6 files changed, 587 insertions(+), 165 deletions(-)

-- 
2.20.1


             reply	other threads:[~2020-09-21 17:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 17:54 Stanislaw Kardach [this message]
2020-09-21 17:54 ` [PATCH net-next v2 1/3] octeontx2-af: fix LD CUSTOM LTYPE aliasing Stanislaw Kardach
2020-09-21 17:54 ` [PATCH net-next v2 2/3] octeontx2-af: prepare for custom KPU profiles Stanislaw Kardach
2020-09-21 17:54 ` [PATCH net-next v2 3/3] octeontx2-af: add support for custom KPU entries Stanislaw Kardach
2020-09-21 23:26   ` Jakub Kicinski
2020-09-22 11:40     ` Stanislaw Kardach
2020-09-22 15:13       ` Jakub Kicinski
2020-09-23  0:43 ` [PATCH net-next 0/3] octeontx2-af: add support for KPU profile customization David Miller
  -- strict thread matches above, loose matches on Subject: below --
2020-09-11 13:21 skardach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200921175442.16789-1-skardach@marvell.com \
    --to=skardach@marvell.com \
    --cc=davem@davemloft.net \
    --cc=kda@semihalf.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.