Skip to content

Commit 29ce8f9

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
include/linux/netdevice.h net/socket.c d0efb16 ("net: don't unconditionally copy_from_user a struct ifreq for socket ioctls") 876f0bf ("net: socket: simplify dev_ifconf handling") 29c4964 ("net: socket: rework compat_ifreq_ioctl()") Signed-off-by: Jakub Kicinski <[email protected]>
2 parents c3496da + 57f780f commit 29ce8f9

File tree

14 files changed

+117
-20
lines changed

14 files changed

+117
-20
lines changed

drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ static int atl_resume_common(struct device *dev, bool deep)
411411
pci_restore_state(pdev);
412412

413413
if (deep) {
414+
/* Reinitialize Nic/Vecs objects */
415+
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
416+
414417
ret = aq_nic_init(nic);
415418
if (ret)
416419
goto err_exit;

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5122,6 +5122,7 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
51225122
struct ice_hw *hw = &pf->hw;
51235123
struct sockaddr *addr = pi;
51245124
enum ice_status status;
5125+
u8 old_mac[ETH_ALEN];
51255126
u8 flags = 0;
51265127
int err = 0;
51275128
u8 *mac;
@@ -5144,8 +5145,13 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
51445145
}
51455146

51465147
netif_addr_lock_bh(netdev);
5148+
ether_addr_copy(old_mac, netdev->dev_addr);
5149+
/* change the netdev's MAC address */
5150+
memcpy(netdev->dev_addr, mac, netdev->addr_len);
5151+
netif_addr_unlock_bh(netdev);
5152+
51475153
/* Clean up old MAC filter. Not an error if old filter doesn't exist */
5148-
status = ice_fltr_remove_mac(vsi, netdev->dev_addr, ICE_FWD_TO_VSI);
5154+
status = ice_fltr_remove_mac(vsi, old_mac, ICE_FWD_TO_VSI);
51495155
if (status && status != ICE_ERR_DOES_NOT_EXIST) {
51505156
err = -EADDRNOTAVAIL;
51515157
goto err_update_filters;
@@ -5168,13 +5174,12 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
51685174
if (err) {
51695175
netdev_err(netdev, "can't set MAC %pM. filter update failed\n",
51705176
mac);
5177+
netif_addr_lock_bh(netdev);
5178+
ether_addr_copy(netdev->dev_addr, old_mac);
51715179
netif_addr_unlock_bh(netdev);
51725180
return err;
51735181
}
51745182

5175-
/* change the netdev's MAC address */
5176-
memcpy(netdev->dev_addr, mac, netdev->addr_len);
5177-
netif_addr_unlock_bh(netdev);
51785183
netdev_dbg(vsi->netdev, "updated MAC address to %pM\n",
51795184
netdev->dev_addr);
51805185

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static void ice_set_tx_tstamp(struct ice_pf *pf, bool on)
2222
return;
2323

2424
/* Set the timestamp enable flag for all the Tx rings */
25-
ice_for_each_rxq(vsi, i) {
25+
ice_for_each_txq(vsi, i) {
2626
if (!vsi->tx_rings[i])
2727
continue;
2828
vsi->tx_rings[i]->ptp_tx = on;
@@ -688,6 +688,41 @@ static int ice_ptp_cfg_clkout(struct ice_pf *pf, unsigned int chan,
688688
return -EFAULT;
689689
}
690690

691+
/**
692+
* ice_ptp_disable_all_clkout - Disable all currently configured outputs
693+
* @pf: pointer to the PF structure
694+
*
695+
* Disable all currently configured clock outputs. This is necessary before
696+
* certain changes to the PTP hardware clock. Use ice_ptp_enable_all_clkout to
697+
* re-enable the clocks again.
698+
*/
699+
static void ice_ptp_disable_all_clkout(struct ice_pf *pf)
700+
{
701+
uint i;
702+
703+
for (i = 0; i < pf->ptp.info.n_per_out; i++)
704+
if (pf->ptp.perout_channels[i].ena)
705+
ice_ptp_cfg_clkout(pf, i, NULL, false);
706+
}
707+
708+
/**
709+
* ice_ptp_enable_all_clkout - Enable all configured periodic clock outputs
710+
* @pf: pointer to the PF structure
711+
*
712+
* Enable all currently configured clock outputs. Use this after
713+
* ice_ptp_disable_all_clkout to reconfigure the output signals according to
714+
* their configuration.
715+
*/
716+
static void ice_ptp_enable_all_clkout(struct ice_pf *pf)
717+
{
718+
uint i;
719+
720+
for (i = 0; i < pf->ptp.info.n_per_out; i++)
721+
if (pf->ptp.perout_channels[i].ena)
722+
ice_ptp_cfg_clkout(pf, i, &pf->ptp.perout_channels[i],
723+
false);
724+
}
725+
691726
/**
692727
* ice_ptp_gpio_enable_e810 - Enable/disable ancillary features of PHC
693728
* @info: the driver's PTP info structure
@@ -783,12 +818,17 @@ ice_ptp_settime64(struct ptp_clock_info *info, const struct timespec64 *ts)
783818
goto exit;
784819
}
785820

821+
/* Disable periodic outputs */
822+
ice_ptp_disable_all_clkout(pf);
823+
786824
err = ice_ptp_write_init(pf, &ts64);
787825
ice_ptp_unlock(hw);
788826

789827
if (!err)
790828
ice_ptp_update_cached_phctime(pf);
791829

830+
/* Reenable periodic outputs */
831+
ice_ptp_enable_all_clkout(pf);
792832
exit:
793833
if (err) {
794834
dev_err(ice_pf_to_dev(pf), "PTP failed to set time %d\n", err);
@@ -842,8 +882,14 @@ static int ice_ptp_adjtime(struct ptp_clock_info *info, s64 delta)
842882
return -EBUSY;
843883
}
844884

885+
/* Disable periodic outputs */
886+
ice_ptp_disable_all_clkout(pf);
887+
845888
err = ice_ptp_write_adj(pf, delta);
846889

890+
/* Reenable periodic outputs */
891+
ice_ptp_enable_all_clkout(pf);
892+
847893
ice_ptp_unlock(hw);
848894

849895
if (err) {
@@ -1064,17 +1110,6 @@ static long ice_ptp_create_clock(struct ice_pf *pf)
10641110
info = &pf->ptp.info;
10651111
dev = ice_pf_to_dev(pf);
10661112

1067-
/* Allocate memory for kernel pins interface */
1068-
if (info->n_pins) {
1069-
info->pin_config = devm_kcalloc(dev, info->n_pins,
1070-
sizeof(*info->pin_config),
1071-
GFP_KERNEL);
1072-
if (!info->pin_config) {
1073-
info->n_pins = 0;
1074-
return -ENOMEM;
1075-
}
1076-
}
1077-
10781113
/* Attempt to register the clock before enabling the hardware. */
10791114
clock = ptp_clock_register(info, dev);
10801115
if (IS_ERR(clock))
@@ -1278,6 +1313,8 @@ ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)
12781313
{
12791314
u8 idx;
12801315

1316+
spin_lock(&tx->lock);
1317+
12811318
for (idx = 0; idx < tx->len; idx++) {
12821319
u8 phy_idx = idx + tx->quad_offset;
12831320

@@ -1290,6 +1327,8 @@ ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)
12901327
tx->tstamps[idx].skb = NULL;
12911328
}
12921329
}
1330+
1331+
spin_unlock(&tx->lock);
12931332
}
12941333

12951334
/**
@@ -1550,6 +1589,9 @@ void ice_ptp_release(struct ice_pf *pf)
15501589
if (!pf->ptp.clock)
15511590
return;
15521591

1592+
/* Disable periodic outputs */
1593+
ice_ptp_disable_all_clkout(pf);
1594+
15531595
ice_clear_ptp_clock_index(pf);
15541596
ptp_clock_unregister(pf->ptp.clock);
15551597
pf->ptp.clock = NULL;

drivers/net/ethernet/mellanox/mlx5/core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ int mlx5_register_device(struct mlx5_core_dev *dev)
450450
void mlx5_unregister_device(struct mlx5_core_dev *dev)
451451
{
452452
mutex_lock(&mlx5_intf_mutex);
453-
dev->priv.flags |= MLX5_PRIV_FLAGS_DISABLE_ALL_ADEV;
453+
dev->priv.flags = MLX5_PRIV_FLAGS_DISABLE_ALL_ADEV;
454454
mlx5_rescan_drivers_locked(dev);
455455
mutex_unlock(&mlx5_intf_mutex);
456456
}

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void mlx5e_tc_encap_flows_add(struct mlx5e_priv *priv,
147147
mlx5e_rep_queue_neigh_stats_work(priv);
148148

149149
list_for_each_entry(flow, flow_list, tmp_list) {
150-
if (!mlx5e_is_offloaded_flow(flow))
150+
if (!mlx5e_is_offloaded_flow(flow) || !flow_flag_test(flow, SLOW))
151151
continue;
152152
attr = flow->attr;
153153
esw_attr = attr->esw_attr;
@@ -188,7 +188,7 @@ void mlx5e_tc_encap_flows_del(struct mlx5e_priv *priv,
188188
int err;
189189

190190
list_for_each_entry(flow, flow_list, tmp_list) {
191-
if (!mlx5e_is_offloaded_flow(flow))
191+
if (!mlx5e_is_offloaded_flow(flow) || flow_flag_test(flow, SLOW))
192192
continue;
193193
attr = flow->attr;
194194
esw_attr = attr->esw_attr;

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,7 @@ bool mlx5e_tc_is_vf_tunnel(struct net_device *out_dev, struct net_device *route_
13171317
int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *route_dev, u16 *vport)
13181318
{
13191319
struct mlx5e_priv *out_priv, *route_priv;
1320+
struct mlx5_devcom *devcom = NULL;
13201321
struct mlx5_core_dev *route_mdev;
13211322
struct mlx5_eswitch *esw;
13221323
u16 vhca_id;
@@ -1328,7 +1329,24 @@ int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *ro
13281329
route_mdev = route_priv->mdev;
13291330

13301331
vhca_id = MLX5_CAP_GEN(route_mdev, vhca_id);
1332+
if (mlx5_lag_is_active(out_priv->mdev)) {
1333+
/* In lag case we may get devices from different eswitch instances.
1334+
* If we failed to get vport num, it means, mostly, that we on the wrong
1335+
* eswitch.
1336+
*/
1337+
err = mlx5_eswitch_vhca_id_to_vport(esw, vhca_id, vport);
1338+
if (err != -ENOENT)
1339+
return err;
1340+
1341+
devcom = out_priv->mdev->priv.devcom;
1342+
esw = mlx5_devcom_get_peer_data(devcom, MLX5_DEVCOM_ESW_OFFLOADS);
1343+
if (!esw)
1344+
return -ENODEV;
1345+
}
1346+
13311347
err = mlx5_eswitch_vhca_id_to_vport(esw, vhca_id, vport);
1348+
if (devcom)
1349+
mlx5_devcom_release_peer_data(devcom, MLX5_DEVCOM_ESW_OFFLOADS);
13321350
return err;
13331351
}
13341352

drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
364364
dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
365365
dest.vport.num = e->vport;
366366
dest.vport.vhca_id = MLX5_CAP_GEN(esw->dev, vhca_id);
367+
dest.vport.flags = MLX5_FLOW_DEST_VPORT_VHCA_ID;
367368
e->fwd_rule = mlx5_add_flow_rules(e->ft, spec, &flow_act, &dest, 1);
368369
if (IS_ERR(e->fwd_rule)) {
369370
mlx5_destroy_flow_group(e->fwd_grp);

drivers/net/ethernet/mellanox/mlx5/core/lag.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ static int mlx5_deactivate_lag(struct mlx5_lag *ldev)
305305
int err;
306306

307307
ldev->flags &= ~MLX5_LAG_MODE_FLAGS;
308+
mlx5_lag_mp_reset(ldev);
308309

309310
if (ldev->shared_fdb) {
310311
mlx5_eswitch_offloads_destroy_single_fdb(ldev->pf[MLX5_LAG_P1].dev->priv.eswitch,

drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,14 @@ static int mlx5_lag_fib_event(struct notifier_block *nb,
302302
return NOTIFY_DONE;
303303
}
304304

305+
void mlx5_lag_mp_reset(struct mlx5_lag *ldev)
306+
{
307+
/* Clear mfi, as it might become stale when a route delete event
308+
* has been missed, see mlx5_lag_fib_route_event().
309+
*/
310+
ldev->lag_mp.mfi = NULL;
311+
}
312+
305313
int mlx5_lag_mp_init(struct mlx5_lag *ldev)
306314
{
307315
struct lag_mp *mp = &ldev->lag_mp;

drivers/net/ethernet/mellanox/mlx5/core/lag_mp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ struct lag_mp {
2121

2222
#ifdef CONFIG_MLX5_ESWITCH
2323

24+
void mlx5_lag_mp_reset(struct mlx5_lag *ldev);
2425
int mlx5_lag_mp_init(struct mlx5_lag *ldev);
2526
void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev);
2627

2728
#else /* CONFIG_MLX5_ESWITCH */
2829

30+
static inline void mlx5_lag_mp_reset(struct mlx5_lag *ldev) {};
2931
static inline int mlx5_lag_mp_init(struct mlx5_lag *ldev) { return 0; }
3032
static inline void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev) {}
3133

0 commit comments

Comments
 (0)