Lines Matching refs:psock
136 static inline void sk_msg_apply_bytes(struct sk_psock *psock, u32 bytes) in sk_msg_apply_bytes() argument
138 if (psock->apply_bytes) { in sk_msg_apply_bytes()
139 if (psock->apply_bytes < bytes) in sk_msg_apply_bytes()
140 psock->apply_bytes = 0; in sk_msg_apply_bytes()
142 psock->apply_bytes -= bytes; in sk_msg_apply_bytes()
288 static inline void sk_psock_queue_msg(struct sk_psock *psock, in sk_psock_queue_msg() argument
291 list_add_tail(&msg->list, &psock->ingress_msg); in sk_psock_queue_msg()
294 static inline bool sk_psock_queue_empty(const struct sk_psock *psock) in sk_psock_queue_empty() argument
296 return psock ? list_empty(&psock->ingress_msg) : true; in sk_psock_queue_empty()
299 static inline void sk_psock_report_error(struct sk_psock *psock, int err) in sk_psock_report_error() argument
301 struct sock *sk = psock->sk; in sk_psock_report_error()
309 int sk_psock_init_strp(struct sock *sk, struct sk_psock *psock);
310 void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock);
311 void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock);
312 void sk_psock_start_verdict(struct sock *sk, struct sk_psock *psock);
313 void sk_psock_stop_verdict(struct sock *sk, struct sk_psock *psock);
315 int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock,
329 struct sk_psock_link *sk_psock_link_pop(struct sk_psock *psock);
331 void __sk_psock_purge_ingress_msg(struct sk_psock *psock);
333 static inline void sk_psock_cork_free(struct sk_psock *psock) in sk_psock_cork_free() argument
335 if (psock->cork) { in sk_psock_cork_free()
336 sk_msg_free(psock->sk, psock->cork); in sk_psock_cork_free()
337 kfree(psock->cork); in sk_psock_cork_free()
338 psock->cork = NULL; in sk_psock_cork_free()
343 struct sk_psock *psock, in sk_psock_update_proto() argument
351 struct sk_psock *psock) in sk_psock_restore_proto() argument
359 WRITE_ONCE(sk->sk_prot->unhash, psock->saved_unhash); in sk_psock_restore_proto()
360 tcp_update_ulp(sk, psock->sk_proto, psock->saved_write_space); in sk_psock_restore_proto()
362 sk->sk_write_space = psock->saved_write_space; in sk_psock_restore_proto()
364 WRITE_ONCE(sk->sk_prot, psock->sk_proto); in sk_psock_restore_proto()
368 static inline void sk_psock_set_state(struct sk_psock *psock, in sk_psock_set_state() argument
371 set_bit(bit, &psock->state); in sk_psock_set_state()
374 static inline void sk_psock_clear_state(struct sk_psock *psock, in sk_psock_clear_state() argument
377 clear_bit(bit, &psock->state); in sk_psock_clear_state()
380 static inline bool sk_psock_test_state(const struct sk_psock *psock, in sk_psock_test_state() argument
383 return test_bit(bit, &psock->state); in sk_psock_test_state()
388 struct sk_psock *psock; in sk_psock_get() local
391 psock = sk_psock(sk); in sk_psock_get()
392 if (psock && !refcount_inc_not_zero(&psock->refcnt)) in sk_psock_get()
393 psock = NULL; in sk_psock_get()
395 return psock; in sk_psock_get()
398 void sk_psock_stop(struct sock *sk, struct sk_psock *psock);
399 void sk_psock_drop(struct sock *sk, struct sk_psock *psock);
401 static inline void sk_psock_put(struct sock *sk, struct sk_psock *psock) in sk_psock_put() argument
403 if (refcount_dec_and_test(&psock->refcnt)) in sk_psock_put()
404 sk_psock_drop(sk, psock); in sk_psock_put()
407 static inline void sk_psock_data_ready(struct sock *sk, struct sk_psock *psock) in sk_psock_data_ready() argument
409 if (psock->parser.enabled) in sk_psock_data_ready()
410 psock->parser.saved_data_ready(sk); in sk_psock_data_ready()
443 int sk_psock_tls_strp_read(struct sk_psock *psock, struct sk_buff *skb);
445 static inline bool sk_psock_strp_enabled(struct sk_psock *psock) in sk_psock_strp_enabled() argument
447 if (!psock) in sk_psock_strp_enabled()
449 return psock->parser.enabled; in sk_psock_strp_enabled()