Lines Matching refs:sock
158 static void sock_def_write_space_wfree(struct sock *sk);
159 static void sock_def_write_space(struct sock *sk);
171 bool sk_ns_capable(const struct sock *sk, in sk_ns_capable()
188 bool sk_capable(const struct sock *sk, int cap) in sk_capable()
203 bool sk_net_capable(const struct sock *sk, int cap) in sk_net_capable()
302 void sk_set_memalloc(struct sock *sk) in sk_set_memalloc()
310 void sk_clear_memalloc(struct sock *sk) in sk_clear_memalloc()
327 int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) in __sk_backlog_rcv()
346 void sk_error_report(struct sock *sk) in sk_error_report()
459 static bool sk_set_prio_allowed(const struct sock *sk, int val) in sk_set_prio_allowed()
466 static bool sock_needs_netstamp(const struct sock *sk) in sock_needs_netstamp()
477 static void sock_disable_timestamp(struct sock *sk, unsigned long flags) in sock_disable_timestamp()
488 int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) in __sock_queue_rcv_skb()
523 int sock_queue_rcv_skb_reason(struct sock *sk, struct sk_buff *skb, in sock_queue_rcv_skb_reason()
552 int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, in __sk_receive_skb()
607 struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) in __sk_dst_check()
625 struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie) in sk_dst_check()
641 static int sock_bindtoindex_locked(struct sock *sk, int ifindex) in sock_bindtoindex_locked()
671 int sock_bindtoindex(struct sock *sk, int ifindex, bool lock_sk) in sock_bindtoindex()
685 static int sock_setbindtodevice(struct sock *sk, sockptr_t optval, int optlen) in sock_setbindtodevice()
733 static int sock_getbindtodevice(struct sock *sk, sockptr_t optval, in sock_getbindtodevice()
774 bool sk_mc_loop(const struct sock *sk) in sk_mc_loop()
794 void sock_set_reuseaddr(struct sock *sk) in sock_set_reuseaddr()
802 void sock_set_reuseport(struct sock *sk) in sock_set_reuseport()
810 void sock_no_linger(struct sock *sk) in sock_no_linger()
819 void sock_set_priority(struct sock *sk, u32 priority) in sock_set_priority()
825 void sock_set_sndtimeo(struct sock *sk, s64 secs) in sock_set_sndtimeo()
834 static void __sock_set_timestamps(struct sock *sk, bool val, bool new, bool ns) in __sock_set_timestamps()
844 void sock_set_timestamp(struct sock *sk, int optname, bool valbool) in sock_set_timestamp()
862 static int sock_timestamping_bind_phc(struct sock *sk, int phc_index) in sock_timestamping_bind_phc()
899 int sock_set_timestamping(struct sock *sk, int optname, in sock_set_timestamping()
951 void bpf_skops_tx_timestamping(struct sock *sk, struct sk_buff *skb, int op) in bpf_skops_tx_timestamping()
964 void sock_set_keepalive(struct sock *sk) in sock_set_keepalive()
974 static void __sock_set_rcvbuf(struct sock *sk, int val) in __sock_set_rcvbuf()
995 void sock_set_rcvbuf(struct sock *sk, int val) in sock_set_rcvbuf()
1003 static void __sock_set_mark(struct sock *sk, u32 val) in __sock_set_mark()
1011 void sock_set_mark(struct sock *sk, u32 val) in sock_set_mark()
1019 static void sock_release_reserved_memory(struct sock *sk, int bytes) in sock_release_reserved_memory()
1029 static int sock_reserve_memory(struct sock *sk, int bytes) in sock_reserve_memory()
1079 sock_devmem_dontneed(struct sock *sk, sockptr_t optval, unsigned int optlen) in sock_devmem_dontneed()
1137 void sockopt_lock_sock(struct sock *sk) in sockopt_lock_sock()
1150 void sockopt_release_sock(struct sock *sk) in sockopt_release_sock()
1187 int sk_setsockopt(struct sock *sk, int level, int optname, in sk_setsockopt()
1191 struct socket *sock = sk->sk_socket; in sk_setsockopt() local
1281 int (*set_peek_off)(struct sock *sk, int val); in sk_setsockopt()
1283 set_peek_off = READ_ONCE(sock->ops)->set_peek_off; in sk_setsockopt()
1445 int (*set_rcvlowat)(struct sock *sk, int val) = NULL; in sk_setsockopt()
1449 if (sock) in sk_setsockopt()
1450 set_rcvlowat = READ_ONCE(sock->ops)->set_rcvlowat; in sk_setsockopt()
1672 int sock_setsockopt(struct socket *sock, int level, int optname, in sock_setsockopt() argument
1675 return sk_setsockopt(sock->sk, level, optname, in sock_setsockopt()
1680 static const struct cred *sk_get_peer_cred(struct sock *sk) in sk_get_peer_cred()
1719 int sk_getsockopt(struct sock *sk, int level, int optname, in sk_getsockopt()
1722 struct socket *sock = sk->sk_socket; in sk_getsockopt() local
1974 lv = READ_ONCE(sock->ops)->getname(sock, (struct sockaddr *)&address, 2); in sk_getsockopt()
1999 return security_socket_getpeersec_stream(sock, in sk_getsockopt()
2023 if (!READ_ONCE(sock->ops)->set_peek_off) in sk_getsockopt()
2172 static inline void sock_lock_init(struct sock *sk) in sock_lock_init()
2197 static void sock_copy(struct sock *nsk, const struct sock *osk) in sock_copy()
2208 BUILD_BUG_ON(offsetof(struct sock, sk_tx_queue_mapping) < in sock_copy()
2209 offsetof(struct sock, sk_dontcopy_begin) || in sock_copy()
2210 offsetof(struct sock, sk_tx_queue_mapping) >= in sock_copy()
2211 offsetof(struct sock, sk_dontcopy_end)); in sock_copy()
2213 memcpy(nsk, osk, offsetof(struct sock, sk_dontcopy_begin)); in sock_copy()
2216 prot->obj_size - offsetof(struct sock, sk_dontcopy_end), in sock_copy()
2225 static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, in sk_prot_alloc()
2228 struct sock *sk; in sk_prot_alloc()
2261 static void sk_prot_free(struct proto *prot, struct sock *sk) in sk_prot_free()
2290 struct sock *sk_alloc(struct net *net, int family, gfp_t priority, in sk_alloc()
2293 struct sock *sk; in sk_alloc()
2334 struct sock *sk = container_of(head, struct sock, sk_rcu); in __sk_destruct()
2376 void sk_net_refcnt_upgrade(struct sock *sk) in sk_net_refcnt_upgrade()
2389 void sk_destruct(struct sock *sk) in sk_destruct()
2404 static void __sk_free(struct sock *sk) in __sk_free()
2415 void sk_free(struct sock *sk) in sk_free()
2427 static void sk_init_common(struct sock *sk) in sk_init_common()
2460 struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) in sk_clone_lock()
2465 struct sock *newsk; in sk_clone_lock()
2587 static u32 sk_dst_gso_max_size(struct sock *sk, struct dst_entry *dst) in sk_dst_gso_max_size()
2605 void sk_setup_caps(struct sock *sk, struct dst_entry *dst) in sk_setup_caps()
2645 struct sock *sk = skb->sk; in sock_wfree()
2683 struct sock *sk = skb->sk; in __sock_wfree()
2689 void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) in skb_set_owner_w()
2743 struct sock *sk = skb->sk; in sock_rfree()
2767 struct sock *sk = skb->sk; in sock_pfree()
2783 unsigned long __sock_i_ino(struct sock *sk) in __sock_i_ino()
2794 unsigned long sock_i_ino(struct sock *sk) in sock_i_ino()
2808 struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, in sock_wmalloc()
2826 struct sock *sk = skb->sk; in sock_ofree()
2831 struct sk_buff *sock_omalloc(struct sock *sk, unsigned long size, in sock_omalloc()
2854 void *sock_kmalloc(struct sock *sk, int size, gfp_t priority) in sock_kmalloc()
2878 void *sock_kmemdup(struct sock *sk, const void *src, in sock_kmemdup()
2894 static inline void __sock_kfree_s(struct sock *sk, void *mem, int size, in __sock_kfree_s()
2906 void sock_kfree_s(struct sock *sk, void *mem, int size) in sock_kfree_s()
2912 void sock_kzfree_s(struct sock *sk, void *mem, int size) in sock_kzfree_s()
2921 static long sock_wait_for_wmem(struct sock *sk, long timeo) in sock_wait_for_wmem()
2950 struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, in sock_alloc_send_pskb()
2994 int __sock_cmsg_send(struct sock *sk, struct cmsghdr *cmsg, in __sock_cmsg_send()
3063 int sock_cmsg_send(struct sock *sk, struct msghdr *msg, in sock_cmsg_send()
3082 static void sk_enter_memory_pressure(struct sock *sk) in sk_enter_memory_pressure()
3090 static void sk_leave_memory_pressure(struct sock *sk) in sk_leave_memory_pressure()
3149 bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag) in sk_page_frag_refill()
3160 void __lock_sock(struct sock *sk) in __lock_sock()
3178 void __release_sock(struct sock *sk) in __release_sock()
3211 void __sk_flush_backlog(struct sock *sk) in __sk_flush_backlog()
3235 int sk_wait_data(struct sock *sk, long *timeo, const struct sk_buff *skb) in sk_wait_data()
3264 int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) in __sk_mem_raise_allocated()
3378 int __sk_mem_schedule(struct sock *sk, int size, int kind) in __sk_mem_schedule()
3397 void __sk_mem_reduce_allocated(struct sock *sk, int amount) in __sk_mem_reduce_allocated()
3414 void __sk_mem_reclaim(struct sock *sk, int amount) in __sk_mem_reclaim()
3422 int sk_set_peek_off(struct sock *sk, int val) in sk_set_peek_off()
3436 int sock_no_bind(struct socket *sock, struct sockaddr *saddr, int len) in sock_no_bind() argument
3442 int sock_no_connect(struct socket *sock, struct sockaddr *saddr, in sock_no_connect() argument
3455 int sock_no_accept(struct socket *sock, struct socket *newsock, in sock_no_accept() argument
3462 int sock_no_getname(struct socket *sock, struct sockaddr *saddr, in sock_no_getname() argument
3469 int sock_no_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) in sock_no_ioctl() argument
3475 int sock_no_listen(struct socket *sock, int backlog) in sock_no_listen() argument
3481 int sock_no_shutdown(struct socket *sock, int how) in sock_no_shutdown() argument
3487 int sock_no_sendmsg(struct socket *sock, struct msghdr *m, size_t len) in sock_no_sendmsg() argument
3493 int sock_no_sendmsg_locked(struct sock *sk, struct msghdr *m, size_t len) in sock_no_sendmsg_locked()
3499 int sock_no_recvmsg(struct socket *sock, struct msghdr *m, size_t len, in sock_no_recvmsg() argument
3506 int sock_no_mmap(struct file *file, struct socket *sock, struct vm_area_struct *vma) in sock_no_mmap() argument
3519 struct socket *sock; in __receive_sock() local
3521 sock = sock_from_file(file); in __receive_sock()
3522 if (sock) { in __receive_sock()
3523 sock_update_netprioidx(&sock->sk->sk_cgrp_data); in __receive_sock()
3524 sock_update_classid(&sock->sk->sk_cgrp_data); in __receive_sock()
3532 static void sock_def_wakeup(struct sock *sk) in sock_def_wakeup()
3543 static void sock_def_error_report(struct sock *sk) in sock_def_error_report()
3555 void sock_def_readable(struct sock *sk) in sock_def_readable()
3570 static void sock_def_write_space(struct sock *sk) in sock_def_write_space()
3596 static void sock_def_write_space_wfree(struct sock *sk) in sock_def_write_space_wfree()
3615 static void sock_def_destruct(struct sock *sk) in sock_def_destruct()
3619 void sk_send_sigurg(struct sock *sk) in sk_send_sigurg()
3627 void sk_reset_timer(struct sock *sk, struct timer_list* timer, in sk_reset_timer()
3635 void sk_stop_timer(struct sock *sk, struct timer_list* timer) in sk_stop_timer()
3642 void sk_stop_timer_sync(struct sock *sk, struct timer_list *timer) in sk_stop_timer_sync()
3649 void sock_init_data_uid(struct socket *sock, struct sock *sk, kuid_t uid) in sock_init_data_uid() argument
3661 sk_set_socket(sk, sock); in sock_init_data_uid()
3665 if (sock) { in sock_init_data_uid()
3666 sk->sk_type = sock->type; in sock_init_data_uid()
3667 RCU_INIT_POINTER(sk->sk_wq, &sock->wq); in sock_init_data_uid()
3668 sock->sk = sk; in sock_init_data_uid()
3720 void sock_init_data(struct socket *sock, struct sock *sk) in sock_init_data() argument
3722 kuid_t uid = sock ? in sock_init_data()
3723 SOCK_INODE(sock)->i_uid : in sock_init_data()
3726 sock_init_data_uid(sock, sk, uid); in sock_init_data()
3730 void lock_sock_nested(struct sock *sk, int subclass) in lock_sock_nested()
3744 void release_sock(struct sock *sk) in release_sock()
3761 bool __lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock) in __lock_sock_fast()
3793 int sock_gettstamp(struct socket *sock, void __user *userstamp, in sock_gettstamp() argument
3796 struct sock *sk = sock->sk; in sock_gettstamp()
3832 void sock_enable_timestamp(struct sock *sk, enum sock_flags flag) in sock_enable_timestamp()
3849 int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, in sock_recv_errqueue()
3892 int sock_common_getsockopt(struct socket *sock, int level, int optname, in sock_common_getsockopt() argument
3895 struct sock *sk = sock->sk; in sock_common_getsockopt()
3902 int sock_common_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, in sock_common_recvmsg() argument
3905 struct sock *sk = sock->sk; in sock_common_recvmsg()
3919 int sock_common_setsockopt(struct socket *sock, int level, int optname, in sock_common_setsockopt() argument
3922 struct sock *sk = sock->sk; in sock_common_setsockopt()
3929 void sk_common_release(struct sock *sk) in sk_common_release()
3964 void sk_get_meminfo(const struct sock *sk, u32 *mem) in sk_get_meminfo()
4355 struct sock *sk = p; in sk_busy_loop_end()
4369 int sock_bind_add(struct sock *sk, struct sockaddr *addr, int addr_len) in sock_bind_add()
4378 int sock_ioctl_inout(struct sock *sk, unsigned int cmd, in sock_ioctl_inout()
4401 static int sock_ioctl_out(struct sock *sk, unsigned int cmd, void __user *arg) in sock_ioctl_out()
4417 int sk_ioctl(struct sock *sk, unsigned int cmd, void __user *arg) in sk_ioctl()
4439 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rx, sk_drops); in sock_struct_check()
4440 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rx, sk_peek_off); in sock_struct_check()
4441 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rx, sk_error_queue); in sock_struct_check()
4442 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rx, sk_receive_queue); in sock_struct_check()
4443 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rx, sk_backlog); in sock_struct_check()
4445 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_rx_dst); in sock_struct_check()
4446 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_rx_dst_ifindex); in sock_struct_check()
4447 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_rx_dst_cookie); in sock_struct_check()
4448 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_rcvbuf); in sock_struct_check()
4449 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_filter); in sock_struct_check()
4450 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_wq); in sock_struct_check()
4451 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_data_ready); in sock_struct_check()
4452 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_rcvtimeo); in sock_struct_check()
4453 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rx, sk_rcvlowat); in sock_struct_check()
4455 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rxtx, sk_err); in sock_struct_check()
4456 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rxtx, sk_socket); in sock_struct_check()
4457 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_rxtx, sk_memcg); in sock_struct_check()
4459 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rxtx, sk_lock); in sock_struct_check()
4460 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rxtx, sk_reserved_mem); in sock_struct_check()
4461 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rxtx, sk_forward_alloc); in sock_struct_check()
4462 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_rxtx, sk_tsflags); in sock_struct_check()
4464 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_omem_alloc); in sock_struct_check()
4465 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_omem_alloc); in sock_struct_check()
4466 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_sndbuf); in sock_struct_check()
4467 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_wmem_queued); in sock_struct_check()
4468 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_wmem_alloc); in sock_struct_check()
4469 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_tsq_flags); in sock_struct_check()
4470 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_send_head); in sock_struct_check()
4471 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_write_queue); in sock_struct_check()
4472 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_write_pending); in sock_struct_check()
4473 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_dst_pending_confirm); in sock_struct_check()
4474 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_pacing_status); in sock_struct_check()
4475 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_frag); in sock_struct_check()
4476 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_timer); in sock_struct_check()
4477 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_pacing_rate); in sock_struct_check()
4478 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_zckey); in sock_struct_check()
4479 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_tskey); in sock_struct_check()
4481 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_max_pacing_rate); in sock_struct_check()
4482 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_sndtimeo); in sock_struct_check()
4483 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_priority); in sock_struct_check()
4484 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_mark); in sock_struct_check()
4485 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_dst_cache); in sock_struct_check()
4486 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_route_caps); in sock_struct_check()
4487 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_gso_type); in sock_struct_check()
4488 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_gso_max_size); in sock_struct_check()
4489 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_allocation); in sock_struct_check()
4490 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_txhash); in sock_struct_check()
4491 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_gso_max_segs); in sock_struct_check()
4492 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_pacing_shift); in sock_struct_check()
4493 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_use_task_frag); in sock_struct_check()