selftests: avoid confusions around 'signal invalid addresses'
Subsystems (3)
cover selftests: avoid confusions around 'signal invalid addresses'
With Paolo, we were trying to understand why one test was failing, see:
https://github.com/multipath-tcp/mptcp_net-next/issues/254
Paolo noticed that even if the CI was reporting this:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3
The issue here was not with the 17th test but with the next one. This patch can be sent to -net.
While at it, we can also fully remove mptcp_parse_option() from mptcp.h. Not sure this patch needs to be sent to -net but it should not be rejected from there :)
Matthieu Baerts (2):
mptcp: mptcp_parse_option is no longer exported
selftests: mptcp: add missing join check
include/net/mptcp.h | 6 ------ tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 2 files changed, 1 insertion(+), 6 deletions(-)
Signature · 1 line
2.33.1
PATCH 1/2 mptcp: mptcp_parse_option is no longer exported
Options parsing in now done from mptcp_incoming_options().
mptcp_parse_option() has been removed from mptcp.h when CONFIG_MPTCP is defined but not when it is not.
--- include/net/mptcp.h | 6 ------ 1 file changed, 6 deletions(-)
include/net/mptcp.h +0 -6
@@ -218,12 +218,6 @@ static inline bool rsk_drop_req(const struct request_sock *req)return false; } -static inline void mptcp_parse_option (const struct sk_buff *skb, -const unsigned char *ptr,int opsize, -struct tcp_options_received *opt_rx) -{ -} -static inline bool mptcp_syn_options (struct sock *sk,const struct sk_buff *skb,unsigned int *size,struct mptcp_out_options *opts)
Signature · 1 line
2.33.1
Re: [PATCH mptcp-net 1/2] mptcp: mptcp_parse_option is no longer exported
Quoted 18 lines · Matthieu Baerts
Options parsing in now done from
mptcp_incoming_options().
mptcp_parse_option()has been removed frommptcp.hwhenCONFIG_MPTCPis defined but not when it is not.Fixes cfde141ea3fa ("mptcp: move option parsing into mptcp_incoming_options()")Signed-off-by Matthieu Baerts <[email protected]>--- include/net/mptcp.h | 6 ------ 1 file changed, 6 deletions(-)include/net/mptcp.h +0
-0@@ -218,12 +218,6 @@ static inline bool rsk_drop_req(const struct request_sock *req)return false; }
include/net/mptcp.h static inline bool rsk_drop_req(const struct request_sock *req) · line 223
Quoted 10 lines
include/net/mptcp.h +0
-6-static inline void mptcp_parse_option (const struct sk_buff *skb, -const unsigned char *ptr,int opsize, -struct tcp_options_received *opt_rx) -{ -} -static inline bool mptcp_syn_options (struct sock *sk,const struct sk_buff *skb,unsigned int *size,struct mptcp_out_options *opts)
Nice catch!
Re: [PATCH mptcp-net 1/2] mptcp: mptcp_parse_option is no longer exported
In reply to Matthieu BaertsQuoted 11 lines · Matthieu Baerts
Options parsing in now done from
mptcp_incoming_options().
mptcp_parse_option()has been removed frommptcp.hwhenCONFIG_MPTCPis defined but not when it is not.Fixes cfde141ea3fa ("mptcp: move option parsing into mptcp_incoming_options()")Signed-off-by Matthieu Baerts <[email protected]>---
include/net/mptcp.h| 6 ------1 file changed, 6 deletions(-)
Looks good to me, but it seems more like a net-next cleanup patch. When building without CONFIG_MPTCP I don't see mptcp_parse_option showing up as a symbol in the files that include mptcp.h.
Quoted 22 lines
include/net/mptcp.h +0
-6@@ -218,12 +218,6 @@ static inline bool rsk_drop_req(const struct request_sock *req)return false; } -static inline void mptcp_parse_option (const struct sk_buff *skb, -const unsigned char *ptr,int opsize, -struct tcp_options_received *opt_rx) -{ -} -static inline bool mptcp_syn_options (struct sock *sk,const struct sk_buff *skb,unsigned int *size,struct mptcp_out_options *opts)Signature · 1 line
2.33.1
--
Mat Martineau
Intel
PATCH 2/2 selftests: mptcp: add missing join check
In reply to Matthieu BaertsThis function also writes the name of the test with its ID, making clear a new test has been executed.
Without that, the ADD_ADDR results from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3
In fact, this 17th test was OK but not the 18th one.
Now we have:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ]
18 signal addresses race test syn[ ok ] - synack[ ok ] - ack[ ok ]
add[fail] got 2 ADD_ADDR[s] expected 3
--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +1 -0
@@ -1342,6 +1342,7 @@ signal_address_tests() pm_nl_add_endpoint $ns2 10.0.3.2 flags signal pm_nl_add_endpoint $ns2 10.0.4.2 flags signal run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal addresses race test" 3 3 3 # the server will not signal the address terminating # the MPC subflow
Signature · 1 line
2.33.1
Re: [PATCH mptcp-net 2/2] selftests: mptcp: add missing join check
Hi Matt,
I think in this test chk_join_nr is omitted on purpose, since it is more likely to fail. As we can see, chk_add_nr failed sometimes, if we add this chk_join_nr, it will fail more frequently.
Quoted 12 lines · Matthieu Baerts <[email protected]> 于2022年1月22日周六 17:32写道:
This function also writes the name of the test with its ID, making clear a new test has been executed.
Without that, the
ADD_ADDRresults from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had:17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3
Quoted 8 lines
In fact, this 17th test was OK but not the 18th one.
Now we have:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ]
18 signal addresses race test syn[ ok ] - synack[ ok ] - ack[ ok ]
add[fail] got 2 ADD_ADDR[s] expected 3
I think if chk_add_nr fail here, chk_join_nr must fail too. If we got 2 ADD_ADDR[s], we got 2 JOIN[s] syn too, not 3. Furthermore, if chk_add_nr passed, we can't make sure chk_join_nr will pass too. Since MP_JOIN is translated after ADD_ADDR, it may be lost.
Quoted 13 lines
Fixes 33c563ad28e3 ("selftests: mptcp: add_addr and echo race test")Reported-by Paolo Abeni <[email protected]>Signed-off-by Matthieu Baerts <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/net/mptcp/mptcp_join.sh +0
-0
tools/testing/selftests/net/mptcp/mptcp_join.sh signal_address_tests() · line 1345
Quoted 4 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +1
-0@@ -1342,6 +1342,7 @@ signal_address_tests() pm_nl_add_endpoint $ns2 10.0.3.2 flags signal pm_nl_add_endpoint $ns2 10.0.4.2 flags signal run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal addresses race test" 3 3 3
I think we can omit the join numbers check, just print out the name of the test. Don't pass the join numbers to chk_join_nr, just the msg:
chk_join_nr "signal addresses race test"
Then in chk_join_nr, test the input numbers before doing the numbers check:
'''
tools/testing/selftests/net/mptcp/mptcp_join.sh +0 -0
@@ -918,7 +918,7 @@ chk_join_nr() printf "%02u %-36s %s" "$TEST_COUNT" "$msg" "syn" count=`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinSynRx |
awk '{print $2}'`
[ -z "$count" ] && count=0
- if [ "$count" != "$syn_nr" ]; then
+ if [ -n "$syn_nr" ] && [ "$count" != "$syn_nr" ]; then
echo "[fail] got $count JOIN[s] syn expected $syn_nr" ret=1
dump_stats=1
@@ -929,7 +929,7 @@ chk_join_nr()
echo -n " - synack"
count=`ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinSynAckRx
| awk '{print $2}'`
[ -z "$count" ] && count=0
- if [ "$count" != "$syn_ack_nr" ]; then
+ if [ -n "$syn_ack_nr" ] && [ "$count" != "$syn_ack_nr" ]; then
echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr" ret=1
dump_stats=1
@@ -940,7 +940,7 @@ chk_join_nr()
echo -n " - ack"
count=`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinAckRx |
awk '{print $2}'`
[ -z "$count" ] && count=0
- if [ "$count" != "$ack_nr" ]; then
+ if [ -n ""$ack_nr"" ] && [ "$count" != "$ack_nr" ]; then
echo "[fail] got $count JOIN[s] ack expected $ack_nr" ret=1
dump_stats=1
'''
WDYT?
Thanks,
-Geliang
Quoted 7 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +0
-1# the server will not signal the address terminating # the MPC subflow --2.33.1
Re: [PATCH mptcp-net 2/2] selftests: mptcp: add missing join check
Hi Geliang,
Thank you for looking at that!
Quoted 3 lines · Geliang Tang
I think in this test
chk_join_nris omitted on purpose, since it is more likely to fail. As we can see,chk_add_nrfailed sometimes, if we add thischk_join_nr, it will fail more frequently.
May you explain why this tests is likely to fail? Both the commit message and the comment in the code don't explain that.
Quoted 22 lines
Quoted 12 lines · Matthieu Baerts <[email protected]> 于2022年1月22日周六 17:32写道:
This function also writes the name of the test with its ID, making clear a new test has been executed.
Without that, the
ADD_ADDRresults from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had:17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3Quoted 8 lines
In fact, this 17th test was OK but not the 18th one.
Now we have:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ]
18 signal addresses race test syn[ ok ] - synack[ ok ] - ack[ ok ]
add[fail] got 2 ADD_ADDR[s] expected 3
Quoted 4 lines
I think if
chk_add_nrfail here,chk_join_nrmust fail too. If we got 2 ADD_ADDR[s], we got 2 JOIN[s] syn too, not 3. Furthermore, ifchk_add_nrpassed, we can't make surechk_join_nrwill pass too. SinceMP_JOINis translated afterADD_ADDR, it may be lost.
Indeed, to simplify the commit message, I mixed both a "success" and a "failure" output. I should not have done that and only put a "success" one to keep the output small.
Quoted 20 lines
Quoted 12 lines
Fixes 33c563ad28e3 ("selftests: mptcp: add_addr and echo race test")Reported-by Paolo Abeni <[email protected]>Signed-off-by Matthieu Baerts <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/net/mptcp/mptcp_join.sh +0
-0tools/testing/selftests/net/mptcp/mptcp_join.sh signal_address_tests() · line 1345
Quoted 4 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +1
-0@@ -1342,6 +1342,7 @@ signal_address_tests() pm_nl_add_endpoint $ns2 10.0.3.2 flags signal pm_nl_add_endpoint $ns2 10.0.4.2 flags signal run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal addresses race test" 3 3 3I think we can omit the join numbers check, just print out the name of the test. Don't pass the join numbers to
chk_join_nr, just the msg:
Quoted 1 line
chk_join_nr"signal addresses race test"
Do you mean we could have situations where ADD_ADDR have been properly sent and received but we check counters just before MPJ are emitted? In this case we would mark the test as failed because MPJs are not OK (checked too soon in fact) while ADD_ADDR are?
If yes and if it helps, we can also wait for the kernel to have sent exactly 3 ADD_ADDR before checking the MPJ. On the other hand, do we not already cover this UC where we look for MPJs emitted after having received an ADD_ADDR, no?
If we keep checking all counters, I think it might be clearer: MPJ counters are not OK because we didn't receive/process the ADD_ADDR, no?
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Re: [PATCH mptcp-net 2/2] selftests: mptcp: add missing join check
Hi Matt,
I guess we will get this error:
'''
01 signal addresses race test syn[fail] got 2 JOIN[s] syn expected 3
- synack[fail] got 2 JOIN[s] synack expected 3
- ack[fail] got 2 JOIN[s] ack expected 3
add[ ok ] - echo [ok]
'''
But it didn't happen in my tests. I only got this error:
'''
01 signal addresses race test syn[fail] got 2 JOIN[s] syn expected 3
- synack[fail] got 2 JOIN[s] synack expected 3
- ack[fail] got 2 JOIN[s] ack expected 3
add[ ok ] - echo [fail] got 2ADD_ADDR echo[s] expected 3
'''
I'm not sure now. Please ignore my comments.
Thanks,
-Geliang
Quoted 84 lines · Matthieu Baerts <[email protected]> 于2022年1月24日周一 17:39写道:
Hi Geliang,
Thank you for looking at that!
Quoted 3 lines · Geliang Tang
I think in this test
chk_join_nris omitted on purpose, since it is more likely to fail. As we can see,chk_add_nrfailed sometimes, if we add thischk_join_nr, it will fail more frequently.May you explain why this tests is likely to fail? Both the commit message and the comment in the code don't explain that.
Quoted 22 lines
Quoted 12 lines · Matthieu Baerts <[email protected]> 于2022年1月22日周六 17:32写道:
This function also writes the name of the test with its ID, making clear a new test has been executed.
Without that, the
ADD_ADDRresults from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had:17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3Quoted 8 lines
In fact, this 17th test was OK but not the 18th one.
Now we have:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ]
18 signal addresses race test syn[ ok ] - synack[ ok ] - ack[ ok ]
add[fail] got 2 ADD_ADDR[s] expected 3Quoted 4 lines
I think if
chk_add_nrfail here,chk_join_nrmust fail too. If we got 2 ADD_ADDR[s], we got 2 JOIN[s] syn too, not 3. Furthermore, ifchk_add_nrpassed, we can't make surechk_join_nrwill pass too. SinceMP_JOINis translated afterADD_ADDR, it may be lost.Indeed, to simplify the commit message, I mixed both a "success" and a "failure" output. I should not have done that and only put a "success" one to keep the output small.
Quoted 20 lines
Quoted 12 lines
Fixes 33c563ad28e3 ("selftests: mptcp: add_addr and echo race test")Reported-by Paolo Abeni <[email protected]>Signed-off-by Matthieu Baerts <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/net/mptcp/mptcp_join.sh +0
-0tools/testing/selftests/net/mptcp/mptcp_join.sh signal_address_tests() · line 1345
Quoted 4 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +1
-0@@ -1342,6 +1342,7 @@ signal_address_tests() pm_nl_add_endpoint $ns2 10.0.3.2 flags signal pm_nl_add_endpoint $ns2 10.0.4.2 flags signal run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal addresses race test" 3 3 3I think we can omit the join numbers check, just print out the name of the test. Don't pass the join numbers to
chk_join_nr, just the msg:Quoted 1 line
chk_join_nr"signal addresses race test"Do you mean we could have situations where
ADD_ADDRhave been properly sent and received but we check counters just before MPJ are emitted? In this case we would mark the test as failed because MPJs are not OK (checked too soon in fact) whileADD_ADDRare?If yes and if it helps, we can also wait for the kernel to have sent exactly 3
ADD_ADDRbefore checking the MPJ. On the other hand, do we not already cover this UC where we look for MPJs emitted after having received anADD_ADDR, no?If we keep checking all counters, I think it might be clearer: MPJ counters are not OK because we didn't receive/process the
ADD_ADDR, no?Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Mat Martineau
Reviewed-byRe: [PATCH mptcp-net 2/2] selftests: mptcp: add missing join check
In reply to Matthieu BaertsQuoted 34 lines · Matthieu Baerts
Hi Geliang,
Thank you for looking at that!
Quoted 3 lines · Geliang Tang
I think in this test
chk_join_nris omitted on purpose, since it is more likely to fail. As we can see,chk_add_nrfailed sometimes, if we add thischk_join_nr, it will fail more frequently.May you explain why this tests is likely to fail? Both the commit message and the comment in the code don't explain that.
Quoted 22 lines
Quoted 20 lines · Matthieu Baerts <[email protected]> 于2022年1月22日周六 17:32写道:
This function also writes the name of the test with its ID, making clear a new test has been executed.
Without that, the
ADD_ADDRresults from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had:17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3In fact, this 17th test was OK but not the 18th one.
Now we have:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ]
18 signal addresses race test syn[ ok ] - synack[ ok ] - ack[ ok ]
add[fail] got 2 ADD_ADDR[s] expected 3
Quoted 9 lines
Quoted 4 lines
I think if
chk_add_nrfail here,chk_join_nrmust fail too. If we got 2 ADD_ADDR[s], we got 2 JOIN[s] syn too, not 3. Furthermore, ifchk_add_nrpassed, we can't make surechk_join_nrwill pass too. SinceMP_JOINis translated afterADD_ADDR, it may be lost.Indeed, to simplify the commit message, I mixed both a "success" and a "failure" output. I should not have done that and only put a "success" one to keep the output small.
Given that Geliang withdrew his comments, and I don't have changes to request, I think this looks ok for the export branch:
Not sure if you want to adjust the commit message as you mention just above.
-Mat
Quoted 27 lines
Quoted 20 lines
Quoted 12 lines
Fixes 33c563ad28e3 ("selftests: mptcp: add_addr and echo race test")Reported-by Paolo Abeni <[email protected]>Signed-off-by Matthieu Baerts <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/net/mptcp/mptcp_join.sh +0
-0tools/testing/selftests/net/mptcp/mptcp_join.sh signal_address_tests() · line 1345
Quoted 4 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +1
-0@@ -1342,6 +1342,7 @@ signal_address_tests() pm_nl_add_endpoint $ns2 10.0.3.2 flags signal pm_nl_add_endpoint $ns2 10.0.4.2 flags signal run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal addresses race test" 3 3 3I think we can omit the join numbers check, just print out the name of the test. Don't pass the join numbers to
chk_join_nr, just the msg:Quoted 1 line
chk_join_nr"signal addresses race test"Do you mean we could have situations where
ADD_ADDRhave been properly sent and received but we check counters just before MPJ are emitted? In this case we would mark the test as failed because MPJs are not OK (checked too soon in fact) whileADD_ADDRare?
Quoted 8 lines
If yes and if it helps, we can also wait for the kernel to have sent exactly 3
ADD_ADDRbefore checking the MPJ. On the other hand, do we not already cover this UC where we look for MPJs emitted after having received anADD_ADDR, no?If we keep checking all counters, I think it might be clearer: MPJ counters are not OK because we didn't receive/process the
ADD_ADDR, no?
--
Mat Martineau
Intel
Re: [PATCH mptcp-net 2/2] selftests: mptcp: add missing join check
Hi Mat, Geliang, Paolo,
Quoted 51 lines · Mat Martineau
Quoted 39 lines · Matthieu Baerts
Hi Geliang,
Thank you for looking at that!
Quoted 4 lines · Geliang Tang
I think in this test
chk_join_nris omitted on purpose, since it is more likely to fail. As we can see,chk_add_nrfailed sometimes, if we add thischk_join_nr, it will fail more frequently.May you explain why this tests is likely to fail? Both the commit message and the comment in the code don't explain that.
Quoted 26 lines
Matthieu Baerts <[email protected]> 于2022年1月22日周六
Quoted 23 lines · 17:32写道:
This function also writes the name of the test with its ID, making clear
a new test has been executed.Without that, the
ADD_ADDRresults from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had:17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ] add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3
In fact, this 17th test was OK but not the 18th one.
Now we have:
17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ] add[ ok ] - echo [ ok ] 18 signal addresses race test syn[ ok ] - synack[ ok ] - ack[ ok ] add[fail] got 2 ADD_ADDR[s] expected 3
Quoted 9 lines
Quoted 4 lines
I think if
chk_add_nrfail here,chk_join_nrmust fail too. If we got 2 ADD_ADDR[s], we got 2 JOIN[s] syn too, not 3. Furthermore, ifchk_add_nrpassed, we can't make surechk_join_nrwill pass too. SinceMP_JOINis translated afterADD_ADDR, it may be lost.Indeed, to simplify the commit message, I mixed both a "success" and a "failure" output. I should not have done that and only put a "success" one to keep the output small.
Quoted 4 lines
Given that Geliang withdrew his comments, and I don't have changes to request, I think this looks ok for the export branch:
Reviewed-by Mat Martineau <[email protected]>
Thank you for the reviews and suggestions!
Quoted 2 lines
Not sure if you want to adjust the commit message as you mention just above.
Yes, just did by writing output from the CI:
https://api.cirrus-ci.com/v1/artifact/task/5375837896704000/summary/summary.txt
- 948d50855388: mptcp: mptcp_parse_option is no longer exported
- ee286fda85da: selftests: mptcp: add missing join check
- Results: 419c18898efd..d57649f20e6e
Builds and tests are now in progress:
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220128T164437
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net