sch_cake: do not use skb_mac_header() in cake_overhead()
We want to remove our use of skb_mac_header() in tx paths, eg remove skb_reset_mac_header() from __dev_queue_xmit(). Idea is that ndo_start_xmit() can get the mac header simply looking at skb->data. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
f5fca219ad
commit
e495a9673c
@ -1360,7 +1360,7 @@ static u32 cake_overhead(struct cake_sched_data *q, const struct sk_buff *skb)
|
||||
return cake_calc_overhead(q, len, off);
|
||||
|
||||
/* borrowed from qdisc_pkt_len_init() */
|
||||
hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
|
||||
hdr_len = skb_transport_offset(skb);
|
||||
|
||||
/* + transport layer */
|
||||
if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 |
|
||||
@ -1368,14 +1368,14 @@ static u32 cake_overhead(struct cake_sched_data *q, const struct sk_buff *skb)
|
||||
const struct tcphdr *th;
|
||||
struct tcphdr _tcphdr;
|
||||
|
||||
th = skb_header_pointer(skb, skb_transport_offset(skb),
|
||||
th = skb_header_pointer(skb, hdr_len,
|
||||
sizeof(_tcphdr), &_tcphdr);
|
||||
if (likely(th))
|
||||
hdr_len += __tcp_hdrlen(th);
|
||||
} else {
|
||||
struct udphdr _udphdr;
|
||||
|
||||
if (skb_header_pointer(skb, skb_transport_offset(skb),
|
||||
if (skb_header_pointer(skb, hdr_len,
|
||||
sizeof(_udphdr), &_udphdr))
|
||||
hdr_len += sizeof(struct udphdr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user