Lines Matching refs:psock

112 	int  (*psock_update_sk_prot)(struct sock *sk, struct sk_psock *psock,
140 int sk_msg_recvmsg(struct sock *sk, struct sk_psock *psock, struct msghdr *msg,
149 static inline void sk_msg_apply_bytes(struct sk_psock *psock, u32 bytes) in sk_msg_apply_bytes() argument
151 if (psock->apply_bytes) { in sk_msg_apply_bytes()
152 if (psock->apply_bytes < bytes) in sk_msg_apply_bytes()
153 psock->apply_bytes = 0; in sk_msg_apply_bytes()
155 psock->apply_bytes -= bytes; in sk_msg_apply_bytes()
296 static inline void sk_psock_set_state(struct sk_psock *psock, in sk_psock_set_state() argument
299 set_bit(bit, &psock->state); in sk_psock_set_state()
302 static inline void sk_psock_clear_state(struct sk_psock *psock, in sk_psock_clear_state() argument
305 clear_bit(bit, &psock->state); in sk_psock_clear_state()
308 static inline bool sk_psock_test_state(const struct sk_psock *psock, in sk_psock_test_state() argument
311 return test_bit(bit, &psock->state); in sk_psock_test_state()
320 static inline void sk_psock_queue_msg(struct sk_psock *psock, in sk_psock_queue_msg() argument
323 spin_lock_bh(&psock->ingress_lock); in sk_psock_queue_msg()
324 if (sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED)) in sk_psock_queue_msg()
325 list_add_tail(&msg->list, &psock->ingress_msg); in sk_psock_queue_msg()
327 sk_msg_free(psock->sk, msg); in sk_psock_queue_msg()
330 spin_unlock_bh(&psock->ingress_lock); in sk_psock_queue_msg()
333 static inline struct sk_msg *sk_psock_dequeue_msg(struct sk_psock *psock) in sk_psock_dequeue_msg() argument
337 spin_lock_bh(&psock->ingress_lock); in sk_psock_dequeue_msg()
338 msg = list_first_entry_or_null(&psock->ingress_msg, struct sk_msg, list); in sk_psock_dequeue_msg()
341 spin_unlock_bh(&psock->ingress_lock); in sk_psock_dequeue_msg()
345 static inline struct sk_msg *sk_psock_peek_msg(struct sk_psock *psock) in sk_psock_peek_msg() argument
349 spin_lock_bh(&psock->ingress_lock); in sk_psock_peek_msg()
350 msg = list_first_entry_or_null(&psock->ingress_msg, struct sk_msg, list); in sk_psock_peek_msg()
351 spin_unlock_bh(&psock->ingress_lock); in sk_psock_peek_msg()
355 static inline struct sk_msg *sk_psock_next_msg(struct sk_psock *psock, in sk_psock_next_msg() argument
360 spin_lock_bh(&psock->ingress_lock); in sk_psock_next_msg()
361 if (list_is_last(&msg->list, &psock->ingress_msg)) in sk_psock_next_msg()
365 spin_unlock_bh(&psock->ingress_lock); in sk_psock_next_msg()
369 static inline bool sk_psock_queue_empty(const struct sk_psock *psock) in sk_psock_queue_empty() argument
371 return psock ? list_empty(&psock->ingress_msg) : true; in sk_psock_queue_empty()
381 static inline void sk_psock_report_error(struct sk_psock *psock, int err) in sk_psock_report_error() argument
383 struct sock *sk = psock->sk; in sk_psock_report_error()
390 void sk_psock_stop(struct sk_psock *psock);
393 int sk_psock_init_strp(struct sock *sk, struct sk_psock *psock);
394 void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock);
395 void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock);
397 static inline int sk_psock_init_strp(struct sock *sk, struct sk_psock *psock) in sk_psock_init_strp() argument
402 static inline void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock) in sk_psock_start_strp() argument
406 static inline void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock) in sk_psock_stop_strp() argument
411 void sk_psock_start_verdict(struct sock *sk, struct sk_psock *psock);
412 void sk_psock_stop_verdict(struct sock *sk, struct sk_psock *psock);
414 int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock,
431 struct sk_psock_link *sk_psock_link_pop(struct sk_psock *psock);
433 static inline void sk_psock_cork_free(struct sk_psock *psock) in sk_psock_cork_free() argument
435 if (psock->cork) { in sk_psock_cork_free()
436 sk_msg_free(psock->sk, psock->cork); in sk_psock_cork_free()
437 kfree(psock->cork); in sk_psock_cork_free()
438 psock->cork = NULL; in sk_psock_cork_free()
443 struct sk_psock *psock) in sk_psock_restore_proto() argument
445 if (psock->psock_update_sk_prot) in sk_psock_restore_proto()
446 psock->psock_update_sk_prot(sk, psock, true); in sk_psock_restore_proto()
451 struct sk_psock *psock; in sk_psock_get() local
454 psock = sk_psock(sk); in sk_psock_get()
455 if (psock && !refcount_inc_not_zero(&psock->refcnt)) in sk_psock_get()
456 psock = NULL; in sk_psock_get()
458 return psock; in sk_psock_get()
461 void sk_psock_drop(struct sock *sk, struct sk_psock *psock);
463 static inline void sk_psock_put(struct sock *sk, struct sk_psock *psock) in sk_psock_put() argument
465 if (refcount_dec_and_test(&psock->refcnt)) in sk_psock_put()
466 sk_psock_drop(sk, psock); in sk_psock_put()
469 static inline void sk_psock_data_ready(struct sock *sk, struct sk_psock *psock) in sk_psock_data_ready() argument
472 if (psock->saved_data_ready) in sk_psock_data_ready()
473 psock->saved_data_ready(sk); in sk_psock_data_ready()
508 int sk_psock_tls_strp_read(struct sk_psock *psock, struct sk_buff *skb);
510 static inline bool sk_psock_strp_enabled(struct sk_psock *psock) in sk_psock_strp_enabled() argument
512 if (!psock) in sk_psock_strp_enabled()
514 return !!psock->saved_data_ready; in sk_psock_strp_enabled()