All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28
@ 2020-09-28 21:50 Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 02/15] igb: read PBA number from flash Tony Nguyen
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem; +Cc: Tony Nguyen, netdev, nhorman, sassmann

This series contains updates to igb, igc, and e1000e drivers.

Sven Auhagen adds XDP support for igb.

Gal Hammer allows for 82576 to display part number string correctly for
igb.

Sasha adds device IDs for i221 and i226 parts. Exposes LPI counters and
removes unused fields in structures for igc. He also adds Meteor Lake
support for e1000e.

For igc, Andre renames IGC_TSYNCTXCTL_VALID to IGC_TSYNCTXCTL_TXTT_0 to
match the datasheet and adds a warning if it's not set when expected.
Removes the PTP Tx timestamp check in igc_ptp_tx_work() as it's already
checked in the watchdog_task. Cleans up some code by removing invalid error
bits, renaming a bit to match datasheet naming, and removing a, now
unneeded, macro.

Vinicius makes changes for igc PTP: removes calling SYSTIMR to latch timer
value, stores PTP time before a reset, and rejects schedules with times in
the future.

v2: Remove 'inline' from igb_xdp_tx_queue_mapping() and igb_rx_offset()
for patch 1

The following are changes since commit bcbf1be0ad49eed35f3cf27fb668f77e0c94f5f7:
  Merge branch 'udp_tunnel-convert-Intel-drivers-with-shared-tables'
and are available in the git repository at:
  https://github.com/anguy11/next-queue.git 1GbE

Andre Guedes (4):
  igc: Rename IGC_TSYNCTXCTL_VALID macro
  igc: Don't reschedule ptp_tx work
  igc: Remove timeout check from ptp_tx work
  igc: Clean RX descriptor error flags

Gal Hammer (1):
  igb: read PBA number from flash

Sasha Neftin (5):
  igc: Add new device ID's
  igc: Expose LPI counters
  igc: Remove reset disable flag
  igc: Clean up nvm_info structure
  e1000e: Add support for Meteor Lake

Sven Auhagen (1):
  igb: add XDP support

Vinicius Costa Gomes (4):
  igc: Remove references to SYSTIMR register
  igc: Save PTP time before a reset
  igc: Export a way to read the PTP timer
  igc: Reject schedules with a base_time in the future

 drivers/net/ethernet/intel/e1000e/ethtool.c  |   2 +
 drivers/net/ethernet/intel/e1000e/hw.h       |   5 +
 drivers/net/ethernet/intel/e1000e/ich8lan.c  |   7 +
 drivers/net/ethernet/intel/e1000e/netdev.c   |   6 +
 drivers/net/ethernet/intel/e1000e/ptp.c      |   1 +
 drivers/net/ethernet/intel/igb/igb.h         |  80 +++-
 drivers/net/ethernet/intel/igb/igb_ethtool.c |   4 +
 drivers/net/ethernet/intel/igb/igb_main.c    | 437 +++++++++++++++++--
 drivers/net/ethernet/intel/igc/igc.h         |   3 +
 drivers/net/ethernet/intel/igc/igc_base.c    |   5 +
 drivers/net/ethernet/intel/igc/igc_defines.h |  16 +-
 drivers/net/ethernet/intel/igc/igc_ethtool.c |   3 +
 drivers/net/ethernet/intel/igc/igc_hw.h      |  11 +-
 drivers/net/ethernet/intel/igc/igc_main.c    |  39 +-
 drivers/net/ethernet/intel/igc/igc_ptp.c     |  58 +--
 15 files changed, 591 insertions(+), 86 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [net-next v2 02/15] igb: read PBA number from flash
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 04/15] igc: Rename IGC_TSYNCTXCTL_VALID macro Tony Nguyen
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Gal Hammer, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Gal Hammer <ghammer@redhat.com>

Fixed flash presence check for 82576 controllers so the part
number string is read and displayed correctly.

Signed-off-by: Gal Hammer <ghammer@redhat.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index e53ed2de5cce..368f950f68b1 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3532,7 +3532,9 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			  "Width x1" : "unknown"), netdev->dev_addr);
 	}
 
-	if ((hw->mac.type >= e1000_i210 ||
+	if ((hw->mac.type == e1000_82576 &&
+	     rd32(E1000_EECD) & E1000_EECD_PRES) ||
+	    (hw->mac.type >= e1000_i210 ||
 	     igb_get_flash_presence_i210(hw))) {
 		ret_val = igb_read_part_string(hw, part_str,
 					       E1000_PBANUM_LENGTH);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 04/15] igc: Rename IGC_TSYNCTXCTL_VALID macro
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 02/15] igb: read PBA number from flash Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 05/15] igc: Don't reschedule ptp_tx work Tony Nguyen
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Andre Guedes, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Andre Guedes <andre.guedes@intel.com>

Rename the IGC_TSYNCTXCTL_VALID macro to IGC_TSYNCTXCTL_TXTT_0 so it
matches the datasheet.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_defines.h | 2 +-
 drivers/net/ethernet/intel/igc/igc_ptp.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index f1f464967f87..3f5a201bda89 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -409,7 +409,7 @@
 #define IGC_IMIREXT_SIZE_BP	0x00001000  /* Packet size bypass */
 
 /* Time Sync Transmit Control bit definitions */
-#define IGC_TSYNCTXCTL_VALID			0x00000001  /* Tx timestamp valid */
+#define IGC_TSYNCTXCTL_TXTT_0			0x00000001  /* Tx timestamp reg 0 valid */
 #define IGC_TSYNCTXCTL_ENABLED			0x00000010  /* enable Tx timestamping */
 #define IGC_TSYNCTXCTL_MAX_ALLOWED_DLY_MASK	0x0000F000  /* max delay */
 #define IGC_TSYNCTXCTL_SYNC_COMP_ERR		0x20000000  /* sync err */
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index e4b8f312f97c..dbe0776a7f2f 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -429,7 +429,7 @@ static void igc_ptp_tx_work(struct work_struct *work)
 	}
 
 	tsynctxctl = rd32(IGC_TSYNCTXCTL);
-	if (tsynctxctl & IGC_TSYNCTXCTL_VALID)
+	if (tsynctxctl & IGC_TSYNCTXCTL_TXTT_0)
 		igc_ptp_tx_hwtstamp(adapter);
 	else
 		/* reschedule to check later */
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 05/15] igc: Don't reschedule ptp_tx work
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 02/15] igb: read PBA number from flash Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 04/15] igc: Rename IGC_TSYNCTXCTL_VALID macro Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 06/15] igc: Remove timeout check from " Tony Nguyen
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Andre Guedes, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Andre Guedes <andre.guedes@intel.com>

The ptp_tx work is scheduled only if TSICR.TXTS bit is set, therefore
TSYNCTXCTL.TXTT_0 bit is expected to be set when we check it igc_ptp_tx_
work(). If it isn't, something is really off and rescheduling the ptp_tx
work to check it later doesn't help much. This patch changes the code to
WARN_ON_ONCE() if this situation ever happens.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ptp.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index dbe0776a7f2f..791f406f1314 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -429,11 +429,10 @@ static void igc_ptp_tx_work(struct work_struct *work)
 	}
 
 	tsynctxctl = rd32(IGC_TSYNCTXCTL);
-	if (tsynctxctl & IGC_TSYNCTXCTL_TXTT_0)
-		igc_ptp_tx_hwtstamp(adapter);
-	else
-		/* reschedule to check later */
-		schedule_work(&adapter->ptp_tx_work);
+	if (WARN_ON_ONCE(!(tsynctxctl & IGC_TSYNCTXCTL_TXTT_0)))
+		return;
+
+	igc_ptp_tx_hwtstamp(adapter);
 }
 
 /**
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 06/15] igc: Remove timeout check from ptp_tx work
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (2 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 05/15] igc: Don't reschedule ptp_tx work Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 07/15] igc: Clean RX descriptor error flags Tony Nguyen
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Andre Guedes, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Andre Guedes <andre.guedes@intel.com>

The Tx timestamp timeout is already checked by the watchdog_task
which runs periodically. In addition to that, from the ptp_tx work
perspective, if __IGC_PTP_TX_IN_PROGRESS flag is set we always want
handle the timestamp stored in hardware and update the skb. So remove
the timeout check in igc_ptp_tx_work() function.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ptp.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 791f406f1314..61852c99815d 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -422,12 +422,6 @@ static void igc_ptp_tx_work(struct work_struct *work)
 	if (!test_bit(__IGC_PTP_TX_IN_PROGRESS, &adapter->state))
 		return;
 
-	if (time_is_before_jiffies(adapter->ptp_tx_start +
-				   IGC_PTP_TX_TIMEOUT)) {
-		igc_ptp_tx_timeout(adapter);
-		return;
-	}
-
 	tsynctxctl = rd32(IGC_TSYNCTXCTL);
 	if (WARN_ON_ONCE(!(tsynctxctl & IGC_TSYNCTXCTL_TXTT_0)))
 		return;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 07/15] igc: Clean RX descriptor error flags
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (3 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 06/15] igc: Remove timeout check from " Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 08/15] igc: Expose LPI counters Tony Nguyen
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Andre Guedes, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Andre Guedes <andre.guedes@intel.com>

i225 advanced receive descriptor doesn't have the following extend error
bits: CE, SE, SEQ, CXE. In addition to that, the bit TCPE is called L4E
in the datasheet.

Clean up the code accordingly, and get rid of the macro
IGC_RXDEXT_ERR_FRAME_ERR_MASK since it doesn't make much sense anymore.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_defines.h | 14 +-------------
 drivers/net/ethernet/intel/igc/igc_main.c    |  5 ++---
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index 3f5a201bda89..32f5fd684139 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -324,22 +324,10 @@
 /* Advanced Receive Descriptor bit definitions */
 #define IGC_RXDADV_STAT_TSIP	0x08000 /* timestamp in packet */
 
-#define IGC_RXDEXT_STATERR_CE		0x01000000
-#define IGC_RXDEXT_STATERR_SE		0x02000000
-#define IGC_RXDEXT_STATERR_SEQ		0x04000000
-#define IGC_RXDEXT_STATERR_CXE		0x10000000
-#define IGC_RXDEXT_STATERR_TCPE		0x20000000
+#define IGC_RXDEXT_STATERR_L4E		0x20000000
 #define IGC_RXDEXT_STATERR_IPE		0x40000000
 #define IGC_RXDEXT_STATERR_RXE		0x80000000
 
-/* Same mask, but for extended and packet split descriptors */
-#define IGC_RXDEXT_ERR_FRAME_ERR_MASK ( \
-	IGC_RXDEXT_STATERR_CE  |	\
-	IGC_RXDEXT_STATERR_SE  |	\
-	IGC_RXDEXT_STATERR_SEQ |	\
-	IGC_RXDEXT_STATERR_CXE |	\
-	IGC_RXDEXT_STATERR_RXE)
-
 #define IGC_MRQC_RSS_FIELD_IPV4_TCP	0x00010000
 #define IGC_MRQC_RSS_FIELD_IPV4		0x00020000
 #define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX	0x00040000
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index b46bc8ded836..7a46b22413f2 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -1433,7 +1433,7 @@ static void igc_rx_checksum(struct igc_ring *ring,
 
 	/* TCP/UDP checksum error bit is set */
 	if (igc_test_staterr(rx_desc,
-			     IGC_RXDEXT_STATERR_TCPE |
+			     IGC_RXDEXT_STATERR_L4E |
 			     IGC_RXDEXT_STATERR_IPE)) {
 		/* work around errata with sctp packets where the TCPE aka
 		 * L4E bit is set incorrectly on 64 byte (60 byte w/o crc)
@@ -1742,8 +1742,7 @@ static bool igc_cleanup_headers(struct igc_ring *rx_ring,
 				union igc_adv_rx_desc *rx_desc,
 				struct sk_buff *skb)
 {
-	if (unlikely((igc_test_staterr(rx_desc,
-				       IGC_RXDEXT_ERR_FRAME_ERR_MASK)))) {
+	if (unlikely(igc_test_staterr(rx_desc, IGC_RXDEXT_STATERR_RXE))) {
 		struct net_device *netdev = rx_ring->netdev;
 
 		if (!(netdev->features & NETIF_F_RXALL)) {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 08/15] igc: Expose LPI counters
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (4 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 07/15] igc: Clean RX descriptor error flags Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 09/15] igc: Remove references to SYSTIMR register Tony Nguyen
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Sasha Neftin, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Sasha Neftin <sasha.neftin@intel.com>

Completion to commit 900d1e8b346b ("igc: Add LPI counters")
LPI counters exposed by statistics update method.
A EEE TX LPI counter reflect the transmitter entries EEE (IEEE 802.3az)
into the LPI state. A EEE RX LPI counter reflect the receiver link
partner entries into EEE(IEEE 802.3az) LPI state.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 3 +++
 drivers/net/ethernet/intel/igc/igc_hw.h      | 2 ++
 drivers/net/ethernet/intel/igc/igc_main.c    | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 44410c2265d6..61d331ce38cd 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -321,6 +321,9 @@ static void igc_ethtool_get_regs(struct net_device *netdev,
 
 	for (i = 0; i < 8; i++)
 		regs_buff[205 + i] = rd32(IGC_ETQF(i));
+
+	regs_buff[213] = adapter->stats.tlpic;
+	regs_buff[214] = adapter->stats.rlpic;
 }
 
 static void igc_ethtool_get_wol(struct net_device *netdev,
diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index 6defdb8a31fe..b70253fb8ebc 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -244,6 +244,8 @@ struct igc_hw_stats {
 	u64 prc511;
 	u64 prc1023;
 	u64 prc1522;
+	u64 tlpic;
+	u64 rlpic;
 	u64 gprc;
 	u64 bprc;
 	u64 mprc;
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 7a46b22413f2..7576dbfdac99 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -3683,6 +3683,8 @@ void igc_update_stats(struct igc_adapter *adapter)
 	adapter->stats.prc511 += rd32(IGC_PRC511);
 	adapter->stats.prc1023 += rd32(IGC_PRC1023);
 	adapter->stats.prc1522 += rd32(IGC_PRC1522);
+	adapter->stats.tlpic += rd32(IGC_TLPIC);
+	adapter->stats.rlpic += rd32(IGC_RLPIC);
 
 	mpc = rd32(IGC_MPC);
 	adapter->stats.mpc += mpc;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 09/15] igc: Remove references to SYSTIMR register
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (5 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 08/15] igc: Expose LPI counters Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 10/15] igc: Save PTP time before a reset Tony Nguyen
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Vinicius Costa Gomes, netdev, nhorman, sassmann,
	anthony.l.nguyen, Aaron Brown

From: Vinicius Costa Gomes <vinicius.gomes@intel.com>

In i225, it's no longer necessary to use the SYSTIMR register to
latch the timer value, the timestamp is latched when SYSTIML is read.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ptp.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 61852c99815d..0300b45b36e2 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -22,11 +22,7 @@ static void igc_ptp_read_i225(struct igc_adapter *adapter,
 	struct igc_hw *hw = &adapter->hw;
 	u32 sec, nsec;
 
-	/* The timestamp latches on lowest register read. For I210/I211, the
-	 * lowest register is SYSTIMR. Since we only need to provide nanosecond
-	 * resolution, we can ignore it.
-	 */
-	rd32(IGC_SYSTIMR);
+	/* The timestamp is latched when SYSTIML is read. */
 	nsec = rd32(IGC_SYSTIML);
 	sec = rd32(IGC_SYSTIMH);
 
@@ -39,9 +35,6 @@ static void igc_ptp_write_i225(struct igc_adapter *adapter,
 {
 	struct igc_hw *hw = &adapter->hw;
 
-	/* Writing the SYSTIMR register is not necessary as it only
-	 * provides sub-nanosecond resolution.
-	 */
 	wr32(IGC_SYSTIML, ts->tv_nsec);
 	wr32(IGC_SYSTIMH, ts->tv_sec);
 }
@@ -102,10 +95,9 @@ static int igc_ptp_gettimex64_i225(struct ptp_clock_info *ptp,
 	spin_lock_irqsave(&igc->tmreg_lock, flags);
 
 	ptp_read_system_prets(sts);
-	rd32(IGC_SYSTIMR);
-	ptp_read_system_postts(sts);
 	ts->tv_nsec = rd32(IGC_SYSTIML);
 	ts->tv_sec = rd32(IGC_SYSTIMH);
+	ptp_read_system_postts(sts);
 
 	spin_unlock_irqrestore(&igc->tmreg_lock, flags);
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 10/15] igc: Save PTP time before a reset
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (6 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 09/15] igc: Remove references to SYSTIMR register Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 11/15] igc: Remove reset disable flag Tony Nguyen
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Vinicius Costa Gomes, netdev, nhorman, sassmann,
	anthony.l.nguyen, Aaron Brown

From: Vinicius Costa Gomes <vinicius.gomes@intel.com>

Many TSN features depend on the internal PTP clock, so the internal
PTP jumping when the adapter is reset can cause problems, usually in
the form of "TX Hangs" warnings in the driver.

The solution is to save the PTP time before a reset and restore it
after the reset is done. The value of the PTP time is saved before a
reset and we use the difference from CLOCK_MONOTONIC from reset time
to now, to correct what's going to be the new PTP time.

This is heavily inspired by commit bf4bf09bdd91 ("i40e: save PTP time
before a device reset").

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h      |  2 ++
 drivers/net/ethernet/intel/igc/igc_main.c |  2 ++
 drivers/net/ethernet/intel/igc/igc_ptp.c  | 28 ++++++++++++++++++++---
 3 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 2d566f3c827b..2e5720d34a16 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -215,6 +215,8 @@ struct igc_adapter {
 	spinlock_t tmreg_lock;
 	struct cyclecounter cc;
 	struct timecounter tc;
+	struct timespec64 prev_ptp_time; /* Pre-reset PTP clock */
+	ktime_t ptp_reset_start; /* Reset time in clock mono */
 };
 
 void igc_up(struct igc_adapter *adapter);
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 7576dbfdac99..1c16cd35c81c 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -3778,6 +3778,8 @@ void igc_down(struct igc_adapter *adapter)
 
 	set_bit(__IGC_DOWN, &adapter->state);
 
+	igc_ptp_suspend(adapter);
+
 	/* disable receives in the hardware */
 	rctl = rd32(IGC_RCTL);
 	wr32(IGC_RCTL, rctl & ~IGC_RCTL_EN);
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 0300b45b36e2..49abefdab26c 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -8,6 +8,7 @@
 #include <linux/pci.h>
 #include <linux/ptp_classify.h>
 #include <linux/clocksource.h>
+#include <linux/ktime.h>
 
 #define INCVALUE_MASK		0x7fffffff
 #define ISGN			0x80000000
@@ -500,6 +501,9 @@ void igc_ptp_init(struct igc_adapter *adapter)
 	adapter->tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE;
 	adapter->tstamp_config.tx_type = HWTSTAMP_TX_OFF;
 
+	adapter->prev_ptp_time = ktime_to_timespec64(ktime_get_real());
+	adapter->ptp_reset_start = ktime_get();
+
 	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps,
 						&adapter->pdev->dev);
 	if (IS_ERR(adapter->ptp_clock)) {
@@ -511,6 +515,24 @@ void igc_ptp_init(struct igc_adapter *adapter)
 	}
 }
 
+static void igc_ptp_time_save(struct igc_adapter *adapter)
+{
+	igc_ptp_read_i225(adapter, &adapter->prev_ptp_time);
+	adapter->ptp_reset_start = ktime_get();
+}
+
+static void igc_ptp_time_restore(struct igc_adapter *adapter)
+{
+	struct timespec64 ts = adapter->prev_ptp_time;
+	ktime_t delta;
+
+	delta = ktime_sub(ktime_get(), adapter->ptp_reset_start);
+
+	timespec64_add_ns(&ts, ktime_to_ns(delta));
+
+	igc_ptp_write_i225(adapter, &ts);
+}
+
 /**
  * igc_ptp_suspend - Disable PTP work items and prepare for suspend
  * @adapter: Board private structure
@@ -527,6 +549,8 @@ void igc_ptp_suspend(struct igc_adapter *adapter)
 	dev_kfree_skb_any(adapter->ptp_tx_skb);
 	adapter->ptp_tx_skb = NULL;
 	clear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);
+
+	igc_ptp_time_save(adapter);
 }
 
 /**
@@ -576,9 +600,7 @@ void igc_ptp_reset(struct igc_adapter *adapter)
 
 	/* Re-initialize the timer. */
 	if (hw->mac.type == igc_i225) {
-		struct timespec64 ts64 = ktime_to_timespec64(ktime_get_real());
-
-		igc_ptp_write_i225(adapter, &ts64);
+		igc_ptp_time_restore(adapter);
 	} else {
 		timecounter_init(&adapter->tc, &adapter->cc,
 				 ktime_to_ns(ktime_get_real()));
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 11/15] igc: Remove reset disable flag
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (7 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 10/15] igc: Save PTP time before a reset Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 12/15] igc: Export a way to read the PTP timer Tony Nguyen
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Sasha Neftin, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Sasha Neftin <sasha.neftin@intel.com>

Boolean reset disable flag not applicable for i225 device and
could be removed.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_hw.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index b70253fb8ebc..17d6669959db 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -158,7 +158,6 @@ struct igc_phy_info {
 	u8 mdix;
 
 	bool is_mdix;
-	bool reset_disable;
 	bool speed_downgraded;
 	bool autoneg_wait_to_complete;
 };
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 12/15] igc: Export a way to read the PTP timer
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (8 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 11/15] igc: Remove reset disable flag Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 13/15] igc: Reject schedules with a base_time in the future Tony Nguyen
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Vinicius Costa Gomes, netdev, nhorman, sassmann,
	anthony.l.nguyen, Aaron Brown

From: Vinicius Costa Gomes <vinicius.gomes@intel.com>

The next patch will need a way to retrieve the current timestamp from
the NIC's PTP clock.

The 'i225' suffix is removed, if anything model specific is needed,
those specifics should be hidden by this function.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h     | 1 +
 drivers/net/ethernet/intel/igc/igc_ptp.c | 7 +++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 2e5720d34a16..35baae900c1f 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -550,6 +550,7 @@ void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, void *va,
 int igc_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
 int igc_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
 void igc_ptp_tx_hang(struct igc_adapter *adapter);
+void igc_ptp_read(struct igc_adapter *adapter, struct timespec64 *ts);
 
 #define igc_rx_pg_size(_ring) (PAGE_SIZE << igc_rx_pg_order(_ring))
 
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 49abefdab26c..ac0b9c85da7c 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -17,8 +17,7 @@
 #define IGC_PTP_TX_TIMEOUT		(HZ * 15)
 
 /* SYSTIM read access for I225 */
-static void igc_ptp_read_i225(struct igc_adapter *adapter,
-			      struct timespec64 *ts)
+void igc_ptp_read(struct igc_adapter *adapter, struct timespec64 *ts)
 {
 	struct igc_hw *hw = &adapter->hw;
 	u32 sec, nsec;
@@ -75,7 +74,7 @@ static int igc_ptp_adjtime_i225(struct ptp_clock_info *ptp, s64 delta)
 
 	spin_lock_irqsave(&igc->tmreg_lock, flags);
 
-	igc_ptp_read_i225(igc, &now);
+	igc_ptp_read(igc, &now);
 	now = timespec64_add(now, then);
 	igc_ptp_write_i225(igc, (const struct timespec64 *)&now);
 
@@ -517,7 +516,7 @@ void igc_ptp_init(struct igc_adapter *adapter)
 
 static void igc_ptp_time_save(struct igc_adapter *adapter)
 {
-	igc_ptp_read_i225(adapter, &adapter->prev_ptp_time);
+	igc_ptp_read(adapter, &adapter->prev_ptp_time);
 	adapter->ptp_reset_start = ktime_get();
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 13/15] igc: Reject schedules with a base_time in the future
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (9 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 12/15] igc: Export a way to read the PTP timer Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 14/15] igc: Clean up nvm_info structure Tony Nguyen
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Vinicius Costa Gomes, netdev, nhorman, sassmann,
	anthony.l.nguyen, Aaron Brown

From: Vinicius Costa Gomes <vinicius.gomes@intel.com>

When we set the BASET registers of i225 with a base_time in the
future, i225 will "hold" all packets until that base_time is reached,
causing a lot of TX Hangs.

As this behaviour seems contrary to the expectations of the IEEE
802.1Q standard (section 8.6.9, especially 8.6.9.4.5), let's start by
rejecting these types of schedules. If this is too limiting, we can
for example, setup a timer to configure the BASET registers closer to
the start time, only blocking the packets for a "short" while.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 25 +++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 1c16cd35c81c..569747bbefd8 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -4702,14 +4702,35 @@ static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
 	return 0;
 }
 
-static bool validate_schedule(const struct tc_taprio_qopt_offload *qopt)
+static bool is_base_time_past(ktime_t base_time, const struct timespec64 *now)
+{
+	struct timespec64 b;
+
+	b = ktime_to_timespec64(base_time);
+
+	return timespec64_compare(now, &b) > 0;
+}
+
+static bool validate_schedule(struct igc_adapter *adapter,
+			      const struct tc_taprio_qopt_offload *qopt)
 {
 	int queue_uses[IGC_MAX_TX_QUEUES] = { };
+	struct timespec64 now;
 	size_t n;
 
 	if (qopt->cycle_time_extension)
 		return false;
 
+	igc_ptp_read(adapter, &now);
+
+	/* If we program the controller's BASET registers with a time
+	 * in the future, it will hold all the packets until that
+	 * time, causing a lot of TX Hangs, so to avoid that, we
+	 * reject schedules that would start in the future.
+	 */
+	if (!is_base_time_past(qopt->base_time, &now))
+		return false;
+
 	for (n = 0; n < qopt->num_entries; n++) {
 		const struct tc_taprio_sched_entry *e;
 		int i;
@@ -4764,7 +4785,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
 	if (adapter->base_time)
 		return -EALREADY;
 
-	if (!validate_schedule(qopt))
+	if (!validate_schedule(adapter, qopt))
 		return -EINVAL;
 
 	adapter->cycle_time = qopt->cycle_time;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 14/15] igc: Clean up nvm_info structure
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (10 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 13/15] igc: Reject schedules with a base_time in the future Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:50 ` [net-next v2 15/15] e1000e: Add support for Meteor Lake Tony Nguyen
  2020-09-28 21:54 ` [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 David Miller
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Sasha Neftin, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Sasha Neftin <sasha.neftin@intel.com>

flash_bank_size and flash_base_addr field not in use and can
be removed from a nvm_info structure

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_hw.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index 17d6669959db..55dae7c4703f 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -130,9 +130,6 @@ struct igc_nvm_info {
 	struct igc_nvm_operations ops;
 	enum igc_nvm_type type;
 
-	u32 flash_bank_size;
-	u32 flash_base_addr;
-
 	u16 word_size;
 	u16 delay_usec;
 	u16 address_bits;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [net-next v2 15/15] e1000e: Add support for Meteor Lake
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (11 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 14/15] igc: Clean up nvm_info structure Tony Nguyen
@ 2020-09-28 21:50 ` Tony Nguyen
  2020-09-28 21:54 ` [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 David Miller
  13 siblings, 0 replies; 15+ messages in thread
From: Tony Nguyen @ 2020-09-28 21:50 UTC (permalink / raw)
  To: davem
  Cc: Sasha Neftin, netdev, nhorman, sassmann, anthony.l.nguyen, Aaron Brown

From: Sasha Neftin <sasha.neftin@intel.com>

Add devices IDs for the next LOM generations that will be
available on the next Intel Client platform (Meteor Lake)
This patch provides the initial support for these devices

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/e1000e/ethtool.c | 2 ++
 drivers/net/ethernet/intel/e1000e/hw.h      | 5 +++++
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 7 +++++++
 drivers/net/ethernet/intel/e1000e/netdev.c  | 6 ++++++
 drivers/net/ethernet/intel/e1000e/ptp.c     | 1 +
 5 files changed, 21 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index a8fc9208382c..03215b0aee4b 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -895,6 +895,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		mask |= BIT(18);
 		break;
 	default:
@@ -1560,6 +1561,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		fext_nvm11 = er32(FEXTNVM11);
 		fext_nvm11 &= ~E1000_FEXTNVM11_DISABLE_MULR_FIX;
 		ew32(FEXTNVM11, fext_nvm11);
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index b1447221669e..69a2329ea463 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -102,6 +102,10 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_ADP_I219_V16		0x1A1F
 #define E1000_DEV_ID_PCH_ADP_I219_LM17		0x1A1C
 #define E1000_DEV_ID_PCH_ADP_I219_V17		0x1A1D
+#define E1000_DEV_ID_PCH_MTP_I219_LM18		0x550A
+#define E1000_DEV_ID_PCH_MTP_I219_V18		0x550B
+#define E1000_DEV_ID_PCH_MTP_I219_LM19		0x550C
+#define E1000_DEV_ID_PCH_MTP_I219_V19		0x550D
 
 #define E1000_REVISION_4	4
 
@@ -127,6 +131,7 @@ enum e1000_mac_type {
 	e1000_pch_cnp,
 	e1000_pch_tgp,
 	e1000_pch_adp,
+	e1000_pch_mtp,
 };
 
 enum e1000_media_type {
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index ded74304e8cf..9aa6fad8ed47 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -320,6 +320,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		if (e1000_phy_is_accessible_pchlan(hw))
 			break;
 
@@ -464,6 +465,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
 		case e1000_pch_cnp:
 		case e1000_pch_tgp:
 		case e1000_pch_adp:
+		case e1000_pch_mtp:
 			/* In case the PHY needs to be in mdio slow mode,
 			 * set slow mode and try to get the PHY id again.
 			 */
@@ -708,6 +710,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 	case e1000_pchlan:
 		/* check management mode */
 		mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan;
@@ -1648,6 +1651,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		rc = e1000_init_phy_params_pchlan(hw);
 		break;
 	default:
@@ -2102,6 +2106,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
 		break;
 	default:
@@ -3145,6 +3150,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		bank1_offset = nvm->flash_bank_size;
 		act_offset = E1000_ICH_NVM_SIG_WORD;
 
@@ -4090,6 +4096,7 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		word = NVM_COMPAT;
 		valid_csum_mask = NVM_COMPAT_VALID_CSUM;
 		break;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 99f4ec9b5696..b30f00891c03 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3587,6 +3587,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
 			/* Stable 24MHz frequency */
 			incperiod = INCPERIOD_24MHZ;
@@ -4104,6 +4105,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		fc->refresh_time = 0xFFFF;
 		fc->pause_time = 0xFFFF;
 
@@ -7877,6 +7879,10 @@ static const struct pci_device_id e1000_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16), board_pch_cnp },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17), board_pch_cnp },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_cnp },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_cnp },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_cnp },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM19), board_pch_cnp },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V19), board_pch_cnp },
 
 	{ 0, 0, 0, 0, 0, 0, 0 }	/* terminate list */
 };
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
index 8d21bcb427ec..f3f671311855 100644
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -297,6 +297,7 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
 	case e1000_pch_cnp:
 	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
 		if ((hw->mac.type < e1000_pch_lpt) ||
 		    (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)) {
 			adapter->ptp_clock_info.max_adj = 24000000 - 1;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28
  2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
                   ` (12 preceding siblings ...)
  2020-09-28 21:50 ` [net-next v2 15/15] e1000e: Add support for Meteor Lake Tony Nguyen
@ 2020-09-28 21:54 ` David Miller
  13 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2020-09-28 21:54 UTC (permalink / raw)
  To: anthony.l.nguyen; +Cc: netdev, nhorman, sassmann

From: Tony Nguyen <anthony.l.nguyen@intel.com>
Date: Mon, 28 Sep 2020 14:50:03 -0700

> This series contains updates to igb, igc, and e1000e drivers.
 ...
>   https://github.com/anguy11/next-queue.git 1GbE

Pulled, thanks Tony.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-09-29  2:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 21:50 [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 Tony Nguyen
2020-09-28 21:50 ` [net-next v2 02/15] igb: read PBA number from flash Tony Nguyen
2020-09-28 21:50 ` [net-next v2 04/15] igc: Rename IGC_TSYNCTXCTL_VALID macro Tony Nguyen
2020-09-28 21:50 ` [net-next v2 05/15] igc: Don't reschedule ptp_tx work Tony Nguyen
2020-09-28 21:50 ` [net-next v2 06/15] igc: Remove timeout check from " Tony Nguyen
2020-09-28 21:50 ` [net-next v2 07/15] igc: Clean RX descriptor error flags Tony Nguyen
2020-09-28 21:50 ` [net-next v2 08/15] igc: Expose LPI counters Tony Nguyen
2020-09-28 21:50 ` [net-next v2 09/15] igc: Remove references to SYSTIMR register Tony Nguyen
2020-09-28 21:50 ` [net-next v2 10/15] igc: Save PTP time before a reset Tony Nguyen
2020-09-28 21:50 ` [net-next v2 11/15] igc: Remove reset disable flag Tony Nguyen
2020-09-28 21:50 ` [net-next v2 12/15] igc: Export a way to read the PTP timer Tony Nguyen
2020-09-28 21:50 ` [net-next v2 13/15] igc: Reject schedules with a base_time in the future Tony Nguyen
2020-09-28 21:50 ` [net-next v2 14/15] igc: Clean up nvm_info structure Tony Nguyen
2020-09-28 21:50 ` [net-next v2 15/15] e1000e: Add support for Meteor Lake Tony Nguyen
2020-09-28 21:54 ` [net-next v2 00/15] 1GbE Intel Wired LAN Driver Updates 2020-09-28 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.