Skip to content

Commit

Permalink
net: namespaceify sysctl_tcp_no_delay_ack
Browse files Browse the repository at this point in the history
isolate sysctl_tcp_no_delay_ack as net namespace

Signed-off-by: Hongbo Li <herberthbli@tencent.com>
  • Loading branch information
herberthbli authored and gxm-newton committed Jan 2, 2020
1 parent 78a8c3c commit 26fb4c4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions include/net/netns/ipv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ struct netns_ipv4 {
int sysctl_fib_multipath_hash_policy;
#endif

int sysctl_tcp_no_delay_ack;

struct fib_notifier_ops *notifier_ops;
unsigned int fib_seq; /* protected by rtnl_mutex */

Expand Down
1 change: 0 additions & 1 deletion include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ extern int sysctl_tcp_pacing_ss_ratio;
extern int sysctl_tcp_pacing_ca_ratio;
extern int sysctl_tcp_tw_ignore_syn_tsval_zero;
extern int sysctl_tcp_loss_init_cwnd;
extern int sysctl_tcp_no_delay_ack;
extern int sysctl_tcp_init_cwnd;

extern atomic_long_t tcp_memory_allocated;
Expand Down
14 changes: 7 additions & 7 deletions net/ipv4/sysctl_net_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
},
{
.procname = "tcp_no_delay_ack",
.data = &sysctl_tcp_no_delay_ack,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.procname = "tcp_init_cwnd",
.data = &sysctl_tcp_init_cwnd,
Expand Down Expand Up @@ -1183,6 +1176,13 @@ static struct ctl_table ipv4_net_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.procname = "tcp_no_delay_ack",
.data = &init_net.ipv4.sysctl_tcp_no_delay_ack,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ }
};

Expand Down
5 changes: 2 additions & 3 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ int sysctl_tcp_early_retrans __read_mostly = 3;
int sysctl_tcp_invalid_ratelimit __read_mostly = HZ/2;
int sysctl_tcp_tw_ignore_syn_tsval_zero __read_mostly = 1;
int sysctl_tcp_loss_init_cwnd = 1;
int sysctl_tcp_no_delay_ack = 0;
int sysctl_tcp_init_cwnd = TCP_INIT_CWND;

#define FLAG_DATA 0x01 /* Incoming frame contained data. */
Expand Down Expand Up @@ -5123,8 +5122,8 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible)
__tcp_select_window(sk) >= tp->rcv_wnd) ||
/* We ACK each frame or... */
tcp_in_quickack_mode(sk) ||
/* We need to send ack no delay or ... */
sysctl_tcp_no_delay_ack ||
/* We need to send ack no delay or ... */
sock_net(sk)->ipv4.sysctl_tcp_no_delay_ack ||
/* We have out of order data. */
(ofo_possible && !RB_EMPTY_ROOT(&tp->out_of_order_queue))) {
/* Then ack it now */
Expand Down

0 comments on commit 26fb4c4

Please sign in to comment.