Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27317
b: refs/heads/master
c: 96f9c2e
h: refs/heads/master
i:
  27315: d6e002e
v: v3
  • Loading branch information
Auke Kok authored and Auke Kok committed May 23, 2006
1 parent 6e5587c commit aa303cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e3ceac609cce39cb96e0eb8604934592371ed8c
refs/heads/master: 96f9c2e277768099479fbed7c3b69c294b1fadef
17 changes: 15 additions & 2 deletions trunk/drivers/net/ixgb/ixgb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
struct ixgb_buffer *buffer_info;
int len = skb->len;
unsigned int offset = 0, size, count = 0, i;
unsigned int mss = skb_shinfo(skb)->tso_size;

unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
unsigned int f;
Expand All @@ -1277,6 +1278,11 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
while(len) {
buffer_info = &tx_ring->buffer_info[i];
size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
/* Workaround for premature desc write-backs
* in TSO mode. Append 4-byte sentinel desc */
if(unlikely(mss && !nr_frags && size == len && size > 8))
size -= 4;

buffer_info->length = size;
buffer_info->dma =
pci_map_single(adapter->pdev,
Expand All @@ -1301,6 +1307,12 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
while(len) {
buffer_info = &tx_ring->buffer_info[i];
size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
/* Workaround for premature desc write-backs
* in TSO mode. Append 4-byte sentinel desc */
if(unlikely(mss && (f == (nr_frags-1)) && (size == len)
&& (size > 8)))
size -= 4;

buffer_info->length = size;
buffer_info->dma =
pci_map_page(adapter->pdev,
Expand Down Expand Up @@ -1378,7 +1390,8 @@ ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,int tx_flags)
#define TXD_USE_COUNT(S) (((S) >> IXGB_MAX_TXD_PWR) + \
(((S) & (IXGB_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
#define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) + \
MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1
MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 \
/* one more for TSO workaround */ + 1

static int
ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
Expand Down Expand Up @@ -1416,7 +1429,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
return NETDEV_TX_OK;
}

if (tso)
if (likely(tso))
tx_flags |= IXGB_TX_FLAGS_TSO;
else if(ixgb_tx_csum(adapter, skb))
tx_flags |= IXGB_TX_FLAGS_CSUM;
Expand Down

0 comments on commit aa303cd

Please sign in to comment.