aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2014-02-06 00:51:13 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-06 21:42:05 -0500
commitbe56052154c7129e6aab0e944f3d1ab331ff0cea (patch)
treeb22a526f7d0c97d9329ff8b19b069841e27806d0
parentff80301efad4818938470326b9879bb960f5e66c (diff)
i40e/i40evf: carefully fill tx ring
We need to make sure that we stay away from the cache line where the DD bit (done) may be getting written back for the transmit ring since the hardware may be writing the whole cache line for a partial update. Change-ID: Id0b6dfc01f654def6a2a021af185803be1915d7e Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c4
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_txrx.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index e4497f8e117d..2081bdb214e5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2102,7 +2102,7 @@ static int i40e_xmit_descriptor_count(struct sk_buff *skb,
2102 2102
2103 /* need: 1 descriptor per page * PAGE_SIZE/I40E_MAX_DATA_PER_TXD, 2103 /* need: 1 descriptor per page * PAGE_SIZE/I40E_MAX_DATA_PER_TXD,
2104 * + 1 desc for skb_head_len/I40E_MAX_DATA_PER_TXD, 2104 * + 1 desc for skb_head_len/I40E_MAX_DATA_PER_TXD,
2105 * + 2 desc gap to keep tail from touching head, 2105 * + 4 desc gap to avoid the cache line where head is,
2106 * + 1 desc for context descriptor, 2106 * + 1 desc for context descriptor,
2107 * otherwise try next time 2107 * otherwise try next time
2108 */ 2108 */
@@ -2113,7 +2113,7 @@ static int i40e_xmit_descriptor_count(struct sk_buff *skb,
2113 count += skb_shinfo(skb)->nr_frags; 2113 count += skb_shinfo(skb)->nr_frags;
2114#endif 2114#endif
2115 count += TXD_USE_COUNT(skb_headlen(skb)); 2115 count += TXD_USE_COUNT(skb_headlen(skb));
2116 if (i40e_maybe_stop_tx(tx_ring, count + 3)) { 2116 if (i40e_maybe_stop_tx(tx_ring, count + 4 + 1)) {
2117 tx_ring->tx_stats.tx_busy++; 2117 tx_ring->tx_stats.tx_busy++;
2118 return 0; 2118 return 0;
2119 } 2119 }
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 01bfab729b01..b1d87c6a5c35 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1482,7 +1482,7 @@ static int i40e_xmit_descriptor_count(struct sk_buff *skb,
1482 1482
1483 /* need: 1 descriptor per page * PAGE_SIZE/I40E_MAX_DATA_PER_TXD, 1483 /* need: 1 descriptor per page * PAGE_SIZE/I40E_MAX_DATA_PER_TXD,
1484 * + 1 desc for skb_head_len/I40E_MAX_DATA_PER_TXD, 1484 * + 1 desc for skb_head_len/I40E_MAX_DATA_PER_TXD,
1485 * + 2 desc gap to keep tail from touching head, 1485 * + 4 desc gap to avoid the cache line where head is,
1486 * + 1 desc for context descriptor, 1486 * + 1 desc for context descriptor,
1487 * otherwise try next time 1487 * otherwise try next time
1488 */ 1488 */
@@ -1493,7 +1493,7 @@ static int i40e_xmit_descriptor_count(struct sk_buff *skb,
1493 count += skb_shinfo(skb)->nr_frags; 1493 count += skb_shinfo(skb)->nr_frags;
1494#endif 1494#endif
1495 count += TXD_USE_COUNT(skb_headlen(skb)); 1495 count += TXD_USE_COUNT(skb_headlen(skb));
1496 if (i40e_maybe_stop_tx(tx_ring, count + 3)) { 1496 if (i40e_maybe_stop_tx(tx_ring, count + 4 + 1)) {
1497 tx_ring->tx_stats.tx_busy++; 1497 tx_ring->tx_stats.tx_busy++;
1498 return 0; 1498 return 0;
1499 } 1499 }