Lines Matching defs:uarg

1722 	struct ubuf_info_msgzc *uarg;
1731 BUILD_BUG_ON(sizeof(*uarg) > sizeof(skb->cb));
1732 uarg = (void *)skb->cb;
1733 uarg->mmp.user = NULL;
1735 if (likely(!devmem) && mm_account_pinned_pages(&uarg->mmp, size)) {
1740 uarg->ubuf.ops = &msg_zerocopy_ubuf_ops;
1741 uarg->id = ((u32)atomic_inc_return(&sk->sk_zckey)) - 1;
1742 uarg->len = 1;
1743 uarg->bytelen = size;
1744 uarg->zerocopy = 1;
1745 uarg->ubuf.flags = SKBFL_ZEROCOPY_FRAG | SKBFL_DONT_ORPHAN;
1746 refcount_set(&uarg->ubuf.refcnt, 1);
1749 return &uarg->ubuf;
1752 static inline struct sk_buff *skb_from_uarg(struct ubuf_info_msgzc *uarg)
1754 return container_of((void *)uarg, struct sk_buff, cb);
1758 struct ubuf_info *uarg, bool devmem)
1760 if (uarg) {
1766 if (uarg->ops != &msg_zerocopy_ubuf_ops)
1770 * so uarg->len and sk_zckey access is serialized
1777 uarg_zc = uarg_to_msgzc(uarg);
1780 /* TCP can create new skb to attach new uarg */
1797 net_zcopy_get(uarg);
1799 return uarg;
1828 static void __msg_zerocopy_callback(struct ubuf_info_msgzc *uarg)
1830 struct sk_buff *tail, *skb = skb_from_uarg(uarg);
1839 mm_unaccount_pinned_pages(&uarg->mmp);
1844 if (!uarg->len || sock_flag(sk, SOCK_DEAD))
1847 len = uarg->len;
1848 lo = uarg->id;
1849 hi = uarg->id + len - 1;
1850 is_zerocopy = uarg->zerocopy;
1878 static void msg_zerocopy_complete(struct sk_buff *skb, struct ubuf_info *uarg,
1881 struct ubuf_info_msgzc *uarg_zc = uarg_to_msgzc(uarg);
1885 if (refcount_dec_and_test(&uarg->refcnt))
1889 void msg_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref)
1891 struct sock *sk = skb_from_uarg(uarg_to_msgzc(uarg))->sk;
1894 uarg_to_msgzc(uarg)->len--;
1897 msg_zerocopy_complete(NULL, uarg, true);
1908 struct ubuf_info *uarg,
1913 if (uarg->ops->link_skb) {
1914 err = uarg->ops->link_skb(skb, uarg);
1920 /* An skb can only point to one uarg. This edge case happens
1924 if (orig_uarg && uarg != orig_uarg)
1941 skb_zcopy_set(skb, uarg, NULL);