• Home
  • Raw
  • Download

Lines Matching refs:val

149 static void sock_inuse_add(struct net *net, int val);
780 static void __sock_set_timestamps(struct sock *sk, bool val, bool new, bool ns) in __sock_set_timestamps() argument
782 if (val) { in __sock_set_timestamps()
859 int val = timestamping.flags; in sock_set_timestamping() local
862 if (val & ~SOF_TIMESTAMPING_MASK) in sock_set_timestamping()
865 if (val & SOF_TIMESTAMPING_OPT_ID && in sock_set_timestamping()
878 if (val & SOF_TIMESTAMPING_OPT_STATS && in sock_set_timestamping()
879 !(val & SOF_TIMESTAMPING_OPT_TSONLY)) in sock_set_timestamping()
882 if (val & SOF_TIMESTAMPING_BIND_PHC) { in sock_set_timestamping()
888 sk->sk_tsflags = val; in sock_set_timestamping()
891 if (val & SOF_TIMESTAMPING_RX_SOFTWARE) in sock_set_timestamping()
910 static void __sock_set_rcvbuf(struct sock *sk, int val) in __sock_set_rcvbuf() argument
915 val = min_t(int, val, INT_MAX / 2); in __sock_set_rcvbuf()
928 WRITE_ONCE(sk->sk_rcvbuf, max_t(int, val * 2, SOCK_MIN_RCVBUF)); in __sock_set_rcvbuf()
931 void sock_set_rcvbuf(struct sock *sk, int val) in sock_set_rcvbuf() argument
934 __sock_set_rcvbuf(sk, val); in sock_set_rcvbuf()
939 static void __sock_set_mark(struct sock *sk, u32 val) in __sock_set_mark() argument
941 if (val != sk->sk_mark) { in __sock_set_mark()
942 sk->sk_mark = val; in __sock_set_mark()
947 void sock_set_mark(struct sock *sk, u32 val) in sock_set_mark() argument
950 __sock_set_mark(sk, val); in sock_set_mark()
966 int val; in sock_setsockopt() local
981 if (copy_from_sockptr(&val, optval, sizeof(val))) in sock_setsockopt()
984 valbool = val ? 1 : 0; in sock_setsockopt()
990 if (val && !capable(CAP_NET_ADMIN)) in sock_setsockopt()
1020 val = min_t(u32, val, READ_ONCE(sysctl_wmem_max)); in sock_setsockopt()
1025 val = min_t(int, val, INT_MAX / 2); in sock_setsockopt()
1028 max_t(int, val * 2, SOCK_MIN_SNDBUF)); in sock_setsockopt()
1042 if (val < 0) in sock_setsockopt()
1043 val = 0; in sock_setsockopt()
1052 __sock_set_rcvbuf(sk, min_t(u32, val, READ_ONCE(sysctl_rmem_max))); in sock_setsockopt()
1064 __sock_set_rcvbuf(sk, max(val, 0)); in sock_setsockopt()
1082 if ((val >= 0 && val <= 6) || in sock_setsockopt()
1084 sk->sk_priority = val; in sock_setsockopt()
1138 timestamping.flags = val; in sock_setsockopt()
1144 if (val < 0) in sock_setsockopt()
1145 val = INT_MAX; in sock_setsockopt()
1147 ret = sock->ops->set_rcvlowat(sk, val); in sock_setsockopt()
1149 WRITE_ONCE(sk->sk_rcvlowat, val ? : 1); in sock_setsockopt()
1233 __sock_set_mark(sk, val); in sock_setsockopt()
1246 ret = sock->ops->set_peek_off(sk, val); in sock_setsockopt()
1262 if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN)) in sock_setsockopt()
1265 if (val < 0) in sock_setsockopt()
1268 WRITE_ONCE(sk->sk_ll_usec, val); in sock_setsockopt()
1278 if (val > READ_ONCE(sk->sk_busy_poll_budget) && !capable(CAP_NET_ADMIN)) { in sock_setsockopt()
1281 if (val < 0 || val > U16_MAX) in sock_setsockopt()
1284 WRITE_ONCE(sk->sk_busy_poll_budget, val); in sock_setsockopt()
1291 unsigned long ulval = (val == ~0U) ? ~0UL : (unsigned int)val; in sock_setsockopt()
1293 if (sizeof(ulval) != sizeof(val) && in sock_setsockopt()
1309 WRITE_ONCE(sk->sk_incoming_cpu, val); in sock_setsockopt()
1313 if (val == 1) in sock_setsockopt()
1328 if (val < 0 || val > 1) in sock_setsockopt()
1364 ret = sock_bindtoindex_locked(sk, val); in sock_setsockopt()
1368 if (val & ~SOCK_BUF_LOCK_MASK) { in sock_setsockopt()
1372 sk->sk_userlocks = val | (sk->sk_userlocks & in sock_setsockopt()
1427 int val; in sock_getsockopt() member
1450 v.val = sock_flag(sk, SOCK_DBG); in sock_getsockopt()
1454 v.val = sock_flag(sk, SOCK_LOCALROUTE); in sock_getsockopt()
1458 v.val = sock_flag(sk, SOCK_BROADCAST); in sock_getsockopt()
1462 v.val = READ_ONCE(sk->sk_sndbuf); in sock_getsockopt()
1466 v.val = READ_ONCE(sk->sk_rcvbuf); in sock_getsockopt()
1470 v.val = sk->sk_reuse; in sock_getsockopt()
1474 v.val = sk->sk_reuseport; in sock_getsockopt()
1478 v.val = sock_flag(sk, SOCK_KEEPOPEN); in sock_getsockopt()
1482 v.val = sk->sk_type; in sock_getsockopt()
1486 v.val = sk->sk_protocol; in sock_getsockopt()
1490 v.val = sk->sk_family; in sock_getsockopt()
1494 v.val = -sock_error(sk); in sock_getsockopt()
1495 if (v.val == 0) in sock_getsockopt()
1496 v.val = xchg(&sk->sk_err_soft, 0); in sock_getsockopt()
1500 v.val = sock_flag(sk, SOCK_URGINLINE); in sock_getsockopt()
1504 v.val = sk->sk_no_check_tx; in sock_getsockopt()
1508 v.val = sk->sk_priority; in sock_getsockopt()
1521 v.val = sock_flag(sk, SOCK_RCVTSTAMP) && in sock_getsockopt()
1527 v.val = sock_flag(sk, SOCK_RCVTSTAMPNS) && !sock_flag(sk, SOCK_TSTAMP_NEW); in sock_getsockopt()
1531 v.val = sock_flag(sk, SOCK_RCVTSTAMP) && sock_flag(sk, SOCK_TSTAMP_NEW); in sock_getsockopt()
1535 v.val = sock_flag(sk, SOCK_RCVTSTAMPNS) && sock_flag(sk, SOCK_TSTAMP_NEW); in sock_getsockopt()
1562 v.val = READ_ONCE(sk->sk_rcvlowat); in sock_getsockopt()
1566 v.val = 1; in sock_getsockopt()
1570 v.val = !!test_bit(SOCK_PASSCRED, &sock->flags); in sock_getsockopt()
1630 v.val = sk->sk_state == TCP_LISTEN; in sock_getsockopt()
1634 v.val = !!test_bit(SOCK_PASSSEC, &sock->flags); in sock_getsockopt()
1641 v.val = sk->sk_mark; in sock_getsockopt()
1645 v.val = sock_flag(sk, SOCK_RXQ_OVFL); in sock_getsockopt()
1649 v.val = sock_flag(sk, SOCK_WIFI_STATUS); in sock_getsockopt()
1656 v.val = READ_ONCE(sk->sk_peek_off); in sock_getsockopt()
1659 v.val = sock_flag(sk, SOCK_NOFCS); in sock_getsockopt()
1673 v.val = sock_flag(sk, SOCK_FILTER_LOCKED); in sock_getsockopt()
1677 v.val = bpf_tell_extensions(); in sock_getsockopt()
1681 v.val = sock_flag(sk, SOCK_SELECT_ERR_QUEUE); in sock_getsockopt()
1686 v.val = READ_ONCE(sk->sk_ll_usec); in sock_getsockopt()
1689 v.val = READ_ONCE(sk->sk_prefer_busy_poll); in sock_getsockopt()
1695 if (sizeof(v.ulval) != sizeof(v.val) && len >= sizeof(v.ulval)) { in sock_getsockopt()
1700 v.val = min_t(unsigned long, ~0U, in sock_getsockopt()
1706 v.val = READ_ONCE(sk->sk_incoming_cpu); in sock_getsockopt()
1724 v.val = READ_ONCE(sk->sk_napi_id); in sock_getsockopt()
1727 if (v.val < MIN_NAPI_ID) in sock_getsockopt()
1728 v.val = 0; in sock_getsockopt()
1741 v.val = sock_flag(sk, SOCK_ZEROCOPY); in sock_getsockopt()
1754 v.val = sk->sk_bound_dev_if; in sock_getsockopt()
1765 v.val = sk->sk_userlocks & SOCK_BUF_LOCK_MASK; in sock_getsockopt()
2917 int sk_set_peek_off(struct sock *sk, int val) in sk_set_peek_off() argument
2919 WRITE_ONCE(sk->sk_peek_off, val); in sk_set_peek_off()
3507 int val[PROTO_INUSE_NR]; member
3512 void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) in sock_prot_inuse_add() argument
3514 __this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val); in sock_prot_inuse_add()
3524 res += per_cpu_ptr(net->core.prot_inuse, cpu)->val[idx]; in sock_prot_inuse_get()
3530 static void sock_inuse_add(struct net *net, int val) in sock_inuse_add() argument
3532 this_cpu_add(*net->core.sock_inuse, val); in sock_inuse_add()
3613 static void sock_inuse_add(struct net *net, int val) in sock_inuse_add() argument