Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289732
b: refs/heads/master
c: 8bca5d1
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 25, 2012
1 parent 9ca743b commit 8f53a13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 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: aaca2377e9c08d1964a5cacb95330708a6f6d106
refs/heads/master: 8bca5d1ebb8bf18187256845ba3aaff5fbc01934
22 changes: 11 additions & 11 deletions trunk/drivers/net/vmxnet3/vmxnet3_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,27 +816,24 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,

if (ctx->mss) { /* TSO */
ctx->eth_ip_hdr_size = skb_transport_offset(skb);
ctx->l4_hdr_size = ((struct tcphdr *)
skb_transport_header(skb))->doff * 4;
ctx->l4_hdr_size = tcp_hdrlen(skb);
ctx->copy_size = ctx->eth_ip_hdr_size + ctx->l4_hdr_size;
} else {
if (skb->ip_summed == CHECKSUM_PARTIAL) {
ctx->eth_ip_hdr_size = skb_checksum_start_offset(skb);

if (ctx->ipv4) {
struct iphdr *iph = (struct iphdr *)
skb_network_header(skb);
const struct iphdr *iph = ip_hdr(skb);

if (iph->protocol == IPPROTO_TCP)
ctx->l4_hdr_size = ((struct tcphdr *)
skb_transport_header(skb))->doff * 4;
ctx->l4_hdr_size = tcp_hdrlen(skb);
else if (iph->protocol == IPPROTO_UDP)
/*
* Use tcp header size so that bytes to
* be copied are more than required by
* the device.
*/
ctx->l4_hdr_size =
sizeof(struct tcphdr);
ctx->l4_hdr_size = sizeof(struct tcphdr);
else
ctx->l4_hdr_size = 0;
} else {
Expand Down Expand Up @@ -881,14 +878,17 @@ static void
vmxnet3_prepare_tso(struct sk_buff *skb,
struct vmxnet3_tx_ctx *ctx)
{
struct tcphdr *tcph = (struct tcphdr *)skb_transport_header(skb);
struct tcphdr *tcph = tcp_hdr(skb);

if (ctx->ipv4) {
struct iphdr *iph = (struct iphdr *)skb_network_header(skb);
struct iphdr *iph = ip_hdr(skb);

iph->check = 0;
tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, 0,
IPPROTO_TCP, 0);
} else {
struct ipv6hdr *iph = (struct ipv6hdr *)skb_network_header(skb);
struct ipv6hdr *iph = ipv6_hdr(skb);

tcph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, 0,
IPPROTO_TCP, 0);
}
Expand Down

0 comments on commit 8f53a13

Please sign in to comment.