Commit e495a967 authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski

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: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f5fca219
...@@ -1360,7 +1360,7 @@ static u32 cake_overhead(struct cake_sched_data *q, const struct sk_buff *skb) ...@@ -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); return cake_calc_overhead(q, len, off);
/* borrowed from qdisc_pkt_len_init() */ /* borrowed from qdisc_pkt_len_init() */
hdr_len = skb_transport_header(skb) - skb_mac_header(skb); hdr_len = skb_transport_offset(skb);
/* + transport layer */ /* + transport layer */
if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | 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) ...@@ -1368,14 +1368,14 @@ static u32 cake_overhead(struct cake_sched_data *q, const struct sk_buff *skb)
const struct tcphdr *th; const struct tcphdr *th;
struct tcphdr _tcphdr; struct tcphdr _tcphdr;
th = skb_header_pointer(skb, skb_transport_offset(skb), th = skb_header_pointer(skb, hdr_len,
sizeof(_tcphdr), &_tcphdr); sizeof(_tcphdr), &_tcphdr);
if (likely(th)) if (likely(th))
hdr_len += __tcp_hdrlen(th); hdr_len += __tcp_hdrlen(th);
} else { } else {
struct udphdr _udphdr; struct udphdr _udphdr;
if (skb_header_pointer(skb, skb_transport_offset(skb), if (skb_header_pointer(skb, hdr_len,
sizeof(_udphdr), &_udphdr)) sizeof(_udphdr), &_udphdr))
hdr_len += sizeof(struct udphdr); hdr_len += sizeof(struct udphdr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment