Commit 07e31637 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

sky2: transmit ring accounting

Be more accurate about number of transmit list elements required.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99455153
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
#define RX_DEF_PENDING RX_MAX_PENDING #define RX_DEF_PENDING RX_MAX_PENDING
/* This is the worst case number of transmit list elements for a single skb: /* This is the worst case number of transmit list elements for a single skb:
VLAN + TSO + CKSUM + Data + skb_frags * DMA */ VLAN:GSO + CKSUM + Data + skb_frags * DMA */
#define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) #define MAX_SKB_TX_LE (2 + (sizeof(dma_addr_t)/sizeof(u32))*(MAX_SKB_FRAGS+1))
#define TX_MIN_PENDING (MAX_SKB_TX_LE+1) #define TX_MIN_PENDING (MAX_SKB_TX_LE+1)
#define TX_MAX_PENDING 4096 #define TX_MAX_PENDING 4096
#define TX_DEF_PENDING 127 #define TX_DEF_PENDING 127
...@@ -1567,11 +1567,13 @@ static unsigned tx_le_req(const struct sk_buff *skb) ...@@ -1567,11 +1567,13 @@ static unsigned tx_le_req(const struct sk_buff *skb)
{ {
unsigned count; unsigned count;
count = sizeof(dma_addr_t) / sizeof(u32); count = (skb_shinfo(skb)->nr_frags + 1)
count += skb_shinfo(skb)->nr_frags * count; * (sizeof(dma_addr_t) / sizeof(u32));
if (skb_is_gso(skb)) if (skb_is_gso(skb))
++count; ++count;
else if (sizeof(dma_addr_t) == sizeof(u32))
++count; /* possible vlan */
if (skb->ip_summed == CHECKSUM_PARTIAL) if (skb->ip_summed == CHECKSUM_PARTIAL)
++count; ++count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment