Lines Matching refs:uarg

937 	struct ubuf_info *uarg;  in sock_zerocopy_alloc()  local
946 BUILD_BUG_ON(sizeof(*uarg) > sizeof(skb->cb)); in sock_zerocopy_alloc()
947 uarg = (void *)skb->cb; in sock_zerocopy_alloc()
948 uarg->mmp.user = NULL; in sock_zerocopy_alloc()
950 if (mm_account_pinned_pages(&uarg->mmp, size)) { in sock_zerocopy_alloc()
955 uarg->callback = sock_zerocopy_callback; in sock_zerocopy_alloc()
956 uarg->id = ((u32)atomic_inc_return(&sk->sk_zckey)) - 1; in sock_zerocopy_alloc()
957 uarg->len = 1; in sock_zerocopy_alloc()
958 uarg->bytelen = size; in sock_zerocopy_alloc()
959 uarg->zerocopy = 1; in sock_zerocopy_alloc()
960 refcount_set(&uarg->refcnt, 1); in sock_zerocopy_alloc()
963 return uarg; in sock_zerocopy_alloc()
967 static inline struct sk_buff *skb_from_uarg(struct ubuf_info *uarg) in skb_from_uarg() argument
969 return container_of((void *)uarg, struct sk_buff, cb); in skb_from_uarg()
973 struct ubuf_info *uarg) in sock_zerocopy_realloc() argument
975 if (uarg) { in sock_zerocopy_realloc()
987 bytelen = uarg->bytelen + size; in sock_zerocopy_realloc()
988 if (uarg->len == USHRT_MAX - 1 || bytelen > byte_limit) { in sock_zerocopy_realloc()
996 if ((u32)(uarg->id + uarg->len) == next) { in sock_zerocopy_realloc()
997 if (mm_account_pinned_pages(&uarg->mmp, size)) in sock_zerocopy_realloc()
999 uarg->len++; in sock_zerocopy_realloc()
1000 uarg->bytelen = bytelen; in sock_zerocopy_realloc()
1002 sock_zerocopy_get(uarg); in sock_zerocopy_realloc()
1003 return uarg; in sock_zerocopy_realloc()
1032 void sock_zerocopy_callback(struct ubuf_info *uarg, bool success) in sock_zerocopy_callback() argument
1034 struct sk_buff *tail, *skb = skb_from_uarg(uarg); in sock_zerocopy_callback()
1042 mm_unaccount_pinned_pages(&uarg->mmp); in sock_zerocopy_callback()
1047 if (!uarg->len || sock_flag(sk, SOCK_DEAD)) in sock_zerocopy_callback()
1050 len = uarg->len; in sock_zerocopy_callback()
1051 lo = uarg->id; in sock_zerocopy_callback()
1052 hi = uarg->id + len - 1; in sock_zerocopy_callback()
1081 void sock_zerocopy_put(struct ubuf_info *uarg) in sock_zerocopy_put() argument
1083 if (uarg && refcount_dec_and_test(&uarg->refcnt)) { in sock_zerocopy_put()
1084 if (uarg->callback) in sock_zerocopy_put()
1085 uarg->callback(uarg, uarg->zerocopy); in sock_zerocopy_put()
1087 consume_skb(skb_from_uarg(uarg)); in sock_zerocopy_put()
1092 void sock_zerocopy_put_abort(struct ubuf_info *uarg) in sock_zerocopy_put_abort() argument
1094 if (uarg) { in sock_zerocopy_put_abort()
1095 struct sock *sk = skb_from_uarg(uarg)->sk; in sock_zerocopy_put_abort()
1098 uarg->len--; in sock_zerocopy_put_abort()
1100 sock_zerocopy_put(uarg); in sock_zerocopy_put_abort()
1110 struct ubuf_info *uarg) in skb_zerocopy_iter_stream() argument
1119 if (orig_uarg && uarg != orig_uarg) in skb_zerocopy_iter_stream()
1134 skb_zcopy_set(skb, uarg); in skb_zerocopy_iter_stream()