PF driver skeleton files. Follow up patches add meat to these files. sw_nb* : Implements various notifier callbacks for linux events sw_fdb* : L2 offload sw_fib* : L3 offload sw_fl* : Flow based offload (ovs, nft etc) Signed-off-by: Ratheesh Kannoth --- drivers/net/ethernet/marvell/octeontx2/Kconfig | 12 ++++++++++++ .../net/ethernet/marvell/octeontx2/nic/Makefile | 8 +++++++- .../marvell/octeontx2/nic/switch/sw_fdb.c | 16 ++++++++++++++++ .../marvell/octeontx2/nic/switch/sw_fdb.h | 13 +++++++++++++ .../marvell/octeontx2/nic/switch/sw_fib.c | 16 ++++++++++++++++ .../marvell/octeontx2/nic/switch/sw_fib.h | 13 +++++++++++++ .../marvell/octeontx2/nic/switch/sw_fl.c | 16 ++++++++++++++++ .../marvell/octeontx2/nic/switch/sw_fl.h | 13 +++++++++++++ .../marvell/octeontx2/nic/switch/sw_nb.c | 17 +++++++++++++++++ .../marvell/octeontx2/nic/switch/sw_nb.h | 13 +++++++++++++ 10 files changed, 136 insertions(+), 1 deletion(-) 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 diff --git a/drivers/net/ethernet/marvell/octeontx2/Kconfig b/drivers/net/ethernet/marvell/octeontx2/Kconfig index 35c4f5f64f58..a883efc9d9dd 100644 --- a/drivers/net/ethernet/marvell/octeontx2/Kconfig +++ b/drivers/net/ethernet/marvell/octeontx2/Kconfig @@ -28,6 +28,18 @@ config NDC_DIS_DYNAMIC_CACHING , NPA stack pages etc in NDC. Also locks down NIX SQ/CQ/RQ/RSS and NPA Aura/Pool contexts. +config OCTEONTX_SWITCH + tristate "Marvell OcteonTX2 switch driver" + select OCTEONTX2_MBOX + select NET_DEVLINK + default n + select PAGE_POOL + depends on (64BIT && COMPILE_TEST) || ARM64 + help + This driver supports Marvell's OcteonTX2 switch driver. + Marvell SW HW can offload L2, L3 offload. ARM core interacts + with Marvell SW HW thru mbox. + config OCTEONTX2_PF tristate "Marvell OcteonTX2 NIC Physical Function driver" select OCTEONTX2_MBOX diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/Makefile b/drivers/net/ethernet/marvell/octeontx2/nic/Makefile index 883e9f4d601c..da87e952c187 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/Makefile +++ b/drivers/net/ethernet/marvell/octeontx2/nic/Makefile @@ -9,7 +9,13 @@ obj-$(CONFIG_RVU_ESWITCH) += rvu_rep.o rvu_nicpf-y := otx2_pf.o otx2_common.o otx2_txrx.o otx2_ethtool.o \ otx2_flows.o otx2_tc.o cn10k.o cn20k.o otx2_dmac_flt.o \ - otx2_devlink.o qos_sq.o qos.o otx2_xsk.o + otx2_devlink.o qos_sq.o qos.o otx2_xsk.o \ + switch/sw_fdb.o switch/sw_fl.o + +ifdef CONFIG_OCTEONTX_SWITCH +rvu_nicpf-y += switch/sw_nb.o switch/sw_fib.o +endif + rvu_nicvf-y := otx2_vf.o rvu_rep-y := rep.o diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.c b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.c new file mode 100644 index 000000000000..6842c8d91ffc --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Marvell RVU switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#include "sw_fdb.h" + +int sw_fdb_init(void) +{ + return 0; +} + +void sw_fdb_deinit(void) +{ +} diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.h b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.h new file mode 100644 index 000000000000..d4314d6d3ee4 --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fdb.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Marvell switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#ifndef SW_FDB_H_ +#define SW_FDB_H_ + +void sw_fdb_deinit(void); +int sw_fdb_init(void); + +#endif // SW_FDB_H diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.c b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.c new file mode 100644 index 000000000000..12ddf8119372 --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Marvell RVU switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#include "sw_fib.h" + +int sw_fib_init(void) +{ + return 0; +} + +void sw_fib_deinit(void) +{ +} diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.h b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.h new file mode 100644 index 000000000000..a51d15c2b80e --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fib.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Marvell switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#ifndef SW_FIB_H_ +#define SW_FIB_H_ + +void sw_fib_deinit(void); +int sw_fib_init(void); + +#endif // SW_FIB_H diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.c b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.c new file mode 100644 index 000000000000..36a2359a0a48 --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Marvell RVU switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#include "sw_fl.h" + +int sw_fl_init(void) +{ + return 0; +} + +void sw_fl_deinit(void) +{ +} diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.h b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.h new file mode 100644 index 000000000000..cd018d770a8a --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_fl.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Marvell switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#ifndef SW_FL_H_ +#define SW_FL_H_ + +void sw_fl_deinit(void); +int sw_fl_init(void); + +#endif // SW_FL_H diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.c b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.c new file mode 100644 index 000000000000..2d14a0590c5d --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Marvell RVU switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#include "sw_nb.h" + +int sw_nb_unregister(void) +{ + return 0; +} + +int sw_nb_register(void) +{ + return 0; +} diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.h b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.h new file mode 100644 index 000000000000..503a0e18cfd7 --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/nic/switch/sw_nb.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Marvell switch driver + * + * Copyright (C) 2026 Marvell. + * + */ +#ifndef SW_NB_H_ +#define SW_NB_H_ + +int sw_nb_register(void); +int sw_nb_unregister(void); + +#endif // SW_NB_H__ -- 2.43.0