diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-21 16:45:18 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-03-22 22:43:23 -0700 |
commit | e495a9673caf7619fc234b6808814bdf5072e0a6 (patch) | |
tree | 95e03723edd6d9fe7c2d848e06446e14117fed57 /net | |
parent | f5fca219ad4548bc45f0221f9857ad22cb8136a1 (diff) | |
download | linux-stable-e495a9673caf7619fc234b6808814bdf5072e0a6.tar.gz linux-stable-e495a9673caf7619fc234b6808814bdf5072e0a6.tar.bz2 linux-stable-e495a9673caf7619fc234b6808814bdf5072e0a6.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_cake.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c index 7970217b565a..891e007d5c0b 100644 --- a/net/sched/sch_cake.c +++ b/net/sched/sch_cake.c @@ -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); } |