Lines Matching refs:cork
962 struct inet_cork *cork, in __ip_append_data() argument
973 struct ip_options *opt = cork->opt; in __ip_append_data()
982 struct rtable *rt = (struct rtable *)cork->dst; in __ip_append_data()
990 mtu = cork->gso_size ? IP_MAX_MTU : cork->fragsize; in __ip_append_data()
991 paged = !!cork->gso_size; in __ip_append_data()
993 if (cork->tx_flags & SKBTX_ANY_TSTAMP && in __ip_append_data()
1003 if (cork->length + length > maxnonfragsize - fragheaderlen) { in __ip_append_data()
1016 (!(flags & MSG_MORE) || cork->gso_size) && in __ip_append_data()
1034 cork->length += length; in __ip_append_data()
1156 skb_shinfo(skb)->tx_flags = cork->tx_flags; in __ip_append_data()
1157 cork->tx_flags = 0; in __ip_append_data()
1238 cork->length -= length; in __ip_append_data()
1244 static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, in ip_setup_cork() argument
1254 cork->fragsize = ip_sk_use_pmtu(sk) ? in ip_setup_cork()
1257 if (!inetdev_valid_mtu(cork->fragsize)) in ip_setup_cork()
1265 if (!cork->opt) { in ip_setup_cork()
1266 cork->opt = kmalloc(sizeof(struct ip_options) + 40, in ip_setup_cork()
1268 if (unlikely(!cork->opt)) in ip_setup_cork()
1271 memcpy(cork->opt, &opt->opt, sizeof(struct ip_options) + opt->opt.optlen); in ip_setup_cork()
1272 cork->flags |= IPCORK_OPT; in ip_setup_cork()
1273 cork->addr = ipc->addr; in ip_setup_cork()
1276 cork->gso_size = ipc->gso_size; in ip_setup_cork()
1278 cork->dst = &rt->dst; in ip_setup_cork()
1282 cork->length = 0; in ip_setup_cork()
1283 cork->ttl = ipc->ttl; in ip_setup_cork()
1284 cork->tos = ipc->tos; in ip_setup_cork()
1285 cork->mark = ipc->sockc.mark; in ip_setup_cork()
1286 cork->priority = ipc->priority; in ip_setup_cork()
1287 cork->transmit_time = ipc->sockc.transmit_time; in ip_setup_cork()
1288 cork->tx_flags = 0; in ip_setup_cork()
1289 sock_tx_timestamp(sk, ipc->sockc.tsflags, &cork->tx_flags); in ip_setup_cork()
1319 err = ip_setup_cork(sk, &inet->cork.base, ipc, rtp); in ip_append_data()
1326 return __ip_append_data(sk, fl4, &sk->sk_write_queue, &inet->cork.base, in ip_append_data()
1338 struct inet_cork *cork; in ip_append_page() local
1354 cork = &inet->cork.base; in ip_append_page()
1355 rt = (struct rtable *)cork->dst; in ip_append_page()
1356 if (cork->flags & IPCORK_OPT) in ip_append_page()
1357 opt = cork->opt; in ip_append_page()
1363 mtu = cork->gso_size ? IP_MAX_MTU : cork->fragsize; in ip_append_page()
1369 if (cork->length + size > maxnonfragsize - fragheaderlen) { in ip_append_page()
1379 cork->length += size; in ip_append_page()
1456 cork->length -= size; in ip_append_page()
1461 static void ip_cork_release(struct inet_cork *cork) in ip_cork_release() argument
1463 cork->flags &= ~IPCORK_OPT; in ip_cork_release()
1464 kfree(cork->opt); in ip_cork_release()
1465 cork->opt = NULL; in ip_cork_release()
1466 dst_release(cork->dst); in ip_cork_release()
1467 cork->dst = NULL; in ip_cork_release()
1477 struct inet_cork *cork) in __ip_make_skb() argument
1484 struct rtable *rt = (struct rtable *)cork->dst; in __ip_make_skb()
1523 if (cork->flags & IPCORK_OPT) in __ip_make_skb()
1524 opt = cork->opt; in __ip_make_skb()
1526 if (cork->ttl != 0) in __ip_make_skb()
1527 ttl = cork->ttl; in __ip_make_skb()
1536 iph->tos = (cork->tos != -1) ? cork->tos : inet->tos; in __ip_make_skb()
1545 ip_options_build(skb, opt, cork->addr, rt, 0); in __ip_make_skb()
1548 skb->priority = (cork->tos != -1) ? cork->priority: sk->sk_priority; in __ip_make_skb()
1549 skb->mark = cork->mark; in __ip_make_skb()
1550 skb->tstamp = cork->transmit_time; in __ip_make_skb()
1555 cork->dst = NULL; in __ip_make_skb()
1572 ip_cork_release(cork); in __ip_make_skb()
1609 struct inet_cork *cork) in __ip_flush_pending_frames() argument
1616 ip_cork_release(cork); in __ip_flush_pending_frames()
1621 __ip_flush_pending_frames(sk, &sk->sk_write_queue, &inet_sk(sk)->cork.base); in ip_flush_pending_frames()
1630 struct inet_cork *cork, unsigned int flags) in ip_make_skb() argument
1640 cork->flags = 0; in ip_make_skb()
1641 cork->addr = 0; in ip_make_skb()
1642 cork->opt = NULL; in ip_make_skb()
1643 err = ip_setup_cork(sk, cork, ipc, rtp); in ip_make_skb()
1647 err = __ip_append_data(sk, fl4, &queue, cork, in ip_make_skb()
1651 __ip_flush_pending_frames(sk, &queue, cork); in ip_make_skb()
1655 return __ip_make_skb(sk, fl4, &queue, cork); in ip_make_skb()