Skip to content

Commit 0b32ce6

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2020-08-14 This series contains updates to i40e and igc drivers. Vinicius fixes an issue with PTP spinlock being accessed before initialization. Przemyslaw fixes an issue with trusted VFs seeing additional traffic. Grzegorz adds a wait for pending resets on driver removal to prevent null pointer dereference. v2: Fix function parameter for hw/aq in patch 2. Fix fixes tag in patch 3. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3575938 + 5b6d4a7 commit 0b32ce6

File tree

5 files changed

+33
-14
lines changed

5 files changed

+33
-14
lines changed

drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes {
981981
#define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04
982982
#define I40E_AQC_SET_VSI_DEFAULT 0x08
983983
#define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10
984-
#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000
984+
#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000
985985
__le16 seid;
986986
__le16 vlan_tag;
987987
#define I40E_AQC_SET_VSI_VLAN_VALID 0x8000

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

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,21 @@ i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
19661966
return status;
19671967
}
19681968

1969+
/**
1970+
* i40e_is_aq_api_ver_ge
1971+
* @aq: pointer to AdminQ info containing HW API version to compare
1972+
* @maj: API major value
1973+
* @min: API minor value
1974+
*
1975+
* Assert whether current HW API version is greater/equal than provided.
1976+
**/
1977+
static bool i40e_is_aq_api_ver_ge(struct i40e_adminq_info *aq, u16 maj,
1978+
u16 min)
1979+
{
1980+
return (aq->api_maj_ver > maj ||
1981+
(aq->api_maj_ver == maj && aq->api_min_ver >= min));
1982+
}
1983+
19691984
/**
19701985
* i40e_aq_add_vsi
19711986
* @hw: pointer to the hw struct
@@ -2091,18 +2106,16 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
20912106

20922107
if (set) {
20932108
flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
2094-
if (rx_only_promisc &&
2095-
(((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) ||
2096-
(hw->aq.api_maj_ver > 1)))
2097-
flags |= I40E_AQC_SET_VSI_PROMISC_TX;
2109+
if (rx_only_promisc && i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2110+
flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
20982111
}
20992112

21002113
cmd->promiscuous_flags = cpu_to_le16(flags);
21012114

21022115
cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_UNICAST);
2103-
if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) ||
2104-
(hw->aq.api_maj_ver > 1))
2105-
cmd->valid_flags |= cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_TX);
2116+
if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2117+
cmd->valid_flags |=
2118+
cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY);
21062119

21072120
cmd->seid = cpu_to_le16(seid);
21082121
status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
@@ -2199,11 +2212,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
21992212
i40e_fill_default_direct_cmd_desc(&desc,
22002213
i40e_aqc_opc_set_vsi_promiscuous_modes);
22012214

2202-
if (enable)
2215+
if (enable) {
22032216
flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
2217+
if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2218+
flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
2219+
}
22042220

22052221
cmd->promiscuous_flags = cpu_to_le16(flags);
22062222
cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_UNICAST);
2223+
if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2224+
cmd->valid_flags |=
2225+
cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY);
22072226
cmd->seid = cpu_to_le16(seid);
22082227
cmd->vlan_tag = cpu_to_le16(vid | I40E_AQC_SET_VSI_VLAN_VALID);
22092228

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15463,6 +15463,9 @@ static void i40e_remove(struct pci_dev *pdev)
1546315463
i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), 0);
1546415464
i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), 0);
1546515465

15466+
while (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))
15467+
usleep_range(1000, 2000);
15468+
1546615469
/* no more scheduling of any task */
1546715470
set_bit(__I40E_SUSPENDED, pf->state);
1546815471
set_bit(__I40E_DOWN, pf->state);

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5142,6 +5142,8 @@ static int igc_probe(struct pci_dev *pdev,
51425142
device_set_wakeup_enable(&adapter->pdev->dev,
51435143
adapter->flags & IGC_FLAG_WOL_SUPPORTED);
51445144

5145+
igc_ptp_init(adapter);
5146+
51455147
/* reset the hardware with the new settings */
51465148
igc_reset(adapter);
51475149

@@ -5158,9 +5160,6 @@ static int igc_probe(struct pci_dev *pdev,
51585160
/* carrier off reporting is important to ethtool even BEFORE open */
51595161
netif_carrier_off(netdev);
51605162

5161-
/* do hw tstamp init after resetting */
5162-
igc_ptp_init(adapter);
5163-
51645163
/* Check if Media Autosense is enabled */
51655164
adapter->ei = *ei;
51665165

drivers/net/ethernet/intel/igc/igc_ptp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,6 @@ void igc_ptp_init(struct igc_adapter *adapter)
496496
adapter->tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE;
497497
adapter->tstamp_config.tx_type = HWTSTAMP_TX_OFF;
498498

499-
igc_ptp_reset(adapter);
500-
501499
adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps,
502500
&adapter->pdev->dev);
503501
if (IS_ERR(adapter->ptp_clock)) {

0 commit comments

Comments
 (0)