Lines Matching refs:uarg

1671 	struct ubuf_info_msgzc *uarg;  in msg_zerocopy_alloc()  local
1680 BUILD_BUG_ON(sizeof(*uarg) > sizeof(skb->cb)); in msg_zerocopy_alloc()
1681 uarg = (void *)skb->cb; in msg_zerocopy_alloc()
1682 uarg->mmp.user = NULL; in msg_zerocopy_alloc()
1684 if (mm_account_pinned_pages(&uarg->mmp, size)) { in msg_zerocopy_alloc()
1689 uarg->ubuf.ops = &msg_zerocopy_ubuf_ops; in msg_zerocopy_alloc()
1690 uarg->id = ((u32)atomic_inc_return(&sk->sk_zckey)) - 1; in msg_zerocopy_alloc()
1691 uarg->len = 1; in msg_zerocopy_alloc()
1692 uarg->bytelen = size; in msg_zerocopy_alloc()
1693 uarg->zerocopy = 1; in msg_zerocopy_alloc()
1694 uarg->ubuf.flags = SKBFL_ZEROCOPY_FRAG | SKBFL_DONT_ORPHAN; in msg_zerocopy_alloc()
1695 refcount_set(&uarg->ubuf.refcnt, 1); in msg_zerocopy_alloc()
1698 return &uarg->ubuf; in msg_zerocopy_alloc()
1701 static inline struct sk_buff *skb_from_uarg(struct ubuf_info_msgzc *uarg) in skb_from_uarg() argument
1703 return container_of((void *)uarg, struct sk_buff, cb); in skb_from_uarg()
1707 struct ubuf_info *uarg) in msg_zerocopy_realloc() argument
1709 if (uarg) { in msg_zerocopy_realloc()
1715 if (uarg->ops != &msg_zerocopy_ubuf_ops) in msg_zerocopy_realloc()
1726 uarg_zc = uarg_to_msgzc(uarg); in msg_zerocopy_realloc()
1745 net_zcopy_get(uarg); in msg_zerocopy_realloc()
1747 return uarg; in msg_zerocopy_realloc()
1776 static void __msg_zerocopy_callback(struct ubuf_info_msgzc *uarg) in __msg_zerocopy_callback() argument
1778 struct sk_buff *tail, *skb = skb_from_uarg(uarg); in __msg_zerocopy_callback()
1787 mm_unaccount_pinned_pages(&uarg->mmp); in __msg_zerocopy_callback()
1792 if (!uarg->len || sock_flag(sk, SOCK_DEAD)) in __msg_zerocopy_callback()
1795 len = uarg->len; in __msg_zerocopy_callback()
1796 lo = uarg->id; in __msg_zerocopy_callback()
1797 hi = uarg->id + len - 1; in __msg_zerocopy_callback()
1798 is_zerocopy = uarg->zerocopy; in __msg_zerocopy_callback()
1826 static void msg_zerocopy_complete(struct sk_buff *skb, struct ubuf_info *uarg, in msg_zerocopy_complete() argument
1829 struct ubuf_info_msgzc *uarg_zc = uarg_to_msgzc(uarg); in msg_zerocopy_complete()
1833 if (refcount_dec_and_test(&uarg->refcnt)) in msg_zerocopy_complete()
1837 void msg_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref) in msg_zerocopy_put_abort() argument
1839 struct sock *sk = skb_from_uarg(uarg_to_msgzc(uarg))->sk; in msg_zerocopy_put_abort()
1842 uarg_to_msgzc(uarg)->len--; in msg_zerocopy_put_abort()
1845 msg_zerocopy_complete(NULL, uarg, true); in msg_zerocopy_put_abort()
1856 struct ubuf_info *uarg) in skb_zerocopy_iter_stream() argument
1860 if (uarg->ops->link_skb) { in skb_zerocopy_iter_stream()
1861 err = uarg->ops->link_skb(skb, uarg); in skb_zerocopy_iter_stream()
1871 if (orig_uarg && uarg != orig_uarg) in skb_zerocopy_iter_stream()
1887 skb_zcopy_set(skb, uarg, NULL); in skb_zerocopy_iter_stream()