Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31557f0f authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

mlxsw: Introduce Mellanox SwitchX-2 ASIC support



Benefit from the previously introduced Mellanox Switch infrastructure and
add driver for SwitchX-2 ASIC. Note that this driver is very simple now.
It implements bare minimum for getting device to work on slow-path.
Fast-path offload functionality is going to be added soon.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarElad Raz <eladr@mellanox.com>
Reviewed-by: default avatarScott Feldman <sfeldma@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4ec14b76
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -19,3 +19,14 @@ config MLXSW_PCI

	  To compile this driver as a module, choose M here: the
	  module will be called mlxsw_pci.

config MLXSW_SWITCHX2
	tristate "Mellanox Technologies SwitchX-2 support"
	depends on MLXSW_CORE && NET_SWITCHDEV
	default m
	---help---
	  This driver supports Mellanox Technologies SwitchX-2 Ethernet
	  Switch ASICs.

	  To compile this driver as a module, choose M here: the
	  module will be called mlxsw_switchx2.
+2 −0
Original line number Diff line number Diff line
@@ -2,3 +2,5 @@ obj-$(CONFIG_MLXSW_CORE) += mlxsw_core.o
mlxsw_core-objs			:= core.o
obj-$(CONFIG_MLXSW_PCI)		+= mlxsw_pci.o
mlxsw_pci-objs			:= pci.o
obj-$(CONFIG_MLXSW_SWITCHX2)	+= mlxsw_switchx2.o
mlxsw_switchx2-objs		:= switchx2.o
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@
#define MODULE_MLXSW_DRIVER_ALIAS(kind)	\
	MODULE_ALIAS(MLXSW_MODULE_ALIAS_PREFIX kind)

#define MLXSW_DEVICE_KIND_SWITCHX2 "switchx2"

struct mlxsw_core;
struct mlxsw_driver;
struct mlxsw_bus;
+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@
static const char mlxsw_pci_driver_name[] = "mlxsw_pci";

static const struct pci_device_id mlxsw_pci_id_table[] = {
	{PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SWITCHX2), 0},
	{0, }
};

@@ -63,6 +64,8 @@ static struct dentry *mlxsw_pci_dbg_root;
static const char *mlxsw_pci_device_kind_get(const struct pci_device_id *id)
{
	switch (id->device) {
	case PCI_DEVICE_ID_MELLANOX_SWITCHX2:
		return MLXSW_DEVICE_KIND_SWITCHX2;
	default:
		BUG();
	}
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@

#include "item.h"

#define PCI_DEVICE_ID_MELLANOX_SWITCHX2	0xc738
#define MLXSW_PCI_BAR0_SIZE		(1024 * 1024) /* 1MB */
#define MLXSW_PCI_PAGE_SIZE		4096

Loading