Skip to content

Commit 609c8ae

Browse files
committed
Merge branch 'mlxsw-next'
Ido Schimmel says: ==================== mlxsw: Various updates This patchset contains various updates to the mlxsw driver and related selftests. Patches #1-#5 contain various updates to mlxsw selftests. The most significant change is the conversion of the DCB selftests to use the new iproute2 DCB support. Patches #6-#9 contain mostly trivial changes to the driver itself. No user facing changes. Patches #10-#11 remove support for SwitchX-2 and SwitchIB ASICs that did not see any updates in the last 4-5 years and will not see any in the future. See individual commit messages for detailed explanation as to why it is OK to remove these drivers from the kernel. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 16145db + b0d80c0 commit 609c8ae

File tree

19 files changed

+83
-2402
lines changed

19 files changed

+83
-2402
lines changed

drivers/net/ethernet/mellanox/mlxsw/Kconfig

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,6 @@ config MLXSW_I2C
4949
To compile this driver as a module, choose M here: the
5050
module will be called mlxsw_i2c.
5151

52-
config MLXSW_SWITCHIB
53-
tristate "Mellanox Technologies SwitchIB and SwitchIB-2 support"
54-
depends on MLXSW_CORE && MLXSW_PCI && NET_SWITCHDEV
55-
default m
56-
help
57-
This driver supports Mellanox Technologies SwitchIB and SwitchIB-2
58-
Infiniband Switch ASICs.
59-
60-
To compile this driver as a module, choose M here: the
61-
module will be called mlxsw_switchib.
62-
63-
config MLXSW_SWITCHX2
64-
tristate "Mellanox Technologies SwitchX-2 support"
65-
depends on MLXSW_CORE && MLXSW_PCI && NET_SWITCHDEV
66-
default m
67-
help
68-
This driver supports Mellanox Technologies SwitchX-2 Ethernet
69-
Switch ASICs.
70-
71-
To compile this driver as a module, choose M here: the
72-
module will be called mlxsw_switchx2.
73-
7452
config MLXSW_SPECTRUM
7553
tristate "Mellanox Technologies Spectrum family support"
7654
depends on MLXSW_CORE && MLXSW_PCI && NET_SWITCHDEV && VLAN_8021Q

drivers/net/ethernet/mellanox/mlxsw/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ obj-$(CONFIG_MLXSW_PCI) += mlxsw_pci.o
88
mlxsw_pci-objs := pci.o
99
obj-$(CONFIG_MLXSW_I2C) += mlxsw_i2c.o
1010
mlxsw_i2c-objs := i2c.o
11-
obj-$(CONFIG_MLXSW_SWITCHIB) += mlxsw_switchib.o
12-
mlxsw_switchib-objs := switchib.o
13-
obj-$(CONFIG_MLXSW_SWITCHX2) += mlxsw_switchx2.o
14-
mlxsw_switchx2-objs := switchx2.o
1511
obj-$(CONFIG_MLXSW_SPECTRUM) += mlxsw_spectrum.o
1612
mlxsw_spectrum-objs := spectrum.o spectrum_buffers.o \
1713
spectrum_switchdev.o spectrum_router.o \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static int mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core,
630630
struct sk_buff *skb;
631631
int err;
632632

633-
skb = skb_copy(trans->tx_skb, GFP_KERNEL);
633+
skb = skb_clone(trans->tx_skb, GFP_KERNEL);
634634
if (!skb)
635635
return -ENOMEM;
636636

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

Lines changed: 0 additions & 9 deletions
This file was deleted.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ static void mlxsw_m_port_remove(struct mlxsw_m *mlxsw_m, u8 local_port)
234234
static int mlxsw_m_port_module_map(struct mlxsw_m *mlxsw_m, u8 local_port,
235235
u8 *last_module)
236236
{
237+
unsigned int max_ports = mlxsw_core_max_ports(mlxsw_m->core);
237238
u8 module, width;
238239
int err;
239240

@@ -249,6 +250,9 @@ static int mlxsw_m_port_module_map(struct mlxsw_m *mlxsw_m, u8 local_port,
249250
if (module == *last_module)
250251
return 0;
251252
*last_module = module;
253+
254+
if (WARN_ON_ONCE(module >= max_ports))
255+
return -EINVAL;
252256
mlxsw_m->module_to_port[module] = ++mlxsw_m->max_ports;
253257

254258
return 0;

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,11 +1426,6 @@ static int mlxsw_pci_sys_ready_wait(struct mlxsw_pci *mlxsw_pci,
14261426
unsigned long end;
14271427
u32 val;
14281428

1429-
if (id->device == PCI_DEVICE_ID_MELLANOX_SWITCHX2) {
1430-
msleep(MLXSW_PCI_SW_RESET_TIMEOUT_MSECS);
1431-
return 0;
1432-
}
1433-
14341429
/* We must wait for the HW to become responsive. */
14351430
msleep(MLXSW_PCI_SW_RESET_WAIT_MSECS);
14361431

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66

77
#include <linux/pci.h>
88

9-
#define PCI_DEVICE_ID_MELLANOX_SWITCHX2 0xc738
109
#define PCI_DEVICE_ID_MELLANOX_SPECTRUM 0xcb84
1110
#define PCI_DEVICE_ID_MELLANOX_SPECTRUM2 0xcf6c
1211
#define PCI_DEVICE_ID_MELLANOX_SPECTRUM3 0xcf70
13-
#define PCI_DEVICE_ID_MELLANOX_SWITCHIB 0xcb20
14-
#define PCI_DEVICE_ID_MELLANOX_SWITCHIB2 0xcf08
1512

1613
#if IS_ENABLED(CONFIG_MLXSW_PCI)
1714

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,9 +2125,14 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
21252125
struct mlxsw_sp *mlxsw_sp = priv;
21262126
struct mlxsw_sp_port *mlxsw_sp_port;
21272127
enum mlxsw_reg_pude_oper_status status;
2128+
unsigned int max_ports;
21282129
u8 local_port;
21292130

2131+
max_ports = mlxsw_core_max_ports(mlxsw_sp->core);
21302132
local_port = mlxsw_reg_pude_local_port_get(pude_pl);
2133+
2134+
if (WARN_ON_ONCE(local_port >= max_ports))
2135+
return;
21312136
mlxsw_sp_port = mlxsw_sp->ports[local_port];
21322137
if (!mlxsw_sp_port)
21332138
return;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ static u16 mlxsw_sp_hdroom_buf_delay_get(const struct mlxsw_sp *mlxsw_sp,
364364

365365
static u32 mlxsw_sp_hdroom_int_buf_size_get(struct mlxsw_sp *mlxsw_sp, int mtu, u32 speed)
366366
{
367-
u32 buffsize = mlxsw_sp->sb_ops->int_buf_size_get(speed, mtu);
367+
u32 buffsize = mlxsw_sp->sb_ops->int_buf_size_get(mtu, speed);
368368

369369
return mlxsw_sp_bytes_cells(mlxsw_sp, buffsize) + 1;
370370
}
@@ -388,8 +388,8 @@ void mlxsw_sp_hdroom_bufs_reset_sizes(struct mlxsw_sp_port *mlxsw_sp_port,
388388
int i;
389389

390390
/* Internal buffer. */
391-
reserve_cells = mlxsw_sp_hdroom_int_buf_size_get(mlxsw_sp, mlxsw_sp_port->max_speed,
392-
mlxsw_sp_port->max_mtu);
391+
reserve_cells = mlxsw_sp_hdroom_int_buf_size_get(mlxsw_sp, mlxsw_sp_port->max_mtu,
392+
mlxsw_sp_port->max_speed);
393393
reserve_cells = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, reserve_cells);
394394
hdroom->int_buf.reserve_cells = reserve_cells;
395395

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,13 @@ void mlxsw_sp1_ptp_got_timestamp(struct mlxsw_sp *mlxsw_sp, bool ingress,
568568
u8 domain_number, u16 sequence_id,
569569
u64 timestamp)
570570
{
571+
unsigned int max_ports = mlxsw_core_max_ports(mlxsw_sp->core);
571572
struct mlxsw_sp_port *mlxsw_sp_port;
572573
struct mlxsw_sp1_ptp_key key;
573574
u8 types;
574575

576+
if (WARN_ON_ONCE(local_port >= max_ports))
577+
return;
575578
mlxsw_sp_port = mlxsw_sp->ports[local_port];
576579
if (!mlxsw_sp_port)
577580
return;

0 commit comments

Comments
 (0)