[SK_BUFF]: Introduce skb_transport_offset()
For the quite common 'skb->h.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
badff6d01a
commit
ea2ae17d64
@ -2887,7 +2887,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||
return err;
|
||||
}
|
||||
|
||||
hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
|
||||
hdr_len = (skb_transport_offset(skb) + (skb->h.th->doff << 2));
|
||||
mss = skb_shinfo(skb)->gso_size;
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
struct iphdr *iph = ip_hdr(skb);
|
||||
@ -2897,7 +2897,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||
iph->daddr, 0,
|
||||
IPPROTO_TCP, 0);
|
||||
cmd_length = E1000_TXD_CMD_IP;
|
||||
ipcse = skb->h.raw - skb->data - 1;
|
||||
ipcse = skb_transport_offset(skb) - 1;
|
||||
} else if (skb->protocol == htons(ETH_P_IPV6)) {
|
||||
ipv6_hdr(skb)->payload_len = 0;
|
||||
skb->h.th->check =
|
||||
@ -2908,7 +2908,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||
}
|
||||
ipcss = skb_network_offset(skb);
|
||||
ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
|
||||
tucss = skb->h.raw - skb->data;
|
||||
tucss = skb_transport_offset(skb);
|
||||
tucso = (void *)&(skb->h.th->check) - (void *)skb->data;
|
||||
tucse = 0;
|
||||
|
||||
@ -2950,7 +2950,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||
uint8_t css;
|
||||
|
||||
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
|
||||
css = skb->h.raw - skb->data;
|
||||
css = skb_transport_offset(skb);
|
||||
|
||||
i = tx_ring->next_to_use;
|
||||
buffer_info = &tx_ring->buffer_info[i];
|
||||
@ -3292,7 +3292,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
||||
/* 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->h.raw - skb->data) + (skb->h.th->doff << 2));
|
||||
hdr_len = (skb_transport_offset(skb) + (skb->h.th->doff << 2));
|
||||
if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) {
|
||||
switch (adapter->hw.mac_type) {
|
||||
unsigned int pull_size;
|
||||
|
Reference in New Issue
Block a user