diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-21 16:45:17 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-03-22 22:43:23 -0700 |
commit | f5fca219ad4548bc45f0221f9857ad22cb8136a1 (patch) | |
tree | bea1cdd9ff34847c01cc98a643a01b7b04928e68 /net | |
parent | b50fea1f261d2f011e9ee28e3e30c21eb2e680d5 (diff) | |
download | linux-stable-f5fca219ad4548bc45f0221f9857ad22cb8136a1.tar.gz linux-stable-f5fca219ad4548bc45f0221f9857ad22cb8136a1.tar.bz2 linux-stable-f5fca219ad4548bc45f0221f9857ad22cb8136a1.zip |
net: do not use skb_mac_header() in qdisc_pkt_len_init()
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/core/dev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index c278beee6792..7172334a418f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3735,25 +3735,25 @@ static void qdisc_pkt_len_init(struct sk_buff *skb) * we add to pkt_len the headers size of all segments */ if (shinfo->gso_size && skb_transport_header_was_set(skb)) { - unsigned int hdr_len; u16 gso_segs = shinfo->gso_segs; + unsigned int hdr_len; /* mac layer + network layer */ - 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 | SKB_GSO_TCPV6))) { 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); } |