summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2018-01-31 06:15:33 +0300
committerDavid S. Miller <davem@davemloft.net>2018-02-01 17:36:03 +0300
commit2b16f048729bf35e6c28a40cbfad07239f9dcd90 (patch)
treefc9e536298bba6872e9f9b8f25359c7afa42c4ea /net/sched
parent255442c93843f52b6891b21d0b485bf2c97f93c3 (diff)
downloadlinux-2b16f048729bf35e6c28a40cbfad07239f9dcd90.tar.xz
net: create skb_gso_validate_mac_len()
If you take a GSO skb, and split it into packets, will the MAC length (L2 + L3 + L4 headers + payload) of those packets be small enough to fit within a given length? Move skb_gso_mac_seglen() to skbuff.h with other related functions like skb_gso_network_seglen() so we can use it, and then create skb_gso_validate_mac_len to do the full calculation. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_tbf.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 83e76d046993..229172d509cc 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -142,16 +142,6 @@ static u64 psched_ns_t2l(const struct psched_ratecfg *r,
return len;
}
-/*
- * Return length of individual segments of a gso packet,
- * including all headers (MAC, IP, TCP/UDP)
- */
-static unsigned int skb_gso_mac_seglen(const struct sk_buff *skb)
-{
- unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
- return hdr_len + skb_gso_transport_seglen(skb);
-}
-
/* GSO packet is too big, segment it so that tbf can transmit
* each segment in time
*/