[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260109103035.2972893-1-rkannoth@marvell.com>
Date: Fri, 9 Jan 2026 16:00:25 +0530
From: Ratheesh Kannoth <rkannoth@...vell.com>
To: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <sgoutham@...vell.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
<kuba@...nel.org>, <pabeni@...hat.com>, <andrew+netdev@...n.ch>,
"Ratheesh
Kannoth" <rkannoth@...vell.com>
Subject: [PATCH net-next v3 00/10] Switch support
Marvell CN10K switch hardware is capable of accelerating L2, L3,
and flow. The switch hardware runs an application that
creates a logical port for each representor device when representors
are enabled through devlink.
This patch series implements communication from Host OS to switch
HW and vice versa.
|--------------------------------|
| HOST OS |
| |
| eth0(rep-eth0) eth1(rep-eth1) |
| | | |
| | | |
---------------------------------|
| |
| |
---------------------------------|
| lport0 lport1 |
| |
| switch |
| |
---------------------------------|
When representors are created, corresponding "logical ports" are
created in switchdev. The switch hardware allocates a NIX PF and
configures its send queues. These send queues should be able to
transmit packets to any channel, as send queues as from same NIX PF.
Switch is capable of forwarding packets between these logical ports.
Notifier callbacks are registered to receive system events such as
FDB add/delete and FIB add/delete. Flow add/delete operations are
handled through the .ndo_setup_tc() interface. These events are
captured and processed by the NIC driver and forwarded to the switch
device through the AF driver. All message exchanges use the mailbox
interface.
Bridge acceleration:
FDB add/delete notifications are processed, and learned SMAC
information is sent to the switch hardware. The switch inserts a
hardware rule to accelerate packets destined to the MAC address.
Flow acceleration:
NFT and OVS applications call .ndo_setup_tc() to push rules to
hardware for acceleration. This interface is used to forward
rules to the switch hardware through the mailbox interface.
Ratheesh Kannoth (10):
octeontx2-af: switch: Add AF to switch mbox and skeleton files
Mbox message for AF to switch
octeontx2-af: switch: Add switch dev to AF mboxes
Switch to AF driver mbox messages
octeontx2-pf: switch: Add pf files hierarchy
PF skeleton files for bridge, fib and flow
octeontx2-af: switch: Representor for switch port
Switch ID is copied and sent to switch when Representors are
enabled thru devlink. Upon receipt of the message, switch queries
AF driver to get info on rep interfaces.
octeontx2-af: switch: Enable Switch hw port for all channels
Switch ports should be configured to TX packets on any channel.
octeontx2-pf: switch: Register for notifier chains.
Notifier callback for various system events.
octeontx2: switch: L2 offload support
Bridge (L2) offload support
octeontx2: switch: L3 offload support
FIB (L3) offload support.
octeontx2: switch: Flow offload support
Flow (5/7 tuple) offload support.
octeontx2: switch: trace support
Trace logs for flow and action
.../net/ethernet/marvell/octeontx2/Kconfig | 12 +
.../ethernet/marvell/octeontx2/af/Makefile | 2 +
.../net/ethernet/marvell/octeontx2/af/mbox.h | 219 ++++++
.../net/ethernet/marvell/octeontx2/af/rvu.c | 111 +++-
.../net/ethernet/marvell/octeontx2/af/rvu.h | 6 +
.../ethernet/marvell/octeontx2/af/rvu_nix.c | 54 +-
.../ethernet/marvell/octeontx2/af/rvu_npc.c | 77 ++-
.../marvell/octeontx2/af/rvu_npc_fs.c | 13 +-
.../ethernet/marvell/octeontx2/af/rvu_rep.c | 3 +-
.../marvell/octeontx2/af/switch/rvu_sw.c | 47 ++
.../marvell/octeontx2/af/switch/rvu_sw.h | 14 +
.../marvell/octeontx2/af/switch/rvu_sw_fl.c | 294 ++++++++
.../marvell/octeontx2/af/switch/rvu_sw_fl.h | 13 +
.../marvell/octeontx2/af/switch/rvu_sw_l2.c | 284 ++++++++
.../marvell/octeontx2/af/switch/rvu_sw_l2.h | 13 +
.../marvell/octeontx2/af/switch/rvu_sw_l3.c | 215 ++++++
.../marvell/octeontx2/af/switch/rvu_sw_l3.h | 11 +
.../ethernet/marvell/octeontx2/nic/Makefile | 8 +-
.../ethernet/marvell/octeontx2/nic/otx2_tc.c | 17 +-
.../marvell/octeontx2/nic/otx2_txrx.h | 2 +
.../ethernet/marvell/octeontx2/nic/otx2_vf.c | 8 +
.../net/ethernet/marvell/octeontx2/nic/rep.c | 10 +
.../marvell/octeontx2/nic/switch/sw_fdb.c | 143 ++++
.../marvell/octeontx2/nic/switch/sw_fdb.h | 18 +
.../marvell/octeontx2/nic/switch/sw_fib.c | 133 ++++
.../marvell/octeontx2/nic/switch/sw_fib.h | 16 +
.../marvell/octeontx2/nic/switch/sw_fl.c | 544 +++++++++++++++
.../marvell/octeontx2/nic/switch/sw_fl.h | 15 +
.../marvell/octeontx2/nic/switch/sw_nb.c | 629 ++++++++++++++++++
.../marvell/octeontx2/nic/switch/sw_nb.h | 31 +
.../marvell/octeontx2/nic/switch/sw_trace.c | 11 +
.../marvell/octeontx2/nic/switch/sw_trace.h | 82 +++
32 files changed, 3040 insertions(+), 15 deletions(-)
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw_fl.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw_fl.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw_l2.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw_l2.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw_l3.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/switch/rvu_sw_l3.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_trace.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_trace.h
--
ChangeLog:
v1 -> v2: Fixed build errors
v2 -> v3: Fixed sparse error, Addressed comments from Alok, Kalesh
2.43.0
Powered by blists - more mailing lists