Skip to contentSkip to conversation

sctp: porting "tests: fix SMALL_MAXSEG" to ltp/utils/sctp

PATCH New Li Zhijian 3 participants 3 messages Dec 8, 2017 – Dec 12, 2017

lore
Share & tools
lore

Li Zhijian

author
#0 lore raw

PATCH 1/1 sctp: porting "tests: fix SMALL_MAXSEG" to ltp/utils/sctp

LKP reported a sctp issue: https://lists.01.org/pipermail/lkp/2017-December/007830.html recently we need to update sctp to fix this issue

the origin patch: https://github.com/sctp/lksctp-tools/commit/723993d3e33100fa96245d2ed46611eb9cba5236
-----------------
tests: fix SMALL_MAXSEG
After Commit ecca8f88da5c ("sctp: set frag_point in sctp_setsockopt_maxseg correctly") in kernel, sctp will not allow to set max_seg with a too small
value.

Now it's using SMALL_MAXSEG in func_tests, with SMALL_MAXSEG = 100, sctp_setsockopt always returns err and causes some tests to fail.

This patch is to avoid it by defining SMALL_MAXSEG as 500 instead, 500 is a good value, as it's very close to the minimum and will not cause the last frag's size is different from the others', which would also lead to failure of some tests.
-----------------

---
 utils/sctp/func_tests/test_sctp_sendrecvmsg.c | 2 +-
 utils/sctp/func_tests/test_timetolive.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
utils/sctp/func_tests/test_sctp_sendrecvmsg.c +1 -1
index 21ba867..70b0ce7 100644
@@ -61,7 +61,7 @@ int TST_CNT = 0;
 
 /* RCVBUF value, and indirectly RWND*2 */
 #define SMALL_RCVBUF 3000
-#define SMALL_MAXSEG 100
+#define SMALL_MAXSEG 500
 /* This is extra data length to ensure rwnd closes */
 #define RWND_SLOP    100
 static char *fillmsg = NULL;
utils/sctp/func_tests/test_timetolive.c +1 -1
index d13168e..3a920d6 100644
@@ -77,7 +77,7 @@ int TST_CNT = 0;
 #define SMALL_RCVBUF 3000
 
 /* MAX segment size */
-#define SMALL_MAXSEG 100
+#define SMALL_MAXSEG 500
 
 /* RWND_SLOP is the extra data that fills up the rwnd */
 #define RWND_SLOP 100
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 sctp: porting "tests: fix SMALL_MAXSEG" to ltp/utils/sctp

Quoted 55 lines · Li Zhijian

LKP reported a sctp issue: https://lists.01.org/pipermail/lkp/2017-December/007830.html recently we need to update sctp to fix this issue

the origin patch: https://github.com/sctp/lksctp-tools/commit/723993d3e33100fa96245d2ed46611eb9cba5236
-----------------
tests: fix SMALL_MAXSEG
After Commit ecca8f88da5c ("sctp: set frag_point in sctp_setsockopt_maxseg correctly") in kernel, sctp will not allow to set max_seg with a too small
value.

Now it's using SMALL_MAXSEG in func_tests, with SMALL_MAXSEG = 100, sctp_setsockopt always returns err and causes some tests to fail.

This patch is to avoid it by defining SMALL_MAXSEG as 500 instead, 500 is a good value, as it's very close to the minimum and will not cause the last frag's size is different from the others', which would also lead to failure of some tests.
-----------------

---
 utils/sctp/func_tests/test_sctp_sendrecvmsg.c | 2 +-
 utils/sctp/func_tests/test_timetolive.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
utils/sctp/func_tests/test_sctp_sendrecvmsg.c +1 -1
index 21ba867..70b0ce7 100644
@@ -61,7 +61,7 @@ int TST_CNT = 0;
 
 /* RCVBUF value, and indirectly RWND*2 */
 #define SMALL_RCVBUF 3000
-#define SMALL_MAXSEG 100
+#define SMALL_MAXSEG 500
 /* This is extra data length to ensure rwnd closes */
 #define RWND_SLOP    100
 static char *fillmsg = NULL;
utils/sctp/func_tests/test_timetolive.c +1 -2
index d13168e..3a920d6 100644
@@ -77,7 +77,7 @@ int TST_CNT = 0;
 #define SMALL_RCVBUF 3000
 
 /* MAX segment size */
-#define SMALL_MAXSEG 100
+#define SMALL_MAXSEG 500
 
 /* RWND_SLOP is the extra data that fills up the rwnd */
 #define RWND_SLOP 100
--
Quoted 4 lines

2.7.4

Thanks.