Skip to contentSkip to conversation

i40e/i40evf updates

PATCH New Catherine Sullivan 1 participant 2 messages Oct 27, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover i40e/i40evf updates

Anjali fixes the RS bit update in Tx path and disables the force WB workaround.

Carolyn updates the fw version error messaging.

Helin adds new fields to store user configuration, renames rss_size to alloc_rss_size in i40e_pf, renames vf adapter specific rss function, creates a generic config rss function, creates a generic get rss function, adds new fields to store user configuration of RSS, and fixes a confusing message.

Jesse adds a prefetch of skb data on transmit.

Mitch makes an error message more useful, lets the VF give up when it gets ERR_PARAM from the PF, allocates queue vectors dynamically, and allocates ring structs dynamically.

 drivers/net/ethernet/intel/i40e/i40e.h             |  10 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  31 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  98 +++--
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |   3 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   4 +-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c      | 123 ++++---
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h      |   2 +
 drivers/net/ethernet/intel/i40evf/i40evf.h         |  16 +-
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  79 ++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 403 +++++++++++++++------
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  12 +-
 11 files changed, 545 insertions(+), 236 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH v2 6/15 i40evf: create a generic config rss function

From: Helin Zhang <[email protected]>

There are two ways to configure RSS, this patch adjusts those two functions with the same input parameters, and creates a more generic function for configuring RSS.

Change-ID Iace73bdeba4831909979bef221011060ab327f71

---
v2: Fixed spelling

Testing-hints: Test VFQF_HKEY and VFQF_HLUT registers are the same before and after and make sure that ethtool -x and ethtool -X still work correctly.

 drivers/net/ethernet/intel/i40evf/i40evf.h         |   3 +
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  29 ++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 168 +++++++++++++--------
 3 files changed, 130 insertions(+), 70 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +3 -0
index 22fc3d4..b5aa377 100644
@@ -99,6 +99,7 @@ struct i40e_vsi {
 #define MAX_TX_QUEUES MAX_RX_QUEUES
 
 #define I40EVF_HKEY_ARRAY_SIZE ((I40E_VFQF_HKEY_MAX_INDEX + 1) * 4)
+#define I40EVF_HLUT_ARRAY_SIZE ((I40E_VFQF_HLUT_MAX_INDEX + 1) * 4)
 
 /* MAX_MSIX_Q_VECTORS of these are allocated,
  * but we only use one per queue-specific vector.
@@ -313,4 +314,6 @@ void i40evf_request_reset(struct i40evf_adapter *adapter);
 void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
 				enum i40e_virtchnl_ops v_opcode,
 				i40e_status v_retval, u8 *msg, u16 msglen);
+int i40evf_config_rss(struct i40e_vsi *vsi, const u8 *seed, u8 *lut,
+		      u16 lut_size);
 #endif /* _I40EVF_H_ */
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +19 -10
index 4790437..cf253df 100644
@@ -668,9 +668,11 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
 			   const u8 *key, const u8 hfunc)
 {
 	struct i40evf_adapter *adapter = netdev_priv(netdev);
-	struct i40e_hw *hw = &adapter->hw;
-	u32 hlut_val;
-	int i, j;
+	struct i40e_vsi *vsi = &adapter->vsi;
+	u8 seed_def[I40EVF_HKEY_ARRAY_SIZE];
+	u8 *seed = NULL, *lut;
+	int ret;
+	u16 i;
 
 	/* We do not allow change in unsupported parameters */
 	if (key ||
@@ -679,15 +681,22 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
 	if (!indir)
 		return 0;
 
-	for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; 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);
+	if (key) {
+		memcpy(seed_def, key, I40EVF_HKEY_ARRAY_SIZE);
+		seed = seed_def;
 	}
+	lut = kzalloc(I40EVF_HLUT_ARRAY_SIZE, GFP_KERNEL);
+	if (!lut)
+		return -ENOMEM;
 
-	return 0;
+	/* Each 32 bits pointed by 'indir' is stored with a lut entry */
+	for (i = 0; i < I40EVF_HLUT_ARRAY_SIZE; i++)
+		lut[i] = (u8)(indir[i]);
+
+	ret = i40evf_config_rss(vsi, seed, lut, I40EVF_HLUT_ARRAY_SIZE);
+	kfree(lut);
+
+	return ret;
 }
 
 static const struct ethtool_ops i40evf_ethtool_ops = {
drivers/net/ethernet/intel/i40evf/i40evf_main.c +108 -60

218 lines not on this page · raw message

Signature · 1 line
1.9.3