• Home
  • Raw
  • Download

Lines Matching refs:val

335 	unsigned long val;  in tcp_enter_memory_pressure()  local
339 val = jiffies; in tcp_enter_memory_pressure()
341 if (!val) in tcp_enter_memory_pressure()
342 val--; in tcp_enter_memory_pressure()
343 if (!cmpxchg(&tcp_memory_pressure, 0, val)) in tcp_enter_memory_pressure()
350 unsigned long val; in tcp_leave_memory_pressure() local
354 val = xchg(&tcp_memory_pressure, 0); in tcp_leave_memory_pressure()
355 if (val) in tcp_leave_memory_pressure()
357 jiffies_to_msecs(jiffies - val)); in tcp_leave_memory_pressure()
1715 int tcp_set_rcvlowat(struct sock *sk, int val) in tcp_set_rcvlowat() argument
1723 val = min(val, cap); in tcp_set_rcvlowat()
1724 WRITE_ONCE(sk->sk_rcvlowat, val ? : 1); in tcp_set_rcvlowat()
1732 val <<= 1; in tcp_set_rcvlowat()
1733 if (val > sk->sk_rcvbuf) { in tcp_set_rcvlowat()
1734 WRITE_ONCE(sk->sk_rcvbuf, val); in tcp_set_rcvlowat()
1735 tcp_sk(sk)->window_clamp = tcp_win_from_space(sk, val); in tcp_set_rcvlowat()
3266 static void __tcp_sock_set_quickack(struct sock *sk, int val) in __tcp_sock_set_quickack() argument
3268 if (!val) { in __tcp_sock_set_quickack()
3278 if (!(val & 1)) in __tcp_sock_set_quickack()
3283 void tcp_sock_set_quickack(struct sock *sk, int val) in tcp_sock_set_quickack() argument
3286 __tcp_sock_set_quickack(sk, val); in tcp_sock_set_quickack()
3291 int tcp_sock_set_syncnt(struct sock *sk, int val) in tcp_sock_set_syncnt() argument
3293 if (val < 1 || val > MAX_TCP_SYNCNT) in tcp_sock_set_syncnt()
3297 WRITE_ONCE(inet_csk(sk)->icsk_syn_retries, val); in tcp_sock_set_syncnt()
3303 void tcp_sock_set_user_timeout(struct sock *sk, u32 val) in tcp_sock_set_user_timeout() argument
3306 WRITE_ONCE(inet_csk(sk)->icsk_user_timeout, val); in tcp_sock_set_user_timeout()
3311 int tcp_sock_set_keepidle_locked(struct sock *sk, int val) in tcp_sock_set_keepidle_locked() argument
3315 if (val < 1 || val > MAX_TCP_KEEPIDLE) in tcp_sock_set_keepidle_locked()
3319 WRITE_ONCE(tp->keepalive_time, val * HZ); in tcp_sock_set_keepidle_locked()
3334 int tcp_sock_set_keepidle(struct sock *sk, int val) in tcp_sock_set_keepidle() argument
3339 err = tcp_sock_set_keepidle_locked(sk, val); in tcp_sock_set_keepidle()
3345 int tcp_sock_set_keepintvl(struct sock *sk, int val) in tcp_sock_set_keepintvl() argument
3347 if (val < 1 || val > MAX_TCP_KEEPINTVL) in tcp_sock_set_keepintvl()
3351 WRITE_ONCE(tcp_sk(sk)->keepalive_intvl, val * HZ); in tcp_sock_set_keepintvl()
3357 int tcp_sock_set_keepcnt(struct sock *sk, int val) in tcp_sock_set_keepcnt() argument
3359 if (val < 1 || val > MAX_TCP_KEEPCNT) in tcp_sock_set_keepcnt()
3364 WRITE_ONCE(tcp_sk(sk)->keepalive_probes, val); in tcp_sock_set_keepcnt()
3370 int tcp_set_window_clamp(struct sock *sk, int val) in tcp_set_window_clamp() argument
3374 if (!val) { in tcp_set_window_clamp()
3379 tp->window_clamp = val < SOCK_MIN_RCVBUF / 2 ? in tcp_set_window_clamp()
3380 SOCK_MIN_RCVBUF / 2 : val; in tcp_set_window_clamp()
3395 int val; in do_tcp_setsockopt() local
3406 val = strncpy_from_sockptr(name, optval, in do_tcp_setsockopt()
3408 if (val < 0) in do_tcp_setsockopt()
3410 name[val] = 0; in do_tcp_setsockopt()
3425 val = strncpy_from_sockptr(name, optval, in do_tcp_setsockopt()
3428 if (val < 0) in do_tcp_setsockopt()
3430 name[val] = 0; in do_tcp_setsockopt()
3464 if (copy_from_sockptr(&val, optval, sizeof(val))) in do_tcp_setsockopt()
3475 if (val && (val < TCP_MIN_MSS || val > MAX_TCP_WINDOW)) { in do_tcp_setsockopt()
3479 tp->rx_opt.user_mss = val; in do_tcp_setsockopt()
3483 __tcp_sock_set_nodelay(sk, val); in do_tcp_setsockopt()
3487 if (val < 0 || val > 1) in do_tcp_setsockopt()
3490 tp->thin_lto = val; in do_tcp_setsockopt()
3494 if (val < 0 || val > 1) in do_tcp_setsockopt()
3501 else if (val == TCP_REPAIR_ON) { in do_tcp_setsockopt()
3505 } else if (val == TCP_REPAIR_OFF) { in do_tcp_setsockopt()
3509 } else if (val == TCP_REPAIR_OFF_NO_WP) { in do_tcp_setsockopt()
3520 else if ((unsigned int)val < TCP_QUEUES_NR) in do_tcp_setsockopt()
3521 tp->repair_queue = val; in do_tcp_setsockopt()
3533 WRITE_ONCE(tp->write_seq, val); in do_tcp_setsockopt()
3538 WRITE_ONCE(tp->rcv_nxt, val); in do_tcp_setsockopt()
3539 WRITE_ONCE(tp->copied_seq, val); in do_tcp_setsockopt()
3556 __tcp_sock_set_cork(sk, val); in do_tcp_setsockopt()
3560 err = tcp_sock_set_keepidle_locked(sk, val); in do_tcp_setsockopt()
3563 if (val < 1 || val > MAX_TCP_KEEPINTVL) in do_tcp_setsockopt()
3566 WRITE_ONCE(tp->keepalive_intvl, val * HZ); in do_tcp_setsockopt()
3569 if (val < 1 || val > MAX_TCP_KEEPCNT) in do_tcp_setsockopt()
3572 WRITE_ONCE(tp->keepalive_probes, val); in do_tcp_setsockopt()
3575 if (val < 1 || val > MAX_TCP_SYNCNT) in do_tcp_setsockopt()
3578 WRITE_ONCE(icsk->icsk_syn_retries, val); in do_tcp_setsockopt()
3583 if (val < 0 || val > 2) in do_tcp_setsockopt()
3586 tp->save_syn = val; in do_tcp_setsockopt()
3590 if (val < 0) in do_tcp_setsockopt()
3592 else if (val > TCP_FIN_TIMEOUT_MAX / HZ) in do_tcp_setsockopt()
3595 WRITE_ONCE(tp->linger2, val * HZ); in do_tcp_setsockopt()
3601 secs_to_retrans(val, TCP_TIMEOUT_INIT / HZ, in do_tcp_setsockopt()
3606 err = tcp_set_window_clamp(sk, val); in do_tcp_setsockopt()
3610 __tcp_sock_set_quickack(sk, val); in do_tcp_setsockopt()
3623 if (val < 0) in do_tcp_setsockopt()
3626 WRITE_ONCE(icsk->icsk_user_timeout, val); in do_tcp_setsockopt()
3630 if (val >= 0 && ((1 << sk->sk_state) & (TCPF_CLOSE | in do_tcp_setsockopt()
3634 fastopen_queue_tune(sk, val); in do_tcp_setsockopt()
3640 if (val > 1 || val < 0) { in do_tcp_setsockopt()
3645 tp->fastopen_connect = val; in do_tcp_setsockopt()
3653 if (val > 1 || val < 0) in do_tcp_setsockopt()
3658 tp->fastopen_no_cookie = val; in do_tcp_setsockopt()
3664 tp->tsoffset = val - tcp_time_stamp_raw(); in do_tcp_setsockopt()
3670 WRITE_ONCE(tp->notsent_lowat, val); in do_tcp_setsockopt()
3674 if (val > 1 || val < 0) in do_tcp_setsockopt()
3677 tp->recvmsg_inq = val; in do_tcp_setsockopt()
3680 if (val) in do_tcp_setsockopt()
3682 WRITE_ONCE(tp->tcp_tx_delay, val); in do_tcp_setsockopt()
3957 int val, len; in do_tcp_getsockopt() local
3969 val = tp->mss_cache; in do_tcp_getsockopt()
3972 val = tp->rx_opt.user_mss; in do_tcp_getsockopt()
3974 val = tp->rx_opt.mss_clamp; in do_tcp_getsockopt()
3977 val = !!(tp->nonagle&TCP_NAGLE_OFF); in do_tcp_getsockopt()
3980 val = !!(tp->nonagle&TCP_NAGLE_CORK); in do_tcp_getsockopt()
3983 val = keepalive_time_when(tp) / HZ; in do_tcp_getsockopt()
3986 val = keepalive_intvl_when(tp) / HZ; in do_tcp_getsockopt()
3989 val = keepalive_probes(tp); in do_tcp_getsockopt()
3992 val = READ_ONCE(icsk->icsk_syn_retries) ? : in do_tcp_getsockopt()
3996 val = READ_ONCE(tp->linger2); in do_tcp_getsockopt()
3997 if (val >= 0) in do_tcp_getsockopt()
3998 val = (val ? : READ_ONCE(net->ipv4.sysctl_tcp_fin_timeout)) / HZ; in do_tcp_getsockopt()
4001 val = READ_ONCE(icsk->icsk_accept_queue.rskq_defer_accept); in do_tcp_getsockopt()
4002 val = retrans_to_secs(val, TCP_TIMEOUT_INIT / HZ, in do_tcp_getsockopt()
4006 val = tp->window_clamp; in do_tcp_getsockopt()
4044 val = !inet_csk_in_pingpong_mode(sk); in do_tcp_getsockopt()
4089 val = tp->thin_lto; in do_tcp_getsockopt()
4093 val = 0; in do_tcp_getsockopt()
4097 val = tp->repair; in do_tcp_getsockopt()
4102 val = tp->repair_queue; in do_tcp_getsockopt()
4131 val = tp->write_seq; in do_tcp_getsockopt()
4133 val = tp->rcv_nxt; in do_tcp_getsockopt()
4139 val = READ_ONCE(icsk->icsk_user_timeout); in do_tcp_getsockopt()
4143 val = READ_ONCE(icsk->icsk_accept_queue.fastopenq.max_qlen); in do_tcp_getsockopt()
4147 val = tp->fastopen_connect; in do_tcp_getsockopt()
4151 val = tp->fastopen_no_cookie; in do_tcp_getsockopt()
4155 val = READ_ONCE(tp->tcp_tx_delay); in do_tcp_getsockopt()
4159 val = tcp_time_stamp_raw() + tp->tsoffset; in do_tcp_getsockopt()
4162 val = READ_ONCE(tp->notsent_lowat); in do_tcp_getsockopt()
4165 val = tp->recvmsg_inq; in do_tcp_getsockopt()
4168 val = tp->save_syn; in do_tcp_getsockopt()
4275 if (copy_to_user(optval, &val, len)) in do_tcp_getsockopt()