Commit 53467ecb authored by David S. Miller's avatar David S. Miller

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-09-09

This series contains updates to i40e and igc drivers.

Stefan Assmann changes num_vlans to u16 to fix may be used uninitialized
error and propagates error in i40_set_vsi_promisc() for i40e.

Vinicius corrects timestamping latency values for i225 devices and
accounts for TX timestamping delay for igc.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents cdb0e6dc 4406e977
...@@ -1115,7 +1115,7 @@ static int i40e_quiesce_vf_pci(struct i40e_vf *vf) ...@@ -1115,7 +1115,7 @@ static int i40e_quiesce_vf_pci(struct i40e_vf *vf)
static int i40e_getnum_vf_vsi_vlan_filters(struct i40e_vsi *vsi) static int i40e_getnum_vf_vsi_vlan_filters(struct i40e_vsi *vsi)
{ {
struct i40e_mac_filter *f; struct i40e_mac_filter *f;
int num_vlans = 0, bkt; u16 num_vlans = 0, bkt;
hash_for_each(vsi->mac_filter_hash, bkt, f, hlist) { hash_for_each(vsi->mac_filter_hash, bkt, f, hlist) {
if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID) if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID)
...@@ -1134,8 +1134,8 @@ static int i40e_getnum_vf_vsi_vlan_filters(struct i40e_vsi *vsi) ...@@ -1134,8 +1134,8 @@ static int i40e_getnum_vf_vsi_vlan_filters(struct i40e_vsi *vsi)
* *
* Called to get number of VLANs and VLAN list present in mac_filter_hash. * Called to get number of VLANs and VLAN list present in mac_filter_hash.
**/ **/
static void i40e_get_vlan_list_sync(struct i40e_vsi *vsi, int *num_vlans, static void i40e_get_vlan_list_sync(struct i40e_vsi *vsi, u16 *num_vlans,
s16 **vlan_list) s16 **vlan_list)
{ {
struct i40e_mac_filter *f; struct i40e_mac_filter *f;
int i = 0; int i = 0;
...@@ -1169,11 +1169,11 @@ static void i40e_get_vlan_list_sync(struct i40e_vsi *vsi, int *num_vlans, ...@@ -1169,11 +1169,11 @@ static void i40e_get_vlan_list_sync(struct i40e_vsi *vsi, int *num_vlans,
**/ **/
static i40e_status static i40e_status
i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
bool unicast_enable, s16 *vl, int num_vlans) bool unicast_enable, s16 *vl, u16 num_vlans)
{ {
i40e_status aq_ret, aq_tmp = 0;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status aq_ret;
int i; int i;
/* No VLAN to set promisc on, set on VSI */ /* No VLAN to set promisc on, set on VSI */
...@@ -1222,6 +1222,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, ...@@ -1222,6 +1222,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
vf->vf_id, vf->vf_id,
i40e_stat_str(&pf->hw, aq_ret), i40e_stat_str(&pf->hw, aq_ret),
i40e_aq_str(&pf->hw, aq_err)); i40e_aq_str(&pf->hw, aq_err));
if (!aq_tmp)
aq_tmp = aq_ret;
} }
aq_ret = i40e_aq_set_vsi_uc_promisc_on_vlan(hw, seid, aq_ret = i40e_aq_set_vsi_uc_promisc_on_vlan(hw, seid,
...@@ -1235,8 +1238,15 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, ...@@ -1235,8 +1238,15 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
vf->vf_id, vf->vf_id,
i40e_stat_str(&pf->hw, aq_ret), i40e_stat_str(&pf->hw, aq_ret),
i40e_aq_str(&pf->hw, aq_err)); i40e_aq_str(&pf->hw, aq_err));
if (!aq_tmp)
aq_tmp = aq_ret;
} }
} }
if (aq_tmp)
aq_ret = aq_tmp;
return aq_ret; return aq_ret;
} }
...@@ -1258,7 +1268,7 @@ static i40e_status i40e_config_vf_promiscuous_mode(struct i40e_vf *vf, ...@@ -1258,7 +1268,7 @@ static i40e_status i40e_config_vf_promiscuous_mode(struct i40e_vf *vf,
i40e_status aq_ret = I40E_SUCCESS; i40e_status aq_ret = I40E_SUCCESS;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi; struct i40e_vsi *vsi;
int num_vlans; u16 num_vlans;
s16 *vl; s16 *vl;
vsi = i40e_find_vsi_from_id(pf, vsi_id); vsi = i40e_find_vsi_from_id(pf, vsi_id);
......
...@@ -299,18 +299,14 @@ extern char igc_driver_name[]; ...@@ -299,18 +299,14 @@ extern char igc_driver_name[];
#define IGC_RX_HDR_LEN IGC_RXBUFFER_256 #define IGC_RX_HDR_LEN IGC_RXBUFFER_256
/* Transmit and receive latency (for PTP timestamps) */ /* Transmit and receive latency (for PTP timestamps) */
/* FIXME: These values were estimated using the ones that i225 has as #define IGC_I225_TX_LATENCY_10 240
* basis, they seem to provide good numbers with ptp4l/phc2sys, but we #define IGC_I225_TX_LATENCY_100 58
* need to confirm them. #define IGC_I225_TX_LATENCY_1000 80
*/ #define IGC_I225_TX_LATENCY_2500 1325
#define IGC_I225_TX_LATENCY_10 9542 #define IGC_I225_RX_LATENCY_10 6450
#define IGC_I225_TX_LATENCY_100 1024 #define IGC_I225_RX_LATENCY_100 185
#define IGC_I225_TX_LATENCY_1000 178 #define IGC_I225_RX_LATENCY_1000 300
#define IGC_I225_TX_LATENCY_2500 64 #define IGC_I225_RX_LATENCY_2500 1485
#define IGC_I225_RX_LATENCY_10 20662
#define IGC_I225_RX_LATENCY_100 2213
#define IGC_I225_RX_LATENCY_1000 448
#define IGC_I225_RX_LATENCY_2500 160
/* RX and TX descriptor control thresholds. /* RX and TX descriptor control thresholds.
* PTHRESH - MAC will consider prefetch if it has fewer than this number of * PTHRESH - MAC will consider prefetch if it has fewer than this number of
......
...@@ -364,6 +364,7 @@ static void igc_ptp_tx_hwtstamp(struct igc_adapter *adapter) ...@@ -364,6 +364,7 @@ static void igc_ptp_tx_hwtstamp(struct igc_adapter *adapter)
struct sk_buff *skb = adapter->ptp_tx_skb; struct sk_buff *skb = adapter->ptp_tx_skb;
struct skb_shared_hwtstamps shhwtstamps; struct skb_shared_hwtstamps shhwtstamps;
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
int adjust = 0;
u64 regval; u64 regval;
if (WARN_ON_ONCE(!skb)) if (WARN_ON_ONCE(!skb))
...@@ -373,6 +374,24 @@ static void igc_ptp_tx_hwtstamp(struct igc_adapter *adapter) ...@@ -373,6 +374,24 @@ static void igc_ptp_tx_hwtstamp(struct igc_adapter *adapter)
regval |= (u64)rd32(IGC_TXSTMPH) << 32; regval |= (u64)rd32(IGC_TXSTMPH) << 32;
igc_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval); igc_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
switch (adapter->link_speed) {
case SPEED_10:
adjust = IGC_I225_TX_LATENCY_10;
break;
case SPEED_100:
adjust = IGC_I225_TX_LATENCY_100;
break;
case SPEED_1000:
adjust = IGC_I225_TX_LATENCY_1000;
break;
case SPEED_2500:
adjust = IGC_I225_TX_LATENCY_2500;
break;
}
shhwtstamps.hwtstamp =
ktime_add_ns(shhwtstamps.hwtstamp, adjust);
/* Clear the lock early before calling skb_tstamp_tx so that /* Clear the lock early before calling skb_tstamp_tx so that
* applications are not woken up before the lock bit is clear. We use * applications are not woken up before the lock bit is clear. We use
* a copy of the skb pointer to ensure other threads can't change it * a copy of the skb pointer to ensure other threads can't change it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment