Branch: refs/heads/stable1-proposed Home: https://github.com/kronosnet/kronosnet Commit: a3180d535d5eda741776231f33c3b4e11fc6b432 https://github.com/kronosnet/kronosnet/commit/a3180d535d5eda741776231f33c3b4... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2019-08-21 (Wed, 21 Aug 2019)
Changed paths: M libknet/threads_pmtud.c
Log Message: ----------- [PMTUd] fix MTU calculation when using crypto and add docs
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com
Commit: d9fa350f071d59a864cf7314e879cbcd54fce19f https://github.com/kronosnet/kronosnet/commit/d9fa350f071d59a864cf7314e879cb... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2019-08-21 (Wed, 21 Aug 2019)
Changed paths: M libknet/Makefile.am M libknet/crypto.c M libknet/crypto_model.h M libknet/crypto_nss.c M libknet/crypto_openssl.c M libknet/internals.h M libknet/links.c A libknet/onwire.c M libknet/onwire.h M libknet/tests/Makefile.am M libknet/tests/api_knet_send_crypto.c A libknet/tests/fun_pmtud_crypto.c M libknet/threads_common.c M libknet/threads_pmtud.c
Log Message: ----------- [PMTUd] rework the whole math to calculate MTU
internal changes: - drop the concept of sec_header_size that was completely wrong and unnecessary - bump crypto API to version 3 due to the above change - clarify the difference between link->proto_overhead and link->status->proto_overhead. We cannot rename the status one as it would also change ABI. - add onwire.c with documentation on the packet format and what various len(s) mean in context. - add 3 new functions to calculate MTUs back and forth and use them around, hopefully with enough clarification on why things are done in a given way. - heavily change thread_pmtud.c to use those new facilities. - fix major calculation issues when using crypto (non-crypto was not affected by the problem). - fix checks around to make sure they match the new math. - fix padding calculation. - add functional PMTUd crypto test this test can take several hours (12+) and should be executed on a controlled environment since it automatically changes loopback MTU to run tests. - fix way the lowest MTU is calculated during a PMTUd run to avoid spurious double notifications. - drop redundant checks.
user visible changes: - Global MTU is now calculated properly when using crypto and values will be in general bigger than before due to incorrect padding calculation in the previous implementation.
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com
Commit: 100293df41cea95f401292632cfe6e9085bb8f56 https://github.com/kronosnet/kronosnet/commit/100293df41cea95f401292632cfe6e... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2019-08-21 (Wed, 21 Aug 2019)
Changed paths: M libknet/internals.h M libknet/links.c M libknet/links.h M libknet/threads_pmtud.c
Log Message: ----------- [PMTUd] add dynamic pong timeout when using crypto
problem originally reported by proxmox community, users observed that under pressure the MTU would flap back and forth between 2 values due to other node response timeout.
implement a dynamic timeout multiplier when using crypto that should solve the problem in a more flexible fashion.
When a timeout hits, those new logs will show:
[knet]: [info] host: host: 1 (passive) best link: 0 (pri: 0) [knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0 [knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (4) for host 1 link: 0 [knet]: [info] pmtud: PMTUD link change for host: 1 link: 0 from 469 to 65429 [knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429 [knet]: [info] pmtud: Global data MTU changed to: 65429 [knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0 [knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (8) for host 1 link: 0 [knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (16) for host 1 link: 0 [knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (32) for host 1 link: 0 [knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (64) for host 1 link: 0 [knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429 [knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0 [knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (128) for host 1 link: 0 [knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429
and when the latency reduces and it is safe to be more responsive again:
[knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0 [knet]: [debug] pmtud: Decreasing PMTUd response timeout multiplier to (64) for host 1 link: 0 [knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429
....
testing this patch on normal hosts is a bit challenging tho.
Patch was tested by hardcoding a super low timeout here:
diff --git a/libknet/threads_pmtud.c b/libknet/threads_pmtud.c index 4f0ba0f..5e2b89b 100644 --- a/libknet/threads_pmtud.c +++ b/libknet/threads_pmtud.c @@ -261,7 +271,8 @@ retry: /* * crypto, under pressure, is a royal PITA */ - pong_timeout_adj_tmp = dst_link->pong_timeout_adj * 2; + //pong_timeout_adj_tmp = dst_link->pong_timeout_adj * dst_link->pmtud_crypto_timeout_multiplier; + pong_timeout_adj_tmp = 30 * dst_link->pmtud_crypto_timeout_multiplier; } else { pong_timeout_adj_tmp = dst_link->pong_timeout_adj; }
and using a long running version of api_knet_send_crypto_test with a short PMTUd setfreq (10 sec).
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com
Commit: ab490eefc14111fe7eb2df50258a42ab0efeae6a https://github.com/kronosnet/kronosnet/commit/ab490eefc14111fe7eb2df50258a42... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2019-08-21 (Wed, 21 Aug 2019)
Changed paths: M libknet/handle.c M libknet/internals.h M libknet/libknet.h M libknet/tests/api-check.mk A libknet/tests/api_knet_handle_pmtud_set.c M libknet/threads_pmtud.c M man/Makefile.am
Log Message: ----------- [PMTUd] add ability to manually override MTU and disable PMTUd
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com
Commit: 770ee3438b2fb333c702618c3ceb2b60d185ea12 https://github.com/kronosnet/kronosnet/commit/770ee3438b2fb333c702618c3ceb2b... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2019-08-21 (Wed, 21 Aug 2019)
Changed paths: M libknet/Makefile.am
Log Message: ----------- [build] bump soname to indicate new API call
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com
Compare: https://github.com/kronosnet/kronosnet/compare/006fbe6b2a52...770ee3438b2f