Skip to content

Commit fd7ce28

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2021-06-24 This series contains updates to i40e driver only. Dinghao Liu corrects error handling for failed i40e_vsi_request_irq() call. Mateusz allows for disabling of autonegotiation for all BaseT media. Jesse corrects the multiplier being used on 5Gb speeds for PTP. Jan adds locking in paths calling i40e_setup_pf_switch() that were missing it. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 624085a + 956e759 commit fd7ce28

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,8 +1262,7 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
12621262
if (ethtool_link_ksettings_test_link_mode(&safe_ks,
12631263
supported,
12641264
Autoneg) &&
1265-
hw->phy.link_info.phy_type !=
1266-
I40E_PHY_TYPE_10GBASE_T) {
1265+
hw->phy.media_type != I40E_MEDIA_TYPE_BASET) {
12671266
netdev_info(netdev, "Autoneg cannot be disabled on this phy\n");
12681267
err = -EINVAL;
12691268
goto done;

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi);
3232
static void i40e_handle_reset_warning(struct i40e_pf *pf, bool lock_acquired);
3333
static int i40e_add_vsi(struct i40e_vsi *vsi);
3434
static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi);
35-
static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit);
35+
static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acquired);
3636
static int i40e_setup_misc_vector(struct i40e_pf *pf);
3737
static void i40e_determine_queue_usage(struct i40e_pf *pf);
3838
static int i40e_setup_pf_filter_control(struct i40e_pf *pf);
@@ -8703,6 +8703,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
87038703
dev_driver_string(&pf->pdev->dev),
87048704
dev_name(&pf->pdev->dev));
87058705
err = i40e_vsi_request_irq(vsi, int_name);
8706+
if (err)
8707+
goto err_setup_rx;
87068708

87078709
} else {
87088710
err = -EINVAL;
@@ -10569,7 +10571,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1056910571
#endif /* CONFIG_I40E_DCB */
1057010572
if (!lock_acquired)
1057110573
rtnl_lock();
10572-
ret = i40e_setup_pf_switch(pf, reinit);
10574+
ret = i40e_setup_pf_switch(pf, reinit, true);
1057310575
if (ret)
1057410576
goto end_unlock;
1057510577

@@ -14627,10 +14629,11 @@ int i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
1462714629
* i40e_setup_pf_switch - Setup the HW switch on startup or after reset
1462814630
* @pf: board private structure
1462914631
* @reinit: if the Main VSI needs to re-initialized.
14632+
* @lock_acquired: indicates whether or not the lock has been acquired
1463014633
*
1463114634
* Returns 0 on success, negative value on failure
1463214635
**/
14633-
static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)
14636+
static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1463414637
{
1463514638
u16 flags = 0;
1463614639
int ret;
@@ -14732,9 +14735,15 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)
1473214735

1473314736
i40e_ptp_init(pf);
1473414737

14738+
if (!lock_acquired)
14739+
rtnl_lock();
14740+
1473514741
/* repopulate tunnel port filters */
1473614742
udp_tunnel_nic_reset_ntf(pf->vsi[pf->lan_vsi]->netdev);
1473714743

14744+
if (!lock_acquired)
14745+
rtnl_unlock();
14746+
1473814747
return ret;
1473914748
}
1474014749

@@ -15528,7 +15537,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1552815537
pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
1552915538
}
1553015539
#endif
15531-
err = i40e_setup_pf_switch(pf, false);
15540+
err = i40e_setup_pf_switch(pf, false, false);
1553215541
if (err) {
1553315542
dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err);
1553415543
goto err_vsis;

drivers/net/ethernet/intel/i40e/i40e_ptp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
* operate with the nanosecond field directly without fear of overflow.
1212
*
1313
* Much like the 82599, the update period is dependent upon the link speed:
14-
* At 40Gb link or no link, the period is 1.6ns.
15-
* At 10Gb link, the period is multiplied by 2. (3.2ns)
14+
* At 40Gb, 25Gb, or no link, the period is 1.6ns.
15+
* At 10Gb or 5Gb link, the period is multiplied by 2. (3.2ns)
1616
* At 1Gb link, the period is multiplied by 20. (32ns)
1717
* 1588 functionality is not supported at 100Mbps.
1818
*/
1919
#define I40E_PTP_40GB_INCVAL 0x0199999999ULL
2020
#define I40E_PTP_10GB_INCVAL_MULT 2
21+
#define I40E_PTP_5GB_INCVAL_MULT 2
2122
#define I40E_PTP_1GB_INCVAL_MULT 20
2223

2324
#define I40E_PRTTSYN_CTL1_TSYNTYPE_V1 BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
@@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
465466
case I40E_LINK_SPEED_10GB:
466467
mult = I40E_PTP_10GB_INCVAL_MULT;
467468
break;
469+
case I40E_LINK_SPEED_5GB:
470+
mult = I40E_PTP_5GB_INCVAL_MULT;
471+
break;
468472
case I40E_LINK_SPEED_1GB:
469473
mult = I40E_PTP_1GB_INCVAL_MULT;
470474
break;

0 commit comments

Comments
 (0)