Skip to content

Commit f28f20d

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Handle v4/v6 mixed sockets properly in soreuseport, from Craig Gallak. 2) Bug fixes for the new macsec facility (missing kmalloc NULL checks, missing locking around netdev list traversal, etc.) from Sabrina Dubroca. 3) Fix handling of host routes on ifdown in ipv6, from David Ahern. 4) Fix double-fdput in bpf verifier. From Jann Horn. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (31 commits) bpf: fix double-fdput in replace_map_fd_with_map_ptr() net: ipv6: Delete host routes on an ifdown Revert "ipv6: Revert optional address flusing on ifdown." net/mlx4_en: fix spurious timestamping callbacks net: dummy: remove note about being Y by default cxgbi: fix uninitialized flowi6 ipv6: Revert optional address flusing on ifdown. ipv4/fib: don't warn when primary address is missing if in_dev is dead net/mlx5: Add pci shutdown callback net/mlx5_core: Remove static from local variable net/mlx5e: Use vport MTU rather than physical port MTU net/mlx5e: Fix minimum MTU net/mlx5e: Device's mtu field is u16 and not int net/mlx5_core: Add ConnectX-5 to list of supported devices net/mlx5e: Fix MLX5E_100BASE_T define net/mlx5_core: Fix soft lockup in steering error flow qlcnic: Update version to 5.3.64 net: stmmac: socfpga: Remove re-registration of reset controller macsec: fix netlink attribute validation macsec: add missing macsec prefix in uapi ...
2 parents 91ea692 + 8358b02 commit f28f20d

27 files changed

Lines changed: 351 additions & 218 deletions

File tree

‎MAINTAINERS‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11071,6 +11071,15 @@ S: Maintained
1107111071
F: drivers/clk/ti/
1107211072
F: include/linux/clk/ti.h
1107311073

11074+
TI ETHERNET SWITCH DRIVER (CPSW)
11075+
M: Mugunthan V N <mugunthanvnm@ti.com>
11076+
R: Grygorii Strashko <grygorii.strashko@ti.com>
11077+
L: linux-omap@vger.kernel.org
11078+
L: netdev@vger.kernel.org
11079+
S: Maintained
11080+
F: drivers/net/ethernet/ti/cpsw*
11081+
F: drivers/net/ethernet/ti/davinci*
11082+
1107411083
TI FLASH MEDIA INTERFACE DRIVER
1107511084
M: Alex Dubov <oakad@yahoo.com>
1107611085
S: Maintained

‎drivers/infiniband/hw/mlx5/main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port,
671671
struct mlx5_ib_dev *dev = to_mdev(ibdev);
672672
struct mlx5_core_dev *mdev = dev->mdev;
673673
struct mlx5_hca_vport_context *rep;
674-
int max_mtu;
675-
int oper_mtu;
674+
u16 max_mtu;
675+
u16 oper_mtu;
676676
int err;
677677
u8 ib_link_width_oper;
678678
u8 vl_hw_cap;

‎drivers/net/Kconfig‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ config DUMMY
6262
this device is consigned into oblivion) with a configurable IP
6363
address. It is most commonly used in order to make your currently
6464
inactive SLIP address seem like a real address for local programs.
65-
If you use SLIP or PPP, you might want to say Y here. Since this
66-
thing often comes in handy, the default is Y. It won't enlarge your
67-
kernel either. What a deal. Read about it in the Network
65+
If you use SLIP or PPP, you might want to say Y here. It won't
66+
enlarge your kernel. What a deal. Read about it in the Network
6867
Administrator's Guide, available from
6968
<http://www.tldp.org/docs.html#guide>.
7069

‎drivers/net/ethernet/mellanox/mlx4/en_tx.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
405405
u32 packets = 0;
406406
u32 bytes = 0;
407407
int factor = priv->cqe_factor;
408-
u64 timestamp = 0;
409408
int done = 0;
410409
int budget = priv->tx_work_limit;
411410
u32 last_nr_txbb;
@@ -445,9 +444,12 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
445444
new_index = be16_to_cpu(cqe->wqe_index) & size_mask;
446445

447446
do {
447+
u64 timestamp = 0;
448+
448449
txbbs_skipped += last_nr_txbb;
449450
ring_index = (ring_index + last_nr_txbb) & size_mask;
450-
if (ring->tx_info[ring_index].ts_requested)
451+
452+
if (unlikely(ring->tx_info[ring_index].ts_requested))
451453
timestamp = mlx4_en_get_cqe_ts(cqe);
452454

453455
/* free next descriptor */

‎drivers/net/ethernet/mellanox/mlx5/core/en.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ enum mlx5e_link_mode {
609609
MLX5E_100GBASE_KR4 = 22,
610610
MLX5E_100GBASE_LR4 = 23,
611611
MLX5E_100BASE_TX = 24,
612-
MLX5E_100BASE_T = 25,
612+
MLX5E_1000BASE_T = 25,
613613
MLX5E_10GBASE_T = 26,
614614
MLX5E_25GBASE_CR = 27,
615615
MLX5E_25GBASE_KR = 28,

‎drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ static const struct {
138138
[MLX5E_100BASE_TX] = {
139139
.speed = 100,
140140
},
141-
[MLX5E_100BASE_T] = {
142-
.supported = SUPPORTED_100baseT_Full,
143-
.advertised = ADVERTISED_100baseT_Full,
144-
.speed = 100,
141+
[MLX5E_1000BASE_T] = {
142+
.supported = SUPPORTED_1000baseT_Full,
143+
.advertised = ADVERTISED_1000baseT_Full,
144+
.speed = 1000,
145145
},
146146
[MLX5E_10GBASE_T] = {
147147
.supported = SUPPORTED_10000baseT_Full,

‎drivers/net/ethernet/mellanox/mlx5/core/en_main.c‎

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,24 +1404,50 @@ static int mlx5e_refresh_tirs_self_loopback_enable(struct mlx5e_priv *priv)
14041404
return 0;
14051405
}
14061406

1407-
static int mlx5e_set_dev_port_mtu(struct net_device *netdev)
1407+
static int mlx5e_set_mtu(struct mlx5e_priv *priv, u16 mtu)
14081408
{
1409-
struct mlx5e_priv *priv = netdev_priv(netdev);
14101409
struct mlx5_core_dev *mdev = priv->mdev;
1411-
int hw_mtu;
1410+
u16 hw_mtu = MLX5E_SW2HW_MTU(mtu);
14121411
int err;
14131412

1414-
err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(netdev->mtu), 1);
1413+
err = mlx5_set_port_mtu(mdev, hw_mtu, 1);
14151414
if (err)
14161415
return err;
14171416

1418-
mlx5_query_port_oper_mtu(mdev, &hw_mtu, 1);
1417+
/* Update vport context MTU */
1418+
mlx5_modify_nic_vport_mtu(mdev, hw_mtu);
1419+
return 0;
1420+
}
14191421

1420-
if (MLX5E_HW2SW_MTU(hw_mtu) != netdev->mtu)
1421-
netdev_warn(netdev, "%s: Port MTU %d is different than netdev mtu %d\n",
1422-
__func__, MLX5E_HW2SW_MTU(hw_mtu), netdev->mtu);
1422+
static void mlx5e_query_mtu(struct mlx5e_priv *priv, u16 *mtu)
1423+
{
1424+
struct mlx5_core_dev *mdev = priv->mdev;
1425+
u16 hw_mtu = 0;
1426+
int err;
14231427

1424-
netdev->mtu = MLX5E_HW2SW_MTU(hw_mtu);
1428+
err = mlx5_query_nic_vport_mtu(mdev, &hw_mtu);
1429+
if (err || !hw_mtu) /* fallback to port oper mtu */
1430+
mlx5_query_port_oper_mtu(mdev, &hw_mtu, 1);
1431+
1432+
*mtu = MLX5E_HW2SW_MTU(hw_mtu);
1433+
}
1434+
1435+
static int mlx5e_set_dev_port_mtu(struct net_device *netdev)
1436+
{
1437+
struct mlx5e_priv *priv = netdev_priv(netdev);
1438+
u16 mtu;
1439+
int err;
1440+
1441+
err = mlx5e_set_mtu(priv, netdev->mtu);
1442+
if (err)
1443+
return err;
1444+
1445+
mlx5e_query_mtu(priv, &mtu);
1446+
if (mtu != netdev->mtu)
1447+
netdev_warn(netdev, "%s: VPort MTU %d is different than netdev mtu %d\n",
1448+
__func__, mtu, netdev->mtu);
1449+
1450+
netdev->mtu = mtu;
14251451
return 0;
14261452
}
14271453

@@ -1999,22 +2025,27 @@ static int mlx5e_set_features(struct net_device *netdev,
19992025
return err;
20002026
}
20012027

2028+
#define MXL5_HW_MIN_MTU 64
2029+
#define MXL5E_MIN_MTU (MXL5_HW_MIN_MTU + ETH_FCS_LEN)
2030+
20022031
static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)
20032032
{
20042033
struct mlx5e_priv *priv = netdev_priv(netdev);
20052034
struct mlx5_core_dev *mdev = priv->mdev;
20062035
bool was_opened;
2007-
int max_mtu;
2036+
u16 max_mtu;
2037+
u16 min_mtu;
20082038
int err = 0;
20092039

20102040
mlx5_query_port_max_mtu(mdev, &max_mtu, 1);
20112041

20122042
max_mtu = MLX5E_HW2SW_MTU(max_mtu);
2043+
min_mtu = MLX5E_HW2SW_MTU(MXL5E_MIN_MTU);
20132044

2014-
if (new_mtu > max_mtu) {
2045+
if (new_mtu > max_mtu || new_mtu < min_mtu) {
20152046
netdev_err(netdev,
2016-
"%s: Bad MTU (%d) > (%d) Max\n",
2017-
__func__, new_mtu, max_mtu);
2047+
"%s: Bad MTU (%d), valid range is: [%d..%d]\n",
2048+
__func__, new_mtu, min_mtu, max_mtu);
20182049
return -EINVAL;
20192050
}
20202051

@@ -2602,7 +2633,16 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv)
26022633
schedule_work(&priv->set_rx_mode_work);
26032634
mlx5e_disable_async_events(priv);
26042635
flush_scheduled_work();
2605-
unregister_netdev(netdev);
2636+
if (test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state)) {
2637+
netif_device_detach(netdev);
2638+
mutex_lock(&priv->state_lock);
2639+
if (test_bit(MLX5E_STATE_OPENED, &priv->state))
2640+
mlx5e_close_locked(netdev);
2641+
mutex_unlock(&priv->state_lock);
2642+
} else {
2643+
unregister_netdev(netdev);
2644+
}
2645+
26062646
mlx5e_tc_cleanup(priv);
26072647
mlx5e_vxlan_cleanup(priv);
26082648
mlx5e_destroy_flow_tables(priv);
@@ -2615,7 +2655,9 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv)
26152655
mlx5_core_dealloc_transport_domain(priv->mdev, priv->tdn);
26162656
mlx5_core_dealloc_pd(priv->mdev, priv->pdn);
26172657
mlx5_unmap_free_uar(priv->mdev, &priv->cq_uar);
2618-
free_netdev(netdev);
2658+
2659+
if (!test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state))
2660+
free_netdev(netdev);
26192661
}
26202662

26212663
static void *mlx5e_get_netdev(void *vpriv)

‎drivers/net/ethernet/mellanox/mlx5/core/fs_core.c‎

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,33 +1065,6 @@ static struct mlx5_flow_rule *add_rule_fg(struct mlx5_flow_group *fg,
10651065
return rule;
10661066
}
10671067

1068-
static struct mlx5_flow_rule *add_rule_to_auto_fg(struct mlx5_flow_table *ft,
1069-
u8 match_criteria_enable,
1070-
u32 *match_criteria,
1071-
u32 *match_value,
1072-
u8 action,
1073-
u32 flow_tag,
1074-
struct mlx5_flow_destination *dest)
1075-
{
1076-
struct mlx5_flow_rule *rule;
1077-
struct mlx5_flow_group *g;
1078-
1079-
g = create_autogroup(ft, match_criteria_enable, match_criteria);
1080-
if (IS_ERR(g))
1081-
return (void *)g;
1082-
1083-
rule = add_rule_fg(g, match_value,
1084-
action, flow_tag, dest);
1085-
if (IS_ERR(rule)) {
1086-
/* Remove assumes refcount > 0 and autogroup creates a group
1087-
* with a refcount = 0.
1088-
*/
1089-
tree_get_node(&g->node);
1090-
tree_remove_node(&g->node);
1091-
}
1092-
return rule;
1093-
}
1094-
10951068
static struct mlx5_flow_rule *
10961069
_mlx5_add_flow_rule(struct mlx5_flow_table *ft,
10971070
u8 match_criteria_enable,
@@ -1119,8 +1092,23 @@ _mlx5_add_flow_rule(struct mlx5_flow_table *ft,
11191092
goto unlock;
11201093
}
11211094

1122-
rule = add_rule_to_auto_fg(ft, match_criteria_enable, match_criteria,
1123-
match_value, action, flow_tag, dest);
1095+
g = create_autogroup(ft, match_criteria_enable, match_criteria);
1096+
if (IS_ERR(g)) {
1097+
rule = (void *)g;
1098+
goto unlock;
1099+
}
1100+
1101+
rule = add_rule_fg(g, match_value,
1102+
action, flow_tag, dest);
1103+
if (IS_ERR(rule)) {
1104+
/* Remove assumes refcount > 0 and autogroup creates a group
1105+
* with a refcount = 0.
1106+
*/
1107+
unlock_ref_node(&ft->node);
1108+
tree_get_node(&g->node);
1109+
tree_remove_node(&g->node);
1110+
return rule;
1111+
}
11241112
unlock:
11251113
unlock_ref_node(&ft->node);
11261114
return rule;
@@ -1288,7 +1276,7 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev,
12881276
{
12891277
struct mlx5_flow_root_namespace *root_ns = dev->priv.root_ns;
12901278
int prio;
1291-
static struct fs_prio *fs_prio;
1279+
struct fs_prio *fs_prio;
12921280
struct mlx5_flow_namespace *ns;
12931281

12941282
if (!root_ns)

‎drivers/net/ethernet/mellanox/mlx5/core/main.c‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
966966
int err;
967967

968968
mutex_lock(&dev->intf_state_mutex);
969-
if (dev->interface_state == MLX5_INTERFACE_STATE_UP) {
969+
if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
970970
dev_warn(&dev->pdev->dev, "%s: interface is up, NOP\n",
971971
__func__);
972972
goto out;
@@ -1133,7 +1133,8 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
11331133
if (err)
11341134
pr_info("failed request module on %s\n", MLX5_IB_MOD);
11351135

1136-
dev->interface_state = MLX5_INTERFACE_STATE_UP;
1136+
clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state);
1137+
set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
11371138
out:
11381139
mutex_unlock(&dev->intf_state_mutex);
11391140

@@ -1207,7 +1208,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
12071208
}
12081209

12091210
mutex_lock(&dev->intf_state_mutex);
1210-
if (dev->interface_state == MLX5_INTERFACE_STATE_DOWN) {
1211+
if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) {
12111212
dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n",
12121213
__func__);
12131214
goto out;
@@ -1241,7 +1242,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
12411242
mlx5_cmd_cleanup(dev);
12421243

12431244
out:
1244-
dev->interface_state = MLX5_INTERFACE_STATE_DOWN;
1245+
clear_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
1246+
set_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state);
12451247
mutex_unlock(&dev->intf_state_mutex);
12461248
return err;
12471249
}
@@ -1452,13 +1454,27 @@ static const struct pci_error_handlers mlx5_err_handler = {
14521454
.resume = mlx5_pci_resume
14531455
};
14541456

1457+
static void shutdown(struct pci_dev *pdev)
1458+
{
1459+
struct mlx5_core_dev *dev = pci_get_drvdata(pdev);
1460+
struct mlx5_priv *priv = &dev->priv;
1461+
1462+
dev_info(&pdev->dev, "Shutdown was called\n");
1463+
/* Notify mlx5 clients that the kernel is being shut down */
1464+
set_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &dev->intf_state);
1465+
mlx5_unload_one(dev, priv);
1466+
mlx5_pci_disable_device(dev);
1467+
}
1468+
14551469
static const struct pci_device_id mlx5_core_pci_table[] = {
14561470
{ PCI_VDEVICE(MELLANOX, 0x1011) }, /* Connect-IB */
14571471
{ PCI_VDEVICE(MELLANOX, 0x1012), MLX5_PCI_DEV_IS_VF}, /* Connect-IB VF */
14581472
{ PCI_VDEVICE(MELLANOX, 0x1013) }, /* ConnectX-4 */
14591473
{ PCI_VDEVICE(MELLANOX, 0x1014), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4 VF */
14601474
{ PCI_VDEVICE(MELLANOX, 0x1015) }, /* ConnectX-4LX */
14611475
{ PCI_VDEVICE(MELLANOX, 0x1016), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4LX VF */
1476+
{ PCI_VDEVICE(MELLANOX, 0x1017) }, /* ConnectX-5 */
1477+
{ PCI_VDEVICE(MELLANOX, 0x1018), MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 VF */
14621478
{ 0, }
14631479
};
14641480

@@ -1469,6 +1485,7 @@ static struct pci_driver mlx5_core_driver = {
14691485
.id_table = mlx5_core_pci_table,
14701486
.probe = init_one,
14711487
.remove = remove_one,
1488+
.shutdown = shutdown,
14721489
.err_handler = &mlx5_err_handler,
14731490
.sriov_configure = mlx5_core_sriov_configure,
14741491
};

‎drivers/net/ethernet/mellanox/mlx5/core/port.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ int mlx5_query_port_admin_status(struct mlx5_core_dev *dev,
247247
}
248248
EXPORT_SYMBOL_GPL(mlx5_query_port_admin_status);
249249

250-
static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, int *admin_mtu,
251-
int *max_mtu, int *oper_mtu, u8 port)
250+
static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, u16 *admin_mtu,
251+
u16 *max_mtu, u16 *oper_mtu, u8 port)
252252
{
253253
u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
254254
u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
@@ -268,7 +268,7 @@ static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, int *admin_mtu,
268268
*admin_mtu = MLX5_GET(pmtu_reg, out, admin_mtu);
269269
}
270270

271-
int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port)
271+
int mlx5_set_port_mtu(struct mlx5_core_dev *dev, u16 mtu, u8 port)
272272
{
273273
u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
274274
u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
@@ -283,14 +283,14 @@ int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port)
283283
}
284284
EXPORT_SYMBOL_GPL(mlx5_set_port_mtu);
285285

286-
void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu,
286+
void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, u16 *max_mtu,
287287
u8 port)
288288
{
289289
mlx5_query_port_mtu(dev, NULL, max_mtu, NULL, port);
290290
}
291291
EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu);
292292

293-
void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
293+
void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, u16 *oper_mtu,
294294
u8 port)
295295
{
296296
mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu, port);

0 commit comments

Comments
 (0)