Lines Matching full:mtu
148 struct sk_buff *skb, unsigned int mtu) in ip6_finish_output_gso_slowpath_drop() argument
156 * egress MTU. in ip6_finish_output_gso_slowpath_drop()
171 /* Last GSO segment can be smaller than gso_size (and MTU). in ip6_finish_output_gso_slowpath_drop()
175 err = segs->len > mtu ? in ip6_finish_output_gso_slowpath_drop()
186 struct sk_buff *skb, unsigned int mtu) in ip6_finish_output_gso() argument
189 !skb_gso_validate_network_len(skb, mtu)) in ip6_finish_output_gso()
190 return ip6_finish_output_gso_slowpath_drop(net, sk, skb, mtu); in ip6_finish_output_gso()
197 unsigned int mtu; in __ip6_finish_output() local
207 mtu = ip6_skb_dst_mtu(skb); in __ip6_finish_output()
209 return ip6_finish_output_gso(net, sk, skb, mtu); in __ip6_finish_output()
211 if (skb->len > mtu || in __ip6_finish_output()
283 u32 mtu; in ip6_xmit() local
352 mtu = dst_mtu(dst); in ip6_xmit()
353 if ((skb->len <= mtu) || skb->ignore_df || skb_is_gso(skb)) { in ip6_xmit()
375 ipv6_local_error((struct sock *)sk, EMSGSIZE, fl6, mtu); in ip6_xmit()
483 static bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu) in ip6_pkt_too_big() argument
485 if (skb->len <= mtu) in ip6_pkt_too_big()
489 if (IP6CB(skb)->frag_max_size && IP6CB(skb)->frag_max_size > mtu) in ip6_pkt_too_big()
495 if (skb_is_gso(skb) && skb_gso_validate_network_len(skb, mtu)) in ip6_pkt_too_big()
509 u32 mtu; in ip6_forward() local
641 mtu = ip6_dst_mtu_maybe_forward(dst, true); in ip6_forward()
642 if (mtu < IPV6_MIN_MTU) in ip6_forward()
643 mtu = IPV6_MIN_MTU; in ip6_forward()
645 if (ip6_pkt_too_big(skb, mtu)) { in ip6_forward()
648 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); in ip6_forward()
766 void ip6_frag_init(struct sk_buff *skb, unsigned int hlen, unsigned int mtu, in ip6_frag_init() argument
775 state->mtu = mtu; in ip6_frag_init()
795 /* IF: it doesn't fit, use 'mtu' - the data space left */ in ip6_frag_next()
796 if (len > state->mtu) in ip6_frag_next()
797 len = state->mtu; in ip6_frag_next()
872 unsigned int mtu, hlen, nexthdr_offset; in ip6_fragment() local
885 mtu = ip6_skb_dst_mtu(skb); in ip6_fragment()
887 /* We must not fragment if the socket is set to force MTU discovery in ip6_fragment()
890 if (unlikely(!skb->ignore_df && skb->len > mtu)) in ip6_fragment()
894 if (IP6CB(skb)->frag_max_size > mtu) in ip6_fragment()
898 mtu = IP6CB(skb)->frag_max_size; in ip6_fragment()
899 if (mtu < IPV6_MIN_MTU) in ip6_fragment()
900 mtu = IPV6_MIN_MTU; in ip6_fragment()
906 if (frag_size && frag_size < mtu) in ip6_fragment()
907 mtu = frag_size; in ip6_fragment()
909 if (mtu < hlen + sizeof(struct frag_hdr) + 8) in ip6_fragment()
911 mtu -= hlen + sizeof(struct frag_hdr); in ip6_fragment()
927 if (first_len - hlen > mtu || in ip6_fragment()
935 if (frag->len > mtu || in ip6_fragment()
1009 ip6_frag_init(skb, hlen, mtu, rt->dst.dev->needed_tailroom, in ip6_fragment()
1041 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); in ip6_fragment()
1317 static void ip6_append_data_mtu(unsigned int *mtu, in ip6_append_data_mtu() argument
1327 *mtu = orig_mtu - rt->dst.header_len; in ip6_append_data_mtu()
1334 *mtu = orig_mtu; in ip6_append_data_mtu()
1336 *maxfraglen = ((*mtu - fragheaderlen) & ~7) in ip6_append_data_mtu()
1346 unsigned int mtu, frag_size; in ip6_setup_cork() local
1390 mtu = READ_ONCE(np->pmtudisc) >= IPV6_PMTUDISC_PROBE ? in ip6_setup_cork()
1391 READ_ONCE(rt->dst.dev->mtu) : dst_mtu(&rt->dst); in ip6_setup_cork()
1393 mtu = READ_ONCE(np->pmtudisc) >= IPV6_PMTUDISC_PROBE ? in ip6_setup_cork()
1394 READ_ONCE(rt->dst.dev->mtu) : dst_mtu(xfrm_dst_path(&rt->dst)); in ip6_setup_cork()
1397 if (frag_size && frag_size < mtu) in ip6_setup_cork()
1398 mtu = frag_size; in ip6_setup_cork()
1400 cork->base.fragsize = mtu; in ip6_setup_cork()
1425 unsigned int maxfraglen, fragheaderlen, mtu, orig_mtu, pmtu; in __ip6_append_data() local
1449 mtu = cork->gso_size ? IP6_MAX_MTU : cork->fragsize; in __ip6_append_data()
1450 orig_mtu = mtu; in __ip6_append_data()
1461 if (mtu <= fragheaderlen || in __ip6_append_data()
1462 ((mtu - fragheaderlen) & ~7) + fragheaderlen <= sizeof(struct frag_hdr)) in __ip6_append_data()
1465 maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen - in __ip6_append_data()
1471 if (headersize + transhdrlen > mtu) in __ip6_append_data()
1474 if (cork->length + length > mtu - headersize && ipc6->dontfrag && in __ip6_append_data()
1478 ipv6_local_rxpmtu(sk, fl6, mtu - headersize + in __ip6_append_data()
1486 maxnonfragsize = mtu; in __ip6_append_data()
1490 pmtu = max_t(int, mtu - headersize + sizeof(struct ipv6hdr), 0); in __ip6_append_data()
1500 length <= mtu - headersize && in __ip6_append_data()
1553 * Use MTU if total length of the message fits into the MTU. in __ip6_append_data()
1573 copy = (cork->length <= mtu ? mtu : maxfraglen) - skb->len; in __ip6_append_data()
1590 /* update mtu and maxfraglen if necessary */ in __ip6_append_data()
1592 ip6_append_data_mtu(&mtu, &maxfraglen, in __ip6_append_data()
1599 * If remaining data exceeds the mtu, in __ip6_append_data()
1604 if (datalen > (cork->length <= mtu ? mtu : maxfraglen) - fragheaderlen) in __ip6_append_data()
1615 * (without MSG_MORE) fits into the MTU. in __ip6_append_data()
1621 alloclen = mtu; in __ip6_append_data()