|
2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | 3 | # |
4 | 4 | # This tests basic flowtable functionality. |
5 | | -# Creates following topology: |
| 5 | +# Creates following default topology: |
6 | 6 | # |
7 | 7 | # Originator (MTU 9000) <-Router1-> MTU 1500 <-Router2-> Responder (MTU 2000) |
8 | 8 | # Router1 is the one doing flow offloading, Router2 has no special |
9 | 9 | # purpose other than having a link that is smaller than either Originator |
10 | 10 | # and responder, i.e. TCPMSS announced values are too large and will still |
11 | 11 | # result in fragmentation and/or PMTU discovery. |
| 12 | +# |
| 13 | +# You can check with different Orgininator/Link/Responder MTU eg: |
| 14 | +# sh nft_flowtable.sh -o1000 -l500 -r100 |
| 15 | +# |
| 16 | + |
12 | 17 |
|
13 | 18 | # Kselftest framework requirement - SKIP code is 4. |
14 | 19 | ksft_skip=4 |
@@ -78,11 +83,24 @@ ip -net nsr2 addr add dead:2::1/64 dev veth1 |
78 | 83 | # ns2 is going via nsr2 with a smaller mtu, so that TCPMSS announced by both peers |
79 | 84 | # is NOT the lowest link mtu. |
80 | 85 |
|
81 | | -ip -net nsr1 link set veth0 mtu 9000 |
82 | | -ip -net ns1 link set eth0 mtu 9000 |
| 86 | +omtu=9000 |
| 87 | +lmtu=1500 |
| 88 | +rmtu=2000 |
| 89 | + |
| 90 | +while getopts "o:l:r:" o |
| 91 | +do |
| 92 | + case $o in |
| 93 | + o) omtu=$OPTARG;; |
| 94 | + l) lmtu=$OPTARG;; |
| 95 | + r) rmtu=$OPTARG;; |
| 96 | + esac |
| 97 | +done |
| 98 | + |
| 99 | +ip -net nsr1 link set veth0 mtu $omtu |
| 100 | +ip -net ns1 link set eth0 mtu $omtu |
83 | 101 |
|
84 | | -ip -net nsr2 link set veth1 mtu 2000 |
85 | | -ip -net ns2 link set eth0 mtu 2000 |
| 102 | +ip -net nsr2 link set veth1 mtu $rmtu |
| 103 | +ip -net ns2 link set eth0 mtu $rmtu |
86 | 104 |
|
87 | 105 | # transfer-net between nsr1 and nsr2. |
88 | 106 | # these addresses are not used for connections. |
@@ -136,7 +154,7 @@ table inet filter { |
136 | 154 | # as PMTUd is off. |
137 | 155 | # This rule is deleted for the last test, when we expect PMTUd |
138 | 156 | # to kick in and ensure all packets meet mtu requirements. |
139 | | - meta length gt 1500 accept comment something-to-grep-for |
| 157 | + meta length gt $lmtu accept comment something-to-grep-for |
140 | 158 |
|
141 | 159 | # next line blocks connection w.o. working offload. |
142 | 160 | # we only do this for reverse dir, because we expect packets to |
|
0 commit comments