Skip to content

Commit f4abf05

Browse files
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2016-08-16 This series contains fixes to e1000e, igb, ixgbe and i40e. Kshitiz Gupta provides a fix for igb to resolve the PHY delay compensation math in several functions. Jarod Wilson provides a fix for e1000e which had to broken up into 2 patches, first is prepares the driver for expanding the list of NICs that have occasional ~10 hour clock jumps when being used for PTP. Second patch actually fixes i218 silicon which has been experiencing the clock jumps while using PTP. Alex provides 2 patches for ixgbe now that he is back at Intel. First fixes setting VLNCTRL.VFE bit, which was left unchanged in earlier patches which resulted in disabling VLAN filtering for all the VFs. Second corrects the support for disabling the VLAN tag filtering via the feature bit. Lastly, David fixes i40e which was causing a kernel panic when non-contiguous traffic classes or traffic classes not starting with TC0, were configured on a link partner switch. To fix this, changed the logic when determining the total number of TCs enabled. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 647f28c + fbfe12c commit f4abf05

File tree

7 files changed

+107
-49
lines changed

7 files changed

+107
-49
lines changed

drivers/net/ethernet/intel/e1000e/82571.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,8 @@ const struct e1000_info e1000_82574_info = {
20322032
| FLAG2_DISABLE_ASPM_L0S
20332033
| FLAG2_DISABLE_ASPM_L1
20342034
| FLAG2_NO_DISABLE_RX
2035-
| FLAG2_DMA_BURST,
2035+
| FLAG2_DMA_BURST
2036+
| FLAG2_CHECK_SYSTIM_OVERFLOW,
20362037
.pba = 32,
20372038
.max_hw_frame_size = DEFAULT_JUMBO,
20382039
.get_variants = e1000_get_variants_82571,
@@ -2053,7 +2054,8 @@ const struct e1000_info e1000_82583_info = {
20532054
| FLAG_HAS_CTRLEXT_ON_LOAD,
20542055
.flags2 = FLAG2_DISABLE_ASPM_L0S
20552056
| FLAG2_DISABLE_ASPM_L1
2056-
| FLAG2_NO_DISABLE_RX,
2057+
| FLAG2_NO_DISABLE_RX
2058+
| FLAG2_CHECK_SYSTIM_OVERFLOW,
20572059
.pba = 32,
20582060
.max_hw_frame_size = DEFAULT_JUMBO,
20592061
.get_variants = e1000_get_variants_82571,

drivers/net/ethernet/intel/e1000e/e1000.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca);
452452
#define FLAG2_PCIM2PCI_ARBITER_WA BIT(11)
453453
#define FLAG2_DFLT_CRC_STRIPPING BIT(12)
454454
#define FLAG2_CHECK_RX_HWTSTAMP BIT(13)
455+
#define FLAG2_CHECK_SYSTIM_OVERFLOW BIT(14)
455456

456457
#define E1000_RX_DESC_PS(R, i) \
457458
(&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5885,7 +5885,8 @@ const struct e1000_info e1000_pch_lpt_info = {
58855885
| FLAG_HAS_JUMBO_FRAMES
58865886
| FLAG_APME_IN_WUC,
58875887
.flags2 = FLAG2_HAS_PHY_STATS
5888-
| FLAG2_HAS_EEE,
5888+
| FLAG2_HAS_EEE
5889+
| FLAG2_CHECK_SYSTIM_OVERFLOW,
58895890
.pba = 26,
58905891
.max_hw_frame_size = 9022,
58915892
.get_variants = e1000_get_variants_ich8lan,

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4302,6 +4302,42 @@ void e1000e_reinit_locked(struct e1000_adapter *adapter)
43024302
clear_bit(__E1000_RESETTING, &adapter->state);
43034303
}
43044304

4305+
/**
4306+
* e1000e_sanitize_systim - sanitize raw cycle counter reads
4307+
* @hw: pointer to the HW structure
4308+
* @systim: cycle_t value read, sanitized and returned
4309+
*
4310+
* Errata for 82574/82583 possible bad bits read from SYSTIMH/L:
4311+
* check to see that the time is incrementing at a reasonable
4312+
* rate and is a multiple of incvalue.
4313+
**/
4314+
static cycle_t e1000e_sanitize_systim(struct e1000_hw *hw, cycle_t systim)
4315+
{
4316+
u64 time_delta, rem, temp;
4317+
cycle_t systim_next;
4318+
u32 incvalue;
4319+
int i;
4320+
4321+
incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
4322+
for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
4323+
/* latch SYSTIMH on read of SYSTIML */
4324+
systim_next = (cycle_t)er32(SYSTIML);
4325+
systim_next |= (cycle_t)er32(SYSTIMH) << 32;
4326+
4327+
time_delta = systim_next - systim;
4328+
temp = time_delta;
4329+
/* VMWare users have seen incvalue of zero, don't div / 0 */
4330+
rem = incvalue ? do_div(temp, incvalue) : (time_delta != 0);
4331+
4332+
systim = systim_next;
4333+
4334+
if ((time_delta < E1000_82574_SYSTIM_EPSILON) && (rem == 0))
4335+
break;
4336+
}
4337+
4338+
return systim;
4339+
}
4340+
43054341
/**
43064342
* e1000e_cyclecounter_read - read raw cycle counter (used by time counter)
43074343
* @cc: cyclecounter structure
@@ -4312,7 +4348,7 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
43124348
cc);
43134349
struct e1000_hw *hw = &adapter->hw;
43144350
u32 systimel, systimeh;
4315-
cycle_t systim, systim_next;
4351+
cycle_t systim;
43164352
/* SYSTIMH latching upon SYSTIML read does not work well.
43174353
* This means that if SYSTIML overflows after we read it but before
43184354
* we read SYSTIMH, the value of SYSTIMH has been incremented and we
@@ -4335,33 +4371,9 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
43354371
systim = (cycle_t)systimel;
43364372
systim |= (cycle_t)systimeh << 32;
43374373

4338-
if ((hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82583)) {
4339-
u64 time_delta, rem, temp;
4340-
u32 incvalue;
4341-
int i;
4342-
4343-
/* errata for 82574/82583 possible bad bits read from SYSTIMH/L
4344-
* check to see that the time is incrementing at a reasonable
4345-
* rate and is a multiple of incvalue
4346-
*/
4347-
incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
4348-
for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
4349-
/* latch SYSTIMH on read of SYSTIML */
4350-
systim_next = (cycle_t)er32(SYSTIML);
4351-
systim_next |= (cycle_t)er32(SYSTIMH) << 32;
4352-
4353-
time_delta = systim_next - systim;
4354-
temp = time_delta;
4355-
/* VMWare users have seen incvalue of zero, don't div / 0 */
4356-
rem = incvalue ? do_div(temp, incvalue) : (time_delta != 0);
4357-
4358-
systim = systim_next;
4374+
if (adapter->flags2 & FLAG2_CHECK_SYSTIM_OVERFLOW)
4375+
systim = e1000e_sanitize_systim(hw, systim);
43594376

4360-
if ((time_delta < E1000_82574_SYSTIM_EPSILON) &&
4361-
(rem == 0))
4362-
break;
4363-
}
4364-
}
43654377
return systim;
43664378
}
43674379

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

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4554,23 +4554,38 @@ static u8 i40e_get_iscsi_tc_map(struct i40e_pf *pf)
45544554
**/
45554555
static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg)
45564556
{
4557+
int i, tc_unused = 0;
45574558
u8 num_tc = 0;
4558-
int i;
4559+
u8 ret = 0;
45594560

45604561
/* Scan the ETS Config Priority Table to find
45614562
* traffic class enabled for a given priority
4562-
* and use the traffic class index to get the
4563-
* number of traffic classes enabled
4563+
* and create a bitmask of enabled TCs
45644564
*/
4565-
for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
4566-
if (dcbcfg->etscfg.prioritytable[i] > num_tc)
4567-
num_tc = dcbcfg->etscfg.prioritytable[i];
4568-
}
4565+
for (i = 0; i < I40E_MAX_USER_PRIORITY; i++)
4566+
num_tc |= BIT(dcbcfg->etscfg.prioritytable[i]);
45694567

4570-
/* Traffic class index starts from zero so
4571-
* increment to return the actual count
4568+
/* Now scan the bitmask to check for
4569+
* contiguous TCs starting with TC0
45724570
*/
4573-
return num_tc + 1;
4571+
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
4572+
if (num_tc & BIT(i)) {
4573+
if (!tc_unused) {
4574+
ret++;
4575+
} else {
4576+
pr_err("Non-contiguous TC - Disabling DCB\n");
4577+
return 1;
4578+
}
4579+
} else {
4580+
tc_unused = 1;
4581+
}
4582+
}
4583+
4584+
/* There is always at least TC0 */
4585+
if (!ret)
4586+
ret = 1;
4587+
4588+
return ret;
45744589
}
45754590

45764591
/**

drivers/net/ethernet/intel/igb/igb_ptp.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,8 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
744744
}
745745
}
746746

747-
shhwtstamps.hwtstamp = ktime_sub_ns(shhwtstamps.hwtstamp, adjust);
747+
shhwtstamps.hwtstamp =
748+
ktime_add_ns(shhwtstamps.hwtstamp, adjust);
748749

749750
skb_tstamp_tx(adapter->ptp_tx_skb, &shhwtstamps);
750751
dev_kfree_skb_any(adapter->ptp_tx_skb);
@@ -767,13 +768,32 @@ void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector,
767768
struct sk_buff *skb)
768769
{
769770
__le64 *regval = (__le64 *)va;
771+
struct igb_adapter *adapter = q_vector->adapter;
772+
int adjust = 0;
770773

771774
/* The timestamp is recorded in little endian format.
772775
* DWORD: 0 1 2 3
773776
* Field: Reserved Reserved SYSTIML SYSTIMH
774777
*/
775-
igb_ptp_systim_to_hwtstamp(q_vector->adapter, skb_hwtstamps(skb),
778+
igb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb),
776779
le64_to_cpu(regval[1]));
780+
781+
/* adjust timestamp for the RX latency based on link speed */
782+
if (adapter->hw.mac.type == e1000_i210) {
783+
switch (adapter->link_speed) {
784+
case SPEED_10:
785+
adjust = IGB_I210_RX_LATENCY_10;
786+
break;
787+
case SPEED_100:
788+
adjust = IGB_I210_RX_LATENCY_100;
789+
break;
790+
case SPEED_1000:
791+
adjust = IGB_I210_RX_LATENCY_1000;
792+
break;
793+
}
794+
}
795+
skb_hwtstamps(skb)->hwtstamp =
796+
ktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
777797
}
778798

779799
/**
@@ -825,7 +845,7 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,
825845
}
826846
}
827847
skb_hwtstamps(skb)->hwtstamp =
828-
ktime_add_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
848+
ktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
829849

830850
/* Update the last_rx_timestamp timer in order to enable watchdog check
831851
* for error case of latched timestamp on a dropped packet.

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,6 +4100,8 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
41004100
struct ixgbe_hw *hw = &adapter->hw;
41014101
u32 vlnctrl, i;
41024102

4103+
vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4104+
41034105
switch (hw->mac.type) {
41044106
case ixgbe_mac_82599EB:
41054107
case ixgbe_mac_X540:
@@ -4112,8 +4114,7 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
41124114
/* fall through */
41134115
case ixgbe_mac_82598EB:
41144116
/* legacy case, we can just disable VLAN filtering */
4115-
vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4116-
vlnctrl &= ~(IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);
4117+
vlnctrl &= ~IXGBE_VLNCTRL_VFE;
41174118
IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
41184119
return;
41194120
}
@@ -4125,6 +4126,10 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
41254126
/* Set flag so we don't redo unnecessary work */
41264127
adapter->flags2 |= IXGBE_FLAG2_VLAN_PROMISC;
41274128

4129+
/* For VMDq and SR-IOV we must leave VLAN filtering enabled */
4130+
vlnctrl |= IXGBE_VLNCTRL_VFE;
4131+
IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
4132+
41284133
/* Add PF to all active pools */
41294134
for (i = IXGBE_VLVF_ENTRIES; --i;) {
41304135
u32 reg_offset = IXGBE_VLVFB(i * 2 + VMDQ_P(0) / 32);
@@ -4191,6 +4196,11 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
41914196
struct ixgbe_hw *hw = &adapter->hw;
41924197
u32 vlnctrl, i;
41934198

4199+
/* Set VLAN filtering to enabled */
4200+
vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4201+
vlnctrl |= IXGBE_VLNCTRL_VFE;
4202+
IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
4203+
41944204
switch (hw->mac.type) {
41954205
case ixgbe_mac_82599EB:
41964206
case ixgbe_mac_X540:
@@ -4202,10 +4212,6 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
42024212
break;
42034213
/* fall through */
42044214
case ixgbe_mac_82598EB:
4205-
vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4206-
vlnctrl &= ~IXGBE_VLNCTRL_CFIEN;
4207-
vlnctrl |= IXGBE_VLNCTRL_VFE;
4208-
IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
42094215
return;
42104216
}
42114217

@@ -9517,6 +9523,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
95179523

95189524
/* copy netdev features into list of user selectable features */
95199525
netdev->hw_features |= netdev->features |
9526+
NETIF_F_HW_VLAN_CTAG_FILTER |
95209527
NETIF_F_HW_VLAN_CTAG_RX |
95219528
NETIF_F_HW_VLAN_CTAG_TX |
95229529
NETIF_F_RXALL |

0 commit comments

Comments
 (0)