Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: rename skb_gso_validate_mtu -> skb_gso_validate_network_len

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>

authored by

Daniel Axtens and committed by
David S. Miller
779b7931 4e00f5d5

+14 -13
+1 -1
include/linux/skbuff.h
··· 3286 3286 int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); 3287 3287 void skb_scrub_packet(struct sk_buff *skb, bool xnet); 3288 3288 unsigned int skb_gso_transport_seglen(const struct sk_buff *skb); 3289 - bool skb_gso_validate_mtu(const struct sk_buff *skb, unsigned int mtu); 3289 + bool skb_gso_validate_network_len(const struct sk_buff *skb, unsigned int mtu); 3290 3290 bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len); 3291 3291 struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); 3292 3292 struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
+6 -5
net/core/skbuff.c
··· 4955 4955 } 4956 4956 4957 4957 /** 4958 - * skb_gso_validate_mtu - Return in case such skb fits a given MTU 4958 + * skb_gso_validate_network_len - Will a split GSO skb fit into a given MTU? 4959 4959 * 4960 4960 * @skb: GSO skb 4961 4961 * @mtu: MTU to validate against 4962 4962 * 4963 - * skb_gso_validate_mtu validates if a given skb will fit a wanted MTU 4964 - * once split. 4963 + * skb_gso_validate_network_len validates if a given skb will fit a 4964 + * wanted MTU once split. It considers L3 headers, L4 headers, and the 4965 + * payload. 4965 4966 */ 4966 - bool skb_gso_validate_mtu(const struct sk_buff *skb, unsigned int mtu) 4967 + bool skb_gso_validate_network_len(const struct sk_buff *skb, unsigned int mtu) 4967 4968 { 4968 4969 return skb_gso_size_check(skb, skb_gso_network_seglen(skb), mtu); 4969 4970 } 4970 - EXPORT_SYMBOL_GPL(skb_gso_validate_mtu); 4971 + EXPORT_SYMBOL_GPL(skb_gso_validate_network_len); 4971 4972 4972 4973 /** 4973 4974 * skb_gso_validate_mac_len - Will a split GSO skb fit in a given length?
+1 -1
net/ipv4/ip_forward.c
··· 55 55 if (skb->ignore_df) 56 56 return false; 57 57 58 - if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu)) 58 + if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu)) 59 59 return false; 60 60 61 61 return true;
+1 -1
net/ipv4/ip_output.c
··· 248 248 249 249 /* common case: seglen is <= mtu 250 250 */ 251 - if (skb_gso_validate_mtu(skb, mtu)) 251 + if (skb_gso_validate_network_len(skb, mtu)) 252 252 return ip_finish_output2(net, sk, skb); 253 253 254 254 /* Slowpath - GSO segment length exceeds the egress MTU.
+1 -1
net/ipv4/netfilter/nf_flow_table_ipv4.c
··· 186 186 if ((ip_hdr(skb)->frag_off & htons(IP_DF)) == 0) 187 187 return false; 188 188 189 - if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu)) 189 + if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu)) 190 190 return false; 191 191 192 192 return true;
+1 -1
net/ipv6/ip6_output.c
··· 412 412 if (skb->ignore_df) 413 413 return false; 414 414 415 - if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu)) 415 + if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu)) 416 416 return false; 417 417 418 418 return true;
+1 -1
net/ipv6/netfilter/nf_flow_table_ipv6.c
··· 178 178 if (skb->len <= mtu) 179 179 return false; 180 180 181 - if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu)) 181 + if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu)) 182 182 return false; 183 183 184 184 return true;
+1 -1
net/mpls/af_mpls.c
··· 122 122 if (skb->len <= mtu) 123 123 return false; 124 124 125 - if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu)) 125 + if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu)) 126 126 return false; 127 127 128 128 return true;
+1 -1
net/xfrm/xfrm_device.c
··· 217 217 if (skb->len <= mtu) 218 218 goto ok; 219 219 220 - if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu)) 220 + if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu)) 221 221 goto ok; 222 222 } 223 223