Skip to content

Commit 56ade8f

Browse files
jpirkodavem330
authored andcommitted
mlxsw: spectrum: Add initial support for Spectrum ASIC
Add support for new generation Mellanox Spectrum ASIC, 10/25/40/50 and 100Gb/s Ethernet Switch. The initial driver implements bridge forwarding offload including bridge internal VLAN support, FDB static entries, FDB learning and HW ageing including their setup. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a4feea7 commit 56ade8f

File tree

10 files changed

+3374
-0
lines changed

10 files changed

+3374
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ config MLXSW_SWITCHX2
3030

3131
To compile this driver as a module, choose M here: the
3232
module will be called mlxsw_switchx2.
33+
34+
config MLXSW_SPECTRUM
35+
tristate "Mellanox Technologies Spectrum support"
36+
depends on MLXSW_CORE && NET_SWITCHDEV
37+
default m
38+
---help---
39+
This driver supports Mellanox Technologies Spectrum Ethernet
40+
Switch ASICs.
41+
42+
To compile this driver as a module, choose M here: the
43+
module will be called mlxsw_spectrum.

drivers/net/ethernet/mellanox/mlxsw/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ obj-$(CONFIG_MLXSW_PCI) += mlxsw_pci.o
44
mlxsw_pci-objs := pci.o
55
obj-$(CONFIG_MLXSW_SWITCHX2) += mlxsw_switchx2.o
66
mlxsw_switchx2-objs := switchx2.o
7+
obj-$(CONFIG_MLXSW_SPECTRUM) += mlxsw_spectrum.o
8+
mlxsw_spectrum-objs := spectrum.o spectrum_buffers.o \
9+
spectrum_switchdev.o

drivers/net/ethernet/mellanox/mlxsw/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
MODULE_ALIAS(MLXSW_MODULE_ALIAS_PREFIX kind)
5555

5656
#define MLXSW_DEVICE_KIND_SWITCHX2 "switchx2"
57+
#define MLXSW_DEVICE_KIND_SPECTRUM "spectrum"
5758

5859
struct mlxsw_core;
5960
struct mlxsw_driver;

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ static const char mlxsw_pci_driver_name[] = "mlxsw_pci";
5757

5858
static const struct pci_device_id mlxsw_pci_id_table[] = {
5959
{PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SWITCHX2), 0},
60+
{PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM), 0},
6061
{0, }
6162
};
6263

@@ -67,6 +68,8 @@ static const char *mlxsw_pci_device_kind_get(const struct pci_device_id *id)
6768
switch (id->device) {
6869
case PCI_DEVICE_ID_MELLANOX_SWITCHX2:
6970
return MLXSW_DEVICE_KIND_SWITCHX2;
71+
case PCI_DEVICE_ID_MELLANOX_SPECTRUM:
72+
return MLXSW_DEVICE_KIND_SPECTRUM;
7073
default:
7174
BUG();
7275
}

drivers/net/ethernet/mellanox/mlxsw/pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "item.h"
4141

4242
#define PCI_DEVICE_ID_MELLANOX_SWITCHX2 0xc738
43+
#define PCI_DEVICE_ID_MELLANOX_SPECTRUM 0xcb84
4344
#define MLXSW_PCI_BAR0_SIZE (1024 * 1024) /* 1MB */
4445
#define MLXSW_PCI_PAGE_SIZE 4096
4546

0 commit comments

Comments
 (0)