All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-01-10  8:58 Jeff Kirsher
  2014-01-10  8:58 ` [net-next 01/16] i40e: use assignment instead of memcpy Jeff Kirsher
                   ` (16 more replies)
  0 siblings, 17 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to i40e only.

Most notable is Jacob's patch to add PTP support to i40e.

Mitch cleans up additional memcpy's and use struct assignment instead.
Then fixes long lines to appease checkpatch.pl.  Mitch then provides
a fix to keep us from spamming the log with confusing errors.  If you
use ip to change the MAC address of a VF while the VF driver is loaded,
closing the VF interface or unloading the VF driver will cause the VF
driver to remove the MAC filter for its original (now invalid) MAC
address.

Jesse cleans up macros which are no longer needed or used.

I (Jeff) cleanup function header comments to ensure Doxygen/kdoc works
correctly to generate documentation without warnings.

Anjali fixes a bug where ethtool set-channels would return failure when
configuring only one Rx queue.  Then fixes a bug where the driver was
erroneously exiting the driver unload path if one part of the unload
failed.

Shannon fixes if the IPV6EXADD but is set in the Rx descriptor status,
there was an optional extension header with an alternate IP address
detected and the hardware checksum was not handling the alternate IP
address correctly.  Then adjusts the ITR max and min values to match
the hardware max value and recommended min value.  Shannon makes sure
to clear the PXE mode after the adminq is initialized.

The following are changes since commit 11b57f90257c1d6a91cee720151b69e0c2020cf6:
  xen-netback: stop vif thread spinning if frontend is unresponsive
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Anjali Singhai Jain (3):
  i40e: Update the Current NVM version Low value
  i40e: Setting queue count to 1 using ethtool is valid
  i40e: do not bail when disabling if Tx queue disable fails

Catherine Sullivan (2):
  i40e: Bump version
  i40e: Bump version

Jacob Keller (1):
  i40e: enable PTP

Jeff Kirsher (1):
  i40e: Cleanup Doxygen warnings

Jesse Brandeburg (1):
  i40e: drop unused macros

Mitch Williams (3):
  i40e: use assignment instead of memcpy
  i40e: fix long lines
  i40e: allow VF to remove any MAC filter

Shannon Nelson (5):
  i40e: check for possible incorrect ipv6 checksum
  i40e: adjust ITR max and min values
  i40e: clear qtx_head before enabling Tx queue
  i40e: call clear_pxe after adminq is initialized
  i40e: fix log message wording

 drivers/net/ethernet/intel/i40e/Makefile           |   2 +
 drivers/net/ethernet/intel/i40e/i40e.h             |  26 +-
 drivers/net/ethernet/intel/i40e/i40e_adminq.c      |  28 +-
 drivers/net/ethernet/intel/i40e/i40e_common.c      |  23 +-
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c     |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  35 +-
 drivers/net/ethernet/intel/i40e/i40e_hmc.c         |   8 +-
 drivers/net/ethernet/intel/i40e/i40e_hmc.h         |   3 -
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  63 +-
 drivers/net/ethernet/intel/i40e/i40e_nvm.c         |   1 +
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |   4 +-
 drivers/net/ethernet/intel/i40e/i40e_ptp.c         | 640 +++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |  57 ++
 drivers/net/ethernet/intel/i40e/i40e_txrx.h        |   8 +-
 drivers/net/ethernet/intel/i40e/i40e_type.h        |  13 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   8 +-
 16 files changed, 859 insertions(+), 62 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/i40e/i40e_ptp.c

-- 
1.8.3.1

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

* [net-next 01/16] i40e: use assignment instead of memcpy
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 02/16] i40e: drop unused macros Jeff Kirsher
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

These instances were found by coccinelle/spatch, and can
use struct assignment instead of memcpy.

Change-ID: Idc23c3599241bf8a658bda18c80417af3fbfee66
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_common.c | 3 +--
 drivers/net/ethernet/intel/i40e/i40e_hmc.c    | 8 +++-----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index c75aa2d..4e5a02c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -922,7 +922,7 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
 			   "AQRX: Event received with error 0x%X.\n",
 			   hw->aq.arq_last_status);
 	} else {
-		memcpy(&e->desc, desc, sizeof(struct i40e_aq_desc));
+		e->desc = *desc;
 		datalen = le16_to_cpu(desc->datalen);
 		e->msg_size = min(datalen, e->msg_size);
 		if (e->msg_buf != NULL && (e->msg_size != 0))
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 807312b..6bfbeec 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -599,8 +599,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
 		goto aq_get_link_info_exit;
 
 	/* save off old link status information */
-	memcpy(&hw->phy.link_info_old, hw_link_info,
-	       sizeof(struct i40e_link_status));
+	hw->phy.link_info_old = *hw_link_info;
 
 	/* update link status */
 	hw_link_info->phy_type = (enum i40e_aq_phy_type)resp->phy_type;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
index 76dfef3..bf2d4cc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
@@ -89,11 +89,9 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
 			sd_entry->u.pd_table.pd_entry =
 				(struct i40e_hmc_pd_entry *)
 				sd_entry->u.pd_table.pd_entry_virt_mem.va;
-			memcpy(&sd_entry->u.pd_table.pd_page_addr, &mem,
-			       sizeof(struct i40e_dma_mem));
+			sd_entry->u.pd_table.pd_page_addr = mem;
 		} else {
-			memcpy(&sd_entry->u.bp.addr, &mem,
-			       sizeof(struct i40e_dma_mem));
+			sd_entry->u.bp.addr = mem;
 			sd_entry->u.bp.sd_pd_index = sd_index;
 		}
 		/* initialize the sd entry */
@@ -164,7 +162,7 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
 		if (ret_code)
 			goto exit;
 
-		memcpy(&pd_entry->bp.addr, &mem, sizeof(struct i40e_dma_mem));
+		pd_entry->bp.addr = mem;
 		pd_entry->bp.sd_pd_index = pd_index;
 		pd_entry->bp.entry_type = I40E_SD_TYPE_PAGED;
 		/* Set page address and valid bit */
-- 
1.8.3.1

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

* [net-next 02/16] i40e: drop unused macros
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-01-10  8:58 ` [net-next 01/16] i40e: use assignment instead of memcpy Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 03/16] i40e: Update the Current NVM version Low value Jeff Kirsher
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, gospo, sassmann, Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

A previous commit removed any need for these macros, so remove
them too.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_type.h | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 12473ad..072c850 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -60,15 +60,6 @@
 /* Max default timeout in ms, */
 #define I40E_MAX_NVM_TIMEOUT		18000
 
-/* Check whether address is multicast.  This is little-endian specific check.*/
-#define I40E_IS_MULTICAST(address)	\
-	(bool)(((u8 *)(address))[0] & ((u8)0x01))
-
-/* Check whether an address is broadcast. */
-#define I40E_IS_BROADCAST(address)	\
-	((((u8 *)(address))[0] == ((u8)0xff)) && \
-	(((u8 *)(address))[1] == ((u8)0xff)))
-
 /* Switch from mc to the 2usec global time (this is the GTIME resolution) */
 #define I40E_MS_TO_GTIME(time)		(((time) * 1000) / 2)
 
-- 
1.8.3.1

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

* [net-next 03/16] i40e: Update the Current NVM version Low value
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-01-10  8:58 ` [net-next 01/16] i40e: use assignment instead of memcpy Jeff Kirsher
  2014-01-10  8:58 ` [net-next 02/16] i40e: drop unused macros Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 04/16] i40e: Bump version Jeff Kirsher
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Jesse Brandeburg,
	Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

The current driver will warn the user if the NVM version
is out of date, this raises the bar to a newer version.

Change-ID: I5ec21d8efa4e7c3fdacb56f85d310bb2229b1483
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 4d4cdbf..7dab660 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -88,7 +88,7 @@
 
 /* The values in here are decimal coded as hex as is the case in the NVM map*/
 #define I40E_CURRENT_NVM_VERSION_HI 0x2
-#define I40E_CURRENT_NVM_VERSION_LO 0x1
+#define I40E_CURRENT_NVM_VERSION_LO 0x30
 
 
 /* magic for getting defines into strings */
-- 
1.8.3.1

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

* [net-next 04/16] i40e: Bump version
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (2 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 03/16] i40e: Update the Current NVM version Low value Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 05/16] i40e: fix long lines Jeff Kirsher
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Catherine Sullivan, netdev, gospo, sassmann, Jesse Brandeburg,
	Jeff Kirsher

From: Catherine Sullivan <catherine.sullivan@intel.com>

Update driver version to 0.3.27-k

Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 1b792ee..80c83eb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -38,7 +38,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 0
 #define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 25
+#define DRV_VERSION_BUILD 27
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
-- 
1.8.3.1

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

* [net-next 05/16] i40e: fix long lines
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (3 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 04/16] i40e: Bump version Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  9:07   ` Joe Perches
  2014-01-10  8:58 ` [net-next 06/16] i40e: Cleanup Doxygen warnings Jeff Kirsher
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

Avoid over-length lines in order to appease checkpatch.

Change-ID: I63820a710acf798f49d2f85c610228711af84f72
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 3 ++-
 drivers/net/ethernet/intel/i40e/i40e_prototype.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 6bfbeec..1bf0ec1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -681,7 +681,8 @@ aq_add_vsi_exit:
  * @cmd_details: pointer to command details structure or NULL
  **/
 i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
-				u16 seid, bool set, struct i40e_asq_cmd_details *cmd_details)
+				u16 seid, bool set,
+				struct i40e_asq_cmd_details *cmd_details)
 {
 	struct i40e_aq_desc desc;
 	struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index c7c3d82..f8c53a6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -93,9 +93,9 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
 				u16 vsi_id, bool set_filter,
 				struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
-				u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
+		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
-				u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
+		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw,
 				struct i40e_vsi_context *vsi_ctx,
 				struct i40e_asq_cmd_details *cmd_details);
-- 
1.8.3.1

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

* [net-next 06/16] i40e: Cleanup Doxygen warnings
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (4 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 05/16] i40e: fix long lines Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 07/16] i40e: Setting queue count to 1 using ethtool is valid Jeff Kirsher
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann, Jesse Brandeburg

These changes make Doxygen/kdoc work correctly without warnings.

Change-ID: I2941f38860be805ff7548d84dae35754c83f1d62
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c | 26 +++++++++++++-------------
 drivers/net/ethernet/intel/i40e/i40e_common.c | 17 ++++++++++-------
 drivers/net/ethernet/intel/i40e/i40e_hmc.h    |  3 ---
 drivers/net/ethernet/intel/i40e/i40e_nvm.c    |  1 +
 4 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index 4e5a02c..a50e6b3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -128,7 +128,7 @@ static void i40e_free_adminq_arq(struct i40e_hw *hw)
 
 /**
  *  i40e_alloc_arq_bufs - Allocate pre-posted buffers for the receive queue
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  **/
 static i40e_status i40e_alloc_arq_bufs(struct i40e_hw *hw)
 {
@@ -195,7 +195,7 @@ unwind_alloc_arq_bufs:
 
 /**
  *  i40e_alloc_asq_bufs - Allocate empty buffer structs for the send queue
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  **/
 static i40e_status i40e_alloc_asq_bufs(struct i40e_hw *hw)
 {
@@ -235,7 +235,7 @@ unwind_alloc_asq_bufs:
 
 /**
  *  i40e_free_arq_bufs - Free receive queue buffer info elements
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  **/
 static void i40e_free_arq_bufs(struct i40e_hw *hw)
 {
@@ -254,7 +254,7 @@ static void i40e_free_arq_bufs(struct i40e_hw *hw)
 
 /**
  *  i40e_free_asq_bufs - Free send queue buffer info elements
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  **/
 static void i40e_free_asq_bufs(struct i40e_hw *hw)
 {
@@ -277,7 +277,7 @@ static void i40e_free_asq_bufs(struct i40e_hw *hw)
 
 /**
  *  i40e_config_asq_regs - configure ASQ registers
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  *
  *  Configure base address and length registers for the transmit queue
  **/
@@ -304,7 +304,7 @@ static void i40e_config_asq_regs(struct i40e_hw *hw)
 
 /**
  *  i40e_config_arq_regs - ARQ register configuration
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  *
  * Configure base address and length registers for the receive (event queue)
  **/
@@ -334,7 +334,7 @@ static void i40e_config_arq_regs(struct i40e_hw *hw)
 
 /**
  *  i40e_init_asq - main initialization routine for ASQ
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  *
  *  This is the main initialization routine for the Admin Send Queue
  *  Prior to calling this function, drivers *MUST* set the following fields
@@ -391,7 +391,7 @@ init_adminq_exit:
 
 /**
  *  i40e_init_arq - initialize ARQ
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  *
  *  The main initialization routine for the Admin Receive (Event) Queue.
  *  Prior to calling this function, drivers *MUST* set the following fields
@@ -448,7 +448,7 @@ init_adminq_exit:
 
 /**
  *  i40e_shutdown_asq - shutdown the ASQ
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  *
  *  The main shutdown routine for the Admin Send Queue
  **/
@@ -479,7 +479,7 @@ static i40e_status i40e_shutdown_asq(struct i40e_hw *hw)
 
 /**
  *  i40e_shutdown_arq - shutdown ARQ
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  *
  *  The main shutdown routine for the Admin Receive Queue
  **/
@@ -510,7 +510,7 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)
 
 /**
  *  i40e_init_adminq - main initialization routine for Admin Queue
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  *
  *  Prior to calling this function, drivers *MUST* set the following fields
  *  in the hw->aq structure:
@@ -607,7 +607,7 @@ init_adminq_exit:
 
 /**
  *  i40e_shutdown_adminq - shutdown routine for the Admin Queue
- *  @hw:     pointer to the hardware structure
+ *  @hw: pointer to the hardware structure
  **/
 i40e_status i40e_shutdown_adminq(struct i40e_hw *hw)
 {
@@ -626,7 +626,7 @@ i40e_status i40e_shutdown_adminq(struct i40e_hw *hw)
 
 /**
  *  i40e_clean_asq - cleans Admin send queue
- *  @asq: pointer to the adminq send ring
+ *  @hw: pointer to the hardware structure
  *
  *  returns the number of free desc
  **/
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 1bf0ec1..0b5a75c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -74,7 +74,8 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 /**
  * i40e_debug_aq
  * @hw: debug mask related to admin queue
- * @cap: pointer to adminq command descriptor
+ * @mask: debug mask
+ * @desc: pointer to admin queue descriptor
  * @buffer: pointer to command buffer
  *
  * Dumps debug log about adminq command with descriptor contents.
@@ -629,7 +630,7 @@ aq_get_link_info_exit:
 /**
  * i40e_aq_add_vsi
  * @hw: pointer to the hw struct
- * @vsi: pointer to a vsi context struct
+ * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
  *
  * Add a VSI context to the hardware.
@@ -776,7 +777,7 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
 /**
  * i40e_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
- * @vsi: pointer to a vsi context struct
+ * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
  **/
 i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw,
@@ -818,7 +819,7 @@ aq_get_vsi_params_exit:
 /**
  * i40e_aq_update_vsi_params
  * @hw: pointer to the hw struct
- * @vsi: pointer to a vsi context struct
+ * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
  *
  * Update a VSI context.
@@ -921,7 +922,6 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw,
 /**
  * i40e_aq_send_driver_version
  * @hw: pointer to the hw struct
- * @event: driver event: driver ok, start or stop
  * @dv: driver's major, minor version
  * @cmd_details: pointer to command details structure or NULL
  *
@@ -1039,10 +1039,10 @@ i40e_status i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
  * @hw: pointer to the hw struct
  * @veb_seid: the SEID of the VEB to query
  * @switch_id: the uplink switch id
- * @floating_veb: set to true if the VEB is floating
+ * @floating: set to true if the VEB is floating
  * @statistic_index: index of the stats counter block for this VEB
  * @vebs_used: number of VEB's used by function
- * @vebs_unallocated: total VEB's not reserved by any function
+ * @vebs_free: total VEB's not reserved by any function
  * @cmd_details: pointer to command details structure or NULL
  *
  * This retrieves the parameters for a particular VEB, specified by
@@ -1179,6 +1179,8 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid,
  * i40e_aq_send_msg_to_vf
  * @hw: pointer to the hardware structure
  * @vfid: vf id to send msg
+ * @v_opcode: opcodes for VF-PF communication
+ * @v_retval: return error code
  * @msg: pointer to the msg buffer
  * @msglen: msg length
  * @cmd_details: pointer to command details
@@ -1723,6 +1725,7 @@ i40e_status i40e_aq_start_lldp(struct i40e_hw *hw,
  * @udp_port: the UDP port to add
  * @header_len: length of the tunneling header length in DWords
  * @protocol_index: protocol index type
+ * @filter_index: pointer to filter index
  * @cmd_details: pointer to command details structure or NULL
  **/
 i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.h b/drivers/net/ethernet/intel/i40e/i40e_hmc.h
index 72bf30a..0cd4701 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.h
@@ -116,7 +116,6 @@ struct i40e_hmc_info {
  * @hw: pointer to our hw struct
  * @pa: pointer to physical address
  * @sd_index: segment descriptor index
- * @hmc_fn_id: hmc function id
  * @type: if sd entry is direct or paged
  **/
 #define I40E_SET_PF_SD_ENTRY(hw, pa, sd_index, type)			\
@@ -138,7 +137,6 @@ struct i40e_hmc_info {
  * I40E_CLEAR_PF_SD_ENTRY - marks the sd entry as invalid in the hardware
  * @hw: pointer to our hw struct
  * @sd_index: segment descriptor index
- * @hmc_fn_id: hmc function id
  * @type: if sd entry is direct or paged
  **/
 #define I40E_CLEAR_PF_SD_ENTRY(hw, sd_index, type)			\
@@ -159,7 +157,6 @@ struct i40e_hmc_info {
  * @hw: pointer to our hw struct
  * @sd_idx: segment descriptor index
  * @pd_idx: page descriptor index
- * @hmc_fn_id: hmc function id
  **/
 #define I40E_INVALIDATE_PF_HMC_PD(hw, sd_idx, pd_idx)			\
 	wr32((hw), I40E_PFHMC_PDINV,					\
diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 37d66c8..e12bf07 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -244,6 +244,7 @@ i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
 /**
  *  i40e_calc_nvm_checksum - Calculates and returns the checksum
  *  @hw: pointer to hardware structure
+ *  @checksum: pointer to the checksum
  *
  *  This function calculate SW Checksum that covers the whole 64kB shadow RAM
  *  except the VPD and PCIe ALT Auto-load modules. The structure and size of VPD
-- 
1.8.3.1

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

* [net-next 07/16] i40e: Setting queue count to 1 using ethtool is valid
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (5 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 06/16] i40e: Cleanup Doxygen warnings Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 08/16] i40e: do not bail when disabling if Tx queue disable fails Jeff Kirsher
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Jesse Brandeburg,
	Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

Fix a bug where ethtool set-channels would return failure when configuring
only one Rx queue.

Change-ID: Id833c48c17d71e352b30f3249f6acf9e7aaec57e
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index b886ee5..342a6e1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1634,7 +1634,7 @@ static int i40e_set_channels(struct net_device *dev,
 	 * class queue mapping
 	 */
 	new_count = i40e_reconfig_rss_queues(pf, count);
-	if (new_count > 1)
+	if (new_count > 0)
 		return 0;
 	else
 		return -EINVAL;
-- 
1.8.3.1

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

* [net-next 08/16] i40e: do not bail when disabling if Tx queue disable fails
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (6 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 07/16] i40e: Setting queue count to 1 using ethtool is valid Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 09/16] i40e: allow VF to remove any MAC filter Jeff Kirsher
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Jesse Brandeburg,
	Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

Fix a bug where the driver was erroneously exiting the driver unload
path if one part of the unload failed.  Instead of the original way
the driver should always continue when disabling and be sure to disable
all queues.

Change-ID: Ib8c81c596bc87c31d8e9ca97ebf871168475279d
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 80c83eb..65c27cb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3113,7 +3113,7 @@ static int i40e_vsi_control_rx(struct i40e_vsi *vsi, bool enable)
  **/
 int i40e_vsi_control_rings(struct i40e_vsi *vsi, bool request)
 {
-	int ret;
+	int ret = 0;
 
 	/* do rx first for enable and last for disable */
 	if (request) {
@@ -3122,10 +3122,9 @@ int i40e_vsi_control_rings(struct i40e_vsi *vsi, bool request)
 			return ret;
 		ret = i40e_vsi_control_tx(vsi, request);
 	} else {
-		ret = i40e_vsi_control_tx(vsi, request);
-		if (ret)
-			return ret;
-		ret = i40e_vsi_control_rx(vsi, request);
+		/* Ignore return value, we need to shutdown whatever we can */
+		i40e_vsi_control_tx(vsi, request);
+		i40e_vsi_control_rx(vsi, request);
 	}
 
 	return ret;
-- 
1.8.3.1

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

* [net-next 09/16] i40e: allow VF to remove any MAC filter
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (7 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 08/16] i40e: do not bail when disabling if Tx queue disable fails Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 10/16] i40e: check for possible incorrect ipv6 checksum Jeff Kirsher
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

If you use ip to change the MAC address of a VF while the VF
driver is loaded, closing the VF interface or unloading the VF
driver will cause the VF driver to remove the MAC filter for its
original (now invalid) MAC address. This would cause the PF
driver to kick an error message to the log, and back to the VF
driver.

Since the VF driver has not really done anything naughty, let's
not punish it. Don't check for MAC address overrides on the
delete operation, just make sure it's a valid address. This keeps
us from spamming the log with confusing errors.

Change-ID: I1f051bd4014e50855457d928c9ee8b0766981b2f
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 51a4f61..d04a776 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1525,9 +1525,13 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
 	}
 
 	for (i = 0; i < al->num_elements; i++) {
-		ret = i40e_check_vf_permission(vf, al->list[i].addr);
-		if (ret)
+		if (is_broadcast_ether_addr(al->list[i].addr) ||
+		    is_zero_ether_addr(al->list[i].addr)) {
+			dev_err(&pf->pdev->dev, "invalid VF MAC addr %pM\n",
+				al->list[i].addr);
+			ret = I40E_ERR_INVALID_MAC_ADDR;
 			goto error_param;
+		}
 	}
 	vsi = pf->vsi[vsi_id];
 
-- 
1.8.3.1

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

* [net-next 10/16] i40e: check for possible incorrect ipv6 checksum
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (8 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 09/16] i40e: allow VF to remove any MAC filter Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 11/16] i40e: adjust ITR max and min values Jeff Kirsher
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Shannon Nelson, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@intel.com>

If the IPV6EXADD bit is set in the Rx descriptor status, there
was an optional extension header with an alternate IP address
detected.  The HW checksum offload doesn't handle the alternate
IP address correctly so likely comes up with the wrong answer.
Thus, if the bit is set we ignore the checksum offload value.

Change-ID: I70ff8d38cdcddccf44107691cae13d0c07c284c8
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 4 ++++
 drivers/net/ethernet/intel/i40e/i40e_type.h | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 43d88dd..946d8b1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -892,6 +892,10 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
 	      rx_status & (1 << I40E_RX_DESC_STATUS_L3L4P_SHIFT)))
 		return;
 
+	/* likely incorrect csum if alternate IP extention headers found */
+	if (rx_status & (1 << I40E_RX_DESC_STATUS_IPV6EXADD_SHIFT))
+		return;
+
 	/* IP or L4 or outmost IP checksum error */
 	if (rx_error & ((1 << I40E_RX_DESC_ERROR_IPE_SHIFT) |
 			(1 << I40E_RX_DESC_ERROR_L4E_SHIFT) |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 072c850..80cf240 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -499,7 +499,9 @@ enum i40e_rx_desc_status_bits {
 	I40E_RX_DESC_STATUS_FLM_SHIFT		= 11,
 	I40E_RX_DESC_STATUS_FLTSTAT_SHIFT	= 12, /* 2 BITS */
 	I40E_RX_DESC_STATUS_LPBK_SHIFT		= 14,
-	I40E_RX_DESC_STATUS_UDP_0_SHIFT		= 16
+	I40E_RX_DESC_STATUS_IPV6EXADD_SHIFT	= 15,
+	I40E_RX_DESC_STATUS_RESERVED_SHIFT	= 16, /* 2 BITS */
+	I40E_RX_DESC_STATUS_UDP_0_SHIFT		= 18
 };
 
 #define I40E_RXD_QW1_STATUS_TSYNINDX_SHIFT   I40E_RX_DESC_STATUS_TSYNINDX_SHIFT
-- 
1.8.3.1

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

* [net-next 11/16] i40e: adjust ITR max and min values
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (9 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 10/16] i40e: check for possible incorrect ipv6 checksum Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 12/16] i40e: clear qtx_head before enabling Tx queue Jeff Kirsher
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Shannon Nelson, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@intel.com>

Set the ITR max and min values to match the hardware max value
and the recommended min value.  These values are shifted right
one bit because the register counts in 2 usec units, so leave
a comment to explain.

Change-ID: I289c27955cf6c566a6d21b95c3110b88cbb15dad
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index 6f8506c..93b8642 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -29,9 +29,8 @@
 
 /* Interrupt Throttling and Rate Limiting (storm control) Goodies */
 
-#define I40E_MAX_ITR               0x07FF
-#define I40E_MIN_ITR               0x0001
-#define I40E_ITR_USEC_RESOLUTION   2
+#define I40E_MAX_ITR               0x0FF0  /* reg uses 2 usec resolution */
+#define I40E_MIN_ITR               0x0004  /* reg uses 2 usec resolution */
 #define I40E_MAX_IRATE             0x03F
 #define I40E_MIN_IRATE             0x001
 #define I40E_IRATE_USEC_RESOLUTION 4
-- 
1.8.3.1

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

* [net-next 12/16] i40e: clear qtx_head before enabling Tx queue
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (10 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 11/16] i40e: adjust ITR max and min values Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 13/16] i40e: call clear_pxe after adminq is initialized Jeff Kirsher
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Shannon Nelson, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@intel.com>

Make sure the "new" qtx_head[q] register is cleared before
enabling the Tx queue.

Change-ID: I0c7a12815e343a5ae68807af172a35d6c6857935
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 65c27cb..bc14a85 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3008,11 +3008,13 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
 			continue;
 
 		/* turn on/off the queue */
-		if (enable)
+		if (enable) {
+			wr32(hw, I40E_QTX_HEAD(pf_q), 0);
 			tx_reg |= I40E_QTX_ENA_QENA_REQ_MASK |
 				  I40E_QTX_ENA_QENA_STAT_MASK;
-		else
+		} else {
 			tx_reg &= ~I40E_QTX_ENA_QENA_REQ_MASK;
+		}
 
 		wr32(hw, I40E_QTX_ENA(pf_q), tx_reg);
 
-- 
1.8.3.1

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

* [net-next 13/16] i40e: call clear_pxe after adminq is initialized
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (11 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 12/16] i40e: clear qtx_head before enabling Tx queue Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 14/16] i40e: enable PTP Jeff Kirsher
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Shannon Nelson, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@intel.com>

In the latest firmware the clear_pxe_mode function will use the
AdminQ request, so call this after AdminQ is set up rather than
relying on i40e_pf_reset() to clear the PXE mode.

Change-ID: Ice8cba2e9cbc3c7bde0a0bcf8eaf5009abef040b
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bc14a85..182ed18 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7612,6 +7612,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_pf_reset;
 	}
 
+	i40e_clear_pxe_mode(hw);
 	err = i40e_get_capabilities(pf);
 	if (err)
 		goto err_adminq_setup;
-- 
1.8.3.1

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

* [net-next 14/16] i40e: enable PTP
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (12 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 13/16] i40e: call clear_pxe after adminq is initialized Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10 11:26   ` Richard Cochran
  2014-01-10 15:55   ` Ben Hutchings
  2014-01-10  8:58 ` [net-next 15/16] i40e: fix log message wording Jeff Kirsher
                   ` (2 subsequent siblings)
  16 siblings, 2 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Jacob Keller, netdev, gospo, sassmann, Richard Cochran,
	Jesse Brandeburg, Jeff Kirsher

From: Jacob Keller <jacob.e.keller@intel.com>

New feature: Enable PTP support in the i40e driver.

Change-ID: I6a8e799f582705191f9583afb1b9231a8db96cc8
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/Makefile       |   2 +
 drivers/net/ethernet/intel/i40e/i40e.h         |  24 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  33 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c    |  45 +-
 drivers/net/ethernet/intel/i40e/i40e_ptp.c     | 640 +++++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_txrx.c    |  53 ++
 drivers/net/ethernet/intel/i40e/i40e_txrx.h    |   3 +
 7 files changed, 798 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/i40e/i40e_ptp.c

diff --git a/drivers/net/ethernet/intel/i40e/Makefile b/drivers/net/ethernet/intel/i40e/Makefile
index 6ec1a79..2f7ccb4 100644
--- a/drivers/net/ethernet/intel/i40e/Makefile
+++ b/drivers/net/ethernet/intel/i40e/Makefile
@@ -41,3 +41,5 @@ i40e-objs := i40e_main.o \
 	i40e_diag.o	\
 	i40e_txrx.o	\
 	i40e_virtchnl_pf.o
+
+i40e-objs += i40e_ptp.o
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 7dab660..d73e6c9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -55,6 +55,9 @@
 #include "i40e_virtchnl.h"
 #include "i40e_virtchnl_pf.h"
 #include "i40e_txrx.h"
+#include <linux/clocksource.h>
+#include <linux/net_tstamp.h>
+#include <linux/ptp_clock_kernel.h>
 
 /* Useful i40e defaults */
 #define I40E_BASE_PF_SEID     16
@@ -242,6 +245,7 @@ struct i40e_pf {
 #define I40E_FLAG_DCB_ENABLED                  (u64)(1 << 20)
 #define I40E_FLAG_FDIR_ENABLED                 (u64)(1 << 21)
 #define I40E_FLAG_FDIR_ATR_ENABLED             (u64)(1 << 22)
+#define I40E_FLAG_PTP                          (u64)(1 << 25)
 #define I40E_FLAG_MFP_ENABLED                  (u64)(1 << 26)
 #ifdef CONFIG_I40E_VXLAN
 #define I40E_FLAG_VXLAN_FILTER_SYNC            (u64)(1 << 27)
@@ -302,6 +306,19 @@ struct i40e_pf {
 	u32	fcoe_hmc_filt_num;
 	u32	fcoe_hmc_cntx_num;
 	struct i40e_filter_control_settings filter_settings;
+
+	struct ptp_clock *ptp_clock;
+	struct ptp_clock_info ptp_caps;
+	struct sk_buff *ptp_tx_skb;
+	struct work_struct ptp_tx_work;
+	unsigned long ptp_tx_start;
+	unsigned long last_rx_ptp_check;
+	spinlock_t tmreg_lock; /* Used to protect the device time registers. */
+	u64 ptp_base_adj;
+	u32 tx_hwtstamp_timeouts;
+	u32 rx_hwtstamp_cleared;
+	bool ptp_tx;
+	bool ptp_rx;
 };
 
 struct i40e_mac_filter {
@@ -566,4 +583,11 @@ struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
 				      bool is_vf, bool is_netdev);
 void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
 
+void i40e_ptp_rx_hang(struct i40e_vsi *vsi);
+void i40e_ptp_tx_hwtstamp(struct i40e_pf *pf);
+void i40e_ptp_rx_hwtstamp(struct i40e_pf *pf, struct sk_buff *skb, u8 index);
+void i40e_ptp_set_increment(struct i40e_pf *pf);
+int i40e_ptp_hwtstamp_ioctl(struct i40e_pf *pf, struct ifreq *ifr, int cmd);
+void i40e_ptp_init(struct i40e_pf *pf);
+void i40e_ptp_stop(struct i40e_pf *pf);
 #endif /* _I40E_H_ */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 342a6e1..7b87d51 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -108,6 +108,8 @@ static struct i40e_stats i40e_gstrings_stats[] = {
 	I40E_PF_STAT("rx_oversize", stats.rx_oversize),
 	I40E_PF_STAT("rx_jabber", stats.rx_jabber),
 	I40E_PF_STAT("VF_admin_queue_requests", vf_aq_requests),
+	I40E_PF_STAT("tx_hwtstamp_timeouts", tx_hwtstamp_timeouts),
+	I40E_PF_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
 };
 
 #define I40E_QUEUE_STATS_LEN(n) \
@@ -748,7 +750,36 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
 static int i40e_get_ts_info(struct net_device *dev,
 			    struct ethtool_ts_info *info)
 {
-	return ethtool_op_get_ts_info(dev, info);
+	struct i40e_pf *pf = i40e_netdev_to_pf(dev);
+
+	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
+				SOF_TIMESTAMPING_RX_SOFTWARE |
+				SOF_TIMESTAMPING_SOFTWARE |
+				SOF_TIMESTAMPING_TX_HARDWARE |
+				SOF_TIMESTAMPING_RX_HARDWARE |
+				SOF_TIMESTAMPING_RAW_HARDWARE;
+
+	if (pf->ptp_clock)
+		info->phc_index = ptp_clock_index(pf->ptp_clock);
+	else
+		info->phc_index = -1;
+
+	info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
+
+	info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
+			   (1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) |
+			   (1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_L2_SYNC) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_L4_SYNC) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ) |
+			   (1 << HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ);
+
+	return 0;
 }
 
 static int i40e_link_test(struct net_device *netdev, u64 *data)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 182ed18..08fe2341 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1698,6 +1698,25 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)
 }
 
 /**
+ * i40e_ioctl - Access the hwtstamp interface
+ * @netdev: network interface device structure
+ * @ifr: interface request data
+ * @cmd: ioctl command
+ **/
+int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
+{
+	struct i40e_netdev_priv *np = netdev_priv(netdev);
+	struct i40e_pf *pf = np->vsi->back;
+
+	switch (cmd) {
+	case SIOCSHWTSTAMP:
+		return i40e_ptp_hwtstamp_ioctl(pf, ifr, cmd);
+	default:
+		return -EOPNOTSUPP;
+	}
+}
+
+/**
  * i40e_vlan_stripping_enable - Turn on vlan stripping for the VSI
  * @vsi: the vsi being adjusted
  **/
@@ -2150,7 +2169,8 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring)
 	tx_ctx.base = (ring->dma / 128);
 	tx_ctx.qlen = ring->count;
 	tx_ctx.fd_ena = !!(vsi->back->flags & (I40E_FLAG_FDIR_ENABLED |
-			I40E_FLAG_FDIR_ATR_ENABLED));
+					       I40E_FLAG_FDIR_ATR_ENABLED));
+	tx_ctx.timesync_ena = !!(vsi->back->flags & I40E_FLAG_PTP);
 
 	/* As part of VSI creation/update, FW allocates certain
 	 * Tx arbitration queue sets for each TC enabled for
@@ -2488,6 +2508,7 @@ static void i40e_enable_misc_int_causes(struct i40e_hw *hw)
 	      I40E_PFINT_ICR0_ENA_GRST_MASK          |
 	      I40E_PFINT_ICR0_ENA_PCI_EXCEPTION_MASK |
 	      I40E_PFINT_ICR0_ENA_GPIO_MASK          |
+	      I40E_PFINT_ICR0_ENA_TIMESYNC_MASK      |
 	      I40E_PFINT_ICR0_ENA_STORM_DETECT_MASK  |
 	      I40E_PFINT_ICR0_ENA_HMC_ERR_MASK       |
 	      I40E_PFINT_ICR0_ENA_VFLR_MASK          |
@@ -2831,6 +2852,18 @@ static irqreturn_t i40e_intr(int irq, void *data)
 		dev_info(&pf->pdev->dev, "HMC error interrupt\n");
 	}
 
+	if (icr0 & I40E_PFINT_ICR0_TIMESYNC_MASK) {
+		u32 prttsyn_stat = rd32(hw, I40E_PRTTSYN_STAT_0);
+
+		if (prttsyn_stat & I40E_PRTTSYN_STAT_0_TXTIME_MASK) {
+			ena_mask &= ~I40E_PFINT_ICR0_ENA_TIMESYNC_MASK;
+			i40e_ptp_tx_hwtstamp(pf);
+			prttsyn_stat &= ~I40E_PRTTSYN_STAT_0_TXTIME_MASK;
+		}
+
+		wr32(hw, I40E_PRTTSYN_STAT_0, prttsyn_stat);
+	}
+
 	/* If a critical error is pending we have no choice but to reset the
 	 * device.
 	 * Report and mask out any remaining unexpected interrupts.
@@ -4304,6 +4337,9 @@ static void i40e_link_event(struct i40e_pf *pf)
 
 	if (pf->vf)
 		i40e_vc_notify_link_state(pf);
+
+	if (pf->flags & I40E_FLAG_PTP)
+		i40e_ptp_set_increment(pf);
 }
 
 /**
@@ -4385,6 +4421,8 @@ static void i40e_watchdog_subtask(struct i40e_pf *pf)
 	for (i = 0; i < I40E_MAX_VEB; i++)
 		if (pf->veb[i])
 			i40e_update_veb_stats(pf->veb[i]);
+
+	i40e_ptp_rx_hang(pf->vsi[pf->lan_vsi]);
 }
 
 /**
@@ -6033,6 +6071,7 @@ static const struct net_device_ops i40e_netdev_ops = {
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_set_mac_address	= i40e_set_mac,
 	.ndo_change_mtu		= i40e_change_mtu,
+	.ndo_do_ioctl		= i40e_ioctl,
 	.ndo_tx_timeout		= i40e_tx_timeout,
 	.ndo_vlan_rx_add_vid	= i40e_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid	= i40e_vlan_rx_kill_vid,
@@ -7299,6 +7338,8 @@ no_autoneg:
 					 ~I40E_PRTDCB_MFLCN_RFCE_MASK);
 
 fc_complete:
+	i40e_ptp_init(pf);
+
 	return ret;
 }
 
@@ -7803,6 +7844,8 @@ static void i40e_remove(struct pci_dev *pdev)
 
 	i40e_dbg_pf_exit(pf);
 
+	i40e_ptp_stop(pf);
+
 	if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
 		i40e_free_vfs(pf);
 		pf->flags &= ~I40E_FLAG_SRIOV_ENABLED;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
new file mode 100644
index 0000000..095091e
--- /dev/null
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -0,0 +1,640 @@
+/*******************************************************************************
+ *
+ * Intel Ethernet Controller XL710 Family Linux Driver
+ * Copyright(c) 2013 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * The full GNU General Public License is included in this distribution in
+ * the file called "COPYING".
+ *
+ * Contact Information:
+ * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
+ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+ *
+ ******************************************************************************/
+
+#include "i40e.h"
+#include <linux/export.h>
+#include <linux/ptp_classify.h>
+
+/* The XL710 timesync is very much like Intel's 82599 design when it comes to
+ * the fundamental clock design. However, the clock operations are much simpler
+ * in the XL710 because the device supports a full 64 bits of nanoseconds.
+ * Because the field is so wide, we can forgo the cycle counter and just
+ * operate with the nanosecond field directly without fear of overflow.
+ *
+ * Much like the 82599, the update period is dependent upon the link speed:
+ * At 40Gb link or no link, the period is 1.6ns.
+ * At 10Gb link, the period is multiplied by 2. (3.2ns)
+ * At 1Gb link, the period is multiplied by 20. (32ns)
+ * 1588 functionality is not supported at 100Mbps.
+ */
+#define I40E_PTP_40GB_INCVAL 0x0199999999ULL
+#define I40E_PTP_10GB_INCVAL 0x0333333333ULL
+#define I40E_PTP_1GB_INCVAL  0x2000000000ULL
+
+#define I40E_PRTTSYN_CTL1_TSYNTYPE_V1  (0x1 << \
+					I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
+#define I40E_PRTTSYN_CTL1_TSYNTYPE_V2  (0x2 << \
+					I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
+#define I40E_PTP_TX_TIMEOUT  (HZ * 15)
+
+/**
+ * i40e_ptp_read - Read the PHC time from the device
+ * @pf: Board private structure
+ * @ts: timespec structure to hold the current time value
+ *
+ * This function reads the PRTTSYN_TIME registers and stores them in a
+ * timespec. However, since the registers are 64 bits of nanoseconds, we must
+ * convert the result to a timespec before we can return.
+ **/
+static void i40e_ptp_read(struct i40e_pf *pf, struct timespec *ts)
+{
+	struct i40e_hw *hw = &pf->hw;
+	u32 hi, lo;
+	u64 ns;
+
+	/* The timer latches on the lowest register read. */
+	lo = rd32(hw, I40E_PRTTSYN_TIME_L);
+	hi = rd32(hw, I40E_PRTTSYN_TIME_H);
+
+	ns = (((u64)hi) << 32) | lo;
+
+	*ts = ns_to_timespec(ns);
+}
+
+/**
+ * i40e_ptp_write - Write the PHC time to the device
+ * @pf: Board private structure
+ * @ts: timespec structure that holds the new time value
+ *
+ * This function writes the PRTTSYN_TIME registers with the user value. Since
+ * we receive a timespec from the stack, we must convert that timespec into
+ * nanoseconds before programming the registers.
+ **/
+static void i40e_ptp_write(struct i40e_pf *pf, const struct timespec *ts)
+{
+	struct i40e_hw *hw = &pf->hw;
+	u64 ns = timespec_to_ns(ts);
+
+	/* The timer will not update until the high register is written, so
+	 * write the low register first.
+	 */
+	wr32(hw, I40E_PRTTSYN_TIME_L, ns & 0xFFFFFFFF);
+	wr32(hw, I40E_PRTTSYN_TIME_H, ns >> 32);
+}
+
+/**
+ * i40e_ptp_convert_to_hwtstamp - Convert device clock to system time
+ * @hwtstamps: Timestamp structure to update
+ * @timestamp: Timestamp from the hardware
+ *
+ * We need to convert the NIC clock value into a hwtstamp which can be used by
+ * the upper level timestamping functions. Since the timestamp is simply a 64-
+ * bit nanosecond value, we can call ns_to_ktime directly to handle this.
+ **/
+static void i40e_ptp_convert_to_hwtstamp(struct skb_shared_hwtstamps *hwtstamps,
+					 u64 timestamp)
+{
+	memset(hwtstamps, 0, sizeof(*hwtstamps));
+
+	hwtstamps->hwtstamp = ns_to_ktime(timestamp);
+}
+
+/**
+ * i40e_ptp_adjfreq - Adjust the PHC frequency
+ * @ptp: The PTP clock structure
+ * @ppb: Parts per billion adjustment from the base
+ *
+ * Adjust the frequency of the PHC by the indicated parts per billion from the
+ * base frequency.
+ **/
+static int i40e_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
+{
+	struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
+	struct i40e_hw *hw = &pf->hw;
+	u64 adj, freq, diff;
+	int neg_adj = 0;
+
+	if (ppb < 0) {
+		neg_adj = 1;
+		ppb = -ppb;
+	}
+
+	smp_mb(); /* Force any pending update before accessing. */
+	adj = ACCESS_ONCE(pf->ptp_base_adj);
+
+	freq = adj;
+	freq *= ppb;
+	diff = div_u64(freq, 1000000000ULL);
+
+	if (neg_adj)
+		adj -= diff;
+	else
+		adj += diff;
+
+	wr32(hw, I40E_PRTTSYN_INC_L, adj & 0xFFFFFFFF);
+	wr32(hw, I40E_PRTTSYN_INC_H, adj >> 32);
+
+	return 0;
+}
+
+/**
+ * i40e_ptp_adjtime - Adjust the PHC time
+ * @ptp: The PTP clock structure
+ * @delta: Offset in nanoseconds to adjust the PHC time by
+ *
+ * Adjust the frequency of the PHC by the indicated parts per billion from the
+ * base frequency.
+ **/
+static int i40e_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
+{
+	struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
+	struct timespec now, then = ns_to_timespec(delta);
+	unsigned long flags;
+
+	spin_lock_irqsave(&pf->tmreg_lock, flags);
+
+	i40e_ptp_read(pf, &now);
+	now = timespec_add(now, then);
+	i40e_ptp_write(pf, (const struct timespec *)&now);
+
+	spin_unlock_irqrestore(&pf->tmreg_lock, flags);
+
+	return 0;
+}
+
+/**
+ * i40e_ptp_gettime - Get the time of the PHC
+ * @ptp: The PTP clock structure
+ * @ts: timespec structure to hold the current time value
+ *
+ * Read the device clock and return the correct value on ns, after converting it
+ * into a timespec struct.
+ **/
+static int i40e_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+{
+	struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
+	unsigned long flags;
+
+	spin_lock_irqsave(&pf->tmreg_lock, flags);
+	i40e_ptp_read(pf, ts);
+	spin_unlock_irqrestore(&pf->tmreg_lock, flags);
+
+	return 0;
+}
+
+/**
+ * i40e_ptp_settime - Set the time of the PHC
+ * @ptp: The PTP clock structure
+ * @ts: timespec structure that holds the new time value
+ *
+ * Set the device clock to the user input value. The conversion from timespec
+ * to ns happens in the write function.
+ **/
+static int i40e_ptp_settime(struct ptp_clock_info *ptp,
+			    const struct timespec *ts)
+{
+	struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
+	unsigned long flags;
+
+	spin_lock_irqsave(&pf->tmreg_lock, flags);
+	i40e_ptp_write(pf, ts);
+	spin_unlock_irqrestore(&pf->tmreg_lock, flags);
+
+	return 0;
+}
+
+/**
+ * i40e_ptp_tx_work
+ * @work: pointer to work struct
+ *
+ * This work function polls the PRTTSYN_STAT_0.TXTIME bit to determine when a
+ * Tx timestamp event has occurred, in order to pass the Tx timestamp value up
+ * the stack in the skb.
+ */
+void i40e_ptp_tx_work(struct work_struct *work)
+{
+	struct i40e_pf *pf = container_of(work, struct i40e_pf,
+					  ptp_tx_work);
+	struct i40e_hw *hw = &pf->hw;
+	u32 prttsyn_stat_0;
+
+	if (!pf->ptp_tx_skb)
+		return;
+
+	if (time_is_before_jiffies(pf->ptp_tx_start +
+				   I40E_PTP_TX_TIMEOUT)) {
+		dev_kfree_skb_any(pf->ptp_tx_skb);
+		pf->ptp_tx_skb = NULL;
+		pf->tx_hwtstamp_timeouts++;
+		dev_warn(&pf->pdev->dev, "clearing Tx timestamp hang");
+		return;
+	}
+
+	prttsyn_stat_0 = rd32(hw, I40E_PRTTSYN_STAT_0);
+	if (prttsyn_stat_0 & I40E_PRTTSYN_STAT_0_TXTIME_MASK)
+		i40e_ptp_tx_hwtstamp(pf);
+	else
+		schedule_work(&pf->ptp_tx_work);
+}
+
+/**
+ * i40e_ptp_enable - Enable/disable ancillary features of the PHC subsystem
+ * @ptp: The PTP clock structure
+ * @rq: The requested feature to change
+ * @on: Enable/disable flag
+ *
+ * The XL710 does not support any of the ancillary features of the PHY
+ * subsystem, so this function may just return.
+ **/
+static int i40e_ptp_enable(struct ptp_clock_info *ptp,
+			   struct ptp_clock_request *rq, int on)
+{
+	return -EOPNOTSUPP;
+}
+
+/**
+ * i40e_ptp_rx_hang - Detect error case when Rx timestamp registers are hung
+ * @vsi: The VSI with the rings relevant to 1588
+ *
+ * This watchdog task is scheduled to detect error case where hardware has
+ * dropped an Rx packet that was timestamped when the ring is full. The
+ * particular error is rare but leaves the device in a state unable to timestamp
+ * any future packets.
+ **/
+void i40e_ptp_rx_hang(struct i40e_vsi *vsi)
+{
+	struct i40e_pf *pf = vsi->back;
+	struct i40e_hw *hw = &pf->hw;
+	struct i40e_ring *rx_ring;
+	unsigned long rx_event;
+	u32 prttsyn_stat;
+	int n;
+
+	if (pf->flags & I40E_FLAG_PTP)
+		return;
+
+	prttsyn_stat = rd32(hw, I40E_PRTTSYN_STAT_1);
+
+	/* Unless all four receive timestamp registers are latched, we are not
+	 * concerned about a possible PTP Rx hang, so just update the timeout
+	 * counter and exit.
+	 */
+	if (!(prttsyn_stat & ((I40E_PRTTSYN_STAT_1_RXT0_MASK <<
+			       I40E_PRTTSYN_STAT_1_RXT0_SHIFT) |
+			      (I40E_PRTTSYN_STAT_1_RXT1_MASK <<
+			       I40E_PRTTSYN_STAT_1_RXT1_SHIFT) |
+			      (I40E_PRTTSYN_STAT_1_RXT2_MASK <<
+			       I40E_PRTTSYN_STAT_1_RXT2_SHIFT) |
+			      (I40E_PRTTSYN_STAT_1_RXT3_MASK <<
+			       I40E_PRTTSYN_STAT_1_RXT3_SHIFT)))) {
+		pf->last_rx_ptp_check = jiffies;
+		return;
+	}
+
+	/* Determine the most recent watchdog or rx_timestamp event. */
+	rx_event = pf->last_rx_ptp_check;
+	for (n = 0; n < vsi->num_queue_pairs; n++) {
+		rx_ring = vsi->rx_rings[n];
+		if (time_after(rx_ring->last_rx_timestamp, rx_event))
+			rx_event = rx_ring->last_rx_timestamp;
+	}
+
+	/* Only need to read the high RXSTMP register to clear the lock */
+	if (time_is_before_jiffies(rx_event + 5 * HZ)) {
+		rd32(hw, I40E_PRTTSYN_RXTIME_H(0));
+		rd32(hw, I40E_PRTTSYN_RXTIME_H(1));
+		rd32(hw, I40E_PRTTSYN_RXTIME_H(2));
+		rd32(hw, I40E_PRTTSYN_RXTIME_H(3));
+		pf->last_rx_ptp_check = jiffies;
+		pf->rx_hwtstamp_cleared++;
+		dev_warn(&vsi->back->pdev->dev,
+			 "%s: clearing Rx timestamp hang",
+			 __func__);
+	}
+}
+
+/**
+ * i40e_ptp_tx_hwtstamp - Utility function which returns the Tx timestamp
+ * @pf: Board private structure
+ *
+ * Read the value of the Tx timestamp from the registers, convert it into a
+ * value consumable by the stack, and store that result into the shhwtstamps
+ * struct before returning it up the stack.
+ **/
+void i40e_ptp_tx_hwtstamp(struct i40e_pf *pf)
+{
+	struct skb_shared_hwtstamps shhwtstamps;
+	struct i40e_hw *hw = &pf->hw;
+	u32 hi, lo;
+	u64 ns;
+
+	lo = rd32(hw, I40E_PRTTSYN_TXTIME_L);
+	hi = rd32(hw, I40E_PRTTSYN_TXTIME_H);
+
+	ns = (((u64)hi) << 32) | lo;
+
+	i40e_ptp_convert_to_hwtstamp(&shhwtstamps, ns);
+	skb_tstamp_tx(pf->ptp_tx_skb, &shhwtstamps);
+	dev_kfree_skb_any(pf->ptp_tx_skb);
+	pf->ptp_tx_skb = NULL;
+}
+
+/**
+ * i40e_ptp_rx_hwtstamp - Utility function which checks for an Rx timestamp
+ * @pf: Board private structure
+ * @skb: Particular skb to send timestamp with
+ * @index: Index into the receive timestamp registers for the timestamp
+ *
+ * The XL710 receives a notification in the receive descriptor with an offset
+ * into the set of RXTIME registers where the timestamp is for that skb. This
+ * function goes and fetches the receive timestamp from that offset, if a valid
+ * one exists. The RXTIME registers are in ns, so we must convert the result
+ * first.
+ **/
+void i40e_ptp_rx_hwtstamp(struct i40e_pf *pf, struct sk_buff *skb, u8 index)
+{
+	u32 prttsyn_stat, hi, lo;
+	struct i40e_hw *hw;
+	u64 ns;
+
+	/* Since we cannot turn off the Rx timestamp logic if the device is
+	 * doing Tx timestamping, check if Rx timestamping is configured.
+	 */
+	if (!pf->ptp_rx)
+		return;
+
+	hw = &pf->hw;
+
+	prttsyn_stat = rd32(hw, I40E_PRTTSYN_STAT_1);
+
+	if (!(prttsyn_stat & (1 << index)))
+		return;
+
+	lo = rd32(hw, I40E_PRTTSYN_RXTIME_L(index));
+	hi = rd32(hw, I40E_PRTTSYN_RXTIME_H(index));
+
+	ns = (((u64)hi) << 32) | lo;
+
+	i40e_ptp_convert_to_hwtstamp(skb_hwtstamps(skb), ns);
+}
+
+/**
+ * i40e_ptp_set_increment - Utility function to update clock increment rate
+ * @pf: Board private structure
+ *
+ * During a link change, the DMA frequency that drives the 1588 logic will
+ * change. In order to keep the PRTTSYN_TIME registers in units of nanoseconds,
+ * we must update the increment value per clock tick.
+ **/
+void i40e_ptp_set_increment(struct i40e_pf *pf)
+{
+	struct i40e_link_status *hw_link_info;
+	struct i40e_hw *hw = &pf->hw;
+	u64 incval;
+
+	hw_link_info = &hw->phy.link_info;
+
+	i40e_aq_get_link_info(&pf->hw, true, NULL, NULL);
+
+	switch (hw_link_info->link_speed) {
+	case I40E_LINK_SPEED_10GB:
+		incval = I40E_PTP_10GB_INCVAL;
+		break;
+	case I40E_LINK_SPEED_1GB:
+		incval = I40E_PTP_1GB_INCVAL;
+		break;
+	case I40E_LINK_SPEED_100MB:
+		dev_warn(&pf->pdev->dev,
+			 "%s: 1588 functionality is not supported at 100 Mbps. Stopping the PHC.\n",
+			 __func__);
+		incval = 0;
+		break;
+	case I40E_LINK_SPEED_40GB:
+	default:
+		incval = I40E_PTP_40GB_INCVAL;
+		break;
+	}
+
+	/* Write the new increment value into the increment register. The
+	 * hardware will not update the clock until both registers have been
+	 * written.
+	 */
+	wr32(hw, I40E_PRTTSYN_INC_L, incval & 0xFFFFFFFF);
+	wr32(hw, I40E_PRTTSYN_INC_H, incval >> 32);
+
+	/* Update the base adjustement value. */
+	ACCESS_ONCE(pf->ptp_base_adj) = incval;
+	smp_mb(); /* Force the above update. */
+}
+
+/**
+ * i40e_ptp_hwtstamp_ioctl - ioctl interface to control the HW timestamping
+ * @pf: Board private structure
+ * @ifreq: ioctl data
+ * @cmd: Particular ioctl requested
+ *
+ * Respond to the user filter requests and make the appropriate hardware
+ * changes here. The XL710 cannot support splitting of the Tx/Rx timestamping
+ * logic, so keep track in software of whether to indicate these timestamps
+ * or not.
+ *
+ * It is permissible to "upgrade" the user request to a broader filter, as long
+ * as the user receives the timestamps they care about and the user is notified
+ * the filter has been broadened.
+ **/
+int i40e_ptp_hwtstamp_ioctl(struct i40e_pf *pf, struct ifreq *ifr, int cmd)
+{
+	struct i40e_hw *hw = &pf->hw;
+	struct hwtstamp_config config;
+	u32 pf_id, tsyntype, regval;
+
+	if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
+		return -EFAULT;
+
+	/* Reserved for future extensions. */
+	if (config.flags)
+		return -EINVAL;
+
+	/* Confirm that 1588 is supported on this PF. */
+	pf_id = (rd32(hw, I40E_PRTTSYN_CTL0) & I40E_PRTTSYN_CTL0_PF_ID_MASK) >>
+		I40E_PRTTSYN_CTL0_PF_ID_SHIFT;
+	if (hw->pf_id != pf_id)
+		return -EINVAL;
+
+	switch (config.tx_type) {
+	case HWTSTAMP_TX_OFF:
+		pf->ptp_tx = false;
+		break;
+	case HWTSTAMP_TX_ON:
+		pf->ptp_tx = true;
+		break;
+	default:
+		return -ERANGE;
+	}
+
+	switch (config.rx_filter) {
+	case HWTSTAMP_FILTER_NONE:
+		pf->ptp_rx = false;
+		tsyntype = 0;
+		break;
+	case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
+	case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
+	case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
+		pf->ptp_rx = true;
+		tsyntype = I40E_PRTTSYN_CTL1_V1MESSTYPE0_MASK |
+			   I40E_PRTTSYN_CTL1_TSYNTYPE_V1 |
+			   I40E_PRTTSYN_CTL1_UDP_ENA_MASK;
+		config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
+		break;
+	case HWTSTAMP_FILTER_PTP_V2_EVENT:
+	case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
+	case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
+	case HWTSTAMP_FILTER_PTP_V2_SYNC:
+	case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
+	case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
+	case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
+	case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
+	case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
+		pf->ptp_rx = true;
+		tsyntype = I40E_PRTTSYN_CTL1_V2MESSTYPE0_MASK |
+			   I40E_PRTTSYN_CTL1_TSYNTYPE_V2 |
+			   I40E_PRTTSYN_CTL1_UDP_ENA_MASK;
+		config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
+		break;
+	case HWTSTAMP_FILTER_ALL:
+	default:
+		return -ERANGE;
+	}
+
+	/* Clear out all 1588-related registers to clear and unlatch them. */
+	rd32(hw, I40E_PRTTSYN_STAT_0);
+	rd32(hw, I40E_PRTTSYN_TXTIME_H);
+	rd32(hw, I40E_PRTTSYN_RXTIME_H(0));
+	rd32(hw, I40E_PRTTSYN_RXTIME_H(1));
+	rd32(hw, I40E_PRTTSYN_RXTIME_H(2));
+	rd32(hw, I40E_PRTTSYN_RXTIME_H(3));
+
+	/* Enable/disable the Tx timestamp interrupt based on user input. */
+	regval = rd32(hw, I40E_PRTTSYN_CTL0);
+	if (pf->ptp_tx)
+		regval |= I40E_PRTTSYN_CTL0_TXTIME_INT_ENA_MASK;
+	else
+		regval &= ~I40E_PRTTSYN_CTL0_TXTIME_INT_ENA_MASK;
+	wr32(hw, I40E_PRTTSYN_CTL0, regval);
+
+	regval = rd32(hw, I40E_PFINT_ICR0_ENA);
+	if (pf->ptp_tx)
+		regval |= I40E_PFINT_ICR0_ENA_TIMESYNC_MASK;
+	else
+		regval &= ~I40E_PFINT_ICR0_ENA_TIMESYNC_MASK;
+	wr32(hw, I40E_PFINT_ICR0_ENA, regval);
+
+	/* There is no simple on/off switch for Rx. To "disable" Rx support,
+	 * ignore any received timestamps, rather than turn off the clock.
+	 */
+	if (pf->ptp_rx) {
+		regval = rd32(hw, I40E_PRTTSYN_CTL1);
+		/* clear everything but the enable bit */
+		regval &= I40E_PRTTSYN_CTL1_TSYNENA_MASK;
+		/* now enable bits for desired Rx timestamps */
+		regval |= tsyntype;
+		wr32(hw, I40E_PRTTSYN_CTL1, regval);
+	}
+
+	return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
+		-EFAULT : 0;
+}
+
+/**
+ * i40e_ptp_init - Initialize the 1588 support and register the PHC
+ * @pf: Board private structure
+ *
+ * This function registers the device clock as a PHC. If it is successful, it
+ * starts the clock in the hardware.
+ **/
+void i40e_ptp_init(struct i40e_pf *pf)
+{
+	struct i40e_hw *hw = &pf->hw;
+	struct net_device *netdev = pf->vsi[pf->lan_vsi]->netdev;
+
+	snprintf(pf->ptp_caps.name, 16, "%pm", netdev->dev_addr);
+	pf->ptp_caps.owner = THIS_MODULE;
+	pf->ptp_caps.max_adj = 999999999;
+	pf->ptp_caps.n_ext_ts = 0;
+	pf->ptp_caps.pps = 0;
+	pf->ptp_caps.adjfreq = i40e_ptp_adjfreq;
+	pf->ptp_caps.adjtime = i40e_ptp_adjtime;
+	pf->ptp_caps.gettime = i40e_ptp_gettime;
+	pf->ptp_caps.settime = i40e_ptp_settime;
+	pf->ptp_caps.enable = i40e_ptp_enable;
+
+	/* Attempt to register the clock before enabling the hardware. */
+	pf->ptp_clock = ptp_clock_register(&pf->ptp_caps, &pf->pdev->dev);
+	if (IS_ERR(pf->ptp_clock)) {
+		pf->ptp_clock = NULL;
+		dev_err(&pf->pdev->dev, "%s: ptp_clock_register failed\n",
+			__func__);
+	} else {
+		struct timespec ts;
+		u32 regval;
+
+		spin_lock_init(&pf->tmreg_lock);
+		INIT_WORK(&pf->ptp_tx_work, i40e_ptp_tx_work);
+
+		dev_info(&pf->pdev->dev, "%s: added PHC on %s\n", __func__,
+			 netdev->name);
+		pf->flags |= I40E_FLAG_PTP;
+
+		/* Ensure the clocks are running. */
+		regval = rd32(hw, I40E_PRTTSYN_CTL0);
+		regval |= I40E_PRTTSYN_CTL0_TSYNENA_MASK;
+		wr32(hw, I40E_PRTTSYN_CTL0, regval);
+		regval = rd32(hw, I40E_PRTTSYN_CTL1);
+		regval |= I40E_PRTTSYN_CTL1_TSYNENA_MASK;
+		wr32(hw, I40E_PRTTSYN_CTL1, regval);
+
+		/* Set the increment value per clock tick. */
+		i40e_ptp_set_increment(pf);
+
+		/* Set the clock value. */
+		ts = ktime_to_timespec(ktime_get_real());
+		i40e_ptp_settime(&pf->ptp_caps, &ts);
+	}
+}
+
+/**
+ * i40e_ptp_stop - Disable the driver/hardware support and unregister the PHC
+ * @pf: Board private structure
+ *
+ * This function handles the cleanup work required from the initialization by
+ * clearing out the important information and unregistering the PHC.
+ **/
+void i40e_ptp_stop(struct i40e_pf *pf)
+{
+	pf->flags &= ~I40E_FLAG_PTP;
+	pf->ptp_tx = false;
+	pf->ptp_rx = false;
+
+	cancel_work_sync(&pf->ptp_tx_work);
+	if (pf->ptp_tx_skb) {
+		dev_kfree_skb_any(pf->ptp_tx_skb);
+		pf->ptp_tx_skb = NULL;
+	}
+
+	if (pf->ptp_clock) {
+		ptp_clock_unregister(pf->ptp_clock);
+		pf->ptp_clock = NULL;
+		dev_info(&pf->pdev->dev, "%s: removed PHC on %s\n", __func__,
+			 pf->vsi[pf->lan_vsi]->netdev->name);
+	}
+}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 946d8b1..a089ac1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1088,6 +1088,13 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 		}
 
 		skb->rxhash = i40e_rx_hash(rx_ring, rx_desc);
+		if (unlikely(rx_status & I40E_RXD_QW1_STATUS_TSYNVALID_MASK)) {
+			i40e_ptp_rx_hwtstamp(vsi->back, skb, (rx_status &
+					   I40E_RXD_QW1_STATUS_TSYNINDX_MASK) >>
+					   I40E_RXD_QW1_STATUS_TSYNINDX_SHIFT);
+			rx_ring->last_rx_timestamp = jiffies;
+		}
+
 		/* probably a little skewed due to removing CRC */
 		total_rx_bytes += skb->len;
 		total_rx_packets++;
@@ -1426,6 +1433,46 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
 }
 
 /**
+ * i40e_tsyn - set up the tsyn context descriptor
+ * @tx_ring:  ptr to the ring to send
+ * @skb:      ptr to the skb we're sending
+ * @tx_flags: the collected send information
+ *
+ * Returns 0 if no Tx timestamp can happen and 1 if the timestamp will happen
+ **/
+static int i40e_tsyn(struct i40e_ring *tx_ring, struct sk_buff *skb,
+		     u32 tx_flags, u64 *cd_type_cmd_tso_mss)
+{
+	struct i40e_pf *pf;
+
+	if (likely(!(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)))
+		return 0;
+
+	/* Tx timestamps cannot be sampled when doing TSO */
+	if (tx_flags & I40E_TX_FLAGS_TSO)
+		return 0;
+
+	/* only timestamp the outbound packet if the user has requested it and
+	 * we are not already transmitting a packet to be timestamped
+	 */
+	pf = i40e_netdev_to_pf(tx_ring->netdev);
+	if (pf->ptp_tx && !pf->ptp_tx_skb) {
+		skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
+		pf->ptp_tx_skb = skb_get(skb);
+	} else {
+		return 0;
+	}
+
+	*cd_type_cmd_tso_mss |= (u64)I40E_TX_CTX_DESC_TSYN <<
+				I40E_TXD_CTX_QW1_CMD_SHIFT;
+
+	pf->ptp_tx_start = jiffies;
+	schedule_work(&pf->ptp_tx_work);
+
+	return 1;
+}
+
+/**
  * i40e_tx_enable_csum - Enable Tx checksum offloads
  * @skb: send buffer
  * @tx_flags: Tx flags currently set
@@ -1801,6 +1848,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 	__be16 protocol;
 	u32 td_cmd = 0;
 	u8 hdr_len = 0;
+	int tsyn;
 	int tso;
 	if (0 == i40e_xmit_descriptor_count(skb, tx_ring))
 		return NETDEV_TX_BUSY;
@@ -1831,6 +1879,11 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 
 	skb_tx_timestamp(skb);
 
+	tsyn = i40e_tsyn(tx_ring, skb, tx_flags, &cd_type_cmd_tso_mss);
+
+	if (tsyn)
+		tx_flags |= I40E_TX_FLAGS_TSYN;
+
 	/* always enable CRC insertion offload */
 	td_cmd |= I40E_TX_DESC_CMD_ICRC;
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index 93b8642..d534969 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -136,6 +136,7 @@ enum i40e_dyn_idx_t {
 #define I40E_TX_FLAGS_IPV6		(u32)(1 << 5)
 #define I40E_TX_FLAGS_FCCRC		(u32)(1 << 6)
 #define I40E_TX_FLAGS_FSO		(u32)(1 << 7)
+#define I40E_TX_FLAGS_TSYN		(u32)(1 << 8)
 #define I40E_TX_FLAGS_VLAN_MASK		0xffff0000
 #define I40E_TX_FLAGS_VLAN_PRIO_MASK	0xe0000000
 #define I40E_TX_FLAGS_VLAN_PRIO_SHIFT	29
@@ -248,6 +249,8 @@ struct i40e_ring {
 	u8 atr_sample_rate;
 	u8 atr_count;
 
+	unsigned long last_rx_timestamp;
+
 	bool ring_active;		/* is ring online or not */
 
 	/* stats structs */
-- 
1.8.3.1

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

* [net-next 15/16] i40e: fix log message wording
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (13 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 14/16] i40e: enable PTP Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10  8:58 ` [net-next 16/16] i40e: Bump version Jeff Kirsher
  2014-01-10 17:48 ` [net-next 00/16][pull request] Intel Wired LAN Driver Updates David Miller
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Shannon Nelson, netdev, gospo, sassmann, Jesse Brandeburg, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@intel.com>

Change the redundant "vsi VSI" to VSI.

Change-ID: Ic16ea5820a99abc7831713cde39e7d032a7ba4d3
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 0220b18..36a5cc8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -1083,7 +1083,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 		vsi = i40e_dbg_find_vsi(pf, vsi_seid);
 		if (!vsi) {
 			dev_info(&pf->pdev->dev,
-				 "add relay: vsi VSI %d not found\n", vsi_seid);
+				 "add relay: VSI %d not found\n", vsi_seid);
 			goto command_write_done;
 		}
 
-- 
1.8.3.1

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

* [net-next 16/16] i40e: Bump version
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (14 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 15/16] i40e: fix log message wording Jeff Kirsher
@ 2014-01-10  8:58 ` Jeff Kirsher
  2014-01-10 17:48 ` [net-next 00/16][pull request] Intel Wired LAN Driver Updates David Miller
  16 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10  8:58 UTC (permalink / raw)
  To: davem
  Cc: Catherine Sullivan, netdev, gospo, sassmann, Jesse Brandeburg,
	Jeff Kirsher

From: Catherine Sullivan <catherine.sullivan@intel.com>

Update the driver version to 0.3.28-k.

Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 08fe2341..e13a3f8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -38,7 +38,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 0
 #define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 27
+#define DRV_VERSION_BUILD 28
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
-- 
1.8.3.1

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

* Re: [net-next 05/16] i40e: fix long lines
  2014-01-10  8:58 ` [net-next 05/16] i40e: fix long lines Jeff Kirsher
@ 2014-01-10  9:07   ` Joe Perches
  2014-01-10 10:02     ` David Laight
  0 siblings, 1 reply; 36+ messages in thread
From: Joe Perches @ 2014-01-10  9:07 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: davem, Mitch Williams, netdev, gospo, sassmann, Jesse Brandeburg

On Fri, 2014-01-10 at 00:58 -0800, Jeff Kirsher wrote:
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> Avoid over-length lines in order to appease checkpatch.

I think you can and should ignore long line warnings
where appropriate.

and...

> diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
[]
> @@ -681,7 +681,8 @@ aq_add_vsi_exit:
>   * @cmd_details: pointer to command details structure or NULL
>   **/
>  i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
> -				u16 seid, bool set, struct i40e_asq_cmd_details *cmd_details)
> +				u16 seid, bool set,
> +				struct i40e_asq_cmd_details *cmd_details)

Another way this could be changed is to put the
return value on a separate line like:

i40e_status
i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 seid, bool set,
				    struct i40e_asq_cmd_details *cmd_details)

> diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
[]
> @@ -93,9 +93,9 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
>  				u16 vsi_id, bool set_filter,
>  				struct i40e_asq_cmd_details *cmd_details);
>  i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
> -				u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
> +		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);

i40e_status
i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 vsi_id, bool set,
				    struct i40e_asq_cmd_details *cmd_details);

etc...

but once you use extremely long 35+ characters
function names, 80 columns gets a bit silly too.

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

* RE: [net-next 05/16] i40e: fix long lines
  2014-01-10  9:07   ` Joe Perches
@ 2014-01-10 10:02     ` David Laight
  2014-01-10 10:35       ` Joe Perches
  0 siblings, 1 reply; 36+ messages in thread
From: David Laight @ 2014-01-10 10:02 UTC (permalink / raw)
  To: 'Joe Perches', Jeff Kirsher
  Cc: davem, Mitch Williams, netdev, gospo, sassmann, Jesse Brandeburg

> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c
> b/drivers/net/ethernet/intel/i40e/i40e_common.c
> []
> > @@ -681,7 +681,8 @@ aq_add_vsi_exit:
> >   * @cmd_details: pointer to command details structure or NULL
> >   **/
> >  i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
> > -				u16 seid, bool set, struct i40e_asq_cmd_details *cmd_details)
> > +				u16 seid, bool set,
> > +				struct i40e_asq_cmd_details *cmd_details)
> 
> Another way this could be changed is to put the
> return value on a separate line like:
> 
> i40e_status
> i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 seid, bool set,
> 				    struct i40e_asq_cmd_details *cmd_details)

Personally I prefer that so I can find the definition by grepping
for '^function_name' - but it doesn't seem to be done in any linux
source files.

> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> []
> > @@ -93,9 +93,9 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
> >  				u16 vsi_id, bool set_filter,
> >  				struct i40e_asq_cmd_details *cmd_details);
> >  i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
> > -				u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
> > +		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
> 
> i40e_status
> i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 vsi_id, bool set,
> 				    struct i40e_asq_cmd_details *cmd_details);
> 
> etc...
> 
> but once you use extremely long 35+ characters
> function names, 80 columns gets a bit silly too.

Again this only a real problem when the coding stand requires that
continuation lines have the parameters lined up under the '('.
If they are indented by 4 spaces (as many of the BSDs do) then you
do stand a chance of laying out a call in a reasonable number of
vertical lines.

My Actual preferred layout is to exclude tabs, indent by 4 spaces
and double-indent continuation lines.
I'll also start continuation lines (of expressions) with an operator
to make it even clearer they are continuation lines.
When I'm scan-reading code I tend to concentrate on the LHS of each line.
- so that is where the information need to be.

Not that I expect Linux to change!
(Other code bases have much worse layout rules.)

	David

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

* Re: [net-next 05/16] i40e: fix long lines
  2014-01-10 10:02     ` David Laight
@ 2014-01-10 10:35       ` Joe Perches
  2014-01-10 18:05         ` Williams, Mitch A
  0 siblings, 1 reply; 36+ messages in thread
From: Joe Perches @ 2014-01-10 10:35 UTC (permalink / raw)
  To: David Laight
  Cc: Jeff Kirsher, davem, Mitch Williams, netdev, gospo, sassmann,
	Jesse Brandeburg

On Fri, 2014-01-10 at 10:02 +0000, David Laight wrote:
> > Another way this could be changed is to put the
> > return value on a separate line like:
> > 
> > i40e_status
> > i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 seid, bool set,
> > 				    struct i40e_asq_cmd_details *cmd_details)
> 
> Personally I prefer that so I can find the definition by grepping
> for '^function_name' - but it doesn't seem to be done in any linux
> source files.

That form is used in a lot of files.
$ git grep -E "^[a-z_]+\("

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

* Re: [net-next 14/16] i40e: enable PTP
  2014-01-10  8:58 ` [net-next 14/16] i40e: enable PTP Jeff Kirsher
@ 2014-01-10 11:26   ` Richard Cochran
  2014-01-10 15:55   ` Ben Hutchings
  1 sibling, 0 replies; 36+ messages in thread
From: Richard Cochran @ 2014-01-10 11:26 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: davem, Jacob Keller, netdev, gospo, sassmann, Jesse Brandeburg

On Fri, Jan 10, 2014 at 12:58:54AM -0800, Jeff Kirsher wrote:

> +/**
> + * i40e_ptp_enable - Enable/disable ancillary features of the PHC subsystem
> + * @ptp: The PTP clock structure
> + * @rq: The requested feature to change
> + * @on: Enable/disable flag
> + *
> + * The XL710 does not support any of the ancillary features of the PHY
> + * subsystem, so this function may just return.
> + **/

Typo, PHC subsystem? Otherwise, the driver looks good to me.

Acked-by: Richard Cochran <richardcochran@gmail.com>

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

* Re: [net-next 14/16] i40e: enable PTP
  2014-01-10  8:58 ` [net-next 14/16] i40e: enable PTP Jeff Kirsher
  2014-01-10 11:26   ` Richard Cochran
@ 2014-01-10 15:55   ` Ben Hutchings
  2014-01-10 16:48     ` Keller, Jacob E
  1 sibling, 1 reply; 36+ messages in thread
From: Ben Hutchings @ 2014-01-10 15:55 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: davem, Jacob Keller, netdev, gospo, sassmann, Richard Cochran,
	Jesse Brandeburg

On Fri, 2014-01-10 at 00:58 -0800, Jeff Kirsher wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> New feature: Enable PTP support in the i40e driver.
> 
> Change-ID: I6a8e799f582705191f9583afb1b9231a8db96cc8
> Cc: Richard Cochran <richardcochran@gmail.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/Makefile       |   2 +
>  drivers/net/ethernet/intel/i40e/i40e.h         |  24 +
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  33 +-
>  drivers/net/ethernet/intel/i40e/i40e_main.c    |  45 +-
>  drivers/net/ethernet/intel/i40e/i40e_ptp.c     | 640 +++++++++++++++++++++++++
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c    |  53 ++
>  drivers/net/ethernet/intel/i40e/i40e_txrx.h    |   3 +
>  7 files changed, 798 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/net/ethernet/intel/i40e/i40e_ptp.c

This is missing a Kconfig update to select PTP_1588_CLOCK.

[...]
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -1698,6 +1698,25 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)
>  }
>  
>  /**
> + * i40e_ioctl - Access the hwtstamp interface
> + * @netdev: network interface device structure
> + * @ifr: interface request data
> + * @cmd: ioctl command
> + **/
> +int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
> +{
> +	struct i40e_netdev_priv *np = netdev_priv(netdev);
> +	struct i40e_pf *pf = np->vsi->back;
> +
> +	switch (cmd) {
> +	case SIOCSHWTSTAMP:
> +		return i40e_ptp_hwtstamp_ioctl(pf, ifr, cmd);
> +	default:
> +		return -EOPNOTSUPP;
> +	}
> +}

Please implement SIOCGHWTSTAMP as well.

[...]
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
[...]
> +void i40e_ptp_init(struct i40e_pf *pf)
> +{
> +	struct i40e_hw *hw = &pf->hw;
> +	struct net_device *netdev = pf->vsi[pf->lan_vsi]->netdev;
> +
> +	snprintf(pf->ptp_caps.name, 16, "%pm", netdev->dev_addr);
[...]

Use sizeof(), not a magic number.  Also the clock name should perhaps be
the driver name, not the MAC address.

Is the clock shared between multiple PFs or are there independent clocks
for each PF?

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* Re: [net-next 14/16] i40e: enable PTP
  2014-01-10 15:55   ` Ben Hutchings
@ 2014-01-10 16:48     ` Keller, Jacob E
  0 siblings, 0 replies; 36+ messages in thread
From: Keller, Jacob E @ 2014-01-10 16:48 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Kirsher, Jeffrey T, davem, netdev, gospo, sassmann,
	Richard Cochran, Brandeburg, Jesse

On Fri, 2014-01-10 at 15:55 +0000, Ben Hutchings wrote:
> On Fri, 2014-01-10 at 00:58 -0800, Jeff Kirsher wrote:
> > From: Jacob Keller <jacob.e.keller@intel.com>
> > 
> > New feature: Enable PTP support in the i40e driver.
> > 
> > Change-ID: I6a8e799f582705191f9583afb1b9231a8db96cc8
> > Cc: Richard Cochran <richardcochran@gmail.com>
> > Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> > Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> > Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> >  drivers/net/ethernet/intel/i40e/Makefile       |   2 +
> >  drivers/net/ethernet/intel/i40e/i40e.h         |  24 +
> >  drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  33 +-
> >  drivers/net/ethernet/intel/i40e/i40e_main.c    |  45 +-
> >  drivers/net/ethernet/intel/i40e/i40e_ptp.c     | 640 +++++++++++++++++++++++++
> >  drivers/net/ethernet/intel/i40e/i40e_txrx.c    |  53 ++
> >  drivers/net/ethernet/intel/i40e/i40e_txrx.h    |   3 +
> >  7 files changed, 798 insertions(+), 2 deletions(-)
> >  create mode 100644 drivers/net/ethernet/intel/i40e/i40e_ptp.c
> 
> This is missing a Kconfig update to select PTP_1588_CLOCK.
> 
> [...]
> > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > @@ -1698,6 +1698,25 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)
> >  }
> >  
> >  /**
> > + * i40e_ioctl - Access the hwtstamp interface
> > + * @netdev: network interface device structure
> > + * @ifr: interface request data
> > + * @cmd: ioctl command
> > + **/
> > +int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
> > +{
> > +	struct i40e_netdev_priv *np = netdev_priv(netdev);
> > +	struct i40e_pf *pf = np->vsi->back;
> > +
> > +	switch (cmd) {
> > +	case SIOCSHWTSTAMP:
> > +		return i40e_ptp_hwtstamp_ioctl(pf, ifr, cmd);
> > +	default:
> > +		return -EOPNOTSUPP;
> > +	}
> > +}
> 
> Please implement SIOCGHWTSTAMP as well.

Yep. I still need to implement this for other Intel drivers as well.

> 
> [...]
> > --- /dev/null
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> [...]
> > +void i40e_ptp_init(struct i40e_pf *pf)
> > +{
> > +	struct i40e_hw *hw = &pf->hw;
> > +	struct net_device *netdev = pf->vsi[pf->lan_vsi]->netdev;
> > +
> > +	snprintf(pf->ptp_caps.name, 16, "%pm", netdev->dev_addr);
> [...]
> 
> Use sizeof(), not a magic number.  Also the clock name should perhaps be
> the driver name, not the MAC address.

Some other drivers probably need to be updated to not use magic number
as well..

> 
> Is the clock shared between multiple PFs or are there independent clocks
> for each PF?

Each PF gets its own register set, and while the clock is physically
driven by the same source, there is no mechanism to ensure registers are
in sync, so effectively each PF has its own independent clock. (ie:
can't support boundary clock properly)

Thanks,
Jake

> 
> Ben.
> 



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

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (15 preceding siblings ...)
  2014-01-10  8:58 ` [net-next 16/16] i40e: Bump version Jeff Kirsher
@ 2014-01-10 17:48 ` David Miller
  2014-01-10 17:56   ` Jeff Kirsher
  16 siblings, 1 reply; 36+ messages in thread
From: David Miller @ 2014-01-10 17:48 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 10 Jan 2014 00:58:40 -0800

> This series contains updates to i40e only.

Please address the feedback given and resubmit, thank you.

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

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2014-01-10 17:48 ` [net-next 00/16][pull request] Intel Wired LAN Driver Updates David Miller
@ 2014-01-10 17:56   ` Jeff Kirsher
  0 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-01-10 17:56 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, gospo, sassmann

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

On Fri, 2014-01-10 at 12:48 -0500, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Fri, 10 Jan 2014 00:58:40 -0800
> 
> > This series contains updates to i40e only.
> 
> Please address the feedback given and resubmit, thank you.

Will do.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* RE: [net-next 05/16] i40e: fix long lines
  2014-01-10 10:35       ` Joe Perches
@ 2014-01-10 18:05         ` Williams, Mitch A
  2014-01-10 18:14           ` Joe Perches
  0 siblings, 1 reply; 36+ messages in thread
From: Williams, Mitch A @ 2014-01-10 18:05 UTC (permalink / raw)
  To: Joe Perches, David Laight
  Cc: Kirsher, Jeffrey T, davem, netdev, gospo, sassmann, Brandeburg, Jesse



> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Friday, January 10, 2014 2:36 AM
> To: David Laight
> Cc: Kirsher, Jeffrey T; davem@davemloft.net; Williams, Mitch A;
> netdev@vger.kernel.org; gospo@redhat.com; sassmann@redhat.com; Brandeburg,
> Jesse
> Subject: Re: [net-next 05/16] i40e: fix long lines
> 
> On Fri, 2014-01-10 at 10:02 +0000, David Laight wrote:
> > > Another way this could be changed is to put the
> > > return value on a separate line like:
> > >
> > > i40e_status
> > > i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 seid, bool
> set,
> > > 				    struct i40e_asq_cmd_details *cmd_details)
> >
> > Personally I prefer that so I can find the definition by grepping
> > for '^function_name' - but it doesn't seem to be done in any linux
> > source files.
> 
> That form is used in a lot of files.
> $ git grep -E "^[a-z_]+\("
> 

So, Joe, I just want to be clear. Is this a NAK, or just an FYI? If it's a serious issue for you (or Dave), we'll fix it right away. Otherwise, I'll just keep it in mind and come back with a janitorial patch once we've got all of the driver functionality sorted.

-Mitch

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

* Re: [net-next 05/16] i40e: fix long lines
  2014-01-10 18:05         ` Williams, Mitch A
@ 2014-01-10 18:14           ` Joe Perches
  2014-01-10 18:20             ` Williams, Mitch A
  0 siblings, 1 reply; 36+ messages in thread
From: Joe Perches @ 2014-01-10 18:14 UTC (permalink / raw)
  To: Williams, Mitch A
  Cc: David Laight, Kirsher, Jeffrey T, davem, netdev, gospo, sassmann,
	Brandeburg, Jesse

On Fri, 2014-01-10 at 18:05 +0000, Williams, Mitch A wrote:
> > -----Original Message-----
> > From: Joe Perches [mailto:joe@perches.com]
> > Sent: Friday, January 10, 2014 2:36 AM
[]
> > On Fri, 2014-01-10 at 10:02 +0000, David Laight wrote:
> > > > Another way this could be changed is to put the
> > > > return value on a separate line like:
> > > >
> > > > i40e_status
> > > > i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 seid, bool
> > set,
> > > > 				    struct i40e_asq_cmd_details *cmd_details)
> > >
> > > Personally I prefer that so I can find the definition by grepping
> > > for '^function_name' - but it doesn't seem to be done in any linux
> > > source files.
> > 
> > That form is used in a lot of files.
> > $ git grep -E "^[a-z_]+\("
> > 
> 
> So, Joe, I just want to be clear. Is this a NAK, or just an FYI?

Hi Mitch.

This is your/intel's code.  I don't/shouldn't nak it.
I made a simple suggestion of an alternate style.

> If it's a serious issue for you (or Dave), we'll fix it right away.

It's up to you all to fix it (or not) as you chose.
It's trivial to me.

cheers, Joe

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

* RE: [net-next 05/16] i40e: fix long lines
  2014-01-10 18:14           ` Joe Perches
@ 2014-01-10 18:20             ` Williams, Mitch A
  0 siblings, 0 replies; 36+ messages in thread
From: Williams, Mitch A @ 2014-01-10 18:20 UTC (permalink / raw)
  To: Joe Perches
  Cc: David Laight, Kirsher, Jeffrey T, davem, netdev, gospo, sassmann,
	Brandeburg, Jesse



> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Friday, January 10, 2014 10:15 AM
> To: Williams, Mitch A
> Cc: David Laight; Kirsher, Jeffrey T; davem@davemloft.net;
> netdev@vger.kernel.org; gospo@redhat.com; sassmann@redhat.com; Brandeburg,
> Jesse
> Subject: Re: [net-next 05/16] i40e: fix long lines
> 
> On Fri, 2014-01-10 at 18:05 +0000, Williams, Mitch A wrote:
> > > -----Original Message-----
> > > From: Joe Perches [mailto:joe@perches.com]
> > > Sent: Friday, January 10, 2014 2:36 AM
> []
> > > On Fri, 2014-01-10 at 10:02 +0000, David Laight wrote:
> > > > > Another way this could be changed is to put the
> > > > > return value on a separate line like:
> > > > >
> > > > > i40e_status
> > > > > i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 seid,
> bool
> > > set,
> > > > > 				    struct i40e_asq_cmd_details *cmd_details)
> > > >
> > > > Personally I prefer that so I can find the definition by grepping
> > > > for '^function_name' - but it doesn't seem to be done in any linux
> > > > source files.
> > >
> > > That form is used in a lot of files.
> > > $ git grep -E "^[a-z_]+\("
> > >
> >
> > So, Joe, I just want to be clear. Is this a NAK, or just an FYI?
> 
> Hi Mitch.
> 
> This is your/intel's code.  I don't/shouldn't nak it.
> I made a simple suggestion of an alternate style.
> 
> > If it's a serious issue for you (or Dave), we'll fix it right away.
> 
> It's up to you all to fix it (or not) as you chose.
> It's trivial to me.
> 
> cheers, Joe

Thanks, Joe. As long as Dave is OK with it, I'll let it stand as-is and scrub the whole driver later for stuff like this.

BTW, I appreciate all the time you spend looking at our code. We've got a decent sized team here, but it's always good to have somebody outside the organization keeping us honest.

-Mitch

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

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2014-04-22 12:39 Jeff Kirsher
@ 2014-04-23  1:47 ` David Miller
  0 siblings, 0 replies; 36+ messages in thread
From: David Miller @ 2014-04-23  1:47 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 22 Apr 2014 05:39:15 -0700

> This series contains updates to i40e and i40evf.

Pulled, thanks Jeff.

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

* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-04-22 12:39 Jeff Kirsher
  2014-04-23  1:47 ` David Miller
  0 siblings, 1 reply; 36+ messages in thread
From: Jeff Kirsher @ 2014-04-22 12:39 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to i40e and i40evf.

Greg provides two patches for i40e, the first adds the netdev ops to support
the addition of static FDB entries in the physical function (PF) MAC/VLAN
filter table so that the virtual functions (VFs) can communicate with
bridged virtual Ethernet ports such as those provided by the virtio
driver.  The second is to fix an issue where the assignment of a port
VLAN after it is already up and running requires the VF driver to be
reloaded, so print a message warning the host administrator about the
need to reload the VF driver.  In addition, knock the VF offline so that
it does not continue to receive traffic not on the port VLAN assigned to
it.

Jesse provides a patch for i40e and i40evf to unhide and enable the
PREFENA field in the receive host memory cache (RX-HMC) for best
performance.

Mitch provides a i40e patch to implement the net device op for Tx
bandwidth setting.

Catherine removes a firmware workaround that is no longer needed with
the latest firmware for i40e.  She also provides some minor cleanups
as well bumps the driver versions.

Anjali provides a fix for i40e displaying IPv4 flow director filters
which needed additional information to be communicated up above in
order for it to be displayed correctly.

Shannon adds tracking of the NVM busy state so that the driver won't
allow a new NVM update command until a completion event is received
from the current update.  Updates the admin queue API to reflect
recent changes in the firmware.  Also rearranges the "if netdev" logic
to prepare for handling non-netdev VSIs.  Lastly rework the fdir
setup and tear down to use the newly created i40e_vsi_open() and
i40e_vsi_close(), which also fixes a memory leak of the FDIR queue
buffer info structs across a reset.

The following are changes since commit 5a9d19ab76f98b7cdc97ba9724be01deba791bc0:
  Merge branch 'ndo_set_config'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Anjali Singhai Jain (1):
  i40e: Fix an issue with displaying IPv4 FD filters

Catherine Sullivan (5):
  i40e/i40evf: Bump build versions
  i40e: Remove a FW workaround
  i40e: Cleanup if/else statements
  i40e: Tweak for-loop in i40e_ethtool.c
  i40e/i40evf: Bump build versions

Greg Rose (2):
  i40e: Add bridge FDB add/del/dump ops
  i40e: Reset the VF upon conflicting VLAN configuration

Jesse Brandeburg (1):
  i40e/i40evf: unhide and enable to one prefena field

Mitch Williams (1):
  i40e: Enable VF Tx bandwidth setting

Shannon Nelson (6):
  i40e/i40evf: add tracking to NVM busy state
  i40e/i40evf: update AdminQ API
  i40e: prep vsi_open logic for non-netdev cases
  i40e: abstract the close path for better netdev vsis
  i40e: use generic vsi_open to unquiesce vsi
  i40e: rework fdir setup and teardown

 drivers/net/ethernet/intel/i40e/i40e_adminq.c      |  23 ++
 drivers/net/ethernet/intel/i40e/i40e_adminq.h      |   1 +
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h  |  41 +---
 drivers/net/ethernet/intel/i40e/i40e_common.c      |  29 +++
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  14 +-
 drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c     |   1 +
 drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h     |   1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 261 +++++++++++++--------
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |   3 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  93 +++++++-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |   1 +
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c    |  22 ++
 drivers/net/ethernet/intel/i40evf/i40e_adminq.h    |   1 +
 .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h    |  41 +---
 drivers/net/ethernet/intel/i40evf/i40e_lan_hmc.h   |   1 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |   2 +-
 16 files changed, 369 insertions(+), 166 deletions(-)

-- 
1.9.0

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

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2014-03-21 12:09 Jeff Kirsher
@ 2014-03-21 19:24 ` David Miller
  0 siblings, 0 replies; 36+ messages in thread
From: David Miller @ 2014-03-21 19:24 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 21 Mar 2014 05:09:50 -0700

> This series contains updates to igb, ixgbe, ixgbevf, i40e and i40evf.

Pulled, thanks Jeff.

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

* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-03-21 12:09 Jeff Kirsher
  2014-03-21 19:24 ` David Miller
  0 siblings, 1 reply; 36+ messages in thread
From: Jeff Kirsher @ 2014-03-21 12:09 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to igb, ixgbe, ixgbevf, i40e and i40evf.

Anjali provides a i40e/i40evf patch to add Energy Efficient Ethernet
Low Power Idle stats and a fix for i40e to change the string
"Side Band" to "Sideband" for consistency.

Mitch provides 2 patches for i40evf to fix if the driver encounters
an error while communicating with the PF driver, do not shut down the
admin queue unconditionally.  Add an error message when the admin
queue message never completes and fix formatting on another message
that was unnecessarily wrapped.

Mark provides a ixgbe patch and five ixgbevf patches.  Fix a possible
infinite recursion when an adapter is removed and registers all read
as all one's in ixgbe_clear_vmdq_generic() and ixgbe_clear_rar_generic().
Converts macros to static inline functions to align kernel coding standard
and prepare for adding Live Error Recovery (LER) to ixgbevf.  Change the
ethtool register test to use the normal register accessor functions and
eliminate macors used for calling register test functions to make error
exits more clear.  Checks all register reads for adapter removal by checking
the status register after any register read that returns all F's since the
status register will never return 0xFFFFFFFF unless the adapter is removed.

Jacob implements SIOCGHWTSTAMP ioctl for igb which enables user processes
to read the current hardware stamp config settings non-destructively.

Todd adds the initial register read and write for surprise removal (LER)
for igb.

Christian Engelmayer fixes an igb memory leak in the igb_get_module_eeprom()
error handling path.

Ken Ichikawa provides a fix for igb, specifically for 82575 hardware to
specify -1 to the phc_index for ethtool's get_ts_info, otherwise a wrong
value will be set to the phc_index.

Christopher Paasch fixes a null pointer dereference in igb and makes sure
to unset the HAS_MSIX flag when the driver falls back to MSI only.

The following are changes since commit a85ae0e97879f51bccd8511668b07d346d98b3eb:
  Merge branch 'bcmgenet-next'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Anjali Singhai Jain (2):
  i40e/i40evf: Add EEE LPI stats
  i40e: Fix a message string

Christian Engelmayer (1):
  igb: Fix memory leak in igb_get_module_eeprom()

Christoph Paasch (2):
  igb: Fix Null-pointer dereference in igb_reset_q_vector
  igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back

Fujinaka, Todd (1):
  igb: add register rd/wr for surprise removal

Jacob Keller (1):
  igb: implement SIOCGHWTSTAMP ioctl

Ken ICHIKAWA (1):
  igb: specify phc_index of 82575 for get_ts_info

Mark Rustad (6):
  ixgbe: Break recursion in case of removal
  ixgbevf: Use static inlines instead of macros
  ixgbevf: Make the ethtool register test use accessors
  ixgbevf: Check register reads for adapter removal
  ixgbevf: Check for adapter removal on register writes
  ixgbevf: Additional adapter removal checks

Mitch Williams (2):
  i40evf: don't shut down admin queue on error
  i40evf: clean up init error messages

 drivers/net/ethernet/intel/i40e/i40e_ethtool.c    |   5 +
 drivers/net/ethernet/intel/i40e/i40e_main.c       |  17 ++-
 drivers/net/ethernet/intel/i40e/i40e_type.h       |   5 +
 drivers/net/ethernet/intel/i40evf/i40e_type.h     |   5 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c   |   9 +-
 drivers/net/ethernet/intel/igb/e1000_regs.h       |  21 +++-
 drivers/net/ethernet/intel/igb/igb.h              |   5 +-
 drivers/net/ethernet/intel/igb/igb_ethtool.c      |  14 ++-
 drivers/net/ethernet/intel/igb/igb_main.c         |  33 ++++-
 drivers/net/ethernet/intel/igb/igb_ptp.c          |  46 ++++---
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c   |   3 +
 drivers/net/ethernet/intel/ixgbevf/ethtool.c      | 141 ++++++++++++++--------
 drivers/net/ethernet/intel/ixgbevf/ixgbevf.h      |   6 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |  68 ++++++++++-
 drivers/net/ethernet/intel/ixgbevf/regs.h         |  12 +-
 drivers/net/ethernet/intel/ixgbevf/vf.h           |  33 ++++-
 16 files changed, 321 insertions(+), 102 deletions(-)

-- 
1.8.3.1

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

* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-03-17 12:45 Jeff Kirsher
  0 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to i40e, i40evf, e1000e, ixgbe and ixgbevf.

Mitch adds support for the VF link state ndo which allows the PF driver
to control the virtual link state of the VF devices.  Fixed the RSS HLUT
programming loop in i40evf because most of the entries were not being
written at all which caused the flows to end up at queue zero.  Added
support for viewing and modifying RSS hash options and RSS hash look-up
table programming through ethtool for i40evf.  Fixed complaint about
the use of min() where min_t() should be used in i40evf.

Anjali adds support for ethtool -k option for NTUPLE control for i40e.

Elizabeth cleans up and refactors i40e_open() to separate out the VSI
code into its own i40e_vsi_open().

Jesse enables the hardware feature head write back to avoid updating the
descriptor ring by marking each descriptor with a DD bit and instead
writes a memory location with an update to where the driver should clean
up to in i40e and i40evf.  Reduces context descriptors for i40e/i40evf
since we do not need context descriptors for every packet, only for
TSO or timesync.

Dan Carpenter fixes a potential array underflow in i40e_vc_process_vf_msg().

Dave fixes an e1000e hardware unit hang where the check for pending Tx work
when link is lost was mistakenly moved to be done only when link is first
detected to be lost.  Fixed a problem with poor network performance on
certain silicon in e1000e when configured for 100M HDX performance.

Carolyn adds register defines needed for time sync functions and the code
to call the updated defines.

Jacob adds the ixgbe function for writing PCI config word and checks
whether the adapter has been removed first.

Mark adds the bit __IXGBEVF_REMOVING to indicate that the module is being
removed because the __IXGBEVF_DOWN bit had been overloaded for this
purpose, but leads to trouble.  ixgbevf_down function can now prevent
multiple executions by doing test_and_set_bit on __IXGBEVF_DOWN.

The following are changes since commit e7ef085d0a9dc1cc72e7d8108ed3b4e1a5e8d938:
  Merge branch 'napi_budget_zero'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Anjali Singhai Jain (1):
  i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control

Carolyn Wyborny (1):
  igb: Add register defines needed for time sync functions

Catherine Sullivan (1):
  i40e/i40evf: Bump build versions

Dan Carpenter (1):
  i40e: potential array underflow in i40e_vc_process_vf_msg()

David Ertman (2):
  e1000e: Fix Hardware Unit Hang
  e1000e: Fix Explicitly set Transmit Control Register

Elizabeth Kappler (1):
  i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()

Jacob Keller (1):
  ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check

Jesse Brandeburg (2):
  i40e/i40evf: enable hardware feature head write back
  i40e/i40evf: reduce context descriptors

Mark Rustad (2):
  ixgbevf: Indicate removal state explicitly
  ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit

Mitch Williams (4):
  i40e: support VF link state ndo
  i40evf: correctly program RSS HLUT table
  i40evf: Support RSS option in ethtool
  i40evf: use min_t

 drivers/net/ethernet/intel/e1000e/netdev.c         |  42 ++-
 drivers/net/ethernet/intel/i40e/i40e.h             |   4 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  89 +++++-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |  48 +++-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  91 +++++-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |   4 +
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c      |  48 +++-
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 315 +++++++++++++++++++++
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  23 +-
 drivers/net/ethernet/intel/igb/e1000_defines.h     |  70 ++++-
 drivers/net/ethernet/intel/igb/e1000_regs.h        |   9 +
 drivers/net/ethernet/intel/igb/igb_ptp.c           |   4 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c     |   6 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.h    |   1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |   9 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf.h       |   5 +-
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c  |  18 +-
 17 files changed, 715 insertions(+), 71 deletions(-)

-- 
1.8.3.1

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

* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-03-14  9:47 Jeff Kirsher
  0 siblings, 0 replies; 36+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to ixgbe, igb, i40e and i40evf.

Emil provides two fixes for ixgbe which could have been sent to the
net tree, but being this late in the -rc, I chose to go through net-next
and have stable pick these up.  Both fixes resolve issues found when
using netconsole, first prevents resets on ifup/ifdown when the interface
is down and the second resolves a hand with busy poll.

I provide a code comment fix which David Miller noticed in the last
series of patches I submitted.

Shannon provides a patch to cleanup the NAPI structs when deleting the
netdev.

Anjali provides several patches for i40e, first fixes a bug in the update
filter logic which was causing a kernel panic.  Then provides a fix to
rename an error bit to correctly indicate the error.  Adds a definition
for a new state variable to keep track of features automatically disabled
due to hardware resource limitations versus user enforced feature disabled.
Anjali provides a patch to add code to handle when there is a filter
programming error due to a full table, which also resolves a previous
compile warning about an unused "*pf" variable introduced in the last i40e
series patch submission.

Jesse provides three i40e patches to cleanup strings to make more
consistent and to align with other Intel drivers.

Akeem cleans up a misleading function header comment for i40e.

Mitch provides a fix for i40e/i40evf to use the correctly reported number
of MSI-X vectors in the PF an VF.  Then provides a patch to use
dma_set_mask_and_coherent() which was introduced in v3.13 and simplifies
the DMA mapping code a bit.

The following are changes since commit 177943260a6088bec51fc6c04643d84e43bef423:
  6lowpan: reassembly: un-export local functions
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Akeem G Abodunrin (1):
  i40e: Fix function comments

Anjali Singhai Jain (6):
  i40e: Fix a bug in the update logic for FDIR SB filter.
  i40e/i40evf: Some flow director HW definition fixes
  i40e: Define a new state variable to keep track of feature auto
    disable
  i40e: Add code to handle FD table full condition
  i40e: Bug fix for FDIR replay logic
  i40e: Let MDD events be handled by MDD handler

Emil Tantilov (2):
  ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  ixgbe: fix spinlock recursion with netpoll and busy poll

Jeff Kirsher (1):
  igb: Fix code comment

Jesse Brandeburg (3):
  i40e: make string references to q be queue
  i40e: cleanup strings
  i40e: simplified init string

Mitch Williams (2):
  i40e/i40evf: Use correct number of VF vectors
  i40e/i40evf: Use dma_set_mask_and_coherent

Shannon Nelson (1):
  i40e: delete netdev after deleting napi and vectors

 drivers/net/ethernet/intel/i40e/i40e.h             |  10 +-
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c     |  25 ++-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  37 +++-
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 190 +++++++++++++++------
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |  60 ++++++-
 drivers/net/ethernet/intel/i40e/i40e_type.h        |   6 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   9 +-
 drivers/net/ethernet/intel/i40evf/i40e_type.h      |   6 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  19 +--
 drivers/net/ethernet/intel/igb/igb_main.c          |   2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe.h           |   3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |  23 ++-
 12 files changed, 285 insertions(+), 105 deletions(-)

-- 
1.8.3.1

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

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2012-02-24 10:12 Jeff Kirsher
@ 2012-02-24 19:49 ` David Miller
  0 siblings, 0 replies; 36+ messages in thread
From: David Miller @ 2012-02-24 19:49 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 24 Feb 2012 02:12:53 -0800

> The following are changes since commit 7c3a95a15ad2a5278498a72df0463131048926a3:
>   davinci_mdio: Correct bitmask for clock divider value
> and are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Applied, but I had to add the following patch on top for completeness.

--------------------
net: Add missing getsockopt for SO_NOFCS.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/core/sock.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 55011cb..216719c 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1035,6 +1035,9 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 
 		v.val = sk->sk_peek_off;
 		break;
+	case SO_NOFCS:
+		v.val = !!sock_flag(sk, SOCK_NOFCS);
+		break;
 	default:
 		return -ENOPROTOOPT;
 	}
-- 
1.7.7.6

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

* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2012-02-24 10:12 Jeff Kirsher
  2012-02-24 19:49 ` David Miller
  0 siblings, 1 reply; 36+ messages in thread
From: Jeff Kirsher @ 2012-02-24 10:12 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This patch series contains most of Ben Greear's low-level
Ethernet debugging features patch series.  Problems were found
with the e100 and one of the e1000 patches in the series, so they
have been dropped and will be pushed later once the problems get
ironed out.  There are 4 additional patches added to this pull
request which do the following:

e1000e - cosmetic changes
e1000 - cleanup e1000_dump and e1000_config_dsp_after_link_change
        functions

Here is the patch summary for Ben's low-level Ethernet debugging
patches:

This patch series enables some features designed to make
testing ethernet devices and debugging link-level errors
easier.

First, support is added for receiving the Ethernet FCS.  This
allows stock wireshark to show you the actual Ethernet FCS.

Second, allow sending packets with user-specified Ethernet
FCS.  The user can specify bad FCS in order to test network
equipments' handling of FCS errors, or, in strange cases,
users might want to implement their own FCS scheme.

Third, allow configuring a NIC to receive errored (and possibly
other types of packets not normally passed up the stack).  This
allows sniffers to show packets with bad FCS, for instance.

The following are changes since commit 7c3a95a15ad2a5278498a72df0463131048926a3:
  davinci_mdio: Correct bitmask for clock divider value
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Ben Greear (12):
  net: Support RXFCS feature flag.
  e1000e: Support RXFCS feature flag.
  net: Add framework to allow sending packets with customized CRC.
  e1000e: Support sending custom Ethernet CRC.
  net: Support RX-ALL feature flag.
  e1000e: Support RXALL feature flag.
  e1000: Support sending custom Ethernet CRC.
  e1000: Support RX-FCS flag.
  8139too: Support RX-ALL logic.
  8139too: Support RX-FCS flag.
  r8169: Support RX-ALL flag.
  r8169: Support RX-FCS flag.

Bruce Allan (2):
  e1000e: cosmetic change to boolean comparisons
  e1000e: cosmetic comment changes to make lines less than 80
    characters

Joe Perches (1):
  e1000: Neaten e1000_config_dsp_after_link_change

Tushar Dave (1):
  v2 e1000: Neaten e1000_dump function

 Documentation/networking/netdev-features.txt    |   13 ++
 arch/alpha/include/asm/socket.h                 |    3 +
 arch/arm/include/asm/socket.h                   |    3 +
 arch/avr32/include/asm/socket.h                 |    3 +
 arch/cris/include/asm/socket.h                  |    3 +
 arch/frv/include/asm/socket.h                   |    3 +
 arch/h8300/include/asm/socket.h                 |    3 +
 arch/ia64/include/asm/socket.h                  |    3 +
 arch/m32r/include/asm/socket.h                  |    3 +
 arch/m68k/include/asm/socket.h                  |    3 +
 arch/mips/include/asm/socket.h                  |    3 +
 arch/mn10300/include/asm/socket.h               |    3 +
 arch/parisc/include/asm/socket.h                |    4 +
 arch/powerpc/include/asm/socket.h               |    3 +
 arch/s390/include/asm/socket.h                  |    3 +
 arch/sparc/include/asm/socket.h                 |    4 +
 arch/xtensa/include/asm/socket.h                |    3 +
 drivers/net/ethernet/intel/e1000/e1000_hw.c     |  156 +++++++++++------------
 drivers/net/ethernet/intel/e1000/e1000_main.c   |  147 +++++++++++-----------
 drivers/net/ethernet/intel/e1000e/80003es2lan.c |    8 +-
 drivers/net/ethernet/intel/e1000e/defines.h     |    1 +
 drivers/net/ethernet/intel/e1000e/e1000.h       |    1 +
 drivers/net/ethernet/intel/e1000e/netdev.c      |   80 ++++++++++--
 drivers/net/ethernet/intel/e1000e/param.c       |    5 +-
 drivers/net/ethernet/realtek/8139too.c          |   58 ++++++++-
 drivers/net/ethernet/realtek/r8169.c            |   55 ++++++--
 include/asm-generic/socket.h                    |    4 +
 include/linux/if.h                              |    2 +
 include/linux/netdev_features.h                 |    4 +
 include/linux/netdevice.h                       |    8 +-
 include/linux/skbuff.h                          |    4 +-
 include/net/sock.h                              |    4 +
 net/core/ethtool.c                              |    2 +
 net/core/skbuff.c                               |    1 +
 net/core/sock.c                                 |    5 +
 net/packet/af_packet.c                          |   32 ++++-
 36 files changed, 449 insertions(+), 191 deletions(-)

-- 
1.7.7.6

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

end of thread, other threads:[~2014-04-23  1:47 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-10  8:58 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-01-10  8:58 ` [net-next 01/16] i40e: use assignment instead of memcpy Jeff Kirsher
2014-01-10  8:58 ` [net-next 02/16] i40e: drop unused macros Jeff Kirsher
2014-01-10  8:58 ` [net-next 03/16] i40e: Update the Current NVM version Low value Jeff Kirsher
2014-01-10  8:58 ` [net-next 04/16] i40e: Bump version Jeff Kirsher
2014-01-10  8:58 ` [net-next 05/16] i40e: fix long lines Jeff Kirsher
2014-01-10  9:07   ` Joe Perches
2014-01-10 10:02     ` David Laight
2014-01-10 10:35       ` Joe Perches
2014-01-10 18:05         ` Williams, Mitch A
2014-01-10 18:14           ` Joe Perches
2014-01-10 18:20             ` Williams, Mitch A
2014-01-10  8:58 ` [net-next 06/16] i40e: Cleanup Doxygen warnings Jeff Kirsher
2014-01-10  8:58 ` [net-next 07/16] i40e: Setting queue count to 1 using ethtool is valid Jeff Kirsher
2014-01-10  8:58 ` [net-next 08/16] i40e: do not bail when disabling if Tx queue disable fails Jeff Kirsher
2014-01-10  8:58 ` [net-next 09/16] i40e: allow VF to remove any MAC filter Jeff Kirsher
2014-01-10  8:58 ` [net-next 10/16] i40e: check for possible incorrect ipv6 checksum Jeff Kirsher
2014-01-10  8:58 ` [net-next 11/16] i40e: adjust ITR max and min values Jeff Kirsher
2014-01-10  8:58 ` [net-next 12/16] i40e: clear qtx_head before enabling Tx queue Jeff Kirsher
2014-01-10  8:58 ` [net-next 13/16] i40e: call clear_pxe after adminq is initialized Jeff Kirsher
2014-01-10  8:58 ` [net-next 14/16] i40e: enable PTP Jeff Kirsher
2014-01-10 11:26   ` Richard Cochran
2014-01-10 15:55   ` Ben Hutchings
2014-01-10 16:48     ` Keller, Jacob E
2014-01-10  8:58 ` [net-next 15/16] i40e: fix log message wording Jeff Kirsher
2014-01-10  8:58 ` [net-next 16/16] i40e: Bump version Jeff Kirsher
2014-01-10 17:48 ` [net-next 00/16][pull request] Intel Wired LAN Driver Updates David Miller
2014-01-10 17:56   ` Jeff Kirsher
  -- strict thread matches above, loose matches on Subject: below --
2014-04-22 12:39 Jeff Kirsher
2014-04-23  1:47 ` David Miller
2014-03-21 12:09 Jeff Kirsher
2014-03-21 19:24 ` David Miller
2014-03-17 12:45 Jeff Kirsher
2014-03-14  9:47 Jeff Kirsher
2012-02-24 10:12 Jeff Kirsher
2012-02-24 19:49 ` 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.