From: Mat Martineau <hidden> Date: 2021-06-17 23:46:31
RFC 8684 defines a DSS checksum feature that allows MPTCP to detect
middlebox interference with the MPTCP DSS header and the portion of the
data stream associated with that header. So far, the MPTCP
implementation in the Linux kernel has not supported this feature.
This patch series adds DSS checksum support. By default, the kernel will
not request checksums when sending SYN or SYN/ACK packets for MPTCP
connections. Outgoing checksum requests can be enabled with a
per-namespace net.mptcp.checksum_enabled sysctl. MPTCP connections will
now proceed with DSS checksums when the peer requests them, whether the
sysctl is enabled or not.
Patches 1-5 add checksum bits to the outgoing SYN, SYN/ACK, and data
packet headers. This includes calculating the checksum using a range of
data and the MPTCP DSS mapping for that data.
Patches 6-10 handle the checksum request in the SYN or SYN/ACK, and
receiving and verifying the DSS checksum on data packets.
Patch 11 adjusts the MPTCP-level retransmission process for checksum
compatibility.
Patches 12-14 add checksum-related MIBs, the net.mptcp.checksum_enabled
sysctl, and a checksum field to debug trace output.
Patches 15 & 16 add selftests.
The series is slightly longer than the preferred 15-patch limit that
patchwork warns about. I do try to stay below that whenever possible -
this series does implement one feature and is, I think, cohesive enough
to justify keeping it together. If it's at all problematic please let me
know!
A trivial merge conflict with net/master is introduced in patch 15: a
commit in net/master removes a couple of nearby lines of code.
Geliang Tang (14):
mptcp: add csum_enabled in mptcp_sock
mptcp: generate the data checksum
mptcp: add csum_reqd in mptcp_out_options
mptcp: send out checksum for MP_CAPABLE with data
mptcp: send out checksum for DSS
mptcp: add sk parameter for mptcp_get_options
mptcp: add csum_reqd in mptcp_options_received
mptcp: receive checksum for MP_CAPABLE with data
mptcp: receive checksum for DSS
mptcp: add the mib for data checksum
mptcp: add a new sysctl checksum_enabled
mptcp: dump csum fields in mptcp_dump_mpext
selftests: mptcp: enable checksum in mptcp_connect.sh
selftests: mptcp: enable checksum in mptcp_join.sh
Paolo Abeni (2):
mptcp: validate the data checksum
mptcp: tune re-injections for csum enabled mode
Documentation/networking/mptcp-sysctl.rst | 8 +
include/net/mptcp.h | 9 +-
include/trace/events/mptcp.h | 17 +-
include/uapi/linux/mptcp.h | 1 +
net/mptcp/ctrl.c | 16 ++
net/mptcp/mib.c | 1 +
net/mptcp/mib.h | 1 +
net/mptcp/mptcp_diag.c | 1 +
net/mptcp/options.c | 154 +++++++++++++-----
net/mptcp/protocol.c | 29 +++-
net/mptcp/protocol.h | 23 ++-
net/mptcp/subflow.c | 120 ++++++++++++--
.../selftests/net/mptcp/mptcp_connect.sh | 13 +-
.../testing/selftests/net/mptcp/mptcp_join.sh | 107 +++++++++++-
14 files changed, 431 insertions(+), 69 deletions(-)
base-commit: 8fe088bd4fd12f4c8899b51d5bc3daad98767d49
--
2.32.0
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:32
From: Geliang Tang <redacted>
This patch added a new member named csum_enabled in struct mptcp_sock,
used a dummy mptcp_is_checksum_enabled() helper to initialize it.
Also added a new member named mptcpi_csum_enabled in struct mptcp_info
to expose the csum_enabled flag.
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
include/uapi/linux/mptcp.h | 1 +
net/mptcp/mptcp_diag.c | 1 +
net/mptcp/protocol.c | 1 +
net/mptcp/protocol.h | 2 ++
4 files changed, 5 insertions(+)
@@ -234,6 +234,7 @@ struct mptcp_sock {boolsnd_data_fin_enable;boolrcv_fastclose;booluse_64bit_ack;/* Set when we received a 64-bit DSN */+boolcsum_enabled;spinlock_tjoin_list_lock;structsock*ack_hint;structwork_structwork;
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:35
From: Geliang Tang <redacted>
This patch added a new member named csum in struct mptcp_ext, implemented
a new function named mptcp_generate_data_checksum().
Generate the data checksum in mptcp_sendmsg_frag, save it in mpext->csum.
Note that we must generate the csum for zero window probe, too.
Do the csum update incrementally, to avoid multiple csum computation
when the data is appended to existing skb.
Note that in a later patch we will skip unneeded csum related operation.
Changes not included here to keep the delta small.
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
include/net/mptcp.h | 1 +
net/mptcp/protocol.c | 18 +++++++++++++++++-
net/mptcp/protocol.h | 7 +++++++
3 files changed, 25 insertions(+), 1 deletion(-)
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:37
From: Geliang Tang <redacted>
This patch added a new member csum_reqd in struct mptcp_out_options and
struct mptcp_subflow_request_sock. Initialized it with the helper
function mptcp_is_checksum_enabled().
In mptcp_write_options, if this field is enabled, send out the MP_CAPABLE
suboption with the MPTCP_CAP_CHECKSUM_REQD flag.
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
include/net/mptcp.h | 5 +++--
net/mptcp/options.c | 11 +++++++++--
net/mptcp/protocol.h | 3 ++-
net/mptcp/subflow.c | 1 +
4 files changed, 15 insertions(+), 5 deletions(-)
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:39
From: Geliang Tang <redacted>
In mptcp_write_options, if the checksum is enabled, adjust the option
length and send out the data checksum with DSS suboption.
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
@@ -478,6 +478,9 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb,if(data_len>0){len=TCPOLEN_MPTCP_MPC_ACK_DATA;if(opts->csum_reqd){+/* we need to propagate more info to csum the pseudo hdr */+opts->ext_copy.data_seq=mpext->data_seq;+opts->ext_copy.subflow_seq=mpext->subflow_seq;opts->ext_copy.csum=mpext->csum;len+=TCPOLEN_MPTCP_DSS_CHECKSUM;}
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:41
From: Geliang Tang <redacted>
If the checksum is enabled, send out the data checksum with the
MP_CAPABLE suboption with data.
In mptcp_established_options_mp, save the data checksum in
opts->ext_copy.csum. In mptcp_write_options, adjust the option length and
send it out with the MP_CAPABLE suboption.
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 52 +++++++++++++++++++++++++++++++++++++--------
1 file changed, 43 insertions(+), 9 deletions(-)
@@ -439,6 +439,7 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb,structmptcp_sock*msk=mptcp_sk(subflow->conn);structmptcp_ext*mpext;unsignedintdata_len;+u8len;/* When skb is not available, we better over-estimate the emitted*optionslen.AfullDSSoption(28bytes)islongerthan
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:43
From: Geliang Tang <redacted>
This patch added a new flag csum_reqd in struct mptcp_options_received, if
the flag MPTCP_CAP_CHECKSUM_REQD is set in the receiving MP_CAPABLE
suboption, set this flag.
In mptcp_sk_clone and subflow_finish_connect, if the csum_reqd flag is set,
enable the msk->csum_enabled flag.
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 7 ++++---
net/mptcp/protocol.c | 2 ++
net/mptcp/protocol.h | 1 +
net/mptcp/subflow.c | 2 ++
4 files changed, 9 insertions(+), 3 deletions(-)
@@ -71,11 +71,9 @@ static void mptcp_parse_option(const struct sk_buff *skb,*"If a checksum is not present when its use has been*negotiated,thereceiverMUSTclosethesubflowwithaRSTas*itisconsideredbroken."-*-*Wedon'timplementDSSchecksum-fallbacktoTCP.*/if(flags&MPTCP_CAP_CHECKSUM_REQD)-break;+mp_opt->csum_reqd=1;mp_opt->mp_capable=1;if(opsize>=TCPOLEN_MPTCP_MPC_SYNACK){
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:44
From: Geliang Tang <redacted>
This patch added a new member named csum in struct mptcp_options_received.
When parsing the MP_CAPABLE with data, if the checksum is enabled,
adjust the expected_opsize. If the receiving option length matches the
length with the data checksum, get the checksum value and save it in
mp_opt->csum. And in mptcp_incoming_options, pass it to mpext->csum.
We always parse any csum/nocsum combination and delay the presence check
to later code, to allow reset if missing.
Additionally, in the TX path, use the newly introduce ext field to avoid
MPTCP csum recomputation on TCP retransmission and unneeded csum update
on when setting the data fin_flag.
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
include/net/mptcp.h | 3 ++-
net/mptcp/options.c | 35 ++++++++++++++++++++++++++---------
net/mptcp/protocol.h | 3 +++
3 files changed, 31 insertions(+), 10 deletions(-)
@@ -44,7 +44,20 @@ static void mptcp_parse_option(const struct sk_buff *skb,elseexpected_opsize=TCPOLEN_MPTCP_MPC_SYN;}-if(opsize!=expected_opsize)++/* Cfr RFC 8684 Section 3.3.0:+*Ifachecksumispresentbutitsusehad+*notbeennegotiatedintheMP_CAPABLEhandshake,thereceiverMUST+*closethesubflowwithaRST,asitisnotbehavingasnegotiated.+*Ifachecksumisnotpresentwhenitsusehasbeennegotiated,the+*receiverMUSTclosethesubflowwithaRST,asitisconsidered+*broken+*Weparseevenoptionwithmismatchingcsumpresence,sothat+*laterinsubflow_data_readywecantriggerthereset.+*/+if(opsize!=expected_opsize&&+(expected_opsize!=TCPOLEN_MPTCP_MPC_ACK_DATA||+opsize!=TCPOLEN_MPTCP_MPC_ACK_DATA_CSUM))break;/* try to be gentle vs future versions on the initial syn */
@@ -66,11 +79,6 @@ static void mptcp_parse_option(const struct sk_buff *skb,*hostrequirestheuseofchecksums,checksumsMUSTbeused.*Inotherwords,theonlywayforchecksumsnottobeused*isifbothhostsintheirSYNssetA=0."-*-*Section3.3.0:-*"If a checksum is not present when its use has been-*negotiated,thereceiverMUSTclosethesubflowwithaRSTas-*itisconsideredbroken."*/if(flags&MPTCP_CAP_CHECKSUM_REQD)mp_opt->csum_reqd=1;
@@ -84,7 +92,7 @@ static void mptcp_parse_option(const struct sk_buff *skb,mp_opt->rcvr_key=get_unaligned_be64(ptr);ptr+=8;}-if(opsize==TCPOLEN_MPTCP_MPC_ACK_DATA){+if(opsize>=TCPOLEN_MPTCP_MPC_ACK_DATA){/* Section 3.1.:*"the data parameters in a MP_CAPABLE are semantically*equivalenttothoseinaDSSoptionandcanbeused
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:45
From: Geliang Tang <redacted>
In mptcp_parse_option, adjust the expected_opsize, and always parse the
data checksum value from the receiving DSS regardless of csum presence.
Then save it in mp_opt->csum.
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:47
From: Paolo Abeni <pabeni@redhat.com>
This patch added three new members named data_csum, csum_len and
map_csum in struct mptcp_subflow_context, implemented a new function
named mptcp_validate_data_checksum().
If the current mapping is valid and csum is enabled traverse the later
pending skbs and compute csum incrementally till the whole mapping has
been covered. If not enough data is available in the rx queue, return
MAPPING_EMPTY - that is, no data.
Next subflow_data_ready invocation will trigger again csum computation.
When the full DSS is available, validate the csum and return to the
caller an appropriate error code, to trigger subflow reset of fallback
as required by the RFC.
Additionally:
- if the csum prevence in the DSS don't match the negotiated value e.g.
csum present, but not requested, return invalid mapping to trigger
subflow reset.
- keep some csum state, to avoid re-compute the csum on the same data
when multiple rx queue traversal are required.
- clean-up the uncompleted mapping from the receive queue on close, to
allow proper subflow disposal
Co-developed-by: Geliang Tang <redacted>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/protocol.h | 4 ++
net/mptcp/subflow.c | 105 ++++++++++++++++++++++++++++++++++++++++---
2 files changed, 103 insertions(+), 6 deletions(-)
@@ -409,6 +411,8 @@ struct mptcp_subflow_context {pm_notified:1,/* PM hook called for established status */conn_finished:1,map_valid:1,+map_csum_reqd:1,+map_data_fin:1,mpc_map:1,backup:1,send_mp_prio:1,
@@ -827,10 +827,90 @@ static bool validate_mapping(struct sock *ssk, struct sk_buff *skb)returntrue;}+staticenummapping_statusvalidate_data_csum(structsock*ssk,structsk_buff*skb,+boolcsum_reqd)+{+structmptcp_subflow_context*subflow=mptcp_subflow_ctx(ssk);+structcsum_pseudo_headerheader;+u32offset,seq,delta;+__wsumcsum;+intlen;++if(!csum_reqd)+returnMAPPING_OK;++/* mapping already validated on previous traversal */+if(subflow->map_csum_len==subflow->map_data_len)+returnMAPPING_OK;++/* traverse the receive queue, ensuring it contains a full+*DSSmappingandaccumulatingtherelatedcsum.+*Preservetheaccoumlatecsumacrossmultiplecalls,tocompute+*thecsumonlyonce+*/+delta=subflow->map_data_len-subflow->map_csum_len;+for(;;){+seq=tcp_sk(ssk)->copied_seq+subflow->map_csum_len;+offset=seq-TCP_SKB_CB(skb)->seq;++/* if the current skb has not been accounted yet, csum its contents+*uptotheamountcoveredbythecurrentDSS+*/+if(offset<skb->len){+__wsumcsum;++len=min(skb->len-offset,delta);+csum=skb_checksum(skb,offset,len,0);+subflow->map_data_csum=csum_block_add(subflow->map_data_csum,csum,+subflow->map_csum_len);++delta-=len;+subflow->map_csum_len+=len;+}+if(delta==0)+break;++if(skb_queue_is_last(&ssk->sk_receive_queue,skb)){+/* if this subflow is closed, the partial mapping+*willbenevercompleted;flushthependingskbs,so+*thatsubflow_sched_work_if_closed()cankickin+*/+if(unlikely(ssk->sk_state==TCP_CLOSE))+while((skb=skb_peek(&ssk->sk_receive_queue)))+sk_eat_skb(ssk,skb);++/* not enough data to validate the csum */+returnMAPPING_EMPTY;+}++/* the DSS mapping for next skbs will be validated later,+*whenaget_mapping_statuscallwillprocesssuchskb+*/+skb=skb->next;+}++/* note that 'map_data_len' accounts only for the carried data, does+*notincludetheeventualseqincrementduetothedatafin,+*whilethepseudoheaderrequirestheoriginalDSSdatalen,+*includingthat+*/+header.data_seq=cpu_to_be64(subflow->map_seq);+header.subflow_seq=htonl(subflow->map_subflow_seq);+header.data_len=htons(subflow->map_data_len+subflow->map_data_fin);+header.csum=0;++csum=csum_partial(&header,sizeof(header),subflow->map_data_csum);+if(unlikely(csum_fold(csum)))+returnsubflow->mp_join?MAPPING_INVALID:MAPPING_DUMMY;++returnMAPPING_OK;+}+staticenummapping_statusget_mapping_status(structsock*ssk,structmptcp_sock*msk){structmptcp_subflow_context*subflow=mptcp_subflow_ctx(ssk);+boolcsum_reqd=READ_ONCE(msk->csum_enabled);structmptcp_ext*mpext;structsk_buff*skb;u16data_len;
@@ -923,9 +1003,10 @@ static enum mapping_status get_mapping_status(struct sock *ssk,/* Allow replacing only with an identical map */if(subflow->map_seq==map_seq&&subflow->map_subflow_seq==mpext->subflow_seq&&-subflow->map_data_len==data_len){+subflow->map_data_len==data_len&&+subflow->map_csum_reqd==mpext->csum_reqd){skb_ext_del(skb,SKB_EXT_MPTCP);-returnMAPPING_OK;+gotovalidate_csum;}/* If this skb data are fully covered by the current mapping,
@@ -937,17 +1018,27 @@ static enum mapping_status get_mapping_status(struct sock *ssk,}/* will validate the next map after consuming the current one */-returnMAPPING_OK;+gotovalidate_csum;}subflow->map_seq=map_seq;subflow->map_subflow_seq=mpext->subflow_seq;subflow->map_data_len=data_len;subflow->map_valid=1;+subflow->map_data_fin=mpext->data_fin;subflow->mpc_map=mpext->mpc_map;-pr_debug("new map seq=%llu subflow_seq=%u data_len=%u",+subflow->map_csum_reqd=mpext->csum_reqd;+subflow->map_csum_len=0;+subflow->map_data_csum=csum_unfold(mpext->csum);++/* Cfr RFC 8684 Section 3.3.0 */+if(unlikely(subflow->map_csum_reqd!=csum_reqd))+returnMAPPING_INVALID;++pr_debug("new map seq=%llu subflow_seq=%u data_len=%u csum=%d:%u",subflow->map_seq,subflow->map_subflow_seq,-subflow->map_data_len);+subflow->map_data_len,subflow->map_csum_reqd,+subflow->map_data_csum);validate_seq:/* we revalidate valid mapping on new skb, because we must ensure
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:48
From: Paolo Abeni <pabeni@redhat.com>
If the MPTCP-level checksum is enabled, on re-injections we
must spool a complete DSS, or the receive side will not be
able to compute the csum and process any data.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/protocol.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
@@ -2375,8 +2375,8 @@ static void __mptcp_retrans(struct sock *sk)/* limit retransmission to the bytes already sent on some subflows */info.sent=0;-info.limit=dfrag->already_sent;-while(info.sent<dfrag->already_sent){+info.limit=READ_ONCE(msk->csum_enabled)?dfrag->data_len:dfrag->already_sent;+while(info.sent<info.limit){if(!mptcp_alloc_tx_skb(sk,ssk))break;
@@ -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_DATACSUMERR,/* The data 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 */
@@ -24,3 +24,11 @@ add_addr_timeout - INTEGER (seconds) sysctl. Default: 120++checksum_enabled - BOOLEAN+ 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
@@ -40,10 +41,16 @@ unsigned int mptcp_get_add_addr_timeout(struct net *net)returnmptcp_get_pernet(net)->add_addr_timeout;}+intmptcp_is_checksum_enabled(structnet*net)+{+returnmptcp_get_pernet(net)->checksum_enabled;+}+staticvoidmptcp_pernet_set_defaults(structmptcp_pernet*pernet){pernet->mptcp_enabled=1;pernet->add_addr_timeout=TCP_RTO_MAX;+pernet->checksum_enabled=0;}#ifdef CONFIG_SYSCTL
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:58
From: Geliang Tang <redacted>
This patch added a new argument "-C" for the mptcp_connect.sh script to
set the sysctl checksum_enabled to 1 in ns1, ns2, ns3 and ns4 to enable
the data checksum.
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
tools/testing/selftests/net/mptcp/mptcp_connect.sh | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
@@ -47,6 +48,7 @@ usage() {echo-e"\t-R: set rcvbuf value (default: use kernel default)"echo-e"\t-m: test mode (poll, sendfile; default: poll)"echo-e"\t-t: also run tests with TCP (use twice to non-fallback tcp)"+echo-e"\t-C: enable the MPTCP data checksum"}whilegetopts"$optstring"option;do
@@ -104,6 +106,9 @@ while getopts "$optstring" option;do"t")do_tcp=$((do_tcp+1));;+"C")+checksum=true+;;"?")usage$0exit1
@@ -200,6 +205,12 @@ ip -net "$ns4" route add default via dead:beef:3::2# use TCP syn cookies, even if no flooding was detected. ipnetnsexec"$ns2"sysctl-qnet.ipv4.tcp_syncookies=2+if$checksum;then+foriin"$ns1""$ns2""$ns3""$ns4";do+ipnetnsexec$isysctl-qnet.mptcp.checksum_enabled=1+done+fi+ set_ethtool_flags(){localns="$1"localdev="$2"
From: Mat Martineau <hidden> Date: 2021-06-17 23:46:59
From: Geliang Tang <redacted>
This patch added a new argument "-C" for the mptcp_join.sh script to set
the sysctl checksum_enabled to 1 in ns1 and ns2 to enable the data
checksum.
In chk_join_nr, check the counter of the mib for the data checksum.
Also added a new argument "-S" for the mptcp_join.sh script to start the
test cases that verify the checksum handshake:
* Sender and listener both have checksums off
* Sender and listener both have checksums on
* Sender checksums off, listener checksums on
* Sender checksums on, listener checksums off
The output looks like this:
01 checksum test 0 0 sum[ ok ] - csum [ ok ]
02 checksum test 1 1 sum[ ok ] - csum [ ok ]
03 checksum test 0 1 sum[ ok ] - csum [ ok ]
04 checksum test 1 0 sum[ ok ] - csum [ ok ]
05 no JOIN syn[ ok ] - synack[ ok ] - ack[ ok ]
sum[ ok ] - csum [ ok ]
06 single subflow, limited by client syn[ ok ] - synack[ ok ] - ack[ ok ]
sum[ ok ] - csum [ ok ]
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 107 +++++++++++++++++-
1 file changed, 103 insertions(+), 4 deletions(-)
@@ -124,6 +128,17 @@ reset_with_add_addr_timeout()-jDROP}+reset_with_checksum()+{+localns1_enable=$1+localns2_enable=$2++reset++ipnetnsexec$ns1sysctl-qnet.mptcp.checksum_enabled=$ns1_enable+ipnetnsexec$ns2sysctl-qnet.mptcp.checksum_enabled=$ns2_enable+}+ ip-Version>/dev/null2>&1if[$?-ne0];thenecho"SKIP: Could not run test without ip tool"
@@ -476,6 +491,45 @@ run_tests()fi}+chk_csum_nr()+{+localmsg=${1:-""}+localcount+localdump_stats++if[!-z"$msg"];then+printf"%02u""$TEST_COUNT"+else+echo-n" "+fi+printf" %-36s %s""$msg""sum"+count=`ipnetnsexec$ns1nstat-as|grepMPTcpExtDataCsumErr|awk'{print $2}'`+[-z"$count"]&&count=0+if["$count"!=0];then+echo"[fail] got $count data checksum error[s] expected 0"+ret=1+dump_stats=1+else+echo-n"[ ok ]"+fi+echo-n" - csum "+count=`ipnetnsexec$ns2nstat-as|grepMPTcpExtDataCsumErr|awk'{print $2}'`+[-z"$count"]&&count=0+if["$count"!=0];then+echo"[fail] got $count data checksum error[s] expected 0"+ret=1+dump_stats=1+else+echo"[ ok ]"+fi+if["${dump_stats}"=1];then+echoServernsstats+ipnetnsexec$ns1nstat-as|grepMPTcp+echoClientnsstats+ipnetnsexec$ns2nstat-as|grepMPTcp+fi+}+ chk_join_nr(){localmsg="$1"
@@ -1374,6 +1431,37 @@ syncookies_tests()chk_add_nr11}+checksum_tests()+{+# checksum test 0 0+reset_with_checksum00+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+run_tests$ns1$ns210.0.1.1+chk_csum_nr"checksum test 0 0"++# checksum test 1 1+reset_with_checksum11+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+run_tests$ns1$ns210.0.1.1+chk_csum_nr"checksum test 1 1"++# checksum test 0 1+reset_with_checksum01+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+run_tests$ns1$ns210.0.1.1+chk_csum_nr"checksum test 0 1"++# checksum test 1 0+reset_with_checksum10+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+run_tests$ns1$ns210.0.1.1+chk_csum_nr"checksum test 1 0"+}+ all_tests(){subflows_tests
@@ -1418,13 +1509,16 @@ make_file "$sin" "server" 1trapcleanupEXITforargin"$@";do-# check for "capture" arg before launching tests+# check for "capture/checksum" args before launching testsif[["${arg}"=~^"-"[0-9a-zA-Z]*"c"[0-9a-zA-Z]*$]];thencapture=1fi+if[["${arg}"=~^"-"[0-9a-zA-Z]*"C"[0-9a-zA-Z]*$]];then+checksum=1+fi-# exception for the capture option, the rest means: a part of the tests-if["${arg}"!="-c"];then+# exception for the capture/checksum options, the rest means: a part of the tests+if["${arg}"!="-c"]&&["${arg}"!="-C"];thendo_all_tests=0fidone
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Thu, 17 Jun 2021 16:46:06 -0700 you wrote:
RFC 8684 defines a DSS checksum feature that allows MPTCP to detect
middlebox interference with the MPTCP DSS header and the portion of the
data stream associated with that header. So far, the MPTCP
implementation in the Linux kernel has not supported this feature.
This patch series adds DSS checksum support. By default, the kernel will
not request checksums when sending SYN or SYN/ACK packets for MPTCP
connections. Outgoing checksum requests can be enabled with a
per-namespace net.mptcp.checksum_enabled sysctl. MPTCP connections will
now proceed with DSS checksums when the peer requests them, whether the
sysctl is enabled or not.
[...]