aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_txrx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_txrx.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_txrx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 5dae968d853e..fe5bbabbb41e 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1520,7 +1520,7 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
1520 1520
1521 /* update gso_segs and bytecount */ 1521 /* update gso_segs and bytecount */
1522 first->gso_segs = skb_shinfo(skb)->gso_segs; 1522 first->gso_segs = skb_shinfo(skb)->gso_segs;
1523 first->bytecount = (first->gso_segs - 1) * off->header_len; 1523 first->bytecount += (first->gso_segs - 1) * off->header_len;
1524 1524
1525 cd_tso_len = skb->len - off->header_len; 1525 cd_tso_len = skb->len - off->header_len;
1526 cd_mss = skb_shinfo(skb)->gso_size; 1526 cd_mss = skb_shinfo(skb)->gso_size;
@@ -1556,15 +1556,15 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
1556 * magnitude greater than our largest possible GSO size. 1556 * magnitude greater than our largest possible GSO size.
1557 * 1557 *
1558 * This would then be implemented as: 1558 * This would then be implemented as:
1559 * return (((size >> 12) * 85) >> 8) + 1; 1559 * return (((size >> 12) * 85) >> 8) + ICE_DESCS_FOR_SKB_DATA_PTR;
1560 * 1560 *
1561 * Since multiplication and division are commutative, we can reorder 1561 * Since multiplication and division are commutative, we can reorder
1562 * operations into: 1562 * operations into:
1563 * return ((size * 85) >> 20) + 1; 1563 * return ((size * 85) >> 20) + ICE_DESCS_FOR_SKB_DATA_PTR;
1564 */ 1564 */
1565static unsigned int ice_txd_use_count(unsigned int size) 1565static unsigned int ice_txd_use_count(unsigned int size)
1566{ 1566{
1567 return ((size * 85) >> 20) + 1; 1567 return ((size * 85) >> 20) + ICE_DESCS_FOR_SKB_DATA_PTR;
1568} 1568}
1569 1569
1570/** 1570/**
@@ -1706,7 +1706,8 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)
1706 * + 1 desc for context descriptor, 1706 * + 1 desc for context descriptor,
1707 * otherwise try next time 1707 * otherwise try next time
1708 */ 1708 */
1709 if (ice_maybe_stop_tx(tx_ring, count + 4 + 1)) { 1709 if (ice_maybe_stop_tx(tx_ring, count + ICE_DESCS_PER_CACHE_LINE +
1710 ICE_DESCS_FOR_CTX_DESC)) {
1710 tx_ring->tx_stats.tx_busy++; 1711 tx_ring->tx_stats.tx_busy++;
1711 return NETDEV_TX_BUSY; 1712 return NETDEV_TX_BUSY;
1712 } 1713 }