All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates
@ 2016-11-29  0:05 Bimmy Pujari
  2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters cleans Cloud Filters up Bimmy Pujari
                   ` (13 more replies)
  0 siblings, 14 replies; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:05 UTC (permalink / raw)
  To: intel-wired-lan

Alan Brady adds code to refactor macro INTRL_USEC_TO_REG and adds code
to add interrupt rate limit verbosity.

Alexander Duyck adds code for quick refactor to start moving data off
stack and into Tx buffer info.

Bimmy Pujari changes version from 1.6.25 to 1.6.27.

Faisal Latif adds code to fix client warnings.

Filip Sadowski adds code to disable ntuple filters to clean Cloud 
Filters.

Jacob Keller adds code to not check params until after checking for 
client instance and updates comment explaining where FDIR buffers 
are freed.

Jayaprakash Shanmugam removes FPK HyperV VF device ID.

Mitch Williams removes unused function and adds code to track
outstanding client request.

Scott Peterson adds code to limit dma sync of RX buffers to actual
packet size, moves skb from i40e_rx_buffer to i40e_ring and eliminates
i40e_pull_tail().

 drivers/net/ethernet/intel/i40e/i40e.h             |  40 ++-
 drivers/net/ethernet/intel/i40e/i40e_client.c      |  39 +--
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  18 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  25 +-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        | 270 ++++++++++++---------
 drivers/net/ethernet/intel/i40e/i40e_txrx.h        |  24 +-
 drivers/net/ethernet/intel/i40evf/i40e_common.c    |   1 -
 drivers/net/ethernet/intel/i40evf/i40e_devids.h    |   1 -
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c      | 262 +++++++++++---------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h      |   9 +-
 drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h  |   1 +
 drivers/net/ethernet/intel/i40evf/i40evf.h         |   8 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |   2 +-
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |   4 +
 14 files changed, 416 insertions(+), 288 deletions(-)

-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters cleans Cloud Filters up
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
@ 2016-11-29  0:05 ` Bimmy Pujari
  2016-12-01 18:26   ` Bowers, AndrewX
  2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to start moving data off stack and into Tx buffer info Bimmy Pujari
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:05 UTC (permalink / raw)
  To: intel-wired-lan

From: Filip Sadowski <filip.sadowski@intel.com>

This patch resolves the issue with Cloud Filters not being flushed from
driver memory and HW when ntuple filters get disabled. Additionally it was
possible to add Cloud Filters with ntuple mechanism off. Now Cloud Filters
can be added only with ntuple enabled. Error code is returned otherwise.

Signed-off-by: Filip Sadowski <filip.sadowski@intel.com>
Change-ID: I7bbc43ead41ead59be89ae2ca440a5c77fef2086
---
 drivers/net/ethernet/intel/i40e/i40e.h         | 39 ++++++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  3 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 21 ++++++++++++++
 3 files changed, 63 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 9413d8a..05552b0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -224,6 +224,43 @@ struct i40e_fdir_filter {
 	u32 fd_id;
 };
 
+#define I40E_CLOUD_FIELD_OMAC   0x01
+#define I40E_CLOUD_FIELD_IMAC   0x02
+#define I40E_CLOUD_FIELD_IVLAN  0x04
+#define I40E_CLOUD_FIELD_TEN_ID 0x08
+#define I40E_CLOUD_FIELD_IIP    0x10
+
+#define I40E_CLOUD_FILTER_FLAGS_OMAC I40E_CLOUD_FIELD_OMAC
+#define I40E_CLOUD_FILTER_FLAGS_IMAC I40E_CLOUD_FIELD_IMAC
+#define I40E_CLOUD_FILTER_FLAGS_IMAC_IVLAN (I40E_CLOUD_FIELD_IMAC | \
+					    I40E_CLOUD_FIELD_IVLAN)
+#define I40E_CLOUD_FILTER_FLAGS_IMAC_TEN_ID (I40E_CLOUD_FIELD_IMAC | \
+					     I40E_CLOUD_FIELD_TEN_ID)
+#define I40E_CLOUD_FILTER_FLAGS_OMAC_TEN_ID_IMAC (I40E_CLOUD_FIELD_OMAC | \
+						  I40E_CLOUD_FIELD_IMAC | \
+						  I40E_CLOUD_FIELD_TEN_ID)
+#define I40E_CLOUD_FILTER_FLAGS_IMAC_IVLAN_TEN_ID (I40E_CLOUD_FIELD_IMAC | \
+						   I40E_CLOUD_FIELD_IVLAN | \
+						   I40E_CLOUD_FIELD_TEN_ID)
+#define I40E_CLOUD_FILTER_FLAGS_IIP  I40E_CLOUD_FIELD_IIP
+
+struct i40e_cloud_filter {
+	struct hlist_node cloud_node;
+	/* cloud filter input set follows */
+	u8 outer_mac[ETH_ALEN];
+	u8 inner_mac[ETH_ALEN];
+	__be16 inner_vlan;
+	__be32 inner_ip[4];
+	u32 tenant_id;
+	u8 flags;
+#define I40E_CLOUD_TNL_TYPE_NONE	0xff
+	u8 tunnel_type;
+	/* filter control */
+	u16 seid;
+	u16 queue_id;
+	u32 id;
+};
+
 #define I40E_ETH_P_LLDP			0x88cc
 
 #define I40E_DCB_PRIO_TYPE_STRICT	0
@@ -290,6 +327,8 @@ struct i40e_pf {
 	struct i40e_udp_port_config udp_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
 	u16 pending_udp_bitmap;
 
+	struct hlist_head cloud_filter_list;
+	u16 num_cloud_filters;
 	enum i40e_interrupt_policy int_policy;
 	u16 rx_itr_default;
 	u16 tx_itr_default;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index cc1465a..99772ee 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2705,6 +2705,9 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
 	if (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)
 		return -ENOSPC;
 
+	if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
+		return -EOPNOTSUPP;
+
 	if (test_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state) ||
 	    test_bit(__I40E_RESET_INTR_RECEIVED, &pf->state))
 		return -EBUSY;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d718342..769f922 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5664,6 +5664,25 @@ static void i40e_fdir_filter_exit(struct i40e_pf *pf)
 }
 
 /**
+ * i40e_cloud_filter_exit - Cleans up Cloud Filters
+ * @pf: Pointer to PF
+ *
+ * This function destroys the hlist which keeps all the Cloud Filters.
+ **/
+static void i40e_cloud_filter_exit(struct i40e_pf *pf)
+{
+	struct i40e_cloud_filter *cfilter;
+	struct hlist_node *node;
+
+	hlist_for_each_entry_safe(cfilter, node,
+				  &pf->cloud_filter_list, cloud_node) {
+		hlist_del(&cfilter->cloud_node);
+		kfree(cfilter);
+	}
+	pf->num_cloud_filters = 0;
+}
+
+/**
  * i40e_close - Disables a network interface
  * @netdev: network interface device structure
  *
@@ -6857,6 +6876,7 @@ static void i40e_fdir_teardown(struct i40e_pf *pf)
 	struct i40e_vsi *vsi;
 
 	i40e_fdir_filter_exit(pf);
+	i40e_cloud_filter_exit(pf);
 	vsi = i40e_find_vsi_by_type(pf, I40E_VSI_FDIR);
 	if (vsi)
 		i40e_vsi_release(vsi);
@@ -8801,6 +8821,7 @@ bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features)
 		if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
 			need_reset = true;
 			i40e_fdir_filter_exit(pf);
+			i40e_cloud_filter_exit(pf);
 		}
 		pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
 		pf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to start moving data off stack and into Tx buffer info
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
  2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters cleans Cloud Filters up Bimmy Pujari
@ 2016-11-29  0:05 ` Bimmy Pujari
  2016-12-01 18:50   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 03/14] i40e: Remove FPK HyperV VF device ID Bimmy Pujari
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:05 UTC (permalink / raw)
  To: intel-wired-lan

From: Alexander Duyck <alexander.h.duyck@intel.com>

This patch does some quick work to pull some of the data off of the stack
and hopefully start storing it in the Tx buffer info section of the Tx
ring.  Ideally we should be moving away from having to store much of
anything on the stack and can just maintain it all in the descriptor rings.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Change-ID: I4b4715ea1920e122502482b3f9e56a9a6cb1e9fe
---
Testing Hints:
        This should not break the transmit path and should have no
        signficant impact on Tx performance.  It brings us closer to what
        is already in ixgbe and enables us to add support for a workaround
        needed to deal with gso_size less than 64.

 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 47 +++++++++++++++------------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 47 +++++++++++++++------------
 2 files changed, 54 insertions(+), 40 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 352cf7c..a347d08 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2251,14 +2251,16 @@ static inline int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,
 
 /**
  * i40e_tso - set up the tso context descriptor
- * @skb:      ptr to the skb we're sending
+ * @first:    pointer to first Tx buffer for xmit
  * @hdr_len:  ptr to the size of the packet header
  * @cd_type_cmd_tso_mss: Quad Word 1
  *
  * Returns 0 if no TSO can happen, 1 if tso is going, or error
  **/
-static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
+static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,
+		    u64 *cd_type_cmd_tso_mss)
 {
+	struct sk_buff *skb = first->skb;
 	u64 cd_cmd, cd_tso_len, cd_mss;
 	union {
 		struct iphdr *v4;
@@ -2271,6 +2273,7 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
 		unsigned char *hdr;
 	} l4;
 	u32 paylen, l4_offset;
+	u16 gso_segs, gso_size;
 	int err;
 
 	if (skb->ip_summed != CHECKSUM_PARTIAL)
@@ -2335,10 +2338,18 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
 	/* compute length of segmentation header */
 	*hdr_len = (l4.tcp->doff * 4) + l4_offset;
 
+	/* pull values out of skb_shinfo */
+	gso_size = skb_shinfo(skb)->gso_size;
+	gso_segs = skb_shinfo(skb)->gso_segs;
+
+	/* update gso size and bytecount with header size */
+	first->gso_segs = gso_segs;
+	first->bytecount += (first->gso_segs - 1) * *hdr_len;
+
 	/* find the field values */
 	cd_cmd = I40E_TX_CTX_DESC_TSO;
 	cd_tso_len = skb->len - *hdr_len;
-	cd_mss = skb_shinfo(skb)->gso_size;
+	cd_mss = gso_size;
 	*cd_type_cmd_tso_mss |= (cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |
 				(cd_tso_len << I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |
 				(cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);
@@ -2699,7 +2710,6 @@ static inline void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 	u16 i = tx_ring->next_to_use;
 	u32 td_tag = 0;
 	dma_addr_t dma;
-	u16 gso_segs;
 	u16 desc_count = 1;
 
 	if (tx_flags & I40E_TX_FLAGS_HW_VLAN) {
@@ -2708,15 +2718,6 @@ static inline void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 			 I40E_TX_FLAGS_VLAN_SHIFT;
 	}
 
-	if (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO))
-		gso_segs = skb_shinfo(skb)->gso_segs;
-	else
-		gso_segs = 1;
-
-	/* multiply data chunks by size of headers */
-	first->bytecount = skb->len - hdr_len + (gso_segs * hdr_len);
-	first->gso_segs = gso_segs;
-	first->skb = skb;
 	first->tx_flags = tx_flags;
 
 	dma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE);
@@ -2902,8 +2903,10 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 
 	count = i40e_xmit_descriptor_count(skb);
 	if (i40e_chk_linearize(skb, count)) {
-		if (__skb_linearize(skb))
-			goto out_drop;
+		if (__skb_linearize(skb)) {
+			dev_kfree_skb_any(skb);
+			return NETDEV_TX_OK;
+		}
 		count = i40e_txd_use_count(skb->len);
 		tx_ring->tx_stats.tx_linearize++;
 	}
@@ -2919,6 +2922,12 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 		return NETDEV_TX_BUSY;
 	}
 
+	/* record the location of the first descriptor for this packet */
+	first = &tx_ring->tx_bi[tx_ring->next_to_use];
+	first->skb = skb;
+	first->bytecount = skb->len;
+	first->gso_segs = 1;
+
 	/* prepare the xmit flags */
 	if (i40e_tx_prepare_vlan_flags(skb, tx_ring, &tx_flags))
 		goto out_drop;
@@ -2926,16 +2935,13 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 	/* obtain protocol of skb */
 	protocol = vlan_get_protocol(skb);
 
-	/* record the location of the first descriptor for this packet */
-	first = &tx_ring->tx_bi[tx_ring->next_to_use];
-
 	/* setup IPv4/IPv6 offloads */
 	if (protocol == htons(ETH_P_IP))
 		tx_flags |= I40E_TX_FLAGS_IPV4;
 	else if (protocol == htons(ETH_P_IPV6))
 		tx_flags |= I40E_TX_FLAGS_IPV6;
 
-	tso = i40e_tso(skb, &hdr_len, &cd_type_cmd_tso_mss);
+	tso = i40e_tso(first, &hdr_len, &cd_type_cmd_tso_mss);
 
 	if (tso < 0)
 		goto out_drop;
@@ -2973,7 +2979,8 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 
 out_drop:
-	dev_kfree_skb_any(skb);
+	dev_kfree_skb_any(first->skb);
+	first->skb = NULL;
 	return NETDEV_TX_OK;
 }
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index df67ef3..1818cdf 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1549,14 +1549,16 @@ static inline int i40evf_tx_prepare_vlan_flags(struct sk_buff *skb,
 
 /**
  * i40e_tso - set up the tso context descriptor
- * @skb:      ptr to the skb we're sending
+ * @first:    pointer to first Tx buffer for xmit
  * @hdr_len:  ptr to the size of the packet header
  * @cd_type_cmd_tso_mss: Quad Word 1
  *
  * Returns 0 if no TSO can happen, 1 if tso is going, or error
  **/
-static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
+static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,
+		    u64 *cd_type_cmd_tso_mss)
 {
+	struct sk_buff *skb = first->skb;
 	u64 cd_cmd, cd_tso_len, cd_mss;
 	union {
 		struct iphdr *v4;
@@ -1569,6 +1571,7 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
 		unsigned char *hdr;
 	} l4;
 	u32 paylen, l4_offset;
+	u16 gso_segs, gso_size;
 	int err;
 
 	if (skb->ip_summed != CHECKSUM_PARTIAL)
@@ -1633,10 +1636,18 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
 	/* compute length of segmentation header */
 	*hdr_len = (l4.tcp->doff * 4) + l4_offset;
 
+	/* pull values out of skb_shinfo */
+	gso_size = skb_shinfo(skb)->gso_size;
+	gso_segs = skb_shinfo(skb)->gso_segs;
+
+	/* update gso size and bytecount with header size */
+	first->gso_segs = gso_segs;
+	first->bytecount += (first->gso_segs - 1) * *hdr_len;
+
 	/* find the field values */
 	cd_cmd = I40E_TX_CTX_DESC_TSO;
 	cd_tso_len = skb->len - *hdr_len;
-	cd_mss = skb_shinfo(skb)->gso_size;
+	cd_mss = gso_size;
 	*cd_type_cmd_tso_mss |= (cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |
 				(cd_tso_len << I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |
 				(cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);
@@ -1949,7 +1960,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 	u16 i = tx_ring->next_to_use;
 	u32 td_tag = 0;
 	dma_addr_t dma;
-	u16 gso_segs;
 	u16 desc_count = 1;
 
 	if (tx_flags & I40E_TX_FLAGS_HW_VLAN) {
@@ -1958,15 +1968,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 			 I40E_TX_FLAGS_VLAN_SHIFT;
 	}
 
-	if (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO))
-		gso_segs = skb_shinfo(skb)->gso_segs;
-	else
-		gso_segs = 1;
-
-	/* multiply data chunks by size of headers */
-	first->bytecount = skb->len - hdr_len + (gso_segs * hdr_len);
-	first->gso_segs = gso_segs;
-	first->skb = skb;
 	first->tx_flags = tx_flags;
 
 	dma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE);
@@ -2151,8 +2152,10 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 
 	count = i40e_xmit_descriptor_count(skb);
 	if (i40e_chk_linearize(skb, count)) {
-		if (__skb_linearize(skb))
-			goto out_drop;
+		if (__skb_linearize(skb)) {
+			dev_kfree_skb_any(skb);
+			return NETDEV_TX_OK;
+		}
 		count = i40e_txd_use_count(skb->len);
 		tx_ring->tx_stats.tx_linearize++;
 	}
@@ -2168,6 +2171,12 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 		return NETDEV_TX_BUSY;
 	}
 
+	/* record the location of the first descriptor for this packet */
+	first = &tx_ring->tx_bi[tx_ring->next_to_use];
+	first->skb = skb;
+	first->bytecount = skb->len;
+	first->gso_segs = 1;
+
 	/* prepare the xmit flags */
 	if (i40evf_tx_prepare_vlan_flags(skb, tx_ring, &tx_flags))
 		goto out_drop;
@@ -2175,16 +2184,13 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 	/* obtain protocol of skb */
 	protocol = vlan_get_protocol(skb);
 
-	/* record the location of the first descriptor for this packet */
-	first = &tx_ring->tx_bi[tx_ring->next_to_use];
-
 	/* setup IPv4/IPv6 offloads */
 	if (protocol == htons(ETH_P_IP))
 		tx_flags |= I40E_TX_FLAGS_IPV4;
 	else if (protocol == htons(ETH_P_IPV6))
 		tx_flags |= I40E_TX_FLAGS_IPV6;
 
-	tso = i40e_tso(skb, &hdr_len, &cd_type_cmd_tso_mss);
+	tso = i40e_tso(first, &hdr_len, &cd_type_cmd_tso_mss);
 
 	if (tso < 0)
 		goto out_drop;
@@ -2211,7 +2217,8 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 
 out_drop:
-	dev_kfree_skb_any(skb);
+	dev_kfree_skb_any(first->skb);
+	first->skb = NULL;
 	return NETDEV_TX_OK;
 }
 
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 03/14] i40e: Remove FPK HyperV VF device ID
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
  2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters cleans Cloud Filters up Bimmy Pujari
  2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to start moving data off stack and into Tx buffer info Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 18:54   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 04/14] i40e: remove unused function Bimmy Pujari
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

From: Jayaprakash Shanmugam <jayaprakash.shanmugam@intel.com>

Requirement for VFs to use the VMBus has been removed that's why
removing Hyper-V VF device ID.

Signed-off-by: Jayaprakash Shanmugam <jayaprakash.shanmugam@intel.com>
Change-ID: I84f0964f443ee0db3e5e444b5ace996eb71b8280
---
 drivers/net/ethernet/intel/i40evf/i40e_common.c | 1 -
 drivers/net/ethernet/intel/i40evf/i40e_devids.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40e_common.c b/drivers/net/ethernet/intel/i40evf/i40e_common.c
index aa63b7f..b5a59dd 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_common.c
@@ -64,7 +64,6 @@ i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 			hw->mac.type = I40E_MAC_X722;
 			break;
 		case I40E_DEV_ID_X722_VF:
-		case I40E_DEV_ID_X722_VF_HV:
 			hw->mac.type = I40E_MAC_X722_VF;
 			break;
 		case I40E_DEV_ID_VF:
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_devids.h b/drivers/net/ethernet/intel/i40evf/i40e_devids.h
index 21dcaee..d76393c 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_devids.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_devids.h
@@ -48,7 +48,6 @@
 #define I40E_DEV_ID_10G_BASE_T_X722	0x37D2
 #define I40E_DEV_ID_SFP_I_X722		0x37D3
 #define I40E_DEV_ID_X722_VF		0x37CD
-#define I40E_DEV_ID_X722_VF_HV		0x37D9
 
 #define i40e_is_40G_device(d)		((d) == I40E_DEV_ID_QSFP_A  || \
 					 (d) == I40E_DEV_ID_QSFP_B  || \
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 04/14] i40e: remove unused function
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (2 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 03/14] i40e: Remove FPK HyperV VF device ID Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 18:56   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 05/14] i40e: refactor macro INTRL_USEC_TO_REG Bimmy Pujari
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

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

After refactoring the client open and close code, this is no longer
needed. Remove it.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: If8e6e32baa354d857c2fd8b2f19404f1786011c4
---
Testing Hints : No functional change, just dead
code.

 drivers/net/ethernet/intel/i40e/i40e.h        |  1 -
 drivers/net/ethernet/intel/i40e/i40e_client.c | 35 ---------------------------
 2 files changed, 36 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 05552b0..eb01dac 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -831,7 +831,6 @@ int i40e_lan_add_device(struct i40e_pf *pf);
 int i40e_lan_del_device(struct i40e_pf *pf);
 void i40e_client_subtask(struct i40e_pf *pf);
 void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi);
-void i40e_notify_client_of_netdev_open(struct i40e_vsi *vsi);
 void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset);
 void i40e_notify_client_of_vf_enable(struct i40e_pf *pf, u32 num_vfs);
 void i40e_notify_client_of_vf_reset(struct i40e_pf *pf, u32 vf_id);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 7fe72ab..7ca048f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -201,41 +201,6 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi)
 }
 
 /**
- * i40e_notify_client_of_netdev_open - call the client open callback
- * @vsi: the VSI with netdev opened
- *
- * If there is a client to this netdev, call the client with open
- **/
-void i40e_notify_client_of_netdev_open(struct i40e_vsi *vsi)
-{
-	struct i40e_client_instance *cdev;
-	int ret = 0;
-
-	if (!vsi)
-		return;
-	mutex_lock(&i40e_client_instance_mutex);
-	list_for_each_entry(cdev, &i40e_client_instances, list) {
-		if (cdev->lan_info.netdev == vsi->netdev) {
-			if (!cdev->client ||
-			    !cdev->client->ops || !cdev->client->ops->open) {
-				dev_dbg(&vsi->back->pdev->dev,
-					"Cannot locate client instance open routine\n");
-				continue;
-			}
-			if (!(test_bit(__I40E_CLIENT_INSTANCE_OPENED,
-				       &cdev->state))) {
-				ret = cdev->client->ops->open(&cdev->lan_info,
-							      cdev->client);
-				if (!ret)
-					set_bit(__I40E_CLIENT_INSTANCE_OPENED,
-						&cdev->state);
-			}
-		}
-	}
-	mutex_unlock(&i40e_client_instance_mutex);
-}
-
-/**
  * i40e_client_release_qvlist
  * @ldev: pointer to L2 context.
  *
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 05/14] i40e: refactor macro INTRL_USEC_TO_REG
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (3 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 04/14] i40e: remove unused function Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 21:46   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 06/14] i40e: add interrupt rate limit verbosity Bimmy Pujari
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

From: Alan Brady <alan.brady@intel.com>

This patch refactors the macro INTRL_USEC_TO_REG into a static inline
function and fixes a couple subtle bugs caused by the macro.

This patch fixes a bug which was caused by passing a bad register value
to the firmware.  If enabling interrupt rate limiting, a non-zero value
for the rate limit must be used.  Otherwise the firmware sets the
interrupt rate limit to the maximum value.  Due to the limited
resolution of the register, attempting to set a value of 1, 2, or 3
would be rounded down to 0 and limiting was left enabled, causing
unexpected behavior.

This patch also fixes a possible bug in which using the macro itself can
introduce unintended side-affects because the macro argument is used
more than once in the macro definition (e.g. a variable post-increment
argument would perform a double increment on the variable).

Without this patch, attempting to set interrupt rate limits of 1, 2, or
3 results in unexpected behavior and future use of this macro could
cause subtle bugs.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Change-Id: I83ac842de0ca9c86761923d6e3a4d7b1b95f2b3f
---
Testing-hints:
Use 'ethtool -C ethx rx-usecs-high xxx' to set different values for the
rate limit and 'idb ethx read 0x00035800' to observe register
PFINT_RATEN for values of 1, 2, 3, compared to 0 and 4.

HSDES-number: 1208935557

 drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c    |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_txrx.h    | 15 ++++++++++++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 99772ee..977ae6f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2072,7 +2072,7 @@ static void i40e_set_itr_per_queue(struct i40e_vsi *vsi,
 	struct i40e_q_vector *q_vector;
 	u16 vector, intrl;
 
-	intrl = INTRL_USEC_TO_REG(vsi->int_rate_limit);
+	intrl = i40e_intrl_usec_to_reg(vsi->int_rate_limit);
 
 	vsi->rx_rings[queue]->rx_itr_setting = ec->rx_coalesce_usecs;
 	vsi->tx_rings[queue]->tx_itr_setting = ec->tx_coalesce_usecs;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 769f922..4b5f6c0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3263,7 +3263,7 @@ static void i40e_vsi_configure_msix(struct i40e_vsi *vsi)
 		wr32(hw, I40E_PFINT_ITRN(I40E_TX_ITR, vector - 1),
 		     q_vector->tx.itr);
 		wr32(hw, I40E_PFINT_RATEN(vector - 1),
-		     INTRL_USEC_TO_REG(vsi->int_rate_limit));
+		     i40e_intrl_usec_to_reg(vsi->int_rate_limit));
 
 		/* Linked list for the queuepairs assigned to this vector */
 		wr32(hw, I40E_PFINT_LNKLSTN(vector - 1), qp);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index e065321..1ea820e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -52,7 +52,20 @@
  */
 #define INTRL_ENA                  BIT(6)
 #define INTRL_REG_TO_USEC(intrl) ((intrl & ~INTRL_ENA) << 2)
-#define INTRL_USEC_TO_REG(set) ((set) ? ((set) >> 2) | INTRL_ENA : 0)
+/**
+ * i40e_intrl_usec_to_reg - convert interrupt rate limit to register
+ * @intrl: interrupt rate limit to convert
+ *
+ * This function converts a decimal interrupt rate limit to the appropriate
+ * register format expected by the firmware when setting interrupt rate limit.
+ */
+static inline u16 i40e_intrl_usec_to_reg(int intrl)
+{
+	if (intrl >> 2)
+		return ((intrl >> 2) | INTRL_ENA);
+	else
+		return 0;
+}
 #define I40E_INTRL_8K              125     /* 8000 ints/sec */
 #define I40E_INTRL_62K             16      /* 62500 ints/sec */
 #define I40E_INTRL_83K             12      /* 83333 ints/sec */
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 06/14] i40e: add interrupt rate limit verbosity
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (4 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 05/14] i40e: refactor macro INTRL_USEC_TO_REG Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 19:38   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 07/14] i40e: don't check params until after checking for client instance Bimmy Pujari
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

From: Alan Brady <alan.brady@intel.com>

Due to the resolution of the register controlling interrupt rate
limiting, setting certain values for the interrupt rate limit make it
appear as though the limiting is not completely accurate.  The problem
is that the interrupt rate limit is getting rounded down to the nearest
multiple of 4.  This patch fixes the problem by adding some feedback to
the user as to the actual interrupt rate limit being used when it
differs from the requested limit.  Without this patch setting interrupt
rate limits may appear to behave inaccurately.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Change-ID: I3093cf3f2d437d35a4c4f4bb5af5ce1b85ab21b7
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 977ae6f..f9f71fb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2116,6 +2116,7 @@ static int __i40e_set_coalesce(struct net_device *netdev,
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_vsi *vsi = np->vsi;
 	struct i40e_pf *pf = vsi->back;
+	u16 intrl_reg;
 	int i;
 
 	if (ec->tx_max_coalesced_frames_irq || ec->rx_max_coalesced_frames_irq)
@@ -2127,8 +2128,9 @@ static int __i40e_set_coalesce(struct net_device *netdev,
 		return -EINVAL;
 	}
 
-	if (ec->rx_coalesce_usecs_high >= INTRL_REG_TO_USEC(I40E_MAX_INTRL)) {
-		netif_info(pf, drv, netdev, "Invalid value, rx-usecs-high range is 0-235\n");
+	if (ec->rx_coalesce_usecs_high > INTRL_REG_TO_USEC(I40E_MAX_INTRL)) {
+		netif_info(pf, drv, netdev, "Invalid value, rx-usecs-high range is 0-%lu\n",
+			   INTRL_REG_TO_USEC(I40E_MAX_INTRL));
 		return -EINVAL;
 	}
 
@@ -2141,7 +2143,12 @@ static int __i40e_set_coalesce(struct net_device *netdev,
 			return -EINVAL;
 	}
 
-	vsi->int_rate_limit = ec->rx_coalesce_usecs_high;
+	intrl_reg = i40e_intrl_usec_to_reg(ec->rx_coalesce_usecs_high);
+	vsi->int_rate_limit = INTRL_REG_TO_USEC(intrl_reg);
+	if (vsi->int_rate_limit != ec->rx_coalesce_usecs_high) {
+		netif_info(pf, drv, netdev, "Interrupt rate limit rounded down to %d\n",
+			   vsi->int_rate_limit);
+	}
 
 	if (ec->tx_coalesce_usecs == 0) {
 		if (ec->use_adaptive_tx_coalesce)
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 07/14] i40e: don't check params until after checking for client instance
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (5 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 06/14] i40e: add interrupt rate limit verbosity Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 19:39   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 08/14] i40evf: fix client warnings Bimmy Pujari
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

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

We can avoid the minor bit of work by calling check params after we
check for the client instance, since we're about to return early in
cases where we do not have a client.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Change-ID: I56f8ea2ba48d4f571fa331c9ace50819a022fa1c
---
 drivers/net/ethernet/intel/i40e/i40e_client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 7ca048f..f6409f9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -174,8 +174,6 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi)
 
 	if (!vsi)
 		return;
-	memset(&params, 0, sizeof(params));
-	i40e_client_get_params(vsi, &params);
 	mutex_lock(&i40e_client_instance_mutex);
 	list_for_each_entry(cdev, &i40e_client_instances, list) {
 		if (cdev->lan_info.pf == vsi->back) {
@@ -186,6 +184,8 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi)
 					"Cannot locate client instance l2_param_change routine\n");
 				continue;
 			}
+	memset(&params, 0, sizeof(params));
+	i40e_client_get_params(vsi, &params);
 			if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,
 				      &cdev->state)) {
 				dev_dbg(&vsi->back->pdev->dev, "Client is not open, abort l2 param change\n");
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 08/14] i40evf: fix client warnings
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (6 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 07/14] i40e: don't check params until after checking for client instance Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 19:46   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 09/14] i40evf: track outstanding client request Bimmy Pujari
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

From: Faisal Latif <faisal.latif@intel.com>

The function prototype in i40evf_client.h are giving warnings while
compiling i40iwvf module. Move these function prototypes to i40evf.h.
Also fix return code from u32 to int and this return code is
consistent with i40e_client.h

Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Change-Id: Ie3757f844993aabc27654aaf02ec14fb985ad2c4
---
 drivers/net/ethernet/intel/i40evf/i40evf.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index fffe4cf..1789266 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -336,4 +336,11 @@ 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 i40evf_adapter *adapter);
+int i40evf_lan_add_device(struct i40evf_adapter *adapter);
+int i40evf_lan_del_device(struct i40evf_adapter *adapter);
+void i40evf_client_subtask(struct i40evf_adapter *adapter);
+void i40evf_notify_client_message(struct i40e_vsi *vsi, u8 *msg, u16 len);
+void i40evf_notify_client_l2_params(struct i40e_vsi *vsi);
+void i40evf_notify_client_open(struct i40e_vsi *vsi);
+void i40evf_notify_client_close(struct i40e_vsi *vsi);
 #endif /* _I40EVF_H_ */
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 09/14] i40evf: track outstanding client request
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (7 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 08/14] i40evf: fix client warnings Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 20:58   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 10/14] i40e/i40evf: Limit dma sync of RX buffers to actual packet size Bimmy Pujari
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

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

The iWarp client cannot continue until this operation has been completed
by the PF driver. Sleep (with timeout) until the reply from the PF
driver has been received.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: I5dc41b857bba32d0218b7ce167b5da122dadf349
---
Testing Hints : Load up VF RDMA with > 2 active VFs.

 drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h   | 1 +
 drivers/net/ethernet/intel/i40evf/i40evf.h          | 1 +
 drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 4 ++++
 3 files changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h b/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
index fc374f8..d38a2b2 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
@@ -81,6 +81,7 @@ enum i40e_virtchnl_ops {
 	I40E_VIRTCHNL_OP_GET_STATS = 15,
 	I40E_VIRTCHNL_OP_FCOE = 16,
 	I40E_VIRTCHNL_OP_EVENT = 17, /* must ALWAYS be 17 */
+	I40E_VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP = 21,
 	I40E_VIRTCHNL_OP_CONFIG_RSS_KEY = 23,
 	I40E_VIRTCHNL_OP_CONFIG_RSS_LUT = 24,
 	I40E_VIRTCHNL_OP_GET_RSS_HENA_CAPS = 25,
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index 1789266..f16d9d1 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -195,6 +195,7 @@ struct i40evf_adapter {
 	u64 hw_csum_rx_error;
 	u32 rx_desc_count;
 	int num_msix_vectors;
+	u32 client_pending;
 	struct msix_entry *msix_entries;
 
 	u32 flags;
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 2059a8e..bee58af 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -999,6 +999,10 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
 		if (v_opcode != adapter->current_op)
 			return;
 		break;
+	case I40E_VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP:
+		adapter->client_pending &=
+				~(BIT(I40E_VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP));
+		break;
 	case I40E_VIRTCHNL_OP_GET_RSS_HENA_CAPS: {
 		struct i40e_virtchnl_rss_hena *vrh =
 			(struct i40e_virtchnl_rss_hena *)msg;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 10/14] i40e/i40evf: Limit dma sync of RX buffers to actual packet size
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (8 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 09/14] i40evf: track outstanding client request Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 21:50   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring Bimmy Pujari
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

From: "Scott Peterson" <scott.d.peterson@intel.com>

On packet RX, we perform a dma sync for cpu before passing the
packet up.  Here we limit that sync to the actual length of the
incoming packet, rather than always syncing the entire buffer.

Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
Change-ID: I626aaf6c37275a8ce9e81efcaa773f327b331487
---
Testing Hints:
Verify traffic is still passed correctly with the same or better
performance as before this patch

 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 16 +++++++++-------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 16 +++++++++-------
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index a347d08..7b96ccb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1525,7 +1525,7 @@ static inline bool i40e_page_is_reserved(struct page *page)
  * i40e_add_rx_frag - Add contents of Rx buffer to sk_buff
  * @rx_ring: rx descriptor ring to transact packets on
  * @rx_buffer: buffer containing page to add
- * @rx_desc: descriptor containing length of buffer written by hardware
+ * @size: packet length from rx_desc
  * @skb: sk_buff to place the data into
  *
  * This function will add the data contained in rx_buffer->page to the skb.
@@ -1538,13 +1538,10 @@ static inline bool i40e_page_is_reserved(struct page *page)
  **/
 static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
 			     struct i40e_rx_buffer *rx_buffer,
-			     union i40e_rx_desc *rx_desc,
+			     unsigned int size,
 			     struct sk_buff *skb)
 {
 	struct page *page = rx_buffer->page;
-	u64 qword = le64_to_cpu(rx_desc->wb.qword1.status_error_len);
-	unsigned int size = (qword & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
-			    I40E_RXD_QW1_LENGTH_PBUF_SHIFT;
 #if (PAGE_SIZE < 8192)
 	unsigned int truesize = I40E_RXBUFFER_2048;
 #else
@@ -1613,6 +1610,11 @@ static inline
 struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,
 				     union i40e_rx_desc *rx_desc)
 {
+	u64 local_status_error_len =
+		le64_to_cpu(rx_desc->wb.qword1.status_error_len);
+	unsigned int size =
+		(local_status_error_len & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
+		I40E_RXD_QW1_LENGTH_PBUF_SHIFT;
 	struct i40e_rx_buffer *rx_buffer;
 	struct sk_buff *skb;
 	struct page *page;
@@ -1654,11 +1656,11 @@ struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,
 	dma_sync_single_range_for_cpu(rx_ring->dev,
 				      rx_buffer->dma,
 				      rx_buffer->page_offset,
-				      I40E_RXBUFFER_2048,
+				      size,
 				      DMA_FROM_DEVICE);
 
 	/* pull page into skb */
-	if (i40e_add_rx_frag(rx_ring, rx_buffer, rx_desc, skb)) {
+	if (i40e_add_rx_frag(rx_ring, rx_buffer, size, skb)) {
 		/* hand second half of page back to the ring */
 		i40e_reuse_rx_page(rx_ring, rx_buffer);
 		rx_ring->rx_stats.page_reuse_count++;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 1818cdf..bb498c3 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1003,7 +1003,7 @@ static inline bool i40e_page_is_reserved(struct page *page)
  * i40e_add_rx_frag - Add contents of Rx buffer to sk_buff
  * @rx_ring: rx descriptor ring to transact packets on
  * @rx_buffer: buffer containing page to add
- * @rx_desc: descriptor containing length of buffer written by hardware
+ * @size: packet length from rx_desc
  * @skb: sk_buff to place the data into
  *
  * This function will add the data contained in rx_buffer->page to the skb.
@@ -1016,13 +1016,10 @@ static inline bool i40e_page_is_reserved(struct page *page)
  **/
 static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
 			     struct i40e_rx_buffer *rx_buffer,
-			     union i40e_rx_desc *rx_desc,
+			     unsigned int size,
 			     struct sk_buff *skb)
 {
 	struct page *page = rx_buffer->page;
-	u64 qword = le64_to_cpu(rx_desc->wb.qword1.status_error_len);
-	unsigned int size = (qword & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
-			    I40E_RXD_QW1_LENGTH_PBUF_SHIFT;
 #if (PAGE_SIZE < 8192)
 	unsigned int truesize = I40E_RXBUFFER_2048;
 #else
@@ -1091,6 +1088,11 @@ static inline
 struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,
 				       union i40e_rx_desc *rx_desc)
 {
+	u64 local_status_error_len =
+		le64_to_cpu(rx_desc->wb.qword1.status_error_len);
+	unsigned int size =
+		(local_status_error_len & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
+		I40E_RXD_QW1_LENGTH_PBUF_SHIFT;
 	struct i40e_rx_buffer *rx_buffer;
 	struct sk_buff *skb;
 	struct page *page;
@@ -1132,11 +1134,11 @@ struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,
 	dma_sync_single_range_for_cpu(rx_ring->dev,
 				      rx_buffer->dma,
 				      rx_buffer->page_offset,
-				      I40E_RXBUFFER_2048,
+				      size,
 				      DMA_FROM_DEVICE);
 
 	/* pull page into skb */
-	if (i40e_add_rx_frag(rx_ring, rx_buffer, rx_desc, skb)) {
+	if (i40e_add_rx_frag(rx_ring, rx_buffer, size, skb)) {
 		/* hand second half of page back to the ring */
 		i40e_reuse_rx_page(rx_ring, rx_buffer);
 		rx_ring->rx_stats.page_reuse_count++;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (9 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 10/14] i40e/i40evf: Limit dma sync of RX buffers to actual packet size Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 23:09   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 12/14] i40e/i40evf: elimitate i40e_pull_tail() Bimmy Pujari
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

From: "Scott Peterson" <scott.d.peterson@intel.com>

This patch reduces the size of struct i40e_rx_buffer by one pointer,
and makes the i40e driver a little more consistent with the igb driver
in terms of packets that span buffers.

We do this by moving the skb field from struct i40e_rx_buffer to
struct i40e_ring. We pass the skb we already have (or NULL if we
don't) to i40e_fetch_rx_buffer(), which skips the skb allocation if we
already have one for this packet.

Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
Change-ID: I4ad48a531844494ba0c5d8e1a62209a057f661b0
---
Testing Hints:
Generate traffic with jumbo frames (e.g. netperf), and observe
"non_eop_segs" stat increases on receiver.  That confirms the
path changed here was taken.

 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 31 +++++++++++++--------------
 drivers/net/ethernet/intel/i40e/i40e_txrx.h   |  9 +++++++-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 30 +++++++++++++-------------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h |  9 +++++++-
 4 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 7b96ccb..43de4c4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1013,14 +1013,15 @@ void i40e_clean_rx_ring(struct i40e_ring *rx_ring)
 	if (!rx_ring->rx_bi)
 		return;
 
+	if (rx_ring->skb) {
+		dev_kfree_skb(rx_ring->skb);
+		rx_ring->skb = NULL;
+	}
+
 	/* Free all the Rx ring sk_buffs */
 	for (i = 0; i < rx_ring->count; i++) {
 		struct i40e_rx_buffer *rx_bi = &rx_ring->rx_bi[i];
 
-		if (rx_bi->skb) {
-			dev_kfree_skb(rx_bi->skb);
-			rx_bi->skb = NULL;
-		}
 		if (!rx_bi->page)
 			continue;
 
@@ -1608,7 +1609,8 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
  */
 static inline
 struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,
-				     union i40e_rx_desc *rx_desc)
+				     union i40e_rx_desc *rx_desc,
+				     struct sk_buff *skb)
 {
 	u64 local_status_error_len =
 		le64_to_cpu(rx_desc->wb.qword1.status_error_len);
@@ -1616,15 +1618,12 @@ struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,
 		(local_status_error_len & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
 		I40E_RXD_QW1_LENGTH_PBUF_SHIFT;
 	struct i40e_rx_buffer *rx_buffer;
-	struct sk_buff *skb;
 	struct page *page;
 
 	rx_buffer = &rx_ring->rx_bi[rx_ring->next_to_clean];
 	page = rx_buffer->page;
 	prefetchw(page);
 
-	skb = rx_buffer->skb;
-
 	if (likely(!skb)) {
 		void *page_addr = page_address(page) + rx_buffer->page_offset;
 
@@ -1648,8 +1647,6 @@ struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,
 		 * it now to avoid a possible cache miss
 		 */
 		prefetchw(skb->data);
-	} else {
-		rx_buffer->skb = NULL;
 	}
 
 	/* we are reusing so sync this buffer for CPU use */
@@ -1702,7 +1699,6 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,
 #define staterrlen rx_desc->wb.qword1.status_error_len
 	if (unlikely(i40e_rx_is_programming_status(le64_to_cpu(staterrlen)))) {
 		i40e_clean_programming_status(rx_ring, rx_desc);
-		rx_ring->rx_bi[ntc].skb = skb;
 		return true;
 	}
 	/* if we are the last buffer then there is nothing else to do */
@@ -1710,8 +1706,6 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,
 	if (likely(i40e_test_staterr(rx_desc, I40E_RXD_EOF)))
 		return false;
 
-	/* place skb in next buffer to be received */
-	rx_ring->rx_bi[ntc].skb = skb;
 	rx_ring->rx_stats.non_eop_descs++;
 
 	return true;
@@ -1732,12 +1726,12 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,
 static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 {
 	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
+	struct sk_buff *skb = rx_ring->skb;
 	u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
 	bool failure = false;
 
 	while (likely(total_rx_packets < budget)) {
 		union i40e_rx_desc *rx_desc;
-		struct sk_buff *skb;
 		u16 vlan_tag;
 		u8 rx_ptype;
 		u64 qword;
@@ -1766,7 +1760,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 		 */
 		dma_rmb();
 
-		skb = i40e_fetch_rx_buffer(rx_ring, rx_desc);
+		skb = i40e_fetch_rx_buffer(rx_ring, rx_desc, skb);
 		if (!skb)
 			break;
 
@@ -1785,8 +1779,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 			continue;
 		}
 
-		if (i40e_cleanup_headers(rx_ring, skb))
+		if (i40e_cleanup_headers(rx_ring, skb)) {
+			skb = NULL;
 			continue;
+		}
 
 		/* probably a little skewed due to removing CRC */
 		total_rx_bytes += skb->len;
@@ -1811,11 +1807,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 			   le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) : 0;
 
 		i40e_receive_skb(rx_ring, skb, vlan_tag);
+		skb = NULL;
 
 		/* update budget accounting */
 		total_rx_packets++;
 	}
 
+	rx_ring->skb = skb;
+
 	u64_stats_update_begin(&rx_ring->syncp);
 	rx_ring->stats.packets += total_rx_packets;
 	rx_ring->stats.bytes += total_rx_bytes;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index 1ea820e..f809790 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -253,7 +253,6 @@ struct i40e_tx_buffer {
 };
 
 struct i40e_rx_buffer {
-	struct sk_buff *skb;
 	dma_addr_t dma;
 	struct page *page;
 	unsigned int page_offset;
@@ -354,6 +353,14 @@ struct i40e_ring {
 
 	struct rcu_head rcu;		/* to avoid race on free */
 	u16 next_to_alloc;
+	struct sk_buff *skb;		/* When i40e_clean_rx_ring_irq() must
+					 * return before it sees the EOP for
+					 * the current packet, we save that skb
+					 * here and resume receiving this
+					 * packet the next time
+					 * i40e_clean_rx_ring_irq() is called
+					 * for this ring.
+					 */
 } ____cacheline_internodealigned_in_smp;
 
 enum i40e_latency_range {
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index bb498c3..04c266c 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -501,14 +501,15 @@ void i40evf_clean_rx_ring(struct i40e_ring *rx_ring)
 	if (!rx_ring->rx_bi)
 		return;
 
+	if (rx_ring->skb) {
+		dev_kfree_skb(rx_ring->skb);
+		rx_ring->skb = NULL;
+	}
+
 	/* Free all the Rx ring sk_buffs */
 	for (i = 0; i < rx_ring->count; i++) {
 		struct i40e_rx_buffer *rx_bi = &rx_ring->rx_bi[i];
 
-		if (rx_bi->skb) {
-			dev_kfree_skb(rx_bi->skb);
-			rx_bi->skb = NULL;
-		}
 		if (!rx_bi->page)
 			continue;
 
@@ -1086,7 +1087,8 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
  */
 static inline
 struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,
-				       union i40e_rx_desc *rx_desc)
+				     union i40e_rx_desc *rx_desc,
+				     struct sk_buff *skb)
 {
 	u64 local_status_error_len =
 		le64_to_cpu(rx_desc->wb.qword1.status_error_len);
@@ -1094,15 +1096,12 @@ struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,
 		(local_status_error_len & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
 		I40E_RXD_QW1_LENGTH_PBUF_SHIFT;
 	struct i40e_rx_buffer *rx_buffer;
-	struct sk_buff *skb;
 	struct page *page;
 
 	rx_buffer = &rx_ring->rx_bi[rx_ring->next_to_clean];
 	page = rx_buffer->page;
 	prefetchw(page);
 
-	skb = rx_buffer->skb;
-
 	if (likely(!skb)) {
 		void *page_addr = page_address(page) + rx_buffer->page_offset;
 
@@ -1126,8 +1125,6 @@ struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,
 		 * it now to avoid a possible cache miss
 		 */
 		prefetchw(skb->data);
-	} else {
-		rx_buffer->skb = NULL;
 	}
 
 	/* we are reusing so sync this buffer for CPU use */
@@ -1182,8 +1179,6 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,
 	if (likely(i40e_test_staterr(rx_desc, I40E_RXD_EOF)))
 		return false;
 
-	/* place skb in next buffer to be received */
-	rx_ring->rx_bi[ntc].skb = skb;
 	rx_ring->rx_stats.non_eop_descs++;
 
 	return true;
@@ -1204,12 +1199,12 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,
 static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 {
 	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
+	struct sk_buff *skb = rx_ring->skb;
 	u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
 	bool failure = false;
 
 	while (likely(total_rx_packets < budget)) {
 		union i40e_rx_desc *rx_desc;
-		struct sk_buff *skb;
 		u16 vlan_tag;
 		u8 rx_ptype;
 		u64 qword;
@@ -1238,7 +1233,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 		 */
 		dma_rmb();
 
-		skb = i40evf_fetch_rx_buffer(rx_ring, rx_desc);
+		skb = i40evf_fetch_rx_buffer(rx_ring, rx_desc, skb);
 		if (!skb)
 			break;
 
@@ -1257,8 +1252,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 			continue;
 		}
 
-		if (i40e_cleanup_headers(rx_ring, skb))
+		if (i40e_cleanup_headers(rx_ring, skb)) {
+			skb = NULL;
 			continue;
+		}
 
 		/* probably a little skewed due to removing CRC */
 		total_rx_bytes += skb->len;
@@ -1275,11 +1272,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 			   le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) : 0;
 
 		i40e_receive_skb(rx_ring, skb, vlan_tag);
+		skb = NULL;
 
 		/* update budget accounting */
 		total_rx_packets++;
 	}
 
+	rx_ring->skb = skb;
+
 	u64_stats_update_begin(&rx_ring->syncp);
 	rx_ring->stats.packets += total_rx_packets;
 	rx_ring->stats.bytes += total_rx_bytes;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
index a5fc789..8274ba6 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
@@ -239,7 +239,6 @@ struct i40e_tx_buffer {
 };
 
 struct i40e_rx_buffer {
-	struct sk_buff *skb;
 	dma_addr_t dma;
 	struct page *page;
 	unsigned int page_offset;
@@ -340,6 +339,14 @@ struct i40e_ring {
 
 	struct rcu_head rcu;		/* to avoid race on free */
 	u16 next_to_alloc;
+	struct sk_buff *skb;		/* When i40evf_clean_rx_ring_irq() must
+					 * return before it sees the EOP for
+					 * the current packet, we save that skb
+					 * here and resume receiving this
+					 * packet the next time
+					 * i40evf_clean_rx_ring_irq() is called
+					 * for this ring.
+					 */
 } ____cacheline_internodealigned_in_smp;
 
 enum i40e_latency_range {
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 12/14] i40e/i40evf: elimitate i40e_pull_tail()
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (10 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 21:49   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 13/14] i40e: update comment explaining where FDIR buffers are freed Bimmy Pujari
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 14/14] i40e/i40evf : Changed version from 1.6.25 to 1.6.27 Bimmy Pujari
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

From: "Scott Peterson" <scott.d.peterson@intel.com>

Reorganize the i40e_pull_tail() logic, doing it in i40e_add_rx_frag()
where it's cheaper.  The igb driver does this the same way.

Also renames i40e_page_is_reserved() to reflect what it actually
tests.

Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
Change-ID: Icd9cc507aae1fcdc02308b3a09034111b4c24071
---
Testing Hints:
Needs data integrity verification (e.g. rsync with checksums twice)

 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 169 ++++++++++++++------------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 169 ++++++++++++++------------
 2 files changed, 186 insertions(+), 152 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 43de4c4..3e99206 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1426,45 +1426,6 @@ void i40e_process_skb_fields(struct i40e_ring *rx_ring,
 }
 
 /**
- * i40e_pull_tail - i40e specific version of skb_pull_tail
- * @rx_ring: rx descriptor ring packet is being transacted on
- * @skb: pointer to current skb being adjusted
- *
- * This function is an i40e specific version of __pskb_pull_tail.  The
- * main difference between this version and the original function is that
- * this function can make several assumptions about the state of things
- * that allow for significant optimizations versus the standard function.
- * As a result we can do things like drop a frag and maintain an accurate
- * truesize for the skb.
- */
-static void i40e_pull_tail(struct i40e_ring *rx_ring, struct sk_buff *skb)
-{
-	struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];
-	unsigned char *va;
-	unsigned int pull_len;
-
-	/* it is valid to use page_address instead of kmap since we are
-	 * working with pages allocated out of the lomem pool per
-	 * alloc_page(GFP_ATOMIC)
-	 */
-	va = skb_frag_address(frag);
-
-	/* we need the header to contain the greater of either ETH_HLEN or
-	 * 60 bytes if the skb->len is less than 60 for skb_pad.
-	 */
-	pull_len = eth_get_headlen(va, I40E_RX_HDR_SIZE);
-
-	/* align pull length to size of long to optimize memcpy performance */
-	skb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));
-
-	/* update all of the pointers */
-	skb_frag_size_sub(frag, pull_len);
-	frag->page_offset += pull_len;
-	skb->data_len -= pull_len;
-	skb->tail += pull_len;
-}
-
-/**
  * i40e_cleanup_headers - Correct empty headers
  * @rx_ring: rx descriptor ring packet is being transacted on
  * @skb: pointer to current skb being fixed
@@ -1479,10 +1440,6 @@ static void i40e_pull_tail(struct i40e_ring *rx_ring, struct sk_buff *skb)
  **/
 static bool i40e_cleanup_headers(struct i40e_ring *rx_ring, struct sk_buff *skb)
 {
-	/* place header in linear portion of buffer */
-	if (skb_is_nonlinear(skb))
-		i40e_pull_tail(rx_ring, skb);
-
 	/* if eth_skb_pad returns an error the skb was freed */
 	if (eth_skb_pad(skb))
 		return true;
@@ -1514,12 +1471,78 @@ static void i40e_reuse_rx_page(struct i40e_ring *rx_ring,
 }
 
 /**
- * i40e_page_is_reserved - check if reuse is possible
+ * i40e_page_is_reusable - check if any reuse is possible
  * @page: page struct to check
+ *
+ * A page is not reusable if it was allocated under low memory
+ * conditions, or it's not in the same NUMA node as this CPU.
  */
-static inline bool i40e_page_is_reserved(struct page *page)
+static inline bool i40e_page_is_reusable(struct page *page)
 {
-	return (page_to_nid(page) != numa_mem_id()) || page_is_pfmemalloc(page);
+	return (page_to_nid(page) == numa_mem_id()) &&
+		!page_is_pfmemalloc(page);
+}
+
+/**
+ * i40e_can_reuse_rx_page - Determine if this page can be reused by
+ * the adapter for another receive
+ *
+ * @rx_buffer: buffer containing the page
+ * @page: page address from rx_buffer
+ * @truesize: actual size of the buffer in this page
+ *
+ * If page is reusable, rx_buffer->page_offset is adjusted to point to
+ * an unused region in the page.
+ *
+ * For small pages, @truesize will be a constant value, half the size
+ * of the memory at page.  We'll attempt to alternate between high and
+ * low halves of the page, with one half ready for use by the hardware
+ * and the other half being consumed by the stack.  We use the page
+ * ref count to determine whether the stack has finished consuming the
+ * portion of this page that was passed up with a previous packet.  If
+ * the page ref count is >1, we'll assume the "other" half page is
+ * still busy, and this page cannot be reused.
+ *
+ * For larger pages, @truesize will be the actual space used by the
+ * received packet (adjusted upward to an even multiple of the cache
+ * line size).  This will advance through the page by the amount
+ * actually consumed by the received packets while there is still
+ * space for a buffer.  Each region of larger pages will be used at
+ * most once, after which the page will not be reused.
+ *
+ * In either case, if the page is reusable its refcount is increased.
+ **/
+static bool i40e_can_reuse_rx_page(struct i40e_rx_buffer *rx_buffer,
+				   struct page *page,
+				   const unsigned int truesize)
+{
+#if (PAGE_SIZE >= 8192)
+	unsigned int last_offset = PAGE_SIZE - I40E_RXBUFFER_2048;
+#endif
+
+	/* Is any reuse possible? */
+	if (unlikely(!i40e_page_is_reusable(page)))
+		return false;
+
+#if (PAGE_SIZE < 8192)
+	/* if we are only owner of page we can reuse it */
+	if (unlikely(page_count(page) != 1))
+		return false;
+
+	/* flip page offset to other buffer */
+	rx_buffer->page_offset ^= truesize;
+#else
+	/* move offset up to the next cache line */
+	rx_buffer->page_offset += truesize;
+
+	if (rx_buffer->page_offset > last_offset)
+		return false;
+#endif
+
+	/* Inc ref count on page before passing it up to the stack */
+	get_page(page);
+
+	return true;
 }
 
 /**
@@ -1543,23 +1566,25 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
 			     struct sk_buff *skb)
 {
 	struct page *page = rx_buffer->page;
+	unsigned char *va = page_address(page) + rx_buffer->page_offset;
 #if (PAGE_SIZE < 8192)
 	unsigned int truesize = I40E_RXBUFFER_2048;
 #else
 	unsigned int truesize = ALIGN(size, L1_CACHE_BYTES);
-	unsigned int last_offset = PAGE_SIZE - I40E_RXBUFFER_2048;
 #endif
+	unsigned int pull_len;
+
+	if (unlikely(skb_is_nonlinear(skb)))
+		goto add_tail_frag;
 
 	/* will the data fit in the skb we allocated? if so, just
 	 * copy it as it is pretty small anyway
 	 */
-	if ((size <= I40E_RX_HDR_SIZE) && !skb_is_nonlinear(skb)) {
-		unsigned char *va = page_address(page) + rx_buffer->page_offset;
-
+	if (size <= I40E_RX_HDR_SIZE) {
 		memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
 
-		/* page is not reserved, we can reuse buffer as-is */
-		if (likely(!i40e_page_is_reserved(page)))
+		/* page is reusable, we can reuse buffer as-is */
+		if (likely(i40e_page_is_reusable(page)))
 			return true;
 
 		/* this page cannot be reused so discard it */
@@ -1567,34 +1592,26 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
 		return false;
 	}
 
-	skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
-			rx_buffer->page_offset, size, truesize);
-
-	/* avoid re-using remote pages */
-	if (unlikely(i40e_page_is_reserved(page)))
-		return false;
-
-#if (PAGE_SIZE < 8192)
-	/* if we are only owner of page we can reuse it */
-	if (unlikely(page_count(page) != 1))
-		return false;
+	/* we need the header to contain the greater of either
+	 * ETH_HLEN or 60 bytes if the skb->len is less than
+	 * 60 for skb_pad.
+	 */
+	pull_len = eth_get_headlen(va, I40E_RX_HDR_SIZE);
 
-	/* flip page offset to other buffer */
-	rx_buffer->page_offset ^= truesize;
-#else
-	/* move offset up to the next cache line */
-	rx_buffer->page_offset += truesize;
+	/* align pull length to size of long to optimize
+	 * memcpy performance
+	 */
+	memcpy(__skb_put(skb, pull_len), va, ALIGN(pull_len, sizeof(long)));
 
-	if (rx_buffer->page_offset > last_offset)
-		return false;
-#endif
+	/* update all of the pointers */
+	va += pull_len;
+	size -= pull_len;
 
-	/* Even if we own the page, we are not allowed to use atomic_set()
-	 * This would break get_page_unless_zero() users.
-	 */
-	get_page(rx_buffer->page);
+add_tail_frag:
+	skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
+			(unsigned long)va & ~PAGE_MASK, size, truesize);
 
-	return true;
+	return i40e_can_reuse_rx_page(rx_buffer, page, truesize);
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 04c266c..4870cb5 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -904,45 +904,6 @@ void i40evf_process_skb_fields(struct i40e_ring *rx_ring,
 }
 
 /**
- * i40e_pull_tail - i40e specific version of skb_pull_tail
- * @rx_ring: rx descriptor ring packet is being transacted on
- * @skb: pointer to current skb being adjusted
- *
- * This function is an i40e specific version of __pskb_pull_tail.  The
- * main difference between this version and the original function is that
- * this function can make several assumptions about the state of things
- * that allow for significant optimizations versus the standard function.
- * As a result we can do things like drop a frag and maintain an accurate
- * truesize for the skb.
- */
-static void i40e_pull_tail(struct i40e_ring *rx_ring, struct sk_buff *skb)
-{
-	struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];
-	unsigned char *va;
-	unsigned int pull_len;
-
-	/* it is valid to use page_address instead of kmap since we are
-	 * working with pages allocated out of the lomem pool per
-	 * alloc_page(GFP_ATOMIC)
-	 */
-	va = skb_frag_address(frag);
-
-	/* we need the header to contain the greater of either ETH_HLEN or
-	 * 60 bytes if the skb->len is less than 60 for skb_pad.
-	 */
-	pull_len = eth_get_headlen(va, I40E_RX_HDR_SIZE);
-
-	/* align pull length to size of long to optimize memcpy performance */
-	skb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));
-
-	/* update all of the pointers */
-	skb_frag_size_sub(frag, pull_len);
-	frag->page_offset += pull_len;
-	skb->data_len -= pull_len;
-	skb->tail += pull_len;
-}
-
-/**
  * i40e_cleanup_headers - Correct empty headers
  * @rx_ring: rx descriptor ring packet is being transacted on
  * @skb: pointer to current skb being fixed
@@ -957,10 +918,6 @@ static void i40e_pull_tail(struct i40e_ring *rx_ring, struct sk_buff *skb)
  **/
 static bool i40e_cleanup_headers(struct i40e_ring *rx_ring, struct sk_buff *skb)
 {
-	/* place header in linear portion of buffer */
-	if (skb_is_nonlinear(skb))
-		i40e_pull_tail(rx_ring, skb);
-
 	/* if eth_skb_pad returns an error the skb was freed */
 	if (eth_skb_pad(skb))
 		return true;
@@ -992,12 +949,78 @@ static void i40e_reuse_rx_page(struct i40e_ring *rx_ring,
 }
 
 /**
- * i40e_page_is_reserved - check if reuse is possible
+ * i40e_page_is_reusable - check if any reuse is possible
  * @page: page struct to check
+ *
+ * A page is not reusable if it was allocated under low memory
+ * conditions, or it's not in the same NUMA node as this CPU.
  */
-static inline bool i40e_page_is_reserved(struct page *page)
+static inline bool i40e_page_is_reusable(struct page *page)
 {
-	return (page_to_nid(page) != numa_mem_id()) || page_is_pfmemalloc(page);
+	return (page_to_nid(page) == numa_mem_id()) &&
+		!page_is_pfmemalloc(page);
+}
+
+/**
+ * i40e_can_reuse_rx_page - Determine if this page can be reused by
+ * the adapter for another receive
+ *
+ * @rx_buffer: buffer containing the page
+ * @page: page address from rx_buffer
+ * @truesize: actual size of the buffer in this page
+ *
+ * If page is reusable, rx_buffer->page_offset is adjusted to point to
+ * an unused region in the page.
+ *
+ * For small pages, @truesize will be a constant value, half the size
+ * of the memory at page.  We'll attempt to alternate between high and
+ * low halves of the page, with one half ready for use by the hardware
+ * and the other half being consumed by the stack.  We use the page
+ * ref count to determine whether the stack has finished consuming the
+ * portion of this page that was passed up with a previous packet.  If
+ * the page ref count is >1, we'll assume the "other" half page is
+ * still busy, and this page cannot be reused.
+ *
+ * For larger pages, @truesize will be the actual space used by the
+ * received packet (adjusted upward to an even multiple of the cache
+ * line size).  This will advance through the page by the amount
+ * actually consumed by the received packets while there is still
+ * space for a buffer.  Each region of larger pages will be used at
+ * most once, after which the page will not be reused.
+ *
+ * In either case, if the page is reusable its refcount is increased.
+ **/
+static bool i40e_can_reuse_rx_page(struct i40e_rx_buffer *rx_buffer,
+				   struct page *page,
+				   const unsigned int truesize)
+{
+#if (PAGE_SIZE >= 8192)
+	unsigned int last_offset = PAGE_SIZE - I40E_RXBUFFER_2048;
+#endif
+
+	/* Is any reuse possible? */
+	if (unlikely(!i40e_page_is_reusable(page)))
+		return false;
+
+#if (PAGE_SIZE < 8192)
+	/* if we are only owner of page we can reuse it */
+	if (unlikely(page_count(page) != 1))
+		return false;
+
+	/* flip page offset to other buffer */
+	rx_buffer->page_offset ^= truesize;
+#else
+	/* move offset up to the next cache line */
+	rx_buffer->page_offset += truesize;
+
+	if (rx_buffer->page_offset > last_offset)
+		return false;
+#endif
+
+	/* Inc ref count on page before passing it up to the stack */
+	get_page(page);
+
+	return true;
 }
 
 /**
@@ -1021,23 +1044,25 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
 			     struct sk_buff *skb)
 {
 	struct page *page = rx_buffer->page;
+	unsigned char *va = page_address(page) + rx_buffer->page_offset;
 #if (PAGE_SIZE < 8192)
 	unsigned int truesize = I40E_RXBUFFER_2048;
 #else
 	unsigned int truesize = ALIGN(size, L1_CACHE_BYTES);
-	unsigned int last_offset = PAGE_SIZE - I40E_RXBUFFER_2048;
 #endif
+	unsigned int pull_len;
+
+	if (unlikely(skb_is_nonlinear(skb)))
+		goto add_tail_frag;
 
 	/* will the data fit in the skb we allocated? if so, just
 	 * copy it as it is pretty small anyway
 	 */
-	if ((size <= I40E_RX_HDR_SIZE) && !skb_is_nonlinear(skb)) {
-		unsigned char *va = page_address(page) + rx_buffer->page_offset;
-
+	if (size <= I40E_RX_HDR_SIZE) {
 		memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
 
-		/* page is not reserved, we can reuse buffer as-is */
-		if (likely(!i40e_page_is_reserved(page)))
+		/* page is reusable, we can reuse buffer as-is */
+		if (likely(i40e_page_is_reusable(page)))
 			return true;
 
 		/* this page cannot be reused so discard it */
@@ -1045,34 +1070,26 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,
 		return false;
 	}
 
-	skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
-			rx_buffer->page_offset, size, truesize);
-
-	/* avoid re-using remote pages */
-	if (unlikely(i40e_page_is_reserved(page)))
-		return false;
-
-#if (PAGE_SIZE < 8192)
-	/* if we are only owner of page we can reuse it */
-	if (unlikely(page_count(page) != 1))
-		return false;
+	/* we need the header to contain the greater of either
+	 * ETH_HLEN or 60 bytes if the skb->len is less than
+	 * 60 for skb_pad.
+	 */
+	pull_len = eth_get_headlen(va, I40E_RX_HDR_SIZE);
 
-	/* flip page offset to other buffer */
-	rx_buffer->page_offset ^= truesize;
-#else
-	/* move offset up to the next cache line */
-	rx_buffer->page_offset += truesize;
+	/* align pull length to size of long to optimize
+	 * memcpy performance
+	 */
+	memcpy(__skb_put(skb, pull_len), va, ALIGN(pull_len, sizeof(long)));
 
-	if (rx_buffer->page_offset > last_offset)
-		return false;
-#endif
+	/* update all of the pointers */
+	va += pull_len;
+	size -= pull_len;
 
-	/* Even if we own the page, we are not allowed to use atomic_set()
-	 * This would break get_page_unless_zero() users.
-	 */
-	get_page(rx_buffer->page);
+add_tail_frag:
+	skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
+			(unsigned long)va & ~PAGE_MASK, size, truesize);
 
-	return true;
+	return i40e_can_reuse_rx_page(rx_buffer, page, truesize);
 }
 
 /**
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 13/14] i40e: update comment explaining where FDIR buffers are freed
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (11 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 12/14] i40e/i40evf: elimitate i40e_pull_tail() Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 21:49   ` Bowers, AndrewX
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 14/14] i40e/i40evf : Changed version from 1.6.25 to 1.6.27 Bimmy Pujari
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

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

The original comment implies that the only location where the raw_packet
buffer will be freed is in i40e_clean_tx_ring() which is incorrect. In
fact this isn't even the normal case. Update the comment explaining
where the memory is freed.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Change-ID: Ie0defc35ed1c3af183f81fdc60b6d783707a5595
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 3e99206..e88e335 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -432,7 +432,12 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
 		ret = -EINVAL;
 	}
 
-	/* The buffer allocated here is freed by the i40e_clean_tx_ring() */
+	/* The buffer allocated here will be normally be freed by
+	 * i40e_clean_fdir_tx_irq() as it reclaims resources after transmit
+	 * completion. In the event of an error adding the buffer to the FDIR
+	 * ring, it will immediately be freed. It may also be freed by
+	 * i40e_clean_tx_ring() when closing the VSI.
+	 */
 	return ret;
 }
 
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 14/14] i40e/i40evf : Changed version from 1.6.25 to 1.6.27
  2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
                   ` (12 preceding siblings ...)
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 13/14] i40e: update comment explaining where FDIR buffers are freed Bimmy Pujari
@ 2016-11-29  0:06 ` Bimmy Pujari
  2016-12-01 21:50   ` Bowers, AndrewX
  13 siblings, 1 reply; 29+ messages in thread
From: Bimmy Pujari @ 2016-11-29  0:06 UTC (permalink / raw)
  To: intel-wired-lan

Signed-off-by: Bimmy Pujari <bimmy.pujari@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 4b5f6c0..7351361 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -41,7 +41,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 6
-#define DRV_VERSION_BUILD 25
+#define DRV_VERSION_BUILD 27
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 3fe87e0..729d8fa 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -38,7 +38,7 @@ static const char i40evf_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 6
-#define DRV_VERSION_BUILD 25
+#define DRV_VERSION_BUILD 27
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD) \
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters cleans Cloud Filters up
  2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters cleans Cloud Filters up Bimmy Pujari
@ 2016-12-01 18:26   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 18:26 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Sadowski, Filip <filip.sadowski@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters
> cleans Cloud Filters up
> 
> From: Filip Sadowski <filip.sadowski@intel.com>
> 
> This patch resolves the issue with Cloud Filters not being flushed from driver
> memory and HW when ntuple filters get disabled. Additionally it was possible
> to add Cloud Filters with ntuple mechanism off. Now Cloud Filters can be
> added only with ntuple enabled. Error code is returned otherwise.
> 
> Signed-off-by: Filip Sadowski <filip.sadowski@intel.com>
> Change-ID: I7bbc43ead41ead59be89ae2ca440a5c77fef2086
> ---
>  drivers/net/ethernet/intel/i40e/i40e.h         | 39
> ++++++++++++++++++++++++++
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  3 ++
>  drivers/net/ethernet/intel/i40e/i40e_main.c    | 21 ++++++++++++++
>  3 files changed, 63 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to start moving data off stack and into Tx buffer info
  2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to start moving data off stack and into Tx buffer info Bimmy Pujari
@ 2016-12-01 18:50   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 18:50 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to start
> moving data off stack and into Tx buffer info
> 
> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> This patch does some quick work to pull some of the data off of the stack and
> hopefully start storing it in the Tx buffer info section of the Tx ring.  Ideally
> we should be moving away from having to store much of anything on the
> stack and can just maintain it all in the descriptor rings.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Change-ID: I4b4715ea1920e122502482b3f9e56a9a6cb1e9fe
> ---
> Testing Hints:
>         This should not break the transmit path and should have no
>         signficant impact on Tx performance.  It brings us closer to what
>         is already in ixgbe and enables us to add support for a workaround
>         needed to deal with gso_size less than 64.
> 
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 47 +++++++++++++++--------
> ----
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 47 +++++++++++++++-------
> -----
>  2 files changed, 54 insertions(+), 40 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 03/14] i40e: Remove FPK HyperV VF device ID
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 03/14] i40e: Remove FPK HyperV VF device ID Bimmy Pujari
@ 2016-12-01 18:54   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 18:54 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Shanmugam, Jayaprakash <jayaprakash.shanmugam@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S55 03/14] i40e: Remove FPK HyperV
> VF device ID
> 
> From: Jayaprakash Shanmugam <jayaprakash.shanmugam@intel.com>
> 
> Requirement for VFs to use the VMBus has been removed that's why
> removing Hyper-V VF device ID.
> 
> Signed-off-by: Jayaprakash Shanmugam
> <jayaprakash.shanmugam@intel.com>
> Change-ID: I84f0964f443ee0db3e5e444b5ace996eb71b8280
> ---
>  drivers/net/ethernet/intel/i40evf/i40e_common.c | 1 -
> drivers/net/ethernet/intel/i40evf/i40e_devids.h | 1 -
>  2 files changed, 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 04/14] i40e: remove unused function
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 04/14] i40e: remove unused function Bimmy Pujari
@ 2016-12-01 18:56   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 18:56 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 04/14] i40e: remove unused
> function
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> After refactoring the client open and close code, this is no longer needed.
> Remove it.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Change-ID: If8e6e32baa354d857c2fd8b2f19404f1786011c4
> ---
> Testing Hints : No functional change, just dead code.

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 06/14] i40e: add interrupt rate limit verbosity
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 06/14] i40e: add interrupt rate limit verbosity Bimmy Pujari
@ 2016-12-01 19:38   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 19:38 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Brady, Alan <alan.brady@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S55 06/14] i40e: add interrupt rate
> limit verbosity
> 
> From: Alan Brady <alan.brady@intel.com>
> 
> Due to the resolution of the register controlling interrupt rate limiting, setting
> certain values for the interrupt rate limit make it appear as though the
> limiting is not completely accurate.  The problem is that the interrupt rate
> limit is getting rounded down to the nearest multiple of 4.  This patch fixes
> the problem by adding some feedback to the user as to the actual interrupt
> rate limit being used when it differs from the requested limit.  Without this
> patch setting interrupt rate limits may appear to behave inaccurately.
> 
> Signed-off-by: Alan Brady <alan.brady@intel.com>
> Change-ID: I3093cf3f2d437d35a4c4f4bb5af5ce1b85ab21b7
> ---
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 07/14] i40e: don't check params until after checking for client instance
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 07/14] i40e: don't check params until after checking for client instance Bimmy Pujari
@ 2016-12-01 19:39   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 19:39 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 07/14] i40e: don't check params
> until after checking for client instance
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> We can avoid the minor bit of work by calling check params after we check
> for the client instance, since we're about to return early in cases where we
> do not have a client.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: I56f8ea2ba48d4f571fa331c9ace50819a022fa1c
> ---
>  drivers/net/ethernet/intel/i40e/i40e_client.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 08/14] i40evf: fix client warnings
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 08/14] i40evf: fix client warnings Bimmy Pujari
@ 2016-12-01 19:46   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 19:46 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Latif, Faisal <faisal.latif@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S55 08/14] i40evf: fix client warnings
> 
> From: Faisal Latif <faisal.latif@intel.com>
> 
> The function prototype in i40evf_client.h are giving warnings while compiling
> i40iwvf module. Move these function prototypes to i40evf.h.
> Also fix return code from u32 to int and this return code is consistent with
> i40e_client.h
> 
> Signed-off-by: Faisal Latif <faisal.latif@intel.com>
> Change-Id: Ie3757f844993aabc27654aaf02ec14fb985ad2c4
> ---
>  drivers/net/ethernet/intel/i40evf/i40evf.h | 7 +++++++
>  1 file changed, 7 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 09/14] i40evf: track outstanding client request
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 09/14] i40evf: track outstanding client request Bimmy Pujari
@ 2016-12-01 20:58   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 20:58 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 09/14] i40evf: track outstanding
> client request
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> The iWarp client cannot continue until this operation has been completed by
> the PF driver. Sleep (with timeout) until the reply from the PF driver has
> been received.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Change-ID: I5dc41b857bba32d0218b7ce167b5da122dadf349
> ---
> Testing Hints : Load up VF RDMA with > 2 active VFs.
> 
>  drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h   | 1 +
>  drivers/net/ethernet/intel/i40evf/i40evf.h          | 1 +
>  drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 4 ++++
>  3 files changed, 6 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 05/14] i40e: refactor macro INTRL_USEC_TO_REG
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 05/14] i40e: refactor macro INTRL_USEC_TO_REG Bimmy Pujari
@ 2016-12-01 21:46   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 21:46 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Brady, Alan <alan.brady@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S55 05/14] i40e: refactor macro
> INTRL_USEC_TO_REG
> 
> From: Alan Brady <alan.brady@intel.com>
> 
> This patch refactors the macro INTRL_USEC_TO_REG into a static inline
> function and fixes a couple subtle bugs caused by the macro.
> 
> This patch fixes a bug which was caused by passing a bad register value to the
> firmware.  If enabling interrupt rate limiting, a non-zero value for the rate
> limit must be used.  Otherwise the firmware sets the interrupt rate limit to
> the maximum value.  Due to the limited resolution of the register,
> attempting to set a value of 1, 2, or 3 would be rounded down to 0 and
> limiting was left enabled, causing unexpected behavior.
> 
> This patch also fixes a possible bug in which using the macro itself can
> introduce unintended side-affects because the macro argument is used
> more than once in the macro definition (e.g. a variable post-increment
> argument would perform a double increment on the variable).
> 
> Without this patch, attempting to set interrupt rate limits of 1, 2, or
> 3 results in unexpected behavior and future use of this macro could cause
> subtle bugs.
> 
> Signed-off-by: Alan Brady <alan.brady@intel.com>
> Change-Id: I83ac842de0ca9c86761923d6e3a4d7b1b95f2b3f
> ---
> Testing-hints:
> Use 'ethtool -C ethx rx-usecs-high xxx' to set different values for the rate
> limit and 'idb ethx read 0x00035800' to observe register PFINT_RATEN for
> values of 1, 2, 3, compared to 0 and 4.
> 
> HSDES-number: 1208935557
> 
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  2 +-
>  drivers/net/ethernet/intel/i40e/i40e_main.c    |  2 +-
>  drivers/net/ethernet/intel/i40e/i40e_txrx.h    | 15 ++++++++++++++-
>  3 files changed, 16 insertions(+), 3 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 12/14] i40e/i40evf: elimitate i40e_pull_tail()
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 12/14] i40e/i40evf: elimitate i40e_pull_tail() Bimmy Pujari
@ 2016-12-01 21:49   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 21:49 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 12/14] i40e/i40evf: elimitate
> i40e_pull_tail()
> 
> From: "Scott Peterson" <scott.d.peterson@intel.com>
> 
> Reorganize the i40e_pull_tail() logic, doing it in i40e_add_rx_frag() where it's
> cheaper.  The igb driver does this the same way.
> 
> Also renames i40e_page_is_reserved() to reflect what it actually tests.
> 
> Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
> Change-ID: Icd9cc507aae1fcdc02308b3a09034111b4c24071
> ---
> Testing Hints:
> Needs data integrity verification (e.g. rsync with checksums twice)
> 
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 169 ++++++++++++++---------
> ---
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 169 ++++++++++++++-------
> -----
>  2 files changed, 186 insertions(+), 152 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 13/14] i40e: update comment explaining where FDIR buffers are freed
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 13/14] i40e: update comment explaining where FDIR buffers are freed Bimmy Pujari
@ 2016-12-01 21:49   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 21:49 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 13/14] i40e: update comment
> explaining where FDIR buffers are freed
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> The original comment implies that the only location where the raw_packet
> buffer will be freed is in i40e_clean_tx_ring() which is incorrect. In fact this
> isn't even the normal case. Update the comment explaining where the
> memory is freed.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: Ie0defc35ed1c3af183f81fdc60b6d783707a5595
> ---
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 14/14] i40e/i40evf : Changed version from 1.6.25 to 1.6.27
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 14/14] i40e/i40evf : Changed version from 1.6.25 to 1.6.27 Bimmy Pujari
@ 2016-12-01 21:50   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 21:50 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 14/14] i40e/i40evf : Changed
> version from 1.6.25 to 1.6.27
> 
> Signed-off-by: Bimmy Pujari <bimmy.pujari@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(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 10/14] i40e/i40evf: Limit dma sync of RX buffers to actual packet size
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 10/14] i40e/i40evf: Limit dma sync of RX buffers to actual packet size Bimmy Pujari
@ 2016-12-01 21:50   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 21:50 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 10/14] i40e/i40evf: Limit dma sync
> of RX buffers to actual packet size
> 
> From: "Scott Peterson" <scott.d.peterson@intel.com>
> 
> On packet RX, we perform a dma sync for cpu before passing the packet up.
> Here we limit that sync to the actual length of the incoming packet, rather
> than always syncing the entire buffer.
> 
> Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
> Change-ID: I626aaf6c37275a8ce9e81efcaa773f327b331487
> ---
> Testing Hints:
> Verify traffic is still passed correctly with the same or better performance as
> before this patch
> 
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 16 +++++++++-------
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 16 +++++++++-------
>  2 files changed, 18 insertions(+), 14 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring
  2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring Bimmy Pujari
@ 2016-12-01 23:09   ` Bowers, AndrewX
  0 siblings, 0 replies; 29+ messages in thread
From: Bowers, AndrewX @ 2016-12-01 23:09 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Monday, November 28, 2016 4:06 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb
> from i40e_rx_buffer to i40e_ring
> 
> From: "Scott Peterson" <scott.d.peterson@intel.com>
> 
> This patch reduces the size of struct i40e_rx_buffer by one pointer, and
> makes the i40e driver a little more consistent with the igb driver in terms of
> packets that span buffers.
> 
> We do this by moving the skb field from struct i40e_rx_buffer to struct
> i40e_ring. We pass the skb we already have (or NULL if we
> don't) to i40e_fetch_rx_buffer(), which skips the skb allocation if we already
> have one for this packet.
> 
> Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
> Change-ID: I4ad48a531844494ba0c5d8e1a62209a057f661b0
> ---
> Testing Hints:
> Generate traffic with jumbo frames (e.g. netperf), and observe
> "non_eop_segs" stat increases on receiver.  That confirms the path changed
> here was taken.
> 
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 31 +++++++++++++------------
> --
>  drivers/net/ethernet/intel/i40e/i40e_txrx.h   |  9 +++++++-
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 30 +++++++++++++----------
> ---  drivers/net/ethernet/intel/i40evf/i40e_txrx.h |  9 +++++++-
>  4 files changed, 46 insertions(+), 33 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

end of thread, other threads:[~2016-12-01 23:09 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-29  0:05 [Intel-wired-lan] [next PATCH S55 00/14] i40e/i40evf updates Bimmy Pujari
2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 01/14] i40e: Disabling ntuple filters cleans Cloud Filters up Bimmy Pujari
2016-12-01 18:26   ` Bowers, AndrewX
2016-11-29  0:05 ` [Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to start moving data off stack and into Tx buffer info Bimmy Pujari
2016-12-01 18:50   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 03/14] i40e: Remove FPK HyperV VF device ID Bimmy Pujari
2016-12-01 18:54   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 04/14] i40e: remove unused function Bimmy Pujari
2016-12-01 18:56   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 05/14] i40e: refactor macro INTRL_USEC_TO_REG Bimmy Pujari
2016-12-01 21:46   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 06/14] i40e: add interrupt rate limit verbosity Bimmy Pujari
2016-12-01 19:38   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 07/14] i40e: don't check params until after checking for client instance Bimmy Pujari
2016-12-01 19:39   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 08/14] i40evf: fix client warnings Bimmy Pujari
2016-12-01 19:46   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 09/14] i40evf: track outstanding client request Bimmy Pujari
2016-12-01 20:58   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 10/14] i40e/i40evf: Limit dma sync of RX buffers to actual packet size Bimmy Pujari
2016-12-01 21:50   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring Bimmy Pujari
2016-12-01 23:09   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 12/14] i40e/i40evf: elimitate i40e_pull_tail() Bimmy Pujari
2016-12-01 21:49   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 13/14] i40e: update comment explaining where FDIR buffers are freed Bimmy Pujari
2016-12-01 21:49   ` Bowers, AndrewX
2016-11-29  0:06 ` [Intel-wired-lan] [next PATCH S55 14/14] i40e/i40evf : Changed version from 1.6.25 to 1.6.27 Bimmy Pujari
2016-12-01 21:50   ` Bowers, AndrewX

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.