1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
diff -up ./include/linux/if_ether.h.netdev-e1000e-backport ./include/linux/if_ether.h
--- ./include/linux/if_ether.h.netdev-e1000e-backport 2008-02-15 00:38:38.000000000 +0000
+++ ./include/linux/if_ether.h 2008-02-15 01:34:08.000000000 +0000
@@ -33,6 +33,7 @@
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
+#define ETH_FCS_LEN 4 /* Octets in the FCS */
/*
* These are the defined Ethernet Protocol ID's.
diff -up ./drivers/net/e1000e/netdev.c.netdev-e1000e-backport ./drivers/net/e1000e/netdev.c
--- ./drivers/net/e1000e/netdev.c.netdev-e1000e-backport 2008-02-15 01:30:25.000000000 +0000
+++ ./drivers/net/e1000e/netdev.c 2008-02-15 01:35:38.000000000 +0000
@@ -806,7 +806,7 @@ static bool e1000_clean_rx_irq_jumbo(str
u8 *vaddr;
vaddr = kmap_atomic(buffer_info->page,
KM_SKB_DATA_SOFTIRQ);
- memcpy(skb_tail_pointer(skb),
+ memcpy(skb->tail,
vaddr, length);
kunmap_atomic(vaddr,
KM_SKB_DATA_SOFTIRQ);
@@ -963,7 +963,7 @@ static bool e1000_clean_rx_irq_ps(struct
pci_dma_sync_single_for_cpu(pdev, ps_page->dma,
PAGE_SIZE, PCI_DMA_FROMDEVICE);
vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ);
- memcpy(skb_tail_pointer(skb), vaddr, l1);
+ memcpy(skb->tail, vaddr, l1);
kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
pci_dma_sync_single_for_device(pdev, ps_page->dma,
PAGE_SIZE, PCI_DMA_FROMDEVICE);
@@ -3103,30 +3103,29 @@ static int e1000_tso(struct e1000_adapte
return err;
}
- hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
+ hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
mss = skb_shinfo(skb)->gso_size;
if (skb->protocol == htons(ETH_P_IP)) {
- struct iphdr *iph = ip_hdr(skb);
- iph->tot_len = 0;
- iph->check = 0;
- tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
- iph->daddr, 0,
- IPPROTO_TCP,
- 0);
+ skb->nh.iph->tot_len = 0;
+ skb->nh.iph->check = 0;
+ skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr,
+ skb->nh.iph->daddr, 0,
+ IPPROTO_TCP,
+ 0);
cmd_length = E1000_TXD_CMD_IP;
- ipcse = skb_transport_offset(skb) - 1;
+ ipcse = skb->h.raw - skb->data - 1;
} else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
- ipv6_hdr(skb)->payload_len = 0;
- tcp_hdr(skb)->check =
- ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
- &ipv6_hdr(skb)->daddr,
+ skb->nh.ipv6h->payload_len = 0;
+ skb->h.th->check =
+ ~csum_ipv6_magic(&skb->nh.ipv6h->saddr,
+ &skb->nh.ipv6h->daddr,
0, IPPROTO_TCP, 0);
ipcse = 0;
}
- ipcss = skb_network_offset(skb);
- ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
- tucss = skb_transport_offset(skb);
- tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
+ ipcss = skb->nh.raw - skb->data;
+ ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data;
+ tucss = skb->h.raw - skb->data;
+ tucso = (void *)&(skb->h.th->check) - (void *)skb->data;
tucse = 0;
cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
@@ -3169,7 +3168,7 @@ static bool e1000_tx_csum(struct e1000_a
u8 css;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- css = skb_transport_offset(skb);
+ css = skb->h.raw - skb->data;
i = tx_ring->next_to_use;
buffer_info = &tx_ring->buffer_info[i];
@@ -3477,7 +3476,7 @@ static int e1000_xmit_frame(struct sk_bu
/* TSO Workaround for 82571/2/3 Controllers -- if skb->data
* points to just header, pull a few bytes of payload from
* frags into skb->data */
- hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
+ hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) {
unsigned int pull_size;
|