Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112230
b: refs/heads/master
c: af807c8
h: refs/heads/master
v: v3
  • Loading branch information
Dave Graham authored and David S. Miller committed Oct 9, 2008
1 parent d30c0f9 commit f6c1bfd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 24 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: ec7e6fabbe72f1fe65eed14c106a0fbc00f6c2f1
refs/heads/master: af807c82978ec1b8c5120b59b78ef951b3e4603b
62 changes: 39 additions & 23 deletions trunk/drivers/net/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3749,34 +3749,50 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
struct e1000_buffer *buffer_info;
unsigned int i;
u8 css;
u32 cmd_len = E1000_TXD_CMD_DEXT;

if (skb->ip_summed == CHECKSUM_PARTIAL) {
css = skb_transport_offset(skb);

i = tx_ring->next_to_use;
buffer_info = &tx_ring->buffer_info[i];
context_desc = E1000_CONTEXT_DESC(*tx_ring, i);

context_desc->lower_setup.ip_config = 0;
context_desc->upper_setup.tcp_fields.tucss = css;
context_desc->upper_setup.tcp_fields.tucso =
css + skb->csum_offset;
context_desc->upper_setup.tcp_fields.tucse = 0;
context_desc->tcp_seg_setup.data = 0;
context_desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT);
if (skb->ip_summed != CHECKSUM_PARTIAL)
return 0;

buffer_info->time_stamp = jiffies;
buffer_info->next_to_watch = i;
switch (skb->protocol) {
case __constant_htons(ETH_P_IP):
if (ip_hdr(skb)->protocol == IPPROTO_TCP)
cmd_len |= E1000_TXD_CMD_TCP;
break;
case __constant_htons(ETH_P_IPV6):
/* XXX not handling all IPV6 headers */
if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
cmd_len |= E1000_TXD_CMD_TCP;
break;
default:
if (unlikely(net_ratelimit()))
e_warn("checksum_partial proto=%x!\n", skb->protocol);
break;
}

i++;
if (i == tx_ring->count)
i = 0;
tx_ring->next_to_use = i;
css = skb_transport_offset(skb);

return 1;
}
i = tx_ring->next_to_use;
buffer_info = &tx_ring->buffer_info[i];
context_desc = E1000_CONTEXT_DESC(*tx_ring, i);

context_desc->lower_setup.ip_config = 0;
context_desc->upper_setup.tcp_fields.tucss = css;
context_desc->upper_setup.tcp_fields.tucso =
css + skb->csum_offset;
context_desc->upper_setup.tcp_fields.tucse = 0;
context_desc->tcp_seg_setup.data = 0;
context_desc->cmd_and_length = cpu_to_le32(cmd_len);

buffer_info->time_stamp = jiffies;
buffer_info->next_to_watch = i;

i++;
if (i == tx_ring->count)
i = 0;
tx_ring->next_to_use = i;

return 0;
return 1;
}

#define E1000_MAX_PER_TXD 8192
Expand Down

0 comments on commit f6c1bfd

Please sign in to comment.