Skip to content

Commit

Permalink
tgupdate: merge t/upstream base into t/upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
matttbe committed May 6, 2021
2 parents 0987319 + f5e2760 commit e2c6aca
Show file tree
Hide file tree
Showing 13 changed files with 440 additions and 76 deletions.
8 changes: 8 additions & 0 deletions Documentation/networking/mptcp-sysctl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ add_addr_timeout - INTEGER (seconds)
sysctl.

Default: 120

checksum_enabled - INTEGER
Control whether DSS checksum can be enabled.

DSS checksum can be enabled if the value is nonzero. This is a
per-namespace sysctl.

Default: 0
7 changes: 5 additions & 2 deletions include/net/mptcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct mptcp_ext {
u64 data_seq;
u32 subflow_seq;
u16 data_len;
__sum16 csum;
u8 use_map:1,
dsn64:1,
data_fin:1,
Expand All @@ -31,7 +32,8 @@ struct mptcp_ext {
mpc_map:1,
frozen:1,
reset_transient:1;
u8 reset_reason:4;
u8 reset_reason:4,
csum_reqd:1;
};

#define MPTCP_RM_IDS_MAX 8
Expand Down Expand Up @@ -64,7 +66,8 @@ struct mptcp_out_options {
u8 join_id;
u8 backup;
u8 reset_reason:4;
u8 reset_transient:1;
u8 reset_transient:1,
csum_reqd:1;
u32 nonce;
u64 thmac;
u32 token;
Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/mptcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ struct mptcp_info {
__u64 mptcpi_rcv_nxt;
__u8 mptcpi_local_addr_used;
__u8 mptcpi_local_addr_max;
__u8 mptcpi_csum_enabled;
};

/*
Expand Down
14 changes: 14 additions & 0 deletions net/mptcp/ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct mptcp_pernet {

u8 mptcp_enabled;
unsigned int add_addr_timeout;
int checksum_enabled;
};

static struct mptcp_pernet *mptcp_get_pernet(struct net *net)
Expand All @@ -44,9 +45,15 @@ static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet)
{
pernet->mptcp_enabled = 1;
pernet->add_addr_timeout = TCP_RTO_MAX;
pernet->checksum_enabled = 0;
}

#ifdef CONFIG_SYSCTL
int mptcp_is_checksum_enabled(struct net *net)
{
return mptcp_get_pernet(net)->checksum_enabled;
}

static struct ctl_table mptcp_sysctl_table[] = {
{
.procname = "enabled",
Expand All @@ -65,6 +72,12 @@ static struct ctl_table mptcp_sysctl_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.procname = "checksum_enabled",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{}
};

Expand All @@ -82,6 +95,7 @@ static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet)

table[0].data = &pernet->mptcp_enabled;
table[1].data = &pernet->add_addr_timeout;
table[2].data = &pernet->checksum_enabled;

hdr = register_net_sysctl(net, MPTCP_SYSCTL_PATH, table);
if (!hdr)
Expand Down
1 change: 1 addition & 0 deletions net/mptcp/mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static const struct snmp_mib mptcp_snmp_list[] = {
SNMP_MIB_ITEM("MPJoinAckHMacFailure", MPTCP_MIB_JOINACKMAC),
SNMP_MIB_ITEM("DSSNotMatching", MPTCP_MIB_DSSNOMATCH),
SNMP_MIB_ITEM("InfiniteMapRx", MPTCP_MIB_INFINITEMAPRX),
SNMP_MIB_ITEM("DSSCsumErr", MPTCP_MIB_DSSCSUMERR),
SNMP_MIB_ITEM("OFOQueueTail", MPTCP_MIB_OFOQUEUETAIL),
SNMP_MIB_ITEM("OFOQueue", MPTCP_MIB_OFOQUEUE),
SNMP_MIB_ITEM("OFOMerge", MPTCP_MIB_OFOMERGE),
Expand Down
1 change: 1 addition & 0 deletions net/mptcp/mib.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum linux_mptcp_mib_field {
MPTCP_MIB_JOINACKMAC, /* HMAC was wrong on ACK + MP_JOIN */
MPTCP_MIB_DSSNOMATCH, /* Received a new mapping that did not match the previous one */
MPTCP_MIB_INFINITEMAPRX, /* Received an infinite mapping */
MPTCP_MIB_DSSCSUMERR, /* The DSS checksum fail */
MPTCP_MIB_OFOQUEUETAIL, /* Segments inserted into OoO queue tail */
MPTCP_MIB_OFOQUEUE, /* Segments inserted into OoO queue */
MPTCP_MIB_OFOMERGE, /* Segments merged in OoO queue */
Expand Down
1 change: 1 addition & 0 deletions net/mptcp/mptcp_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static void mptcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
info->mptcpi_write_seq = READ_ONCE(msk->write_seq);
info->mptcpi_snd_una = READ_ONCE(msk->snd_una);
info->mptcpi_rcv_nxt = READ_ONCE(msk->ack_seq);
info->mptcpi_csum_enabled = READ_ONCE(msk->csum_enabled);
unlock_sock_fast(sk, slow);
}

Expand Down
Loading

0 comments on commit e2c6aca

Please sign in to comment.