]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: rename skb_gso_validate_mtu -> skb_gso_validate_network_len
authorDaniel Axtens <dja@axtens.net>
Thu, 1 Mar 2018 06:13:37 +0000 (17:13 +1100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 4 Mar 2018 22:49:17 +0000 (17:49 -0500)
If you take a GSO skb, and split it into packets, will the network
length (L3 headers + L4 headers + payload) of those packets be small
enough to fit within a given MTU?

skb_gso_validate_mtu gives you the answer to that question. However,
we recently added to add a way to validate the MAC length of a split GSO
skb (L2+L3+L4+payload), and the names get confusing, so rename
skb_gso_validate_mtu to skb_gso_validate_network_len

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/skbuff.c
net/ipv4/ip_forward.c
net/ipv4/ip_output.c
net/ipv4/netfilter/nf_flow_table_ipv4.c
net/ipv6/ip6_output.c
net/ipv6/netfilter/nf_flow_table_ipv6.c
net/mpls/af_mpls.c
net/xfrm/xfrm_device.c

index c1e66bdcf5837047fc48cd3bbe15e1e1bc0d3a92..a057dd1a75c777e8e736e16ff9e828031e7d5ee2 100644 (file)
@@ -3286,7 +3286,7 @@ void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len);
 int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);
 void skb_scrub_packet(struct sk_buff *skb, bool xnet);
 unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
-bool skb_gso_validate_mtu(const struct sk_buff *skb, unsigned int mtu);
+bool skb_gso_validate_network_len(const struct sk_buff *skb, unsigned int mtu);
 bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len);
 struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
 struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
index 09bd89c90a71c761728392ce0112b72b817d6240..b6376700882497d9ac623841fb01ed6208fa7c8f 100644 (file)
@@ -4955,19 +4955,20 @@ static inline bool skb_gso_size_check(const struct sk_buff *skb,
 }
 
 /**
- * skb_gso_validate_mtu - Return in case such skb fits a given MTU
+ * skb_gso_validate_network_len - Will a split GSO skb fit into a given MTU?
  *
  * @skb: GSO skb
  * @mtu: MTU to validate against
  *
- * skb_gso_validate_mtu validates if a given skb will fit a wanted MTU
- * once split.
+ * skb_gso_validate_network_len validates if a given skb will fit a
+ * wanted MTU once split. It considers L3 headers, L4 headers, and the
+ * payload.
  */
-bool skb_gso_validate_mtu(const struct sk_buff *skb, unsigned int mtu)
+bool skb_gso_validate_network_len(const struct sk_buff *skb, unsigned int mtu)
 {
        return skb_gso_size_check(skb, skb_gso_network_seglen(skb), mtu);
 }
-EXPORT_SYMBOL_GPL(skb_gso_validate_mtu);
+EXPORT_SYMBOL_GPL(skb_gso_validate_network_len);
 
 /**
  * skb_gso_validate_mac_len - Will a split GSO skb fit in a given length?
index 2dd21c3281a1cb4194dbb34dad086b701716220d..b54b948b059608fc3157fedf40e61519321c6912 100644 (file)
@@ -55,7 +55,7 @@ static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
        if (skb->ignore_df)
                return false;
 
-       if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
+       if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu))
                return false;
 
        return true;
index e8e675be60ec0044007c660bae1bb4d12c9a484e..66340ab750e69ff5775f7996192839a24ddc6e65 100644 (file)
@@ -248,7 +248,7 @@ static int ip_finish_output_gso(struct net *net, struct sock *sk,
 
        /* common case: seglen is <= mtu
         */
-       if (skb_gso_validate_mtu(skb, mtu))
+       if (skb_gso_validate_network_len(skb, mtu))
                return ip_finish_output2(net, sk, skb);
 
        /* Slowpath -  GSO segment length exceeds the egress MTU.
index 282b9cc4fe824eefa51c10dae63c2424153eac00..0cd46bffa46914efab9f26b7d85d7612f1b41450 100644 (file)
@@ -186,7 +186,7 @@ static bool __nf_flow_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
        if ((ip_hdr(skb)->frag_off & htons(IP_DF)) == 0)
                return false;
 
-       if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
+       if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu))
                return false;
 
        return true;
index 997c7f19ad62e61b04927f62eccaf54ca6f42801..a8a919520090920bd87e1c126c83cfae84405532 100644 (file)
@@ -412,7 +412,7 @@ static bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
        if (skb->ignore_df)
                return false;
 
-       if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
+       if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu))
                return false;
 
        return true;
index d346705d6ee6bfe87292bc77d7eb1614d214d2c9..207cb35569b1c3c382560088aeb6ecdd75a236b2 100644 (file)
@@ -178,7 +178,7 @@ static bool __nf_flow_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
        if (skb->len <= mtu)
                return false;
 
-       if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
+       if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu))
                return false;
 
        return true;
index e545a3c9365f8a8fe172a2a2d4ad0a14af49f9a8..7a4de6d618b169d0f72b04386965b6e02ba27ada 100644 (file)
@@ -122,7 +122,7 @@ bool mpls_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
        if (skb->len <= mtu)
                return false;
 
-       if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
+       if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu))
                return false;
 
        return true;
index 8e70291e586a97cab0a57e94a01d2fb7942b08b4..e87d6c4dd5b6a8269b450abf9b84bb6f0c4a6ad3 100644 (file)
@@ -217,7 +217,7 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
                if (skb->len <= mtu)
                        goto ok;
 
-               if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
+               if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu))
                        goto ok;
        }