Lines Matching refs:uarg
1699 struct ubuf_info_msgzc *uarg; in msg_zerocopy_alloc() local
1708 BUILD_BUG_ON(sizeof(*uarg) > sizeof(skb->cb)); in msg_zerocopy_alloc()
1709 uarg = (void *)skb->cb; in msg_zerocopy_alloc()
1710 uarg->mmp.user = NULL; in msg_zerocopy_alloc()
1712 if (likely(!devmem) && mm_account_pinned_pages(&uarg->mmp, size)) { in msg_zerocopy_alloc()
1717 uarg->ubuf.ops = &msg_zerocopy_ubuf_ops; in msg_zerocopy_alloc()
1718 uarg->id = ((u32)atomic_inc_return(&sk->sk_zckey)) - 1; in msg_zerocopy_alloc()
1719 uarg->len = 1; in msg_zerocopy_alloc()
1720 uarg->bytelen = size; in msg_zerocopy_alloc()
1721 uarg->zerocopy = 1; in msg_zerocopy_alloc()
1722 uarg->ubuf.flags = SKBFL_ZEROCOPY_FRAG | SKBFL_DONT_ORPHAN; in msg_zerocopy_alloc()
1723 refcount_set(&uarg->ubuf.refcnt, 1); in msg_zerocopy_alloc()
1726 return &uarg->ubuf; in msg_zerocopy_alloc()
1729 static inline struct sk_buff *skb_from_uarg(struct ubuf_info_msgzc *uarg) in skb_from_uarg() argument
1731 return container_of((void *)uarg, struct sk_buff, cb); in skb_from_uarg()
1735 struct ubuf_info *uarg, bool devmem) in msg_zerocopy_realloc() argument
1737 if (uarg) { in msg_zerocopy_realloc()
1743 if (uarg->ops != &msg_zerocopy_ubuf_ops) in msg_zerocopy_realloc()
1754 uarg_zc = uarg_to_msgzc(uarg); in msg_zerocopy_realloc()
1774 net_zcopy_get(uarg); in msg_zerocopy_realloc()
1776 return uarg; in msg_zerocopy_realloc()
1805 static void __msg_zerocopy_callback(struct ubuf_info_msgzc *uarg) in __msg_zerocopy_callback() argument
1807 struct sk_buff *tail, *skb = skb_from_uarg(uarg); in __msg_zerocopy_callback()
1816 mm_unaccount_pinned_pages(&uarg->mmp); in __msg_zerocopy_callback()
1821 if (!uarg->len || sock_flag(sk, SOCK_DEAD)) in __msg_zerocopy_callback()
1824 len = uarg->len; in __msg_zerocopy_callback()
1825 lo = uarg->id; in __msg_zerocopy_callback()
1826 hi = uarg->id + len - 1; in __msg_zerocopy_callback()
1827 is_zerocopy = uarg->zerocopy; in __msg_zerocopy_callback()
1855 static void msg_zerocopy_complete(struct sk_buff *skb, struct ubuf_info *uarg, in msg_zerocopy_complete() argument
1858 struct ubuf_info_msgzc *uarg_zc = uarg_to_msgzc(uarg); in msg_zerocopy_complete()
1862 if (refcount_dec_and_test(&uarg->refcnt)) in msg_zerocopy_complete()
1866 void msg_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref) in msg_zerocopy_put_abort() argument
1868 struct sock *sk = skb_from_uarg(uarg_to_msgzc(uarg))->sk; in msg_zerocopy_put_abort()
1871 uarg_to_msgzc(uarg)->len--; in msg_zerocopy_put_abort()
1874 msg_zerocopy_complete(NULL, uarg, true); in msg_zerocopy_put_abort()
1885 struct ubuf_info *uarg, in skb_zerocopy_iter_stream() argument
1890 if (uarg->ops->link_skb) { in skb_zerocopy_iter_stream()
1891 err = uarg->ops->link_skb(skb, uarg); in skb_zerocopy_iter_stream()
1901 if (orig_uarg && uarg != orig_uarg) in skb_zerocopy_iter_stream()
1918 skb_zcopy_set(skb, uarg, NULL); in skb_zerocopy_iter_stream()