All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 00/15][pull request] Intel Wired LAN Driver Updates
@ 2014-04-28 13:52 Jeff Kirsher
  2014-04-28 13:52 ` [net-next 01/15] i40e: remove ptp_tx_work timestamp work item Jeff Kirsher
                   ` (15 more replies)
  0 siblings, 16 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to i40e and i40evf.

Jacob provides a i40e patch to remove ptp_tx_work() because it conflicts
with the interrupt-based handler and will cause spurious warning messages
to be displayed in the kernel log.  Since the hardware can properly trigger
an interrupt, we do not need to poll for an available timestamp in a work
queue any more.

Greg provides two patches for i40e, first to retain the MAC filter list
when changing a port VLAN.  Second fixes an issue where the function to
set the VF MAC address was not taking the port VLAN filter into account
when setting/clearing/resetting the VF's host administered MAC address.

Mitch provides three patches for i40evf, first adds support for getting
and setting RSS hashing options, RSS LUT entries, and getting the number
of device channels from ethtool.  Fixes a panic that woudl occur in the VF
if the PF driver failed or was removed from the host kernel.

Shannon adds driver version string to the driver version command so that
can be passed down through the firmware to low-level NC-SI functions.

Neerav provides several patches, first redistributes queue vectors after
DCB reconfiguration because the total number of queues that are configured
for a VSI may change based on a change in the total number of TCs enabled
as a result of a change in the DCB configuration based on DCBX.  Second,
allows the driver probe to continue when querying DCB config fails.
Lastly, provides changes to retrieve and store missing link config
information that was not being cached in the struct i40e_link_status.

Kevin provides a couple of patches, first to change a int variable type
to u16 to avoid a typecheck failure.  Second to update a function
parameters to remove an argument which is no longer used.

The following are changes since commit a49eb42a341f1df8fa0f9dc4449f9dd4a3234a2f:
  sched, act: allow to clear all actions as well
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: Do not enable NTUPLE feature control in MFP mode
  i40e: Do not expose fd-sb commands from debugfs

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

Greg Rose (2):
  i40e: Retain MAC filters when changing port VLAN
  i40e: Use port VLAN in MAC/VLAN filter configuration

Jacob Keller (1):
  i40e: remove ptp_tx_work timestamp work item

Kevin Scott (2):
  i40e: Change variable type to avoid typecheck failure
  i40e: Update function formal parameters

Mitch A Williams (1):
  i40evf: support ethtool RSS options

Mitch Williams (2):
  i40evf: fix panic on PF driver fail
  i40evf: remove debugging message

Neerav Parikh (3):
  i40e: Redistribute queue vectors after DCB reconfiguration
  i40e: Don't stop driver probe when querying DCB config fails
  i40e/i40evf: Retrieve and store missing link config information

Shannon Nelson (1):
  i40e/i40evf: add driver version string to driver version command

 drivers/net/ethernet/intel/i40e/i40e.h             |   2 -
 drivers/net/ethernet/intel/i40e/i40e_common.c      |  21 +-
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c     |   6 -
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  19 +-
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |   4 +-
 drivers/net/ethernet/intel/i40e/i40e_ptp.c         |  36 ---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |   3 -
 drivers/net/ethernet/intel/i40e/i40e_type.h        |   4 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  11 +-
 drivers/net/ethernet/intel/i40evf/i40e_type.h      |   4 +
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 316 +++++++++++++++++++++
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  15 +-
 12 files changed, 373 insertions(+), 68 deletions(-)

-- 
1.9.0

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

* [net-next 01/15] i40e: remove ptp_tx_work timestamp work item
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 02/15] i40e: Retain MAC filters when changing port VLAN Jeff Kirsher
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Jacob Keller, netdev, gospo, sassmann, Jeff Kirsher

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

This patch removes the unnecessary ptp_tx_work item. It conflicts with
the interrupt-based handler, and will cause spurious warning messages to
be displayed in the kernel log. Since the hardware can properly trigger
an interrupt, we do not need to poll for an available timestamp in a
work queue any more.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h      |  2 --
 drivers/net/ethernet/intel/i40e/i40e_ptp.c  | 36 -----------------------------
 drivers/net/ethernet/intel/i40e/i40e_txrx.c |  3 ---
 3 files changed, 41 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index beb7b43..a46571c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -329,9 +329,7 @@ struct i40e_pf {
 	struct ptp_clock *ptp_clock;
 	struct ptp_clock_info ptp_caps;
 	struct sk_buff *ptp_tx_skb;
-	struct work_struct ptp_tx_work;
 	struct hwtstamp_config tstamp_config;
-	unsigned long ptp_tx_start;
 	unsigned long last_rx_ptp_check;
 	spinlock_t tmreg_lock; /* Used to protect the device time registers. */
 	u64 ptp_base_adj;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index e61e637..1fedc7a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -217,40 +217,6 @@ static int i40e_ptp_settime(struct ptp_clock_info *ptp,
 }
 
 /**
- * i40e_ptp_tx_work
- * @work: pointer to work struct
- *
- * This work function polls the PRTTSYN_STAT_0.TXTIME bit to determine when a
- * Tx timestamp event has occurred, in order to pass the Tx timestamp value up
- * the stack in the skb.
- */
-static void i40e_ptp_tx_work(struct work_struct *work)
-{
-	struct i40e_pf *pf = container_of(work, struct i40e_pf,
-					  ptp_tx_work);
-	struct i40e_hw *hw = &pf->hw;
-	u32 prttsyn_stat_0;
-
-	if (!pf->ptp_tx_skb)
-		return;
-
-	if (time_is_before_jiffies(pf->ptp_tx_start +
-				   I40E_PTP_TX_TIMEOUT)) {
-		dev_kfree_skb_any(pf->ptp_tx_skb);
-		pf->ptp_tx_skb = NULL;
-		pf->tx_hwtstamp_timeouts++;
-		dev_warn(&pf->pdev->dev, "clearing Tx timestamp hang\n");
-		return;
-	}
-
-	prttsyn_stat_0 = rd32(hw, I40E_PRTTSYN_STAT_0);
-	if (prttsyn_stat_0 & I40E_PRTTSYN_STAT_0_TXTIME_MASK)
-		i40e_ptp_tx_hwtstamp(pf);
-	else
-		schedule_work(&pf->ptp_tx_work);
-}
-
-/**
  * i40e_ptp_enable - Enable/disable ancillary features of the PHC subsystem
  * @ptp: The PTP clock structure
  * @rq: The requested feature to change
@@ -608,7 +574,6 @@ void i40e_ptp_init(struct i40e_pf *pf)
 		u32 regval;
 
 		spin_lock_init(&pf->tmreg_lock);
-		INIT_WORK(&pf->ptp_tx_work, i40e_ptp_tx_work);
 
 		dev_info(&pf->pdev->dev, "%s: added PHC on %s\n", __func__,
 			 netdev->name);
@@ -647,7 +612,6 @@ void i40e_ptp_stop(struct i40e_pf *pf)
 	pf->ptp_tx = false;
 	pf->ptp_rx = false;
 
-	cancel_work_sync(&pf->ptp_tx_work);
 	if (pf->ptp_tx_skb) {
 		dev_kfree_skb_any(pf->ptp_tx_skb);
 		pf->ptp_tx_skb = NULL;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 9478ddc..ece7ae9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1825,9 +1825,6 @@ static int i40e_tsyn(struct i40e_ring *tx_ring, struct sk_buff *skb,
 	*cd_type_cmd_tso_mss |= (u64)I40E_TX_CTX_DESC_TSYN <<
 				I40E_TXD_CTX_QW1_CMD_SHIFT;
 
-	pf->ptp_tx_start = jiffies;
-	schedule_work(&pf->ptp_tx_work);
-
 	return 1;
 }
 
-- 
1.9.0

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

* [net-next 02/15] i40e: Retain MAC filters when changing port VLAN
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-04-28 13:52 ` [net-next 01/15] i40e: remove ptp_tx_work timestamp work item Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 03/15] i40evf: support ethtool RSS options Jeff Kirsher
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Greg Rose, netdev, gospo, sassmann, Catherine Sullivan, Jeff Kirsher

From: Greg Rose <gregory.v.rose@intel.com>

We were already taking care to retain the MAC filter list when deleting a
port VLAN.  Take some additional care to retain the MAC filter list when
changing a port VLAN.

Change-ID: Iacf9599ea24ecb4dca8e419aacaf4b58ca361a9c
Signed-off-by: Greg Rose <gregory.v.rose@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_virtchnl_pf.c | 6 +++++-
 1 file changed, 5 insertions(+), 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 b27b2f5..982eef0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2128,11 +2128,15 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
 
 	/* Check for condition where there was already a port VLAN ID
 	 * filter set and now it is being deleted by setting it to zero.
+	 * Additionally check for the condition where there was a port
+	 * VLAN but now there is a new and different port VLAN being set.
 	 * Before deleting all the old VLAN filters we must add new ones
 	 * with -1 (I40E_VLAN_ANY) or otherwise we're left with all our
 	 * MAC addresses deleted.
 	 */
-	if (!(vlan_id || qos) && vsi->info.pvid)
+	if ((!(vlan_id || qos) ||
+	    (vlan_id | qos) != le16_to_cpu(vsi->info.pvid)) &&
+	    vsi->info.pvid)
 		ret = i40e_vsi_add_vlan(vsi, I40E_VLAN_ANY);
 
 	if (vsi->info.pvid) {
-- 
1.9.0

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

* [net-next 03/15] i40evf: support ethtool RSS options
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-04-28 13:52 ` [net-next 01/15] i40e: remove ptp_tx_work timestamp work item Jeff Kirsher
  2014-04-28 13:52 ` [net-next 02/15] i40e: Retain MAC filters when changing port VLAN Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-29 12:35   ` Ben Hutchings
  2014-04-28 13:52 ` [net-next 04/15] i40e: Use port VLAN in MAC/VLAN filter configuration Jeff Kirsher
                   ` (12 subsequent siblings)
  15 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Mitch A Williams, netdev, gospo, sassmann, Jeff Kirsher

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

Add support for getting and setting RSS hashing options, RSS LUT
entries, and getting the number of device channels from ethtool. Because
the LUT is so small for the VFs, we just read and write the device
registers directly instead of maintaining a shadow copy.

Signed-off-by: Mitch Williams <mitch.a.williams@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 | 316 +++++++++++++++++++++
 1 file changed, 316 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index 8b0db1c..a46be01 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -365,6 +365,316 @@ static int i40evf_set_coalesce(struct net_device *netdev,
 	return 0;
 }
 
+/**
+ * i40e_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)
+{
+	struct i40e_hw *hw = &adapter->hw;
+	u64 hena = (u64)rd32(hw, I40E_VFQF_HENA(0)) |
+		   ((u64)rd32(hw, I40E_VFQF_HENA(1)) << 32);
+
+	/* We always hash on IP src and dest addresses */
+	cmd->data = RXH_IP_SRC | RXH_IP_DST;
+
+	switch (cmd->flow_type) {
+	case TCP_V4_FLOW:
+		if (hena & ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP))
+			cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+		break;
+	case UDP_V4_FLOW:
+		if (hena & ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP))
+			cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+		break;
+
+	case SCTP_V4_FLOW:
+	case AH_ESP_V4_FLOW:
+	case AH_V4_FLOW:
+	case ESP_V4_FLOW:
+	case IPV4_FLOW:
+		break;
+
+	case TCP_V6_FLOW:
+		if (hena & ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP))
+			cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+		break;
+	case UDP_V6_FLOW:
+		if (hena & ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP))
+			cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+		break;
+
+	case SCTP_V6_FLOW:
+	case AH_ESP_V6_FLOW:
+	case AH_V6_FLOW:
+	case ESP_V6_FLOW:
+	case IPV6_FLOW:
+		break;
+	default:
+		cmd->data = 0;
+		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_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_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_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_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;
+
+	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 +688,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.9.0

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

* [net-next 04/15] i40e: Use port VLAN in MAC/VLAN filter configuration
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (2 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 03/15] i40evf: support ethtool RSS options Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 05/15] i40e/i40evf: add driver version string to driver version command Jeff Kirsher
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Greg Rose, netdev, gospo, sassmann, Catherine Sullivan, Jeff Kirsher

From: Greg Rose <gregory.v.rose@intel.com>

The function to set the VF MAC address was not taking the port VLAN
filter into account when setting/clearing/resetting the VF's host
administered MAC address.  Be sure to use the port VLAN for VF MAC
filtering configurations.

Change-ID: I12595331981c79529738f041dcdbdb667ef8f5e6
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 982eef0..82e7abf 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2049,10 +2049,11 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
 	}
 
 	/* delete the temporary mac address */
-	i40e_del_filter(vsi, vf->default_lan_addr.addr, 0, true, false);
+	i40e_del_filter(vsi, vf->default_lan_addr.addr, vf->port_vlan_id,
+			true, false);
 
 	/* add the new mac address */
-	f = i40e_add_filter(vsi, mac, 0, true, false);
+	f = i40e_add_filter(vsi, mac, vf->port_vlan_id, true, false);
 	if (!f) {
 		dev_err(&pf->pdev->dev,
 			"Unable to add VF ucast filter\n");
-- 
1.9.0

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

* [net-next 05/15] i40e/i40evf: add driver version string to driver version command
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (3 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 04/15] i40e: Use port VLAN in MAC/VLAN filter configuration Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 06/15] i40e: Redistribute queue vectors after DCB reconfiguration Jeff Kirsher
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

The driver version string was added to this struct to be passed
down through the firmware to low-level NC-SI functions. We tell
the firmware about the length of the ASCII string not counting
any terminating null.

Change-ID: I09ac98ff9b869e8661c55fc6a5c98808fc280c91
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Anjali Singhai <anjali.singhai@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 10 +++++++++-
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  1 +
 drivers/net/ethernet/intel/i40e/i40e_type.h   |  1 +
 drivers/net/ethernet/intel/i40evf/i40e_type.h |  1 +
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index f8dfb4b..fde5aef 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1300,6 +1300,7 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
 	struct i40e_aqc_driver_version *cmd =
 		(struct i40e_aqc_driver_version *)&desc.params.raw;
 	i40e_status status;
+	int len;
 
 	if (dv == NULL)
 		return I40E_ERR_PARAM;
@@ -1311,7 +1312,14 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
 	cmd->driver_minor_ver = dv->minor_version;
 	cmd->driver_build_ver = dv->build_version;
 	cmd->driver_subbuild_ver = dv->subbuild_version;
-	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+	len = 0;
+	while (len < sizeof(dv->driver_string) &&
+	       (dv->driver_string[len] < 0x80) &&
+	       dv->driver_string[len])
+		len++;
+	status = i40e_asq_send_command(hw, &desc, dv->driver_string,
+				       len, cmd_details);
 
 	return status;
 }
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4fe15d5..6f00de4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8394,6 +8394,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dv.minor_version = DRV_VERSION_MINOR;
 	dv.build_version = DRV_VERSION_BUILD;
 	dv.subbuild_version = 0;
+	strncpy(dv.driver_string, DRV_VERSION, sizeof(dv.driver_string));
 	i40e_aq_send_driver_version(&pf->hw, &dv, NULL);
 
 	/* since everything's happy, start the service_task timer */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 71a968f..668acc7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -409,6 +409,7 @@ struct i40e_driver_version {
 	u8 minor_version;
 	u8 build_version;
 	u8 subbuild_version;
+	u8 driver_string[32];
 };
 
 /* RX Descriptors */
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index 4673b33..449a3be 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -415,6 +415,7 @@ struct i40e_driver_version {
 	u8 minor_version;
 	u8 build_version;
 	u8 subbuild_version;
+	u8 driver_string[32];
 };
 
 /* RX Descriptors */
-- 
1.9.0

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

* [net-next 06/15] i40e: Redistribute queue vectors after DCB reconfiguration
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (4 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 05/15] i40e/i40evf: add driver version string to driver version command Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 07/15] i40e: Don't stop driver probe when querying DCB config fails Jeff Kirsher
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Neerav Parikh, netdev, gospo, sassmann, Catherine Sullivan, Jeff Kirsher

From: Neerav Parikh <Neerav.Parikh@intel.com>

The queue vectors are originally distributed among the total
number of queues that are configured for a given VSI. The number
of queues that are configured for a VSI depends on the number of
TCs that are enabled for the VSI at VSI setup/creation time.

But, the total number of queues that are configured for a VSI may
change based on change in the total number of TCs enabled as a
result of change in DCB configuration based on DCBX.

Hence, it is required for the queue vectors to be redistributed
when the total queues that are configured for a given VSI changes.

Without redistributing the vectors the queues that are configured
for the newly enabled TCs may not be able to do any Tx/Rx.

Change-ID: I4e780903db019e6199c7ce43627cef22c916acfe
Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 6f00de4..78308e0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4027,6 +4027,8 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf)
 				 pf->vsi[v]->seid);
 			/* Will try to configure as many components */
 		} else {
+			/* Re-configure VSI vectors based on updated TC map */
+			i40e_vsi_map_rings_to_vectors(pf->vsi[v]);
 			if (pf->vsi[v]->netdev)
 				i40e_dcbnl_set_all(pf->vsi[v]);
 		}
-- 
1.9.0

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

* [net-next 07/15] i40e: Don't stop driver probe when querying DCB config fails
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (5 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 06/15] i40e: Redistribute queue vectors after DCB reconfiguration Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 08/15] i40evf: fix panic on PF driver fail Jeff Kirsher
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Neerav Parikh, netdev, gospo, sassmann, Catherine Sullivan, Jeff Kirsher

From: Neerav Parikh <Neerav.Parikh@intel.com>

In case of any AQ command to query port's DCB configuration fails
during driver's probe time; the probe fails and returns an error.

This patch prevents this issue by continuing the driver probe even
when an error is returned.

Also, added an error message to dump the AQ error status to show what
error caused the failure to get the DCB configuration from firmware.

Change-ID: Ifd5663512588bca684069bb7d4fb586dd72221af
Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 78308e0..126be0d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4068,6 +4068,9 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
 				       DCB_CAP_DCBX_VER_IEEE;
 			pf->flags |= I40E_FLAG_DCB_ENABLED;
 		}
+	} else {
+		dev_info(&pf->pdev->dev, "AQ Querying DCB configuration failed: %d\n",
+			 pf->hw.aq.asq_last_status);
 	}
 
 out:
@@ -8300,7 +8303,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (err) {
 		dev_info(&pdev->dev, "init_pf_dcb failed: %d\n", err);
 		pf->flags &= ~I40E_FLAG_DCB_ENABLED;
-		goto err_init_dcb;
+		/* Continue without DCB enabled */
 	}
 #endif /* CONFIG_I40E_DCB */
 
@@ -8438,9 +8441,6 @@ err_vsis:
 err_switch_setup:
 	i40e_reset_interrupt_capability(pf);
 	del_timer_sync(&pf->service_timer);
-#ifdef CONFIG_I40E_DCB
-err_init_dcb:
-#endif /* CONFIG_I40E_DCB */
 err_mac_addr:
 err_configure_lan_hmc:
 	(void)i40e_shutdown_lan_hmc(hw);
-- 
1.9.0

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

* [net-next 08/15] i40evf: fix panic on PF driver fail
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (6 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 07/15] i40e: Don't stop driver probe when querying DCB config fails Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 09/15] i40evf: remove debugging message Jeff Kirsher
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

Fix a panic that would occur in the VF if the PF driver failed or was
removed from the host kernel. In this case, the VF driver calls
i40evf_close(), but this function does nothing because the driver is in
the resetting state. Because of this, the driver doesn't free its irqs
and causes a kernel panic when it tries to disable MSI-X.

Change-ID: If95644a89e554b4d7be0dca1b6add26f63047129
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 | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index da6054c..d7abd0d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -25,6 +25,8 @@
 #include "i40e_prototype.h"
 static int i40evf_setup_all_tx_resources(struct i40evf_adapter *adapter);
 static int i40evf_setup_all_rx_resources(struct i40evf_adapter *adapter);
+static void i40evf_free_all_tx_resources(struct i40evf_adapter *adapter);
+static void i40evf_free_all_rx_resources(struct i40evf_adapter *adapter);
 static int i40evf_close(struct net_device *netdev);
 
 char i40evf_driver_name[] = "i40evf";
@@ -1534,9 +1536,13 @@ static void i40evf_reset_task(struct work_struct *work)
 			rstat_val);
 		adapter->flags |= I40EVF_FLAG_PF_COMMS_FAILED;
 
-		if (netif_running(adapter->netdev))
-			i40evf_close(adapter->netdev);
-
+		if (netif_running(adapter->netdev)) {
+			set_bit(__I40E_DOWN, &adapter->vsi.state);
+			i40evf_down(adapter);
+			i40evf_free_traffic_irqs(adapter);
+			i40evf_free_all_tx_resources(adapter);
+			i40evf_free_all_rx_resources(adapter);
+		}
 		i40evf_free_misc_irq(adapter);
 		i40evf_reset_interrupt_capability(adapter);
 		i40evf_free_queues(adapter);
-- 
1.9.0

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

* [net-next 09/15] i40evf: remove debugging message
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (7 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 08/15] i40evf: fix panic on PF driver fail Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 10/15] i40e: Change variable type to avoid typecheck failure Jeff Kirsher
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

If the PF driver fails or is removed from the host, the VF driver will
fill up its log with this message.

Change-ID: I67045f987f7c0d444d21ded403adc509343cdb8f
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 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d7abd0d..0a4ff41 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1311,7 +1311,6 @@ static void i40evf_watchdog_task(struct work_struct *work)
 		goto restart_watchdog;
 
 	if (adapter->flags & I40EVF_FLAG_PF_COMMS_FAILED) {
-		dev_info(&adapter->pdev->dev, "Checking for redemption\n");
 		if ((rd32(hw, I40E_VFGEN_RSTAT) & 0x3) == I40E_VFR_VFACTIVE) {
 			/* A chance for redemption! */
 			dev_err(&adapter->pdev->dev, "Hardware came out of reset. Attempting reinit.\n");
-- 
1.9.0

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

* [net-next 10/15] i40e: Change variable type to avoid typecheck failure
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (8 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 09/15] i40evf: remove debugging message Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 11/15] i40e: Do not enable NTUPLE feature control in MFP mode Jeff Kirsher
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Kevin Scott, netdev, gospo, sassmann, Jeff Kirsher

From: Kevin Scott <kevin.c.scott@intel.com>

Change the variable type to avoid compiler warning about int to u16
possible data truncation.

Change-ID: I5eb3b578c86513c9625ca32d2f0b57cc01d7dc98
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index fde5aef..e19df8f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1300,7 +1300,7 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
 	struct i40e_aqc_driver_version *cmd =
 		(struct i40e_aqc_driver_version *)&desc.params.raw;
 	i40e_status status;
-	int len;
+	u16 len;
 
 	if (dv == NULL)
 		return I40E_ERR_PARAM;
-- 
1.9.0

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

* [net-next 11/15] i40e: Do not enable NTUPLE feature control in MFP mode
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (9 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 10/15] i40e: Change variable type to avoid typecheck failure Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 12/15] i40e: Do not expose fd-sb commands from debugfs Jeff Kirsher
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

Although NTUPLE feature control is disabled by default, do not
allow user to be able to change it.

Change-ID: I4c3f95fb6dbc56b1b6cc47116ea1f72de02bc99c
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_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 126be0d..5506561 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6783,10 +6783,12 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
 			   NETIF_F_TSO_ECN	       |
 			   NETIF_F_TSO6		       |
 			   NETIF_F_RXCSUM	       |
-			   NETIF_F_NTUPLE	       |
 			   NETIF_F_RXHASH	       |
 			   0;
 
+	if (!(pf->flags & I40E_FLAG_MFP_ENABLED))
+		netdev->features |= NETIF_F_NTUPLE;
+
 	/* copy netdev features into list of user selectable features */
 	netdev->hw_features |= netdev->features;
 
-- 
1.9.0

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

* [net-next 12/15] i40e: Do not expose fd-sb commands from debugfs
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (10 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 11/15] i40e: Do not enable NTUPLE feature control in MFP mode Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 13/15] i40e: Update function formal parameters Jeff Kirsher
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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

Ethtool -k/-K can handle this so we do not need it in debugfs.

Change-ID: I9df692f10a60b71805f8f48d3b87c7da3820b2aa
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_debugfs.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 3c37386..1aaec40 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -1744,10 +1744,6 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 		i40e_dbg_cmd_fd_ctrl(pf, I40E_FLAG_FD_ATR_ENABLED, false);
 	} else if (strncmp(cmd_buf, "fd-atr on", 9) == 0) {
 		i40e_dbg_cmd_fd_ctrl(pf, I40E_FLAG_FD_ATR_ENABLED, true);
-	} else if (strncmp(cmd_buf, "fd-sb off", 9) == 0) {
-		i40e_dbg_cmd_fd_ctrl(pf, I40E_FLAG_FD_SB_ENABLED, false);
-	} else if (strncmp(cmd_buf, "fd-sb on", 8) == 0) {
-		i40e_dbg_cmd_fd_ctrl(pf, I40E_FLAG_FD_SB_ENABLED, true);
 	} else if (strncmp(cmd_buf, "lldp", 4) == 0) {
 		if (strncmp(&cmd_buf[5], "stop", 4) == 0) {
 			int ret;
@@ -1967,8 +1963,6 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 		dev_info(&pf->pdev->dev, "  rem fd_filter <dest q_index> <flex_off> <pctype> <dest_vsi> <dest_ctl> <fd_status> <cnt_index> <fd_id> <packet_len> <packet>\n");
 		dev_info(&pf->pdev->dev, "  fd-atr off\n");
 		dev_info(&pf->pdev->dev, "  fd-atr on\n");
-		dev_info(&pf->pdev->dev, "  fd-sb off\n");
-		dev_info(&pf->pdev->dev, "  fd-sb on\n");
 		dev_info(&pf->pdev->dev, "  lldp start\n");
 		dev_info(&pf->pdev->dev, "  lldp stop\n");
 		dev_info(&pf->pdev->dev, "  lldp get local\n");
-- 
1.9.0

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

* [net-next 13/15] i40e: Update function formal parameters
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (11 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 12/15] i40e: Do not expose fd-sb commands from debugfs Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 14/15] i40e/i40evf: Retrieve and store missing link config information Jeff Kirsher
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Kevin Scott, netdev, gospo, sassmann, Jeff Kirsher

From: Kevin Scott <kevin.c.scott@intel.com>

Change the formal parameters to remove argument which is no longer used.

Change-ID: I493b56eba74a1f396fa1b7d24c0a4acbe536b5bf
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 4 ++--
 drivers/net/ethernet/intel/i40e/i40e_main.c      | 2 --
 drivers/net/ethernet/intel/i40e/i40e_prototype.h | 4 ++--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index e19df8f..55d029f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -2102,8 +2102,8 @@ i40e_status i40e_aq_start_lldp(struct i40e_hw *hw,
  * @cmd_details: pointer to command details structure or NULL
  **/
 i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
-				u16 udp_port, u8 header_len,
-				u8 protocol_index, u8 *filter_index,
+				u16 udp_port, u8 protocol_index,
+				u8 *filter_index,
 				struct i40e_asq_cmd_details *cmd_details)
 {
 	struct i40e_aq_desc desc;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 5506561..b27162b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5608,7 +5608,6 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
  **/
 static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
 {
-	const int vxlan_hdr_qwords = 4;
 	struct i40e_hw *hw = &pf->hw;
 	i40e_status ret;
 	u8 filter_index;
@@ -5626,7 +5625,6 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
 			port = pf->vxlan_ports[i];
 			ret = port ?
 			      i40e_aq_add_udp_tunnel(hw, ntohs(port),
-						     vxlan_hdr_qwords,
 						     I40E_AQC_TUNNEL_TYPE_VXLAN,
 						     &filter_index, NULL)
 			      : i40e_aq_del_udp_tunnel(hw, i, NULL);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 10652f6..d351832 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -157,8 +157,8 @@ i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
 i40e_status i40e_aq_start_lldp(struct i40e_hw *hw,
 				struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
-				u16 udp_port, u8 header_len,
-				u8 protocol_index, u8 *filter_index,
+				u16 udp_port, u8 protocol_index,
+				u8 *filter_index,
 				struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
 				struct i40e_asq_cmd_details *cmd_details);
-- 
1.9.0

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

* [net-next 14/15] i40e/i40evf: Retrieve and store missing link config information
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (12 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 13/15] i40e: Update function formal parameters Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 13:52 ` [net-next 15/15] i40e/i40evf: Bump build version Jeff Kirsher
  2014-04-28 18:53 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates David Miller
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Neerav Parikh, netdev, gospo, sassmann, Neerav Parikh, Jeff Kirsher

From: Neerav Parikh <Neerav.Parikh@intel.com>

Some information returned via "Get Link Status" command was not
being cached in the struct i40e_link_status.
Add this so the driver can utilize this information as needed.

Change-ID: If084a0ae2a63b16b97572196b993742af2c67772
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 7 +++++++
 drivers/net/ethernet/intel/i40e/i40e_type.h   | 3 +++
 drivers/net/ethernet/intel/i40evf/i40e_type.h | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 55d029f..22eefda 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -975,6 +975,13 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
 	hw_link_info->an_info = resp->an_info;
 	hw_link_info->ext_info = resp->ext_info;
 	hw_link_info->loopback = resp->loopback;
+	hw_link_info->max_frame_size = le16_to_cpu(resp->max_frame_size);
+	hw_link_info->pacing = resp->config & I40E_AQ_CONFIG_PACING_MASK;
+
+	if (resp->config & I40E_AQ_CONFIG_CRC_ENA)
+		hw_link_info->crc_enable = true;
+	else
+		hw_link_info->crc_enable = false;
 
 	if (resp->command_flags & cpu_to_le16(I40E_AQ_LSE_ENABLE))
 		hw_link_info->lse_enable = true;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 668acc7..c4df8ba 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -167,6 +167,9 @@ struct i40e_link_status {
 	u8 loopback;
 	/* is Link Status Event notification to SW enabled */
 	bool lse_enable;
+	u16 max_frame_size;
+	bool crc_enable;
+	u8 pacing;
 };
 
 struct i40e_phy_info {
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index 449a3be..51a6dee 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -173,6 +173,9 @@ struct i40e_link_status {
 	u8 loopback;
 	/* is Link Status Event notification to SW enabled */
 	bool lse_enable;
+	u16 max_frame_size;
+	bool crc_enable;
+	u8 pacing;
 };
 
 struct i40e_phy_info {
-- 
1.9.0

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

* [net-next 15/15] i40e/i40evf: Bump build version
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (13 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 14/15] i40e/i40evf: Retrieve and store missing link config information Jeff Kirsher
@ 2014-04-28 13:52 ` Jeff Kirsher
  2014-04-28 18:53 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates David Miller
  15 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-04-28 13:52 UTC (permalink / raw)
  To: davem; +Cc: Catherine Sullivan, netdev, gospo, sassmann, Jeff Kirsher

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

Bump i40e to 0.3.46 and i40evf to 0.9.23.

Change-ID: Ia604ae6d513d9aaa8bfdac79665d9a3a72507df7
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 b27162b..109052a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 0
 #define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 43
+#define DRV_VERSION_BUILD 46
 #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 0a4ff41..6edd581 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -33,7 +33,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.21"
+#define DRV_VERSION "0.9.23"
 const char i40evf_driver_version[] = DRV_VERSION;
 static const char i40evf_copyright[] =
 	"Copyright (c) 2013 - 2014 Intel Corporation.";
-- 
1.9.0

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

* Re: [net-next 00/15][pull request] Intel Wired LAN Driver Updates
  2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (14 preceding siblings ...)
  2014-04-28 13:52 ` [net-next 15/15] i40e/i40evf: Bump build version Jeff Kirsher
@ 2014-04-28 18:53 ` David Miller
  15 siblings, 0 replies; 19+ messages in thread
From: David Miller @ 2014-04-28 18:53 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 28 Apr 2014 06:52:23 -0700

> This series contains updates to i40e and i40evf.

Pulled, thanks a lot Jeff.

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

* Re: [net-next 03/15] i40evf: support ethtool RSS options
  2014-04-28 13:52 ` [net-next 03/15] i40evf: support ethtool RSS options Jeff Kirsher
@ 2014-04-29 12:35   ` Ben Hutchings
  2014-04-29 23:51     ` Williams, Mitch A
  0 siblings, 1 reply; 19+ messages in thread
From: Ben Hutchings @ 2014-04-29 12:35 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, Mitch A Williams, netdev, gospo, sassmann

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

On Mon, 2014-04-28 at 06:52 -0700, Jeff Kirsher wrote:
[...]
> +/**
> + * 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)
> +{
[...]
> +	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;

I'm not sure why these cases operate on 'hena' as
I40E_FILTER_PCTYPE_NONF_IPV{4,6}_OTHER are presumably always set in the
register.

> +	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;

These cases aren't validating that the user didn't ask for ports to be
included in the hash.  They also interact oddly with UDP flow hashing
configuration.  It seems to me that the I40E_FILTER_PCTYPE_FRAG_IPV{4,6}
bits ought to be controllable through one flow type only.

[...]
> +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++) {
[...]

Off by 1?

Ben.

-- 
Ben Hutchings
Q.  Which is the greater problem in the world today, ignorance or apathy?
A.  I don't know and I couldn't care less.

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

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

* RE: [net-next 03/15] i40evf: support ethtool RSS options
  2014-04-29 12:35   ` Ben Hutchings
@ 2014-04-29 23:51     ` Williams, Mitch A
  0 siblings, 0 replies; 19+ messages in thread
From: Williams, Mitch A @ 2014-04-29 23:51 UTC (permalink / raw)
  To: Ben Hutchings, Kirsher, Jeffrey T; +Cc: davem, netdev, gospo, sassmann



> -----Original Message-----
> From: Ben Hutchings [mailto:ben@decadent.org.uk]
> Sent: Tuesday, April 29, 2014 5:35 AM
> To: Kirsher, Jeffrey T
> Cc: davem@davemloft.net; Williams, Mitch A; netdev@vger.kernel.org;
> gospo@redhat.com; sassmann@redhat.com
> Subject: Re: [net-next 03/15] i40evf: support ethtool RSS options
> 
> On Mon, 2014-04-28 at 06:52 -0700, Jeff Kirsher wrote:
> [...]
> > +/**
> > + * 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)
> > +{
> [...]
> > +	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;
> 
> I'm not sure why these cases operate on 'hena' as
> I40E_FILTER_PCTYPE_NONF_IPV{4,6}_OTHER are presumably always set in the
> register.
> 
> > +	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;
> 
> These cases aren't validating that the user didn't ask for ports to be
> included in the hash.  They also interact oddly with UDP flow hashing
> configuration.  It seems to me that the I40E_FILTER_PCTYPE_FRAG_IPV{4,6}
> bits ought to be controllable through one flow type only.

This function is my best effort to reconcile how the hardware works with how the API works.

In general, you cannot control which field is hashed over for any given traffic type. You just enable or disable the traffic type.

However, if you disable a specific L4 protocol, the packet will still match on the underlying L3 protocol, as long as you leave the IP-specific bits turned on.

That said, you are correct, and I don't need to set the IP-specific bits because they're always turned on.

> 
> [...]
> > +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++) {
> [...]
> 
> Off by 1?

Good catch, we all missed it.

I think Dave's already pulled this, and since it's nonfatal, I'll just fix these in a follow-on patch.

Thanks for your review.

-Mitch

> 
> Ben.
> 
> --
> Ben Hutchings
> Q.  Which is the greater problem in the world today, ignorance or apathy?
> A.  I don't know and I couldn't care less.

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

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

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-28 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-04-28 13:52 ` [net-next 01/15] i40e: remove ptp_tx_work timestamp work item Jeff Kirsher
2014-04-28 13:52 ` [net-next 02/15] i40e: Retain MAC filters when changing port VLAN Jeff Kirsher
2014-04-28 13:52 ` [net-next 03/15] i40evf: support ethtool RSS options Jeff Kirsher
2014-04-29 12:35   ` Ben Hutchings
2014-04-29 23:51     ` Williams, Mitch A
2014-04-28 13:52 ` [net-next 04/15] i40e: Use port VLAN in MAC/VLAN filter configuration Jeff Kirsher
2014-04-28 13:52 ` [net-next 05/15] i40e/i40evf: add driver version string to driver version command Jeff Kirsher
2014-04-28 13:52 ` [net-next 06/15] i40e: Redistribute queue vectors after DCB reconfiguration Jeff Kirsher
2014-04-28 13:52 ` [net-next 07/15] i40e: Don't stop driver probe when querying DCB config fails Jeff Kirsher
2014-04-28 13:52 ` [net-next 08/15] i40evf: fix panic on PF driver fail Jeff Kirsher
2014-04-28 13:52 ` [net-next 09/15] i40evf: remove debugging message Jeff Kirsher
2014-04-28 13:52 ` [net-next 10/15] i40e: Change variable type to avoid typecheck failure Jeff Kirsher
2014-04-28 13:52 ` [net-next 11/15] i40e: Do not enable NTUPLE feature control in MFP mode Jeff Kirsher
2014-04-28 13:52 ` [net-next 12/15] i40e: Do not expose fd-sb commands from debugfs Jeff Kirsher
2014-04-28 13:52 ` [net-next 13/15] i40e: Update function formal parameters Jeff Kirsher
2014-04-28 13:52 ` [net-next 14/15] i40e/i40evf: Retrieve and store missing link config information Jeff Kirsher
2014-04-28 13:52 ` [net-next 15/15] i40e/i40evf: Bump build version Jeff Kirsher
2014-04-28 18:53 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates 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.