All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-03-17 12:45 Jeff Kirsher
  2014-03-17 12:45 ` [net-next 01/16] i40e: support VF link state ndo Jeff Kirsher
                   ` (15 more replies)
  0 siblings, 16 replies; 37+ 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] 37+ messages in thread

* [net-next 01/16] i40e: support VF link state ndo
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 21:24   ` Or Gerlitz
  2014-03-17 12:45 ` [net-next 02/16] i40evf: correctly program RSS HLUT table Jeff Kirsher
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

This netdev op allows the PF driver to control the virtual link state of
the VF devices. This can be used to deny naughty VF drivers access to
the wire, or to allow VFs (regardless of temperament) to communicate
with each other over the device's internal switch even though external
link is down.

Add the actual ndo function, and modify vc_notify_link_state to check
the link status of each VF before sending a message in the case when
physical link changes state.

Change-ID: Ib5a6924da78c540789f21d26b5e8086d71c29384
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  1 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 86 ++++++++++++++++++++--
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |  4 +
 3 files changed, 85 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index c66a11e..c7b236f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6547,6 +6547,7 @@ static const struct net_device_ops i40e_netdev_ops = {
 	.ndo_set_vf_vlan	= i40e_ndo_set_vf_port_vlan,
 	.ndo_set_vf_tx_rate	= i40e_ndo_set_vf_bw,
 	.ndo_get_vf_config	= i40e_ndo_get_vf_config,
+	.ndo_set_vf_link_state	= i40e_ndo_set_vf_link_state,
 #ifdef CONFIG_I40E_VXLAN
 	.ndo_add_vxlan_port	= i40e_add_vxlan_port,
 	.ndo_del_vxlan_port	= i40e_del_vxlan_port,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 7839343..f018238 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1920,15 +1920,28 @@ static void i40e_vc_vf_broadcast(struct i40e_pf *pf,
 void i40e_vc_notify_link_state(struct i40e_pf *pf)
 {
 	struct i40e_virtchnl_pf_event pfe;
+	struct i40e_hw *hw = &pf->hw;
+	struct i40e_vf *vf = pf->vf;
+	struct i40e_link_status *ls = &pf->hw.phy.link_info;
+	int i;
 
 	pfe.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE;
 	pfe.severity = I40E_PF_EVENT_SEVERITY_INFO;
-	pfe.event_data.link_event.link_status =
-	    pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP;
-	pfe.event_data.link_event.link_speed = pf->hw.phy.link_info.link_speed;
-
-	i40e_vc_vf_broadcast(pf, I40E_VIRTCHNL_OP_EVENT, I40E_SUCCESS,
-			     (u8 *)&pfe, sizeof(struct i40e_virtchnl_pf_event));
+	for (i = 0; i < pf->num_alloc_vfs; i++) {
+		if (vf->link_forced) {
+			pfe.event_data.link_event.link_status = vf->link_up;
+			pfe.event_data.link_event.link_speed =
+				(vf->link_up ? I40E_LINK_SPEED_40GB : 0);
+		} else {
+			pfe.event_data.link_event.link_status =
+				ls->link_info & I40E_AQ_LINK_UP;
+			pfe.event_data.link_event.link_speed = ls->link_speed;
+		}
+		i40e_aq_send_msg_to_vf(hw, vf->vf_id, I40E_VIRTCHNL_OP_EVENT,
+				       0, (u8 *)&pfe, sizeof(pfe),
+				       NULL);
+		vf++;
+	}
 }
 
 /**
@@ -2193,3 +2206,64 @@ int i40e_ndo_get_vf_config(struct net_device *netdev,
 error_param:
 	return ret;
 }
+
+/**
+ * i40e_ndo_set_vf_link_state
+ * @netdev: network interface device structure
+ * @vf_id: vf identifier
+ * @link: required link state
+ *
+ * Set the link state of a specified VF, regardless of physical link state
+ **/
+int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)
+{
+	struct i40e_netdev_priv *np = netdev_priv(netdev);
+	struct i40e_pf *pf = np->vsi->back;
+	struct i40e_virtchnl_pf_event pfe;
+	struct i40e_hw *hw = &pf->hw;
+	struct i40e_vf *vf;
+	int ret = 0;
+
+	/* validate the request */
+	if (vf_id >= pf->num_alloc_vfs) {
+		dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id);
+		ret = -EINVAL;
+		goto error_out;
+	}
+
+	vf = &(pf->vf[vf_id]);
+
+	pfe.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE;
+	pfe.severity = I40E_PF_EVENT_SEVERITY_INFO;
+
+	switch (link) {
+	case IFLA_VF_LINK_STATE_AUTO:
+		vf->link_forced = false;
+		pfe.event_data.link_event.link_status =
+			pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP;
+		pfe.event_data.link_event.link_speed =
+			pf->hw.phy.link_info.link_speed;
+		break;
+	case IFLA_VF_LINK_STATE_ENABLE:
+		vf->link_forced = true;
+		vf->link_up = true;
+		pfe.event_data.link_event.link_status = true;
+		pfe.event_data.link_event.link_speed = I40E_LINK_SPEED_40GB;
+		break;
+	case IFLA_VF_LINK_STATE_DISABLE:
+		vf->link_forced = true;
+		vf->link_up = false;
+		pfe.event_data.link_event.link_status = false;
+		pfe.event_data.link_event.link_speed = 0;
+		break;
+	default:
+		ret = -EINVAL;
+		goto error_out;
+	}
+	/* Notify the VF of its new link state */
+	i40e_aq_send_msg_to_vf(hw, vf->vf_id, I40E_VIRTCHNL_OP_EVENT,
+			       0, (u8 *)&pfe, sizeof(pfe), NULL);
+
+error_out:
+	return ret;
+}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index bedf0ba..389c47f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -98,6 +98,8 @@ struct i40e_vf {
 
 	unsigned long vf_caps;	/* vf's adv. capabilities */
 	unsigned long vf_states;	/* vf's runtime states */
+	bool link_forced;
+	bool link_up;		/* only valid if vf link is forced */
 };
 
 void i40e_free_vfs(struct i40e_pf *pf);
@@ -116,6 +118,8 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
 int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int tx_rate);
 int i40e_ndo_get_vf_config(struct net_device *netdev,
 			   int vf_id, struct ifla_vf_info *ivi);
+int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link);
+
 void i40e_vc_notify_link_state(struct i40e_pf *pf);
 void i40e_vc_notify_reset(struct i40e_pf *pf);
 
-- 
1.8.3.1

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

* [net-next 02/16] i40evf: correctly program RSS HLUT table
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-03-17 12:45 ` [net-next 01/16] i40e: support VF link state ndo Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 03/16] i40evf: Support RSS option in ethtool Jeff Kirsher
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

The HLUT programming loop in in i40evf_configure_rss was a) overly-
complicated, and b) just plain broken. Most of the entries ended up being
not written at all, so most of the flows ended up at queue zero.

Refactor the HLUT programming loop to simply walk through the registers
and write four values to each one, incrementing through the number of
available queues.

Change-ID: I75766179bc67e4e997187794f3144e28c83fd00d
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d62e27f..7cb0cda 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1414,6 +1414,7 @@ restart_watchdog:
 	schedule_work(&adapter->adminq_task);
 }
 
+#define NEXT_QUEUE(_j) (++_j >= adapter->vsi_res->num_queue_pairs ? _j = 0 : _j)
 /**
  * i40evf_configure_rss - Prepare for RSS if used
  * @adapter: board private structure
@@ -1444,15 +1445,13 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter)
 	wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32));
 
 	/* Populate the LUT with max no. of queues in round robin fashion */
-	for (i = 0, j = 0; i < I40E_VFQF_HLUT_MAX_INDEX; i++, j++) {
-		if (j == adapter->vsi_res->num_queue_pairs)
-			j = 0;
-		/* lut = 4-byte sliding window of 4 lut entries */
-		lut = (lut << 8) | (j &
-			 ((0x1 << 8) - 1));
-		/* On i = 3, we have 4 entries in lut; write to the register */
-		if ((i & 3) == 3)
-			wr32(hw, I40E_VFQF_HLUT(i >> 2), lut);
+	j = adapter->vsi_res->num_queue_pairs;
+	for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
+		lut = NEXT_QUEUE(j);
+		lut |= NEXT_QUEUE(j) << 8;
+		lut |= NEXT_QUEUE(j) << 16;
+		lut |= NEXT_QUEUE(j) << 24;
+		wr32(hw, I40E_VFQF_HLUT(i), lut);
 	}
 	i40e_flush(hw);
 }
-- 
1.8.3.1

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

* [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-03-17 12:45 ` [net-next 01/16] i40e: support VF link state ndo Jeff Kirsher
  2014-03-17 12:45 ` [net-next 02/16] i40evf: correctly program RSS HLUT table Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 14:40   ` Or Gerlitz
  2014-03-17 18:53   ` Ben Hutchings
  2014-03-17 12:45 ` [net-next 04/16] i40evf: use min_t Jeff Kirsher
                   ` (12 subsequent siblings)
  15 siblings, 2 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

Add support for viewing and modifying RSS hash options and RSS hash
look-up table programming through ethtool. Because the lookup table is
so small for the VFs (only 16 registers), we don't bother to maintain a
shadow table in memory, we just read and write the registers directly.

Change-ID: Ib5a6924da78c540789f21d26b5e8086d71c29384
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 315 +++++++++++++++++++++
 1 file changed, 315 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index 8b0db1c..6a169aa 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -365,6 +365,315 @@ static int i40evf_set_coalesce(struct net_device *netdev,
 	return 0;
 }
 
+/**
+ * i40evf_get_rss_hash_opts - Get RSS hash Input Set for each flow type
+ * @adapter: board private structure
+ * @cmd: ethtool rxnfc command
+ *
+ * Returns Success if the flow is supported, else Invalid Input.
+ **/
+static int i40evf_get_rss_hash_opts(struct i40evf_adapter *adapter,
+				    struct ethtool_rxnfc *cmd)
+{
+	cmd->data = 0;
+
+	/* Report default options for RSS on i40e */
+	switch (cmd->flow_type) {
+	case TCP_V4_FLOW:
+	case UDP_V4_FLOW:
+		cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+	/* fall through to add IP fields */
+	case SCTP_V4_FLOW:
+	case AH_ESP_V4_FLOW:
+	case AH_V4_FLOW:
+	case ESP_V4_FLOW:
+	case IPV4_FLOW:
+		cmd->data |= RXH_IP_SRC | RXH_IP_DST;
+		break;
+	case TCP_V6_FLOW:
+	case UDP_V6_FLOW:
+		cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+	/* fall through to add IP fields */
+	case SCTP_V6_FLOW:
+	case AH_ESP_V6_FLOW:
+	case AH_V6_FLOW:
+	case ESP_V6_FLOW:
+	case IPV6_FLOW:
+		cmd->data |= RXH_IP_SRC | RXH_IP_DST;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+/**
+ * i40evf_get_rxnfc - command to get RX flow classification rules
+ * @netdev: network interface device structure
+ * @cmd: ethtool rxnfc command
+ *
+ * Returns Success if the command is supported.
+ **/
+static int i40evf_get_rxnfc(struct net_device *netdev,
+			    struct ethtool_rxnfc *cmd,
+			    u32 *rule_locs)
+{
+	struct i40evf_adapter *adapter = netdev_priv(netdev);
+	int ret = -EOPNOTSUPP;
+
+	switch (cmd->cmd) {
+	case ETHTOOL_GRXRINGS:
+		cmd->data = adapter->vsi_res->num_queue_pairs;
+		ret = 0;
+		break;
+	case ETHTOOL_GRXFH:
+		ret = i40evf_get_rss_hash_opts(adapter, cmd);
+		break;
+	default:
+		break;
+	}
+
+	return ret;
+}
+
+/**
+ * i40evf_set_rss_hash_opt - Enable/Disable flow types for RSS hash
+ * @adapter: board private structure
+ * @cmd: ethtool rxnfc command
+ *
+ * Returns Success if the flow input set is supported.
+ **/
+static int i40evf_set_rss_hash_opt(struct i40evf_adapter *adapter,
+				   struct ethtool_rxnfc *nfc)
+{
+	struct i40e_hw *hw = &adapter->hw;
+	u64 hena = (u64)rd32(hw, I40E_VFQF_HENA(0)) |
+		   ((u64)rd32(hw, I40E_VFQF_HENA(1)) << 32);
+
+	/* RSS does not support anything other than hashing
+	 * to queues on src and dst IPs and ports
+	 */
+	if (nfc->data & ~(RXH_IP_SRC | RXH_IP_DST |
+			  RXH_L4_B_0_1 | RXH_L4_B_2_3))
+		return -EINVAL;
+
+	/* We need at least the IP SRC and DEST fields for hashing */
+	if (!(nfc->data & RXH_IP_SRC) ||
+	    !(nfc->data & RXH_IP_DST))
+		return -EINVAL;
+
+	switch (nfc->flow_type) {
+	case TCP_V4_FLOW:
+		switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) {
+		case 0:
+			hena &= ~((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP);
+			break;
+		case (RXH_L4_B_0_1 | RXH_L4_B_2_3):
+			hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP);
+			break;
+		default:
+			return -EINVAL;
+		}
+		break;
+	case TCP_V6_FLOW:
+		switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) {
+		case 0:
+			hena &= ~((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP);
+			break;
+		case (RXH_L4_B_0_1 | RXH_L4_B_2_3):
+			hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP);
+			break;
+		default:
+			return -EINVAL;
+		}
+		break;
+	case UDP_V4_FLOW:
+		switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) {
+		case 0:
+			hena &=
+			~(((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) |
+			((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) |
+			((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4));
+			break;
+		case (RXH_L4_B_0_1 | RXH_L4_B_2_3):
+			hena |=
+			(((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP)  |
+			((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) |
+			((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4));
+			break;
+		default:
+			return -EINVAL;
+		}
+		break;
+	case UDP_V6_FLOW:
+		switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) {
+		case 0:
+			hena &=
+			~(((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) |
+			((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP) |
+			((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6));
+			break;
+		case (RXH_L4_B_0_1 | RXH_L4_B_2_3):
+			hena |=
+			(((u64)1 << I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP)  |
+			((u64)1 << I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP) |
+			((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6));
+			break;
+		default:
+			return -EINVAL;
+		}
+		break;
+	case AH_ESP_V4_FLOW:
+	case AH_V4_FLOW:
+	case ESP_V4_FLOW:
+	case SCTP_V4_FLOW:
+		if ((nfc->data & RXH_L4_B_0_1) ||
+		    (nfc->data & RXH_L4_B_2_3))
+			return -EINVAL;
+		hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER);
+		break;
+	case AH_ESP_V6_FLOW:
+	case AH_V6_FLOW:
+	case ESP_V6_FLOW:
+	case SCTP_V6_FLOW:
+		if ((nfc->data & RXH_L4_B_0_1) ||
+		    (nfc->data & RXH_L4_B_2_3))
+			return -EINVAL;
+		hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER);
+		break;
+	case IPV4_FLOW:
+		hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) |
+			((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV4);
+		break;
+	case IPV6_FLOW:
+		hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) |
+			((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6);
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	wr32(hw, I40E_VFQF_HENA(0), (u32)hena);
+	wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32));
+	i40e_flush(hw);
+
+	return 0;
+}
+
+/**
+ * i40evf_set_rxnfc - command to set RX flow classification rules
+ * @netdev: network interface device structure
+ * @cmd: ethtool rxnfc command
+ *
+ * Returns Success if the command is supported.
+ **/
+static int i40evf_set_rxnfc(struct net_device *netdev,
+			    struct ethtool_rxnfc *cmd)
+{
+	struct i40evf_adapter *adapter = netdev_priv(netdev);
+	int ret = -EOPNOTSUPP;
+
+	switch (cmd->cmd) {
+	case ETHTOOL_SRXFH:
+		ret = i40evf_set_rss_hash_opt(adapter, cmd);
+		break;
+	default:
+		break;
+	}
+
+	return ret;
+}
+
+/**
+ * i40evf_get_channels: get the number of channels supported by the device
+ * @netdev: network interface device structure
+ * @ch: channel information structure
+ *
+ * For the purposes of our device, we only use combined channels, i.e. a tx/rx
+ * queue pair. Report one extra channel to match our "other" MSI-X vector.
+ **/
+static void i40evf_get_channels(struct net_device *netdev,
+				struct ethtool_channels *ch)
+{
+	struct i40evf_adapter *adapter = netdev_priv(netdev);
+
+	/* Report maximum channels */
+	ch->max_combined = adapter->vsi_res->num_queue_pairs;
+
+	ch->max_other = NONQ_VECS;
+	ch->other_count = NONQ_VECS;
+
+	ch->combined_count = adapter->vsi_res->num_queue_pairs;
+}
+
+/**
+ * i40evf_get_rxfh_indir_size - get the rx flow hash indirection table size
+ * @netdev: network interface device structure
+ *
+ * Returns the table size.
+ **/
+static u32 i40evf_get_rxfh_indir_size(struct net_device *netdev)
+{
+	return (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4;
+}
+
+/**
+ * i40evf_get_rxfh_indir - get the rx flow hash indirection table
+ * @netdev: network interface device structure
+ * @indir: indirection table
+ *
+ * Reads the indirection table directly from the hardware. Always returns 0.
+ **/
+static int i40evf_get_rxfh_indir(struct net_device *netdev, u32 *indir)
+{
+	struct i40evf_adapter *adapter = netdev_priv(netdev);
+	struct i40e_hw *hw = &adapter->hw;
+	u32 hlut_val;
+	int i, j;
+
+	for (i = 0, j = 0; i < I40E_VFQF_HLUT_MAX_INDEX; i++) {
+		hlut_val = rd32(hw, I40E_VFQF_HLUT(i));
+		indir[j++] = hlut_val & 0xff;
+		indir[j++] = (hlut_val >> 8) & 0xff;
+		indir[j++] = (hlut_val >> 16) & 0xff;
+		indir[j++] = (hlut_val >> 24) & 0xff;
+	}
+	return 0;
+}
+
+/**
+ * i40evf_set_rxfh_indir - set the rx flow hash indirection table
+ * @netdev: network interface device structure
+ * @indir: indirection table
+ *
+ * Returns -EINVAL if the table specifies an inavlid queue id, otherwise
+ * returns 0 after programming the table.
+ **/
+static int i40evf_set_rxfh_indir(struct net_device *netdev, const u32 *indir)
+{
+	struct i40evf_adapter *adapter = netdev_priv(netdev);
+	struct i40e_hw *hw = &adapter->hw;
+	u32 hlut_val;
+	int i, j;
+
+	/* Verify user input. */
+	for (i = 0; i < (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4; i++) {
+		if (indir[i] >= adapter->vsi_res->num_queue_pairs)
+			return -EINVAL;
+	}
+
+	for (i = 0, j = 0; i < I40E_VFQF_HLUT_MAX_INDEX + 1; i++) {
+		hlut_val = indir[j++];
+		hlut_val |= indir[j++] << 8;
+		hlut_val |= indir[j++] << 16;
+		hlut_val |= indir[j++] << 24;
+		wr32(hw, I40E_VFQF_HLUT(i), hlut_val);
+	}
+
+	return 0;
+}
+
 static struct ethtool_ops i40evf_ethtool_ops = {
 	.get_settings		= i40evf_get_settings,
 	.get_drvinfo		= i40evf_get_drvinfo,
@@ -378,6 +687,12 @@ static struct ethtool_ops i40evf_ethtool_ops = {
 	.set_msglevel		= i40evf_set_msglevel,
 	.get_coalesce		= i40evf_get_coalesce,
 	.set_coalesce		= i40evf_set_coalesce,
+	.get_rxnfc		= i40evf_get_rxnfc,
+	.set_rxnfc		= i40evf_set_rxnfc,
+	.get_rxfh_indir_size	= i40evf_get_rxfh_indir_size,
+	.get_rxfh_indir		= i40evf_get_rxfh_indir,
+	.set_rxfh_indir		= i40evf_set_rxfh_indir,
+	.get_channels		= i40evf_get_channels,
 };
 
 /**
-- 
1.8.3.1

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

* [net-next 04/16] i40evf: use min_t
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (2 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 03/16] i40evf: Support RSS option in ethtool Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 05/16] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control Jeff Kirsher
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

Checkpatch complained in an earlier patch about using min(), but that
change would have been completely unrelated to the point of that patch.
So fix it here.

Change-ID: I2cd87b39cfd406850d283b88f259757a6bcd14cd
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 7cb0cda..963387c 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1140,8 +1140,8 @@ static int i40evf_set_interrupt_capability(struct i40evf_adapter *adapter)
 	 * than CPU's.  So let's be conservative and only ask for
 	 * (roughly) twice the number of vectors as there are CPU's.
 	 */
-	v_budget = min(pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS;
-	v_budget = min(v_budget, (int)adapter->vf_res->max_vectors);
+	v_budget = min_t(int, pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS;
+	v_budget = min_t(int, v_budget, (int)adapter->vf_res->max_vectors);
 
 	/* A failure in MSI-X entry allocation isn't fatal, but it does
 	 * mean we disable MSI-X capabilities of the adapter.
-- 
1.8.3.1

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

* [net-next 05/16] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (3 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 04/16] i40evf: use min_t Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 06/16] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open() Jeff Kirsher
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

This enables option '-k/-K' in ethtool for NTUPLE control.
NTUPLE control requires a reset, to take effect. When the feature is
turned off, the SW list of stored FD SB filters gets cleaned up.

Change-ID: I9d564b67a10d4afa11de3b320d601c3d2e6edc1f
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@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.h      |  1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c | 41 +++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index bd1b469..ac04112 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -558,6 +558,7 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
 		      struct i40e_fdir_filter *input, bool add);
 void i40e_fdir_check_and_reenable(struct i40e_pf *pf);
 int i40e_get_current_fd_count(struct i40e_pf *pf);
+bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features);
 void i40e_set_ethtool_ops(struct net_device *netdev);
 struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
 					u8 *macaddr, s16 vlan,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index c7b236f..0c7eff3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6409,6 +6409,39 @@ sw_init_done:
 }
 
 /**
+ * i40e_set_ntuple - set the ntuple feature flag and take action
+ * @pf: board private structure to initialize
+ * @features: the feature set that the stack is suggesting
+ *
+ * returns a bool to indicate if reset needs to happen
+ **/
+bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features)
+{
+	bool need_reset = false;
+
+	/* Check if Flow Director n-tuple support was enabled or disabled.  If
+	 * the state changed, we need to reset.
+	 */
+	if (features & NETIF_F_NTUPLE) {
+		/* Enable filters and mark for reset */
+		if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
+			need_reset = true;
+		pf->flags |= I40E_FLAG_FD_SB_ENABLED;
+	} else {
+		/* turn off filters, mark for reset and clear SW filter list */
+		if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
+			need_reset = true;
+			i40e_fdir_filter_exit(pf);
+		}
+		pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
+		/* if ATR was disabled it can be re-enabled. */
+		if (!(pf->flags & I40E_FLAG_FD_ATR_ENABLED))
+			pf->flags |= I40E_FLAG_FD_ATR_ENABLED;
+	}
+	return need_reset;
+}
+
+/**
  * i40e_set_features - set the netdev feature flags
  * @netdev: ptr to the netdev being adjusted
  * @features: the feature set that the stack is suggesting
@@ -6418,12 +6451,19 @@ static int i40e_set_features(struct net_device *netdev,
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_vsi *vsi = np->vsi;
+	struct i40e_pf *pf = vsi->back;
+	bool need_reset;
 
 	if (features & NETIF_F_HW_VLAN_CTAG_RX)
 		i40e_vlan_stripping_enable(vsi);
 	else
 		i40e_vlan_stripping_disable(vsi);
 
+	need_reset = i40e_set_ntuple(pf, features);
+
+	if (need_reset)
+		i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
+
 	return 0;
 }
 
@@ -6596,6 +6636,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
 			   NETIF_F_TSO		       |
 			   NETIF_F_TSO6		       |
 			   NETIF_F_RXCSUM	       |
+			   NETIF_F_NTUPLE	       |
 			   NETIF_F_RXHASH	       |
 			   0;
 
-- 
1.8.3.1

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

* [net-next 06/16] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (4 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 05/16] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 07/16] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Elizabeth Kappler, netdev, gospo, sassmann, Akeem G Abodunrin,
	Catherine Sullivan, Jeff Kirsher

From: Elizabeth Kappler <elizabeth.m.kappler@intel.com>

This patch cleans up and moves a portion of i40e_open to i40e_vsi_open,
in order to have a shorter vsi_open function that does only that.

Change-ID: I1c418dda94dcfc0eb7d4386a70c330692ef5ecc9
Signed-off-by: Elizabeth Kappler <elizabeth.m.kappler@intel.com>
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@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.h      |  3 ++-
 drivers/net/ethernet/intel/i40e/i40e_main.c | 40 +++++++++++++++++++++++------
 2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index ac04112..33cd8b6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -208,7 +208,7 @@ struct i40e_pf {
 	bool fc_autoneg_status;
 
 	u16 eeprom_version;
-	u16 num_vmdq_vsis;         /* num vmdq pools this pf has set up */
+	u16 num_vmdq_vsis;         /* num vmdq vsis this pf has set up */
 	u16 num_vmdq_qps;          /* num queue pairs per vmdq pool */
 	u16 num_vmdq_msix;         /* num queue vectors per vmdq pool */
 	u16 num_req_vfs;           /* num vfs requested for this vf */
@@ -597,6 +597,7 @@ void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector);
 void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf);
 void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf);
 int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
+int i40e_vsi_open(struct i40e_vsi *vsi);
 void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);
 int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
 int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 0c7eff3..0734eef 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4235,7 +4235,6 @@ static int i40e_open(struct net_device *netdev)
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_vsi *vsi = np->vsi;
 	struct i40e_pf *pf = vsi->back;
-	char int_name[IFNAMSIZ];
 	int err;
 
 	/* disallow open during test */
@@ -4244,6 +4243,31 @@ static int i40e_open(struct net_device *netdev)
 
 	netif_carrier_off(netdev);
 
+	err = i40e_vsi_open(vsi);
+	if (err)
+		return err;
+
+#ifdef CONFIG_I40E_VXLAN
+	vxlan_get_rx_port(netdev);
+#endif
+
+	return 0;
+}
+
+/**
+ * i40e_vsi_open -
+ * @vsi: the VSI to open
+ *
+ * Finish initialization of the VSI.
+ *
+ * Returns 0 on success, negative value on failure
+ **/
+int i40e_vsi_open(struct i40e_vsi *vsi)
+{
+	struct i40e_pf *pf = vsi->back;
+	char int_name[IFNAMSIZ];
+	int err;
+
 	/* allocate descriptors */
 	err = i40e_vsi_setup_tx_resources(vsi);
 	if (err)
@@ -4256,18 +4280,22 @@ static int i40e_open(struct net_device *netdev)
 	if (err)
 		goto err_setup_rx;
 
+	if (!vsi->netdev) {
+		err = EINVAL;
+		goto err_setup_rx;
+	}
 	snprintf(int_name, sizeof(int_name) - 1, "%s-%s",
-		 dev_driver_string(&pf->pdev->dev), netdev->name);
+		 dev_driver_string(&pf->pdev->dev), vsi->netdev->name);
 	err = i40e_vsi_request_irq(vsi, int_name);
 	if (err)
 		goto err_setup_rx;
 
 	/* Notify the stack of the actual queue counts. */
-	err = netif_set_real_num_tx_queues(netdev, vsi->num_queue_pairs);
+	err = netif_set_real_num_tx_queues(vsi->netdev, vsi->num_queue_pairs);
 	if (err)
 		goto err_set_queues;
 
-	err = netif_set_real_num_rx_queues(netdev, vsi->num_queue_pairs);
+	err = netif_set_real_num_rx_queues(vsi->netdev, vsi->num_queue_pairs);
 	if (err)
 		goto err_set_queues;
 
@@ -4275,10 +4303,6 @@ static int i40e_open(struct net_device *netdev)
 	if (err)
 		goto err_up_complete;
 
-#ifdef CONFIG_I40E_VXLAN
-	vxlan_get_rx_port(netdev);
-#endif
-
 	return 0;
 
 err_up_complete:
-- 
1.8.3.1

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

* [net-next 07/16] i40e/i40evf: enable hardware feature head write back
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (5 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 06/16] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open() Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 08/16] i40e/i40evf: reduce context descriptors Jeff Kirsher
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Jesse Brandeburg, netdev, gospo, sassmann, Mitch Williams,
	Catherine Sullivan, Jeff Kirsher

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

The hardware supports a feature 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.  Enable this feature.

Change-ID: I5da4e0681f0b581a6401c950a81808792267fe57
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@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        |  5 +++
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        | 45 +++++++++++++++++++---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  3 ++
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c      | 45 +++++++++++++++++++---
 4 files changed, 86 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 0734eef..2f72eed 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2181,6 +2181,11 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring)
 	tx_ctx.fd_ena = !!(vsi->back->flags & (I40E_FLAG_FD_SB_ENABLED |
 					       I40E_FLAG_FD_ATR_ENABLED));
 	tx_ctx.timesync_ena = !!(vsi->back->flags & I40E_FLAG_PTP);
+	/* FDIR VSI tx ring can still use RS bit and writebacks */
+	if (vsi->type != I40E_VSI_FDIR)
+		tx_ctx.head_wb_ena = 1;
+	tx_ctx.head_wb_addr = ring->dma +
+			      (ring->count * sizeof(struct i40e_tx_desc));
 
 	/* As part of VSI creation/update, FW allocates certain
 	 * Tx arbitration queue sets for each TC enabled for
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 88666ad..9892a69 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -619,6 +619,19 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring)
 }
 
 /**
+ * i40e_get_head - Retrieve head from head writeback
+ * @tx_ring:  tx ring to fetch head of
+ *
+ * Returns value of Tx ring head based on value stored
+ * in head write-back location
+ **/
+static inline u32 i40e_get_head(struct i40e_ring *tx_ring)
+{
+	void *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;
+	return le32_to_cpu(*(volatile __le32 *)head);
+}
+
+/**
  * i40e_clean_tx_irq - Reclaim resources after transmit completes
  * @tx_ring:  tx ring to clean
  * @budget:   how many cleans we're allowed
@@ -629,6 +642,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
 {
 	u16 i = tx_ring->next_to_clean;
 	struct i40e_tx_buffer *tx_buf;
+	struct i40e_tx_desc *tx_head;
 	struct i40e_tx_desc *tx_desc;
 	unsigned int total_packets = 0;
 	unsigned int total_bytes = 0;
@@ -637,6 +651,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
 	tx_desc = I40E_TX_DESC(tx_ring, i);
 	i -= tx_ring->count;
 
+	tx_head = I40E_TX_DESC(tx_ring, i40e_get_head(tx_ring));
+
 	do {
 		struct i40e_tx_desc *eop_desc = tx_buf->next_to_watch;
 
@@ -647,9 +663,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
 		/* prevent any other reads prior to eop_desc */
 		read_barrier_depends();
 
-		/* if the descriptor isn't done, no work yet to do */
-		if (!(eop_desc->cmd_type_offset_bsz &
-		      cpu_to_le64(I40E_TX_DESC_DTYPE_DESC_DONE)))
+		/* we have caught up to head, no work left to do */
+		if (tx_head == tx_desc)
 			break;
 
 		/* clear next_to_watch to prevent false hangs */
@@ -905,6 +920,10 @@ int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring)
 
 	/* round up to nearest 4K */
 	tx_ring->size = tx_ring->count * sizeof(struct i40e_tx_desc);
+	/* add u32 for head writeback, align after this takes care of
+	 * guaranteeing this is at least one cache line in size
+	 */
+	tx_ring->size += sizeof(u32);
 	tx_ring->size = ALIGN(tx_ring->size, 4096);
 	tx_ring->desc = dma_alloc_coherent(dev, tx_ring->size,
 					   &tx_ring->dma, GFP_KERNEL);
@@ -2042,9 +2061,23 @@ static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 		tx_bi = &tx_ring->tx_bi[i];
 	}
 
-	tx_desc->cmd_type_offset_bsz =
-		build_ctob(td_cmd, td_offset, size, td_tag) |
-		cpu_to_le64((u64)I40E_TXD_CMD << I40E_TXD_QW1_CMD_SHIFT);
+	/* Place RS bit on last descriptor of any packet that spans across the
+	 * 4th descriptor (WB_STRIDE aka 0x3) in a 64B cacheline.
+	 */
+#define WB_STRIDE 0x3
+	if (((i & WB_STRIDE) != WB_STRIDE) &&
+	    (first <= &tx_ring->tx_bi[i]) &&
+	    (first >= &tx_ring->tx_bi[i & ~WB_STRIDE])) {
+		tx_desc->cmd_type_offset_bsz =
+			build_ctob(td_cmd, td_offset, size, td_tag) |
+			cpu_to_le64((u64)I40E_TX_DESC_CMD_EOP <<
+					 I40E_TXD_QW1_CMD_SHIFT);
+	} else {
+		tx_desc->cmd_type_offset_bsz =
+			build_ctob(td_cmd, td_offset, size, td_tag) |
+			cpu_to_le64((u64)I40E_TXD_CMD <<
+					 I40E_TXD_QW1_CMD_SHIFT);
+	}
 
 	netdev_tx_sent_queue(netdev_get_tx_queue(tx_ring->netdev,
 						 tx_ring->queue_index),
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index f018238..46fc2c6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -230,6 +230,9 @@ static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_idx,
 	tx_ctx.qlen = info->ring_len;
 	tx_ctx.rdylist = le16_to_cpu(pf->vsi[vsi_idx]->info.qs_handle[0]);
 	tx_ctx.rdylist_act = 0;
+	tx_ctx.head_wb_ena = 1;
+	tx_ctx.head_wb_addr = info->dma_ring_addr +
+			      (info->ring_len * sizeof(struct i40e_tx_desc));
 
 	/* clear the context in the HMC */
 	ret = i40e_clear_lan_tx_queue_context(hw, pf_queue_id);
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index b1d87c6..d4d9842 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -170,6 +170,19 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring)
 }
 
 /**
+ * i40e_get_head - Retrieve head from head writeback
+ * @tx_ring:  tx ring to fetch head of
+ *
+ * Returns value of Tx ring head based on value stored
+ * in head write-back location
+ **/
+static inline u32 i40e_get_head(struct i40e_ring *tx_ring)
+{
+	void *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;
+	return le32_to_cpu(*(volatile __le32 *)head);
+}
+
+/**
  * i40e_clean_tx_irq - Reclaim resources after transmit completes
  * @tx_ring:  tx ring to clean
  * @budget:   how many cleans we're allowed
@@ -180,6 +193,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
 {
 	u16 i = tx_ring->next_to_clean;
 	struct i40e_tx_buffer *tx_buf;
+	struct i40e_tx_desc *tx_head;
 	struct i40e_tx_desc *tx_desc;
 	unsigned int total_packets = 0;
 	unsigned int total_bytes = 0;
@@ -188,6 +202,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
 	tx_desc = I40E_TX_DESC(tx_ring, i);
 	i -= tx_ring->count;
 
+	tx_head = I40E_TX_DESC(tx_ring, i40e_get_head(tx_ring));
+
 	do {
 		struct i40e_tx_desc *eop_desc = tx_buf->next_to_watch;
 
@@ -198,9 +214,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
 		/* prevent any other reads prior to eop_desc */
 		read_barrier_depends();
 
-		/* if the descriptor isn't done, no work yet to do */
-		if (!(eop_desc->cmd_type_offset_bsz &
-		      cpu_to_le64(I40E_TX_DESC_DTYPE_DESC_DONE)))
+		/* we have caught up to head, no work left to do */
+		if (tx_head == tx_desc)
 			break;
 
 		/* clear next_to_watch to prevent false hangs */
@@ -432,6 +447,10 @@ int i40evf_setup_tx_descriptors(struct i40e_ring *tx_ring)
 
 	/* round up to nearest 4K */
 	tx_ring->size = tx_ring->count * sizeof(struct i40e_tx_desc);
+	/* add u32 for head writeback, align after this takes care of
+	 * guaranteeing this is at least one cache line in size
+	 */
+	tx_ring->size += sizeof(u32);
 	tx_ring->size = ALIGN(tx_ring->size, 4096);
 	tx_ring->desc = dma_alloc_coherent(dev, tx_ring->size,
 					   &tx_ring->dma, GFP_KERNEL);
@@ -1377,9 +1396,23 @@ static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 		tx_bi = &tx_ring->tx_bi[i];
 	}
 
-	tx_desc->cmd_type_offset_bsz =
-		build_ctob(td_cmd, td_offset, size, td_tag) |
-		cpu_to_le64((u64)I40E_TXD_CMD << I40E_TXD_QW1_CMD_SHIFT);
+	/* Place RS bit on last descriptor of any packet that spans across the
+	 * 4th descriptor (WB_STRIDE aka 0x3) in a 64B cacheline.
+	 */
+#define WB_STRIDE 0x3
+	if (((i & WB_STRIDE) != WB_STRIDE) &&
+	    (first <= &tx_ring->tx_bi[i]) &&
+	    (first >= &tx_ring->tx_bi[i & ~WB_STRIDE])) {
+		tx_desc->cmd_type_offset_bsz =
+			build_ctob(td_cmd, td_offset, size, td_tag) |
+			cpu_to_le64((u64)I40E_TX_DESC_CMD_EOP <<
+					 I40E_TXD_QW1_CMD_SHIFT);
+	} else {
+		tx_desc->cmd_type_offset_bsz =
+			build_ctob(td_cmd, td_offset, size, td_tag) |
+			cpu_to_le64((u64)I40E_TXD_CMD <<
+					 I40E_TXD_QW1_CMD_SHIFT);
+	}
 
 	netdev_tx_sent_queue(netdev_get_tx_queue(tx_ring->netdev,
 						 tx_ring->queue_index),
-- 
1.8.3.1

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

* [net-next 08/16] i40e/i40evf: reduce context descriptors
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (6 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 07/16] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 09/16] i40e: potential array underflow in i40e_vc_process_vf_msg() Jeff Kirsher
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem
  Cc: Jesse Brandeburg, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

We don't need context descriptors for every packet, only tso
or timesync.  This fixes a bug in the driver where it would
always add a context even if all the passed in values
to the context descriptor function were 0/default values.

Change-ID: I0101d2b893380707b5c2de61aab3e16d4310e9a1
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@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   | 3 ++-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 9892a69..752e680 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1950,7 +1950,8 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring,
 	struct i40e_tx_context_desc *context_desc;
 	int i = tx_ring->next_to_use;
 
-	if (!cd_type_cmd_tso_mss && !cd_tunneling && !cd_l2tag2)
+	if ((cd_type_cmd_tso_mss == I40E_TX_DESC_DTYPE_CONTEXT) &&
+	    !cd_tunneling && !cd_l2tag2)
 		return;
 
 	/* grab the next descriptor */
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index d4d9842..18f174d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1285,7 +1285,8 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring,
 	struct i40e_tx_context_desc *context_desc;
 	int i = tx_ring->next_to_use;
 
-	if (!cd_type_cmd_tso_mss && !cd_tunneling && !cd_l2tag2)
+	if ((cd_type_cmd_tso_mss == I40E_TX_DESC_DTYPE_CONTEXT) &&
+	    !cd_tunneling && !cd_l2tag2)
 		return;
 
 	/* grab the next descriptor */
-- 
1.8.3.1

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

* [net-next 09/16] i40e: potential array underflow in i40e_vc_process_vf_msg()
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (7 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 08/16] i40e/i40evf: reduce context descriptors Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 10/16] i40e/i40evf: Bump build versions Jeff Kirsher
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: Dan Carpenter, netdev, gospo, sassmann, Jeff Kirsher

From: Dan Carpenter <dan.carpenter@oracle.com>

If "vf_id" is smaller than hw->func_caps.vf_base_id then it leads to
an array underflow of the pf->vf[] array.  This is unlikely to happen
unless the hardware is bad, but it's a small change and it silences a
static checker warning.

Fixes: 7efa84b7abc1 ('i40e: support VFs on PFs other than 0')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 46fc2c6..f0dc71b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1774,7 +1774,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode,
 			   u32 v_retval, u8 *msg, u16 msglen)
 {
 	struct i40e_hw *hw = &pf->hw;
-	int local_vf_id = vf_id - hw->func_caps.vf_base_id;
+	unsigned int local_vf_id = vf_id - hw->func_caps.vf_base_id;
 	struct i40e_vf *vf;
 	int ret;
 
-- 
1.8.3.1

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

* [net-next 10/16] i40e/i40evf: Bump build versions
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (8 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 09/16] i40e: potential array underflow in i40e_vc_process_vf_msg() Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 11/16] e1000e: Fix Hardware Unit Hang Jeff Kirsher
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: Catherine Sullivan, netdev, gospo, sassmann, Jeff Kirsher

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

Bump to version 0.3.36 for i40e and 0.9.16 for i40evf.

Change-ID: I7b4ff97b32d2825181803c03c316381a7608a618
Signed-off-by: Catherine Sullivan <catherine.sullivan@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 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 2f72eed..27be9b3 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 34
+#define DRV_VERSION_BUILD 36
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 963387c..21934bf 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -31,7 +31,7 @@ char i40evf_driver_name[] = "i40evf";
 static const char i40evf_driver_string[] =
 	"Intel(R) XL710 X710 Virtual Function Network Driver";
 
-#define DRV_VERSION "0.9.14"
+#define DRV_VERSION "0.9.16"
 const char i40evf_driver_version[] = DRV_VERSION;
 static const char i40evf_copyright[] =
 	"Copyright (c) 2013 - 2014 Intel Corporation.";
-- 
1.8.3.1

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

* [net-next 11/16] e1000e: Fix Hardware Unit Hang
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (9 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 10/16] i40e/i40evf: Bump build versions Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 12/16] e1000e: Fix Explicitly set Transmit Control Register Jeff Kirsher
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: David Ertman, netdev, gospo, sassmann, Bruce Allan, Jeff Kirsher

From: David Ertman <davidx.m.ertman@intel.com>

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.  It turns out there is a
small window of opportunity for additional Tx work to get queued up shortly
after link is dropped.

Move the check back to the place it was before in the watchdog task.  Put in
additional debug information for other reset paths and a final catch-all for
false hangs in the scheduled function that prints out the hardware hang
message.

Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 32 +++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 3f044e7..ecd8043 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1090,8 +1090,14 @@ static void e1000_print_hw_hang(struct work_struct *work)
 		adapter->tx_hang_recheck = true;
 		return;
 	}
-	/* Real hang detected */
 	adapter->tx_hang_recheck = false;
+
+	if (er32(TDH(0)) == er32(TDT(0))) {
+		e_dbg("false hang detected, ignoring\n");
+		return;
+	}
+
+	/* Real hang detected */
 	netif_stop_queue(netdev);
 
 	e1e_rphy(hw, MII_BMSR, &phy_status);
@@ -1121,6 +1127,8 @@ static void e1000_print_hw_hang(struct work_struct *work)
 	      eop, jiffies, eop_desc->upper.fields.status, er32(STATUS),
 	      phy_status, phy_1000t_status, phy_ext_status, pci_status);
 
+	e1000e_dump(adapter);
+
 	/* Suggest workaround for known h/w issue */
 	if ((hw->mac.type == e1000_pchlan) && (er32(CTRL) & E1000_CTRL_TFCE))
 		e_err("Try turning off Tx pause (flow control) via ethtool\n");
@@ -4798,6 +4806,7 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
 
 	if (adapter->phy_hang_count > 1) {
 		adapter->phy_hang_count = 0;
+		e_dbg("PHY appears hung - resetting\n");
 		schedule_work(&adapter->reset_task);
 	}
 }
@@ -4956,15 +4965,11 @@ static void e1000_watchdog_task(struct work_struct *work)
 				mod_timer(&adapter->phy_info_timer,
 					  round_jiffies(jiffies + 2 * HZ));
 
-			/* The link is lost so the controller stops DMA.
-			 * If there is queued Tx work that cannot be done
-			 * or if on an 8000ES2LAN which requires a Rx packet
-			 * buffer work-around on link down event, reset the
-			 * controller to flush the Tx/Rx packet buffers.
-			 * (Do the reset outside of interrupt context).
+			/* 8000ES2LAN requires a Rx packet buffer work-around
+			 * on link down event; reset the controller to flush
+			 * the Rx packet buffer.
 			 */
-			if ((adapter->flags & FLAG_RX_NEEDS_RESTART) ||
-			    (e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
+			if (adapter->flags & FLAG_RX_NEEDS_RESTART)
 				adapter->flags |= FLAG_RESTART_NOW;
 			else
 				pm_schedule_suspend(netdev->dev.parent,
@@ -4987,6 +4992,15 @@ link_up:
 	adapter->gotc_old = adapter->stats.gotc;
 	spin_unlock(&adapter->stats64_lock);
 
+	/* If the link is lost the controller stops DMA, but
+	 * if there is queued Tx work it cannot be done.  So
+	 * reset the controller to flush the Tx packet buffers.
+	 */
+	if (!netif_carrier_ok(netdev) &&
+	    (e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
+		adapter->flags |= FLAG_RESTART_NOW;
+
+	/* If reset is necessary, do it outside of interrupt context. */
 	if (adapter->flags & FLAG_RESTART_NOW) {
 		schedule_work(&adapter->reset_task);
 		/* return immediately since reset is imminent */
-- 
1.8.3.1

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

* [net-next 12/16] e1000e: Fix Explicitly set Transmit Control Register
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (10 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 11/16] e1000e: Fix Hardware Unit Hang Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 13/16] igb: Add register defines needed for time sync functions Jeff Kirsher
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: David Ertman, netdev, gospo, sassmann, Todd Fujinaka, Jeff Kirsher

From: David Ertman <davidx.m.ertman@intel.com>

This patch causes the TCTL to be explicitly set to fix a problem with
poor network performance (throughput) on certain silicon when configured
for 100M HDX performance.

Cc: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Acked-by: Bruce W. Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index ecd8043..de56309 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -2898,7 +2898,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
 	struct e1000_hw *hw = &adapter->hw;
 	struct e1000_ring *tx_ring = adapter->tx_ring;
 	u64 tdba;
-	u32 tdlen, tarc;
+	u32 tdlen, tctl, tarc;
 
 	/* Setup the HW Tx Head and Tail descriptor pointers */
 	tdba = tx_ring->dma;
@@ -2935,6 +2935,12 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
 	/* erratum work around: set txdctl the same for both queues */
 	ew32(TXDCTL(1), er32(TXDCTL(0)));
 
+	/* Program the Transmit Control Register */
+	tctl = er32(TCTL);
+	tctl &= ~E1000_TCTL_CT;
+	tctl |= E1000_TCTL_PSP | E1000_TCTL_RTLC |
+		(E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT);
+
 	if (adapter->flags & FLAG_TARC_SPEED_MODE_BIT) {
 		tarc = er32(TARC(0));
 		/* set the speed mode bit, we'll clear it if we're not at
@@ -2965,6 +2971,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
 	/* enable Report Status bit */
 	adapter->txd_cmd |= E1000_TXD_CMD_RS;
 
+	ew32(TCTL, tctl);
+
 	hw->mac.ops.config_collision_dist(hw);
 }
 
-- 
1.8.3.1

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

* [net-next 13/16] igb: Add register defines needed for time sync functions
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (11 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 12/16] e1000e: Fix Explicitly set Transmit Control Register Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 14/16] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check Jeff Kirsher
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: Carolyn Wyborny, netdev, gospo, sassmann, Jeff Kirsher

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This patch adds defines needed for implementing the auxiliary time sync
functions and also changes code to call the updated defines instead of
the old.

Reported-by: Richard Cochran <ricahrdcochran@gmail.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 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 +-
 3 files changed, 78 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h
index 393c896..b05bf92 100644
--- a/drivers/net/ethernet/intel/igb/e1000_defines.h
+++ b/drivers/net/ethernet/intel/igb/e1000_defines.h
@@ -43,7 +43,11 @@
 #define E1000_WUFC_BC   0x00000010 /* Broadcast Wakeup Enable */
 
 /* Extended Device Control */
+#define E1000_CTRL_EXT_SDP2_DATA 0x00000040 /* Value of SW Defineable Pin 2 */
 #define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Defineable Pin 3 */
+#define E1000_CTRL_EXT_SDP2_DIR  0x00000400 /* SDP2 Data direction */
+#define E1000_CTRL_EXT_SDP3_DIR  0x00000800 /* SDP3 Data direction */
+
 /* Physical Func Reset Done Indication */
 #define E1000_CTRL_EXT_PFRSTD    0x00004000
 #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
@@ -190,7 +194,8 @@
 /* enable link status from external LINK_0 and LINK_1 pins */
 #define E1000_CTRL_SWDPIN0  0x00040000  /* SWDPIN 0 value */
 #define E1000_CTRL_SWDPIN1  0x00080000  /* SWDPIN 1 value */
-#define E1000_CTRL_SWDPIO0  0x00400000  /* SWDPIN 0 Input or output */
+#define E1000_CTRL_SDP0_DIR 0x00400000  /* SDP0 Data direction */
+#define E1000_CTRL_SDP1_DIR 0x00800000  /* SDP1 Data direction */
 #define E1000_CTRL_RST      0x04000000  /* Global reset */
 #define E1000_CTRL_RFCE     0x08000000  /* Receive Flow Control enable */
 #define E1000_CTRL_TFCE     0x10000000  /* Transmit flow control enable */
@@ -528,8 +533,67 @@
 
 #define E1000_TIMINCA_16NS_SHIFT 24
 
-#define E1000_TSICR_TXTS 0x00000002
-#define E1000_TSIM_TXTS 0x00000002
+/* Time Sync Interrupt Cause/Mask Register Bits */
+
+#define TSINTR_SYS_WRAP  (1 << 0) /* SYSTIM Wrap around. */
+#define TSINTR_TXTS      (1 << 1) /* Transmit Timestamp. */
+#define TSINTR_RXTS      (1 << 2) /* Receive Timestamp. */
+#define TSINTR_TT0       (1 << 3) /* Target Time 0 Trigger. */
+#define TSINTR_TT1       (1 << 4) /* Target Time 1 Trigger. */
+#define TSINTR_AUTT0     (1 << 5) /* Auxiliary Timestamp 0 Taken. */
+#define TSINTR_AUTT1     (1 << 6) /* Auxiliary Timestamp 1 Taken. */
+#define TSINTR_TADJ      (1 << 7) /* Time Adjust Done. */
+
+#define TSYNC_INTERRUPTS TSINTR_TXTS
+#define E1000_TSICR_TXTS TSINTR_TXTS
+
+/* TSAUXC Configuration Bits */
+#define TSAUXC_EN_TT0    (1 << 0)  /* Enable target time 0. */
+#define TSAUXC_EN_TT1    (1 << 1)  /* Enable target time 1. */
+#define TSAUXC_EN_CLK0   (1 << 2)  /* Enable Configurable Frequency Clock 0. */
+#define TSAUXC_SAMP_AUT0 (1 << 3)  /* Latch SYSTIML/H into AUXSTMPL/0. */
+#define TSAUXC_ST0       (1 << 4)  /* Start Clock 0 Toggle on Target Time 0. */
+#define TSAUXC_EN_CLK1   (1 << 5)  /* Enable Configurable Frequency Clock 1. */
+#define TSAUXC_SAMP_AUT1 (1 << 6)  /* Latch SYSTIML/H into AUXSTMPL/1. */
+#define TSAUXC_ST1       (1 << 7)  /* Start Clock 1 Toggle on Target Time 1. */
+#define TSAUXC_EN_TS0    (1 << 8)  /* Enable hardware timestamp 0. */
+#define TSAUXC_AUTT0     (1 << 9)  /* Auxiliary Timestamp Taken. */
+#define TSAUXC_EN_TS1    (1 << 10) /* Enable hardware timestamp 0. */
+#define TSAUXC_AUTT1     (1 << 11) /* Auxiliary Timestamp Taken. */
+#define TSAUXC_PLSG      (1 << 17) /* Generate a pulse. */
+#define TSAUXC_DISABLE   (1 << 31) /* Disable SYSTIM Count Operation. */
+
+/* SDP Configuration Bits */
+#define AUX0_SEL_SDP0    (0 << 0)  /* Assign SDP0 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP1    (1 << 0)  /* Assign SDP1 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP2    (2 << 0)  /* Assign SDP2 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP3    (3 << 0)  /* Assign SDP3 to auxiliary time stamp 0. */
+#define AUX0_TS_SDP_EN   (1 << 2)  /* Enable auxiliary time stamp trigger 0. */
+#define AUX1_SEL_SDP0    (0 << 3)  /* Assign SDP0 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP1    (1 << 3)  /* Assign SDP1 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP2    (2 << 3)  /* Assign SDP2 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP3    (3 << 3)  /* Assign SDP3 to auxiliary time stamp 1. */
+#define AUX1_TS_SDP_EN   (1 << 5)  /* Enable auxiliary time stamp trigger 1. */
+#define TS_SDP0_SEL_TT0  (0 << 6)  /* Target time 0 is output on SDP0. */
+#define TS_SDP0_SEL_TT1  (1 << 6)  /* Target time 1 is output on SDP0. */
+#define TS_SDP0_SEL_FC0  (2 << 6)  /* Freq clock  0 is output on SDP0. */
+#define TS_SDP0_SEL_FC1  (3 << 6)  /* Freq clock  1 is output on SDP0. */
+#define TS_SDP0_EN       (1 << 8)  /* SDP0 is assigned to Tsync. */
+#define TS_SDP1_SEL_TT0  (0 << 9)  /* Target time 0 is output on SDP1. */
+#define TS_SDP1_SEL_TT1  (1 << 9)  /* Target time 1 is output on SDP1. */
+#define TS_SDP1_SEL_FC0  (2 << 9)  /* Freq clock  0 is output on SDP1. */
+#define TS_SDP1_SEL_FC1  (3 << 9)  /* Freq clock  1 is output on SDP1. */
+#define TS_SDP1_EN       (1 << 11) /* SDP1 is assigned to Tsync. */
+#define TS_SDP2_SEL_TT0  (0 << 12) /* Target time 0 is output on SDP2. */
+#define TS_SDP2_SEL_TT1  (1 << 12) /* Target time 1 is output on SDP2. */
+#define TS_SDP2_SEL_FC0  (2 << 12) /* Freq clock  0 is output on SDP2. */
+#define TS_SDP2_SEL_FC1  (3 << 12) /* Freq clock  1 is output on SDP2. */
+#define TS_SDP2_EN       (1 << 14) /* SDP2 is assigned to Tsync. */
+#define TS_SDP3_SEL_TT0  (0 << 15) /* Target time 0 is output on SDP3. */
+#define TS_SDP3_SEL_TT1  (1 << 15) /* Target time 1 is output on SDP3. */
+#define TS_SDP3_SEL_FC0  (2 << 15) /* Freq clock  0 is output on SDP3. */
+#define TS_SDP3_SEL_FC1  (3 << 15) /* Freq clock  1 is output on SDP3. */
+#define TS_SDP3_EN       (1 << 17) /* SDP3 is assigned to Tsync. */
 
 #define E1000_MDICNFG_EXT_MDIO    0x80000000      /* MDI ext/int destination */
 #define E1000_MDICNFG_COM_MDIO    0x40000000      /* MDI shared w/ lan 0 */
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index abdd935..e9c5fdd 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -40,6 +40,7 @@
 #define E1000_FCT      0x00030  /* Flow Control Type - RW */
 #define E1000_CONNSW   0x00034  /* Copper/Fiber switch control - RW */
 #define E1000_VET      0x00038  /* VLAN Ether Type - RW */
+#define E1000_TSSDP    0x0003C  /* Time Sync SDP Configuration Register - RW */
 #define E1000_ICR      0x000C0  /* Interrupt Cause Read - R/clr */
 #define E1000_ITR      0x000C4  /* Interrupt Throttling Rate - RW */
 #define E1000_ICS      0x000C8  /* Interrupt Cause Set - WO */
@@ -101,6 +102,14 @@
 #define E1000_SYSTIMH    0x0B604 /* System time register High - RO */
 #define E1000_TIMINCA    0x0B608 /* Increment attributes register - RW */
 #define E1000_TSAUXC     0x0B640 /* Timesync Auxiliary Control register */
+#define E1000_TRGTTIML0  0x0B644 /* Target Time Register 0 Low  - RW */
+#define E1000_TRGTTIMH0  0x0B648 /* Target Time Register 0 High - RW */
+#define E1000_TRGTTIML1  0x0B64C /* Target Time Register 1 Low  - RW */
+#define E1000_TRGTTIMH1  0x0B650 /* Target Time Register 1 High - RW */
+#define E1000_AUXSTMPL0  0x0B65C /* Auxiliary Time Stamp 0 Register Low  - RO */
+#define E1000_AUXSTMPH0  0x0B660 /* Auxiliary Time Stamp 0 Register High - RO */
+#define E1000_AUXSTMPL1  0x0B664 /* Auxiliary Time Stamp 1 Register Low  - RO */
+#define E1000_AUXSTMPH1  0x0B668 /* Auxiliary Time Stamp 1 Register High - RO */
 #define E1000_SYSTIMR    0x0B6F8 /* System time register Residue */
 #define E1000_TSICR      0x0B66C /* Interrupt Cause Register */
 #define E1000_TSIM       0x0B674 /* Interrupt Mask Register */
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 9c9c141..a894551a 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -799,7 +799,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
 
 	/* Initialize the time sync interrupts for devices that support it. */
 	if (hw->mac.type >= e1000_82580) {
-		wr32(E1000_TSIM, E1000_TSIM_TXTS);
+		wr32(E1000_TSIM, TSYNC_INTERRUPTS);
 		wr32(E1000_IMS, E1000_IMS_TS);
 	}
 
@@ -877,7 +877,7 @@ void igb_ptp_reset(struct igb_adapter *adapter)
 	case e1000_i211:
 		/* Enable the timer functions and interrupts. */
 		wr32(E1000_TSAUXC, 0x0);
-		wr32(E1000_TSIM, E1000_TSIM_TXTS);
+		wr32(E1000_TSIM, TSYNC_INTERRUPTS);
 		wr32(E1000_IMS, E1000_IMS_TS);
 		break;
 	default:
-- 
1.8.3.1

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

* [net-next 14/16] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (12 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 13/16] igb: Add register defines needed for time sync functions Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 15/16] ixgbevf: Indicate removal state explicitly Jeff Kirsher
  2014-03-17 12:45 ` [net-next 16/16] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit Jeff Kirsher
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: Jacob Keller, netdev, gospo, sassmann, Jeff Kirsher

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

Inline with the current use for ixgbe_read_pci_cfg_word, create a
similar function for writing PCI config, which checks whether the
adapter has been removed first, if Live Error Recovery has been enabled.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 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 +++++++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
index f8ebe58..7fe2254 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
@@ -58,7 +58,6 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
  **/
 static void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
 {
-	struct ixgbe_adapter *adapter = hw->back;
 	u32 gcr = IXGBE_READ_REG(hw, IXGBE_GCR);
 	u16 pcie_devctl2;
 
@@ -84,11 +83,8 @@ static void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
 	 * 16ms to 55ms
 	 */
 	pcie_devctl2 = ixgbe_read_pci_cfg_word(hw, IXGBE_PCI_DEVICE_CONTROL2);
-	if (ixgbe_removed(hw->hw_addr))
-		return;
 	pcie_devctl2 |= IXGBE_PCI_DEVICE_CONTROL2_16ms;
-	pci_write_config_word(adapter->pdev,
-	                      IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2);
+	ixgbe_write_pci_cfg_word(hw, IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2);
 out:
 	/* disable completion timeout resend */
 	gcr &= ~IXGBE_GCR_CMPL_TMOUT_RESEND;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
index d1d67ba..afa1cda 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
@@ -133,6 +133,7 @@ s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw);
 #define IXGBE_FAILED_READ_CFG_WORD 0xffffU
 
 u16 ixgbe_read_pci_cfg_word(struct ixgbe_hw *hw, u32 reg);
+void ixgbe_write_pci_cfg_word(struct ixgbe_hw *hw, u32 reg, u16 value);
 
 static inline bool ixgbe_removed(void __iomem *addr)
 {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 18cd8ca..c773d6c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -361,6 +361,15 @@ static u32 ixgbe_read_pci_cfg_dword(struct ixgbe_hw *hw, u32 reg)
 }
 #endif /* CONFIG_PCI_IOV */
 
+void ixgbe_write_pci_cfg_word(struct ixgbe_hw *hw, u32 reg, u16 value)
+{
+	struct ixgbe_adapter *adapter = hw->back;
+
+	if (ixgbe_removed(hw->hw_addr))
+		return;
+	pci_write_config_word(adapter->pdev, reg, value);
+}
+
 static void ixgbe_service_event_complete(struct ixgbe_adapter *adapter)
 {
 	BUG_ON(!test_bit(__IXGBE_SERVICE_SCHED, &adapter->state));
-- 
1.8.3.1

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

* [net-next 15/16] ixgbevf: Indicate removal state explicitly
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (13 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 14/16] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  2014-03-17 12:45 ` [net-next 16/16] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit Jeff Kirsher
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: Mark Rustad, netdev, gospo, sassmann, Jeff Kirsher

From: Mark Rustad <mark.d.rustad@intel.com>

Add a bit, __IXGBEVF_REMOVING, to indicate that the module is being
removed. The __IXGBEVF_DOWN bit had been overloaded for this purpose,
but that leads to trouble. A few places now check both __IXGBEVF_DOWN
and __IXGBEVF_REMOVING.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf.h      |  5 +++--
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 14 +++++++++-----
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
index 5482932..08fb88a 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 82599 Virtual Function driver
-  Copyright(c) 1999 - 2012 Intel Corporation.
+  Copyright(c) 1999 - 2014 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,
@@ -412,7 +412,8 @@ struct ixgbevf_adapter {
 enum ixbgevf_state_t {
 	__IXGBEVF_TESTING,
 	__IXGBEVF_RESETTING,
-	__IXGBEVF_DOWN
+	__IXGBEVF_DOWN,
+	__IXGBEVF_REMOVING,
 };
 
 struct ixgbevf_cb {
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 8581079..940d924 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 82599 Virtual Function driver
-  Copyright(c) 1999 - 2012 Intel Corporation.
+  Copyright(c) 1999 - 2014 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,
@@ -608,7 +608,8 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
 	napi_complete(napi);
 	if (adapter->rx_itr_setting & 1)
 		ixgbevf_set_itr(q_vector);
-	if (!test_bit(__IXGBEVF_DOWN, &adapter->state))
+	if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
+	    !test_bit(__IXGBEVF_REMOVING, &adapter->state))
 		ixgbevf_irq_enable_queues(adapter,
 					  1 << q_vector->v_idx);
 
@@ -833,7 +834,8 @@ static irqreturn_t ixgbevf_msix_other(int irq, void *data)
 
 	hw->mac.get_link_status = 1;
 
-	if (!test_bit(__IXGBEVF_DOWN, &adapter->state))
+	if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
+	    !test_bit(__IXGBEVF_REMOVING, &adapter->state))
 		mod_timer(&adapter->watchdog_timer, jiffies);
 
 	IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_other);
@@ -2329,6 +2331,7 @@ static void ixgbevf_reset_task(struct work_struct *work)
 
 	/* If we're already down or resetting, just bail */
 	if (test_bit(__IXGBEVF_DOWN, &adapter->state) ||
+	    test_bit(__IXGBEVF_REMOVING, &adapter->state) ||
 	    test_bit(__IXGBEVF_RESETTING, &adapter->state))
 		return;
 
@@ -2413,7 +2416,8 @@ static void ixgbevf_watchdog_task(struct work_struct *work)
 
 pf_has_reset:
 	/* Reset the timer */
-	if (!test_bit(__IXGBEVF_DOWN, &adapter->state))
+	if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
+	    !test_bit(__IXGBEVF_REMOVING, &adapter->state))
 		mod_timer(&adapter->watchdog_timer,
 			  round_jiffies(jiffies + (2 * HZ)));
 
@@ -3563,7 +3567,7 @@ static void ixgbevf_remove(struct pci_dev *pdev)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct ixgbevf_adapter *adapter = netdev_priv(netdev);
 
-	set_bit(__IXGBEVF_DOWN, &adapter->state);
+	set_bit(__IXGBEVF_REMOVING, &adapter->state);
 
 	del_timer_sync(&adapter->watchdog_timer);
 
-- 
1.8.3.1

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

* [net-next 16/16] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit
  2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (14 preceding siblings ...)
  2014-03-17 12:45 ` [net-next 15/16] ixgbevf: Indicate removal state explicitly Jeff Kirsher
@ 2014-03-17 12:45 ` Jeff Kirsher
  15 siblings, 0 replies; 37+ messages in thread
From: Jeff Kirsher @ 2014-03-17 12:45 UTC (permalink / raw)
  To: davem; +Cc: Mark Rustad, netdev, gospo, sassmann, Jeff Kirsher

From: Mark Rustad <mark.d.rustad@intel.com>

The ixgbevf_down function can now prevent multiple executions by
doing test_and_set_bit on __IXGBEVF_DOWN. This did not work before
introduction of the __IXGBEVF_REMOVING bit, because of overloading
of __IXGBEVF_DOWN. Also add smp_mb__before_clear_bit call before
clearing the __IXGBEVF_DOWN bit.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 940d924..a2cba53 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1620,6 +1620,7 @@ static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter)
 
 	spin_unlock_bh(&adapter->mbx_lock);
 
+	smp_mb__before_clear_bit();
 	clear_bit(__IXGBEVF_DOWN, &adapter->state);
 	ixgbevf_napi_enable_all(adapter);
 
@@ -1744,7 +1745,8 @@ void ixgbevf_down(struct ixgbevf_adapter *adapter)
 	int i;
 
 	/* signal that we are down to the interrupt handler */
-	set_bit(__IXGBEVF_DOWN, &adapter->state);
+	if (test_and_set_bit(__IXGBEVF_DOWN, &adapter->state))
+		return; /* do nothing if already down */
 
 	/* disable all enabled rx queues */
 	for (i = 0; i < adapter->num_rx_queues; i++)
-- 
1.8.3.1

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

* Re: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-17 12:45 ` [net-next 03/16] i40evf: Support RSS option in ethtool Jeff Kirsher
@ 2014-03-17 14:40   ` Or Gerlitz
  2014-03-17 18:55     ` Williams, Mitch A
  2014-03-17 18:53   ` Ben Hutchings
  1 sibling, 1 reply; 37+ messages in thread
From: Or Gerlitz @ 2014-03-17 14:40 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: David Miller, Mitch Williams, netdev, gospo, sassmann,
	Catherine Sullivan

On Mon, Mar 17, 2014 at 2:45 PM, Jeff Kirsher
<jeffrey.t.kirsher@intel.com> wrote:
> From: Mitch Williams <mitch.a.williams@intel.com>
>
> Add support for viewing and modifying RSS hash options and RSS hash
> look-up table programming through ethtool.
[...]

FWIW, this commit does more... wouldn't it be worth dropping some
words on that on that change-log?

[...]
>  static struct ethtool_ops i40evf_ethtool_ops = {
>         .get_settings           = i40evf_get_settings,
>         .get_drvinfo            = i40evf_get_drvinfo,
> @@ -378,6 +687,12 @@ static struct ethtool_ops i40evf_ethtool_ops = {
>         .set_msglevel           = i40evf_set_msglevel,
>         .get_coalesce           = i40evf_get_coalesce,
>         .set_coalesce           = i40evf_set_coalesce,
> +       .get_rxnfc              = i40evf_get_rxnfc,
> +       .set_rxnfc              = i40evf_set_rxnfc,
> +       .get_rxfh_indir_size    = i40evf_get_rxfh_indir_size,
> +       .get_rxfh_indir         = i40evf_get_rxfh_indir,
> +       .set_rxfh_indir         = i40evf_set_rxfh_indir,
> +       .get_channels           = i40evf_get_channels,
>  };

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

* Re: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-17 12:45 ` [net-next 03/16] i40evf: Support RSS option in ethtool Jeff Kirsher
  2014-03-17 14:40   ` Or Gerlitz
@ 2014-03-17 18:53   ` Ben Hutchings
  2014-03-17 18:55     ` Williams, Mitch A
  2014-03-26 19:21     ` Williams, Mitch A
  1 sibling, 2 replies; 37+ messages in thread
From: Ben Hutchings @ 2014-03-17 18:53 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: davem, Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan

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

On Mon, 2014-03-17 at 05:45 -0700, Jeff Kirsher wrote:
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> Add support for viewing and modifying RSS hash options and RSS hash
> look-up table programming through ethtool. Because the lookup table is
> so small for the VFs (only 16 registers), we don't bother to maintain a
> shadow table in memory, we just read and write the registers directly.
[...]
> +static int i40evf_get_rss_hash_opts(struct i40evf_adapter *adapter,
> +				    struct ethtool_rxnfc *cmd)
> +{
> +	cmd->data = 0;
> +
> +	/* Report default options for RSS on i40e */

But you're allowing them to be changed from the defaults, so this is
wrong.

[...]
> +static int i40evf_set_rxfh_indir(struct net_device *netdev, const u32 *indir)
> +{
> +	struct i40evf_adapter *adapter = netdev_priv(netdev);
> +	struct i40e_hw *hw = &adapter->hw;
> +	u32 hlut_val;
> +	int i, j;
> +
> +	/* Verify user input. */
> +	for (i = 0; i < (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4; i++) {
> +		if (indir[i] >= adapter->vsi_res->num_queue_pairs)
> +			return -EINVAL;
> +	}
[...]

ethtool_set_rxfh_indir() does this validation so you don't have to.
(This wasn't true originally so you'll need to keep it in compatibility
code for your OOT driver.)

Ben.

-- 
Ben Hutchings
I'm always amazed by the number of people who take up solipsism because
they heard someone else explain it. - E*Borg on alt.fan.pratchett

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

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

* RE: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-17 14:40   ` Or Gerlitz
@ 2014-03-17 18:55     ` Williams, Mitch A
  2014-03-17 21:19       ` Or Gerlitz
  0 siblings, 1 reply; 37+ messages in thread
From: Williams, Mitch A @ 2014-03-17 18:55 UTC (permalink / raw)
  To: Or Gerlitz, Kirsher, Jeffrey T
  Cc: David Miller, netdev, gospo, sassmann, Sullivan, Catherine


> -----Original Message-----
> From: Or Gerlitz [mailto:or.gerlitz@gmail.com]
> Sent: Monday, March 17, 2014 7:40 AM
> To: Kirsher, Jeffrey T
> Cc: David Miller; Williams, Mitch A; netdev@vger.kernel.org;
> gospo@redhat.com; sassmann@redhat.com; Sullivan, Catherine
> Subject: Re: [net-next 03/16] i40evf: Support RSS option in ethtool
> 
> On Mon, Mar 17, 2014 at 2:45 PM, Jeff Kirsher
> <jeffrey.t.kirsher@intel.com> wrote:
> > From: Mitch Williams <mitch.a.williams@intel.com>
> >
> > Add support for viewing and modifying RSS hash options and RSS hash
> > look-up table programming through ethtool.
> [...]
> 
> FWIW, this commit does more... wouldn't it be worth dropping some
> words on that on that change-log?
> 

Well, Or, I'm not sure really what to say. I added code to change which hashing options RSS would use, and code to change the RSS lookup table.

Looks like Ben has some comments, so we'll have to respin this anyway. I'm happy to change the description, just wondering what you'd like to see here.

-Mitch

> [...]
> >  static struct ethtool_ops i40evf_ethtool_ops = {
> >         .get_settings           = i40evf_get_settings,
> >         .get_drvinfo            = i40evf_get_drvinfo,
> > @@ -378,6 +687,12 @@ static struct ethtool_ops i40evf_ethtool_ops = {
> >         .set_msglevel           = i40evf_set_msglevel,
> >         .get_coalesce           = i40evf_get_coalesce,
> >         .set_coalesce           = i40evf_set_coalesce,
> > +       .get_rxnfc              = i40evf_get_rxnfc,
> > +       .set_rxnfc              = i40evf_set_rxnfc,
> > +       .get_rxfh_indir_size    = i40evf_get_rxfh_indir_size,
> > +       .get_rxfh_indir         = i40evf_get_rxfh_indir,
> > +       .set_rxfh_indir         = i40evf_set_rxfh_indir,
> > +       .get_channels           = i40evf_get_channels,
> >  };

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

* RE: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-17 18:53   ` Ben Hutchings
@ 2014-03-17 18:55     ` Williams, Mitch A
  2014-03-26 19:21     ` Williams, Mitch A
  1 sibling, 0 replies; 37+ messages in thread
From: Williams, Mitch A @ 2014-03-17 18:55 UTC (permalink / raw)
  To: Ben Hutchings, Kirsher, Jeffrey T
  Cc: davem, netdev, gospo, sassmann, Sullivan, Catherine



> -----Original Message-----
> From: Ben Hutchings [mailto:ben@decadent.org.uk]
> Sent: Monday, March 17, 2014 11:54 AM
> To: Kirsher, Jeffrey T
> Cc: davem@davemloft.net; Williams, Mitch A; netdev@vger.kernel.org;
> gospo@redhat.com; sassmann@redhat.com; Sullivan, Catherine
> Subject: Re: [net-next 03/16] i40evf: Support RSS option in ethtool
> 
> On Mon, 2014-03-17 at 05:45 -0700, Jeff Kirsher wrote:
> > From: Mitch Williams <mitch.a.williams@intel.com>
> >
> > Add support for viewing and modifying RSS hash options and RSS hash
> > look-up table programming through ethtool. Because the lookup table is
> > so small for the VFs (only 16 registers), we don't bother to maintain a
> > shadow table in memory, we just read and write the registers directly.
> [...]
> > +static int i40evf_get_rss_hash_opts(struct i40evf_adapter *adapter,
> > +				    struct ethtool_rxnfc *cmd)
> > +{
> > +	cmd->data = 0;
> > +
> > +	/* Report default options for RSS on i40e */
> 
> But you're allowing them to be changed from the defaults, so this is
> wrong.
> 
> [...]
> > +static int i40evf_set_rxfh_indir(struct net_device *netdev, const u32
> *indir)
> > +{
> > +	struct i40evf_adapter *adapter = netdev_priv(netdev);
> > +	struct i40e_hw *hw = &adapter->hw;
> > +	u32 hlut_val;
> > +	int i, j;
> > +
> > +	/* Verify user input. */
> > +	for (i = 0; i < (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4; i++) {
> > +		if (indir[i] >= adapter->vsi_res->num_queue_pairs)
> > +			return -EINVAL;
> > +	}
> [...]
> 
> ethtool_set_rxfh_indir() does this validation so you don't have to.
> (This wasn't true originally so you'll need to keep it in compatibility
> code for your OOT driver.)

Thanks, Ben. We'll respin this.

-Mitch

> 
> Ben.
> 
> --
> Ben Hutchings
> I'm always amazed by the number of people who take up solipsism because
> they heard someone else explain it. - E*Borg on alt.fan.pratchett

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

* Re: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-17 18:55     ` Williams, Mitch A
@ 2014-03-17 21:19       ` Or Gerlitz
  0 siblings, 0 replies; 37+ messages in thread
From: Or Gerlitz @ 2014-03-17 21:19 UTC (permalink / raw)
  To: Williams, Mitch A
  Cc: Kirsher, Jeffrey T, David Miller, netdev, gospo, sassmann,
	Sullivan, Catherine

On Mon, Mar 17, 2014 at 8:55 PM, Williams, Mitch A
<mitch.a.williams@intel.com> wrote:
>> On Mon, Mar 17, 2014 at 2:45 PM, Jeff Kirsher
>> <jeffrey.t.kirsher@intel.com> wrote:
>> > From: Mitch Williams <mitch.a.williams@intel.com>
>> >
>> > Add support for viewing and modifying RSS hash options and RSS hash
>> > look-up table programming through ethtool.
>> [...]
>>
>> FWIW, this commit does more... wouldn't it be worth dropping some
>> words on that on that change-log?
>>
>
> Well, Or, I'm not sure really what to say. I added code to change which hashing options RSS would use, and code to change the RSS lookup table.
>
> Looks like Ben has some comments, so we'll have to respin this anyway. I'm happy to change the description, just wondering what you'd like to see here.

When I made the comment I saw that you added bunch of ethtool calls
and wasn't sure this is covered in the change log, in 2nd look I see
one entry which isn't mentioned and isn't directly related to RSS, the
one that gets the number of channels, but it's minor and I assume can
stay here, maybe even non mentioned in the change log, but that will
be according to your taste


>
> -Mitch
>
>> [...]
>> >  static struct ethtool_ops i40evf_ethtool_ops = {
>> >         .get_settings           = i40evf_get_settings,
>> >         .get_drvinfo            = i40evf_get_drvinfo,
>> > @@ -378,6 +687,12 @@ static struct ethtool_ops i40evf_ethtool_ops = {
>> >         .set_msglevel           = i40evf_set_msglevel,
>> >         .get_coalesce           = i40evf_get_coalesce,
>> >         .set_coalesce           = i40evf_set_coalesce,
>> > +       .get_rxnfc              = i40evf_get_rxnfc,
>> > +       .set_rxnfc              = i40evf_set_rxnfc,
>> > +       .get_rxfh_indir_size    = i40evf_get_rxfh_indir_size,
>> > +       .get_rxfh_indir         = i40evf_get_rxfh_indir,
>> > +       .set_rxfh_indir         = i40evf_set_rxfh_indir,
>> > +       .get_channels           = i40evf_get_channels,
>> >  };

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

* Re: [net-next 01/16] i40e: support VF link state ndo
  2014-03-17 12:45 ` [net-next 01/16] i40e: support VF link state ndo Jeff Kirsher
@ 2014-03-17 21:24   ` Or Gerlitz
  2014-03-17 21:40     ` Williams, Mitch A
  0 siblings, 1 reply; 37+ messages in thread
From: Or Gerlitz @ 2014-03-17 21:24 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: David Miller, Mitch Williams, netdev, gospo, sassmann,
	Catherine Sullivan

On Mon, Mar 17, 2014 at 2:45 PM, Jeff Kirsher
<jeffrey.t.kirsher@intel.com> wrote:
> From: Mitch Williams <mitch.a.williams@intel.com>
> This netdev op allows the PF driver to control the virtual link state of
> the VF devices. This can be used to deny naughty VF drivers access to the wire,

Does this denial exists in the patch or the current code? where?

Or.

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

* RE: [net-next 01/16] i40e: support VF link state ndo
  2014-03-17 21:24   ` Or Gerlitz
@ 2014-03-17 21:40     ` Williams, Mitch A
  0 siblings, 0 replies; 37+ messages in thread
From: Williams, Mitch A @ 2014-03-17 21:40 UTC (permalink / raw)
  To: Or Gerlitz, Kirsher, Jeffrey T
  Cc: David Miller, netdev, gospo, sassmann, Sullivan, Catherine



> -----Original Message-----
> From: Or Gerlitz [mailto:or.gerlitz@gmail.com]
> Sent: Monday, March 17, 2014 2:24 PM
> To: Kirsher, Jeffrey T
> Cc: David Miller; Williams, Mitch A; netdev@vger.kernel.org;
> gospo@redhat.com; sassmann@redhat.com; Sullivan, Catherine
> Subject: Re: [net-next 01/16] i40e: support VF link state ndo
> 
> On Mon, Mar 17, 2014 at 2:45 PM, Jeff Kirsher
> <jeffrey.t.kirsher@intel.com> wrote:
> > From: Mitch Williams <mitch.a.williams@intel.com>
> > This netdev op allows the PF driver to control the virtual link state of
> > the VF devices. This can be used to deny naughty VF drivers access to the
> wire,
> 
> Does this denial exists in the patch or the current code? where?
> 
> Or.

To clarify: you can manually deny link to a VF with this functionality. This would not automatically find and shut down misbehaving VFs. That functionality is planned but is not yet ready, and would operate on the hardware level.

-Mitch

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

* RE: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-17 18:53   ` Ben Hutchings
  2014-03-17 18:55     ` Williams, Mitch A
@ 2014-03-26 19:21     ` Williams, Mitch A
  2014-03-28  0:14       ` Ben Hutchings
  1 sibling, 1 reply; 37+ messages in thread
From: Williams, Mitch A @ 2014-03-26 19:21 UTC (permalink / raw)
  To: Ben Hutchings, Kirsher, Jeffrey T
  Cc: davem, netdev, gospo, sassmann, Sullivan, Catherine



> -----Original Message-----
> From: Ben Hutchings [mailto:ben@decadent.org.uk]
> Sent: Monday, March 17, 2014 11:54 AM
> To: Kirsher, Jeffrey T
> Cc: davem@davemloft.net; Williams, Mitch A; netdev@vger.kernel.org;
> gospo@redhat.com; sassmann@redhat.com; Sullivan, Catherine
> Subject: Re: [net-next 03/16] i40evf: Support RSS option in ethtool
> 
> On Mon, 2014-03-17 at 05:45 -0700, Jeff Kirsher wrote:
> > From: Mitch Williams <mitch.a.williams@intel.com>
> >
> > Add support for viewing and modifying RSS hash options and RSS hash
> > look-up table programming through ethtool. Because the lookup table is
> > so small for the VFs (only 16 registers), we don't bother to maintain a
> > shadow table in memory, we just read and write the registers directly.
> [...]
> > +static int i40evf_get_rss_hash_opts(struct i40evf_adapter *adapter,
> > +				    struct ethtool_rxnfc *cmd)
> > +{
> > +	cmd->data = 0;
> > +
> > +	/* Report default options for RSS on i40e */
> 
> But you're allowing them to be changed from the defaults, so this is
> wrong.

Ben, I've got a question on this. Should the ETHTOOL_GRXFH option report what the driver and device are capable of, or should it report the current configuration? 

If this option is supposed to report device capabilities, how can we find out the current configuration? And if it's supposed to report the current configuration, then how do we find out the device capabilities?

I've been wading through the kernel source, and I see both. So I'm confused.

Currently, I have the i40evf driver just reporting capabilities, because I mostly swiped the code from i40e, which (I think) was swiped from ixgbe. (Note to any laywers reading this: "swiped" is a euphemism for "legally copied and/or adapted in compliance with all appropriate software licenses.)

What's your interpretation of how this should work? I'm respinning this for submittal upstream, and now's the time to change it if it needs to be changed.

Thanks,
Mitch

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

* Re: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-26 19:21     ` Williams, Mitch A
@ 2014-03-28  0:14       ` Ben Hutchings
  2014-03-28 17:05         ` Williams, Mitch A
  0 siblings, 1 reply; 37+ messages in thread
From: Ben Hutchings @ 2014-03-28  0:14 UTC (permalink / raw)
  To: Williams, Mitch A
  Cc: Kirsher, Jeffrey T, davem, netdev, gospo, sassmann, Sullivan, Catherine

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

On Wed, 2014-03-26 at 19:21 +0000, Williams, Mitch A wrote:
> 
> > -----Original Message-----
> > From: Ben Hutchings [mailto:ben@decadent.org.uk]
> > Sent: Monday, March 17, 2014 11:54 AM
> > To: Kirsher, Jeffrey T
> > Cc: davem@davemloft.net; Williams, Mitch A; netdev@vger.kernel.org;
> > gospo@redhat.com; sassmann@redhat.com; Sullivan, Catherine
> > Subject: Re: [net-next 03/16] i40evf: Support RSS option in ethtool
> > 
> > On Mon, 2014-03-17 at 05:45 -0700, Jeff Kirsher wrote:
> > > From: Mitch Williams <mitch.a.williams@intel.com>
> > >
> > > Add support for viewing and modifying RSS hash options and RSS hash
> > > look-up table programming through ethtool. Because the lookup table is
> > > so small for the VFs (only 16 registers), we don't bother to maintain a
> > > shadow table in memory, we just read and write the registers directly.
> > [...]
> > > +static int i40evf_get_rss_hash_opts(struct i40evf_adapter *adapter,
> > > +				    struct ethtool_rxnfc *cmd)
> > > +{
> > > +	cmd->data = 0;
> > > +
> > > +	/* Report default options for RSS on i40e */
> > 
> > But you're allowing them to be changed from the defaults, so this is
> > wrong.
> 
> Ben, I've got a question on this. Should the ETHTOOL_GRXFH option
> report what the driver and device are capable of, or should it report
> the current configuration? 

It should report the current configuration.

> If this option is supposed to report device capabilities, how can we
> find out the current configuration? And if it's supposed to report the
> current configuration, then how do we find out the device
> capabilities?

You can't find out the device capabilities except by trial and error (or
driver-specific documentation).  Even if ETHTOOL_GRXFH did tell you
which fields *could* be included in the hash, the structure doesn't have
space to tell you which subsets are supported.

> I've been wading through the kernel source, and I see both. So I'm
> confused.
[...]

The first implementation was in niu, and in the absence of accompanying
documentation that is what I took to define the interface and what I
attempted to document in <linux/ethtool.h>.  If you think the current
kernel-doc comment on struct ethtool_rxnfc is not clear enough, please
do send a patch to improve the wording.

Ben.

-- 
Ben Hutchings
73.46% of all statistics are made up.

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

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

* RE: [net-next 03/16] i40evf: Support RSS option in ethtool
  2014-03-28  0:14       ` Ben Hutchings
@ 2014-03-28 17:05         ` Williams, Mitch A
  0 siblings, 0 replies; 37+ messages in thread
From: Williams, Mitch A @ 2014-03-28 17:05 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Kirsher, Jeffrey T, davem, netdev, gospo, sassmann, Sullivan, Catherine



> -----Original Message-----
> From: Ben Hutchings [mailto:ben@decadent.org.uk]
> Sent: Thursday, March 27, 2014 5:14 PM
> To: Williams, Mitch A
> Cc: Kirsher, Jeffrey T; davem@davemloft.net; netdev@vger.kernel.org;
> gospo@redhat.com; sassmann@redhat.com; Sullivan, Catherine
> Subject: Re: [net-next 03/16] i40evf: Support RSS option in ethtool
> 
> On Wed, 2014-03-26 at 19:21 +0000, Williams, Mitch A wrote:
> >
> > > -----Original Message-----
> > > From: Ben Hutchings [mailto:ben@decadent.org.uk]
> > > Sent: Monday, March 17, 2014 11:54 AM
> > > To: Kirsher, Jeffrey T
> > > Cc: davem@davemloft.net; Williams, Mitch A; netdev@vger.kernel.org;
> > > gospo@redhat.com; sassmann@redhat.com; Sullivan, Catherine
> > > Subject: Re: [net-next 03/16] i40evf: Support RSS option in ethtool
> > >
> > > On Mon, 2014-03-17 at 05:45 -0700, Jeff Kirsher wrote:
> > > > From: Mitch Williams <mitch.a.williams@intel.com>
> > > >
> > > > Add support for viewing and modifying RSS hash options and RSS hash
> > > > look-up table programming through ethtool. Because the lookup table is
> > > > so small for the VFs (only 16 registers), we don't bother to maintain
> a
> > > > shadow table in memory, we just read and write the registers directly.
> > > [...]
> > > > +static int i40evf_get_rss_hash_opts(struct i40evf_adapter *adapter,
> > > > +				    struct ethtool_rxnfc *cmd)
> > > > +{
> > > > +	cmd->data = 0;
> > > > +
> > > > +	/* Report default options for RSS on i40e */
> > >
> > > But you're allowing them to be changed from the defaults, so this is
> > > wrong.
> >
> > Ben, I've got a question on this. Should the ETHTOOL_GRXFH option
> > report what the driver and device are capable of, or should it report
> > the current configuration?
> 
> It should report the current configuration.
> 
> > If this option is supposed to report device capabilities, how can we
> > find out the current configuration? And if it's supposed to report the
> > current configuration, then how do we find out the device
> > capabilities?
> 
> You can't find out the device capabilities except by trial and error (or
> driver-specific documentation).  Even if ETHTOOL_GRXFH did tell you
> which fields *could* be included in the hash, the structure doesn't have
> space to tell you which subsets are supported.
> 
> > I've been wading through the kernel source, and I see both. So I'm
> > confused.
> [...]
> 
> The first implementation was in niu, and in the absence of accompanying
> documentation that is what I took to define the interface and what I
> attempted to document in <linux/ethtool.h>.  If you think the current
> kernel-doc comment on struct ethtool_rxnfc is not clear enough, please
> do send a patch to improve the wording.
> 

Thanks, Ben. I'll make sure that the i40evf driver does the right thing.

-Mitch

> Ben.
> 
> --
> Ben Hutchings
> 73.46% of all statistics are made up.

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

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2014-04-22 12:39 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2014-04-23  1:47 ` David Miller
  0 siblings, 0 replies; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2014-01-10 17:48 ` David Miller
@ 2014-01-10 17:56   ` Jeff Kirsher
  0 siblings, 0 replies; 37+ 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] 37+ messages in thread

* Re: [net-next 00/16][pull request] Intel Wired LAN Driver Updates
  2014-01-10  8:58 Jeff Kirsher
@ 2014-01-10 17:48 ` David Miller
  2014-01-10 17:56   ` Jeff Kirsher
  0 siblings, 1 reply; 37+ 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] 37+ messages in thread

* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-01-10  8:58 Jeff Kirsher
  2014-01-10 17:48 ` David Miller
  0 siblings, 1 reply; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

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

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-17 12:45 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-17 12:45 ` [net-next 01/16] i40e: support VF link state ndo Jeff Kirsher
2014-03-17 21:24   ` Or Gerlitz
2014-03-17 21:40     ` Williams, Mitch A
2014-03-17 12:45 ` [net-next 02/16] i40evf: correctly program RSS HLUT table Jeff Kirsher
2014-03-17 12:45 ` [net-next 03/16] i40evf: Support RSS option in ethtool Jeff Kirsher
2014-03-17 14:40   ` Or Gerlitz
2014-03-17 18:55     ` Williams, Mitch A
2014-03-17 21:19       ` Or Gerlitz
2014-03-17 18:53   ` Ben Hutchings
2014-03-17 18:55     ` Williams, Mitch A
2014-03-26 19:21     ` Williams, Mitch A
2014-03-28  0:14       ` Ben Hutchings
2014-03-28 17:05         ` Williams, Mitch A
2014-03-17 12:45 ` [net-next 04/16] i40evf: use min_t Jeff Kirsher
2014-03-17 12:45 ` [net-next 05/16] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control Jeff Kirsher
2014-03-17 12:45 ` [net-next 06/16] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open() Jeff Kirsher
2014-03-17 12:45 ` [net-next 07/16] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
2014-03-17 12:45 ` [net-next 08/16] i40e/i40evf: reduce context descriptors Jeff Kirsher
2014-03-17 12:45 ` [net-next 09/16] i40e: potential array underflow in i40e_vc_process_vf_msg() Jeff Kirsher
2014-03-17 12:45 ` [net-next 10/16] i40e/i40evf: Bump build versions Jeff Kirsher
2014-03-17 12:45 ` [net-next 11/16] e1000e: Fix Hardware Unit Hang Jeff Kirsher
2014-03-17 12:45 ` [net-next 12/16] e1000e: Fix Explicitly set Transmit Control Register Jeff Kirsher
2014-03-17 12:45 ` [net-next 13/16] igb: Add register defines needed for time sync functions Jeff Kirsher
2014-03-17 12:45 ` [net-next 14/16] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check Jeff Kirsher
2014-03-17 12:45 ` [net-next 15/16] ixgbevf: Indicate removal state explicitly Jeff Kirsher
2014-03-17 12:45 ` [net-next 16/16] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit Jeff Kirsher
  -- strict thread matches above, loose matches on Subject: below --
2014-04-22 12:39 [net-next 00/16][pull request] Intel Wired LAN Driver Updates 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-14  9:47 Jeff Kirsher
2014-01-10  8:58 Jeff Kirsher
2014-01-10 17:48 ` David Miller
2014-01-10 17:56   ` 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.