]> git.proxmox.com Git - mirror_kronosnet.git/log
mirror_kronosnet.git
6 years ago[man] fix casting around
Fabio M. Di Nitto [Tue, 23 Jan 2018 17:22:59 +0000 (18:22 +0100)]
[man] fix casting around

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[man] define _DEFAULT_SOURCE for new features.h
Fabio M. Di Nitto [Tue, 23 Jan 2018 17:17:39 +0000 (18:17 +0100)]
[man] define _DEFAULT_SOURCE for new features.h

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[man] add libqb and libxml2 devel as general buildrequires for man pages
Fabio M. Di Nitto [Tue, 23 Jan 2018 16:35:44 +0000 (17:35 +0100)]
[man] add libqb and libxml2 devel as general buildrequires for man pages

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agodoxyxml: Fix compiler warnings
Christine Caulfield [Tue, 23 Jan 2018 09:16:27 +0000 (09:16 +0000)]
doxyxml: Fix compiler warnings

6 years ago[man] add makefile.am
Fabio M. Di Nitto [Tue, 23 Jan 2018 06:10:27 +0000 (07:10 +0100)]
[man] add makefile.am

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[man] move doxyman to build-aux
Fabio M. Di Nitto [Tue, 23 Jan 2018 06:09:50 +0000 (07:09 +0100)]
[man] move doxyman to build-aux

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[man] drop redundant update-man-page code
Fabio M. Di Nitto [Thu, 7 Dec 2017 04:51:19 +0000 (05:51 +0100)]
[man] drop redundant update-man-page code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agomanpages: Generate man pages using our own command
Christine Caulfield [Mon, 22 Jan 2018 14:11:07 +0000 (14:11 +0000)]
manpages: Generate man pages using our own command

This removes the dependncy on doxy2man which is not
packaged.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agoUse LD_LIBRARY_PATH to find the build tree artifacts and disable RPATH across the...
Fabio M. Di Nitto [Fri, 19 Jan 2018 12:42:30 +0000 (13:42 +0100)]
Use LD_LIBRARY_PATH to find the build tree artifacts and disable RPATH across the project

The libtool wrapper scripts of the test binaries set LD_LIBRARY_PATH to
find the libknet library and its modules in the build tree, but RPATH
overrides this setting.  This is why RPATH is deprecated, so we switch
to RUNPATH instead by using --enable-new-dtags, which is already the
linker default on Debian for example.

Based on the original patch from Ferenc.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agotests: check for exported symbols in the data section as well
Ferenc Wágner [Thu, 18 Jan 2018 10:46:30 +0000 (11:46 +0100)]
tests: check for exported symbols in the data section as well

The PowerPC64 ELFv1 ABI puts the function descriptor symbols there,
but why restrict the consistency check to the text section anyway?

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agotypo fix: change the url in spec file
Bin Liu [Wed, 17 Jan 2018 07:49:38 +0000 (15:49 +0800)]
typo fix: change the url in spec file

6 years agoMerge pull request #112 from kronosnet/man-pages v1.0
Fabio M. Di Nitto [Mon, 8 Jan 2018 15:26:05 +0000 (16:26 +0100)]
Merge pull request #112 from kronosnet/man-pages

[docs] Update copyright and man pages pre-1.0

6 years ago[docs] Update copyright and man pages pre-1.0
Fabio M. Di Nitto [Mon, 8 Jan 2018 14:36:47 +0000 (15:36 +0100)]
[docs] Update copyright and man pages pre-1.0

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #111 from kronosnet/fixes
Fabio M. Di Nitto [Mon, 8 Jan 2018 13:55:38 +0000 (14:55 +0100)]
Merge pull request #111 from kronosnet/fixes

Fixes

6 years ago[PMTUd] drop (now) unnecessary and dangerous usleep
Fabio M. Di Nitto [Mon, 8 Jan 2018 11:12:19 +0000 (12:12 +0100)]
[PMTUd] drop (now) unnecessary and dangerous usleep

prior to all threads being able to notify PMTUd of EMSGSIZE errors,
we had this random usleep in there to have time to collect data.
It was working at the time, but it's a bad idea.

On super large clusters (>66 nodes) with 4 links on each node, when
applying heavy load (cpghum on all nodes at once), the average latency
between nodes can increase so much that the PMTUd thread usleep
could literally block corosync for seconds at a time.

Drop the usleep and live happily ever after

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] reset value or suffer the pains of DEADLOCKING! errno is per thread, not...
Fabio M. Di Nitto [Mon, 8 Jan 2018 11:11:32 +0000 (12:11 +0100)]
[PMTUd] reset value or suffer the pains of DEADLOCKING! errno is per thread, not per function

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] only notify PMTUd when pmtud_running and don't force a run to avoid lock...
Fabio M. Di Nitto [Mon, 8 Jan 2018 11:09:40 +0000 (12:09 +0100)]
[PMTUd] only notify PMTUd when pmtud_running and don't force a run to avoid lock fighting

When we request a writelock, we should notify PMTUd to abort and cond_signal only
if PMTUd is running.

Also, don't request an immediate rerun as we cannot guarantee that the scheduling
is favourable to our request and we could end up waiting forever.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[stats] show loopback links as connected
Fabio M. Di Nitto [Mon, 8 Jan 2018 11:08:32 +0000 (12:08 +0100)]
[stats] show loopback links as connected

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #105 from kronosnet/scale
Fabio M. Di Nitto [Fri, 5 Jan 2018 09:15:37 +0000 (10:15 +0100)]
Merge pull request #105 from kronosnet/scale

Scale

6 years ago[PMTUd] more typo fixes
Fabio M. Di Nitto [Thu, 4 Jan 2018 16:45:50 +0000 (17:45 +0100)]
[PMTUd] more typo fixes

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agomeeeehhhhhh fixed on the top comment, forgot the bottom one
Fabio M. Di Nitto [Thu, 4 Jan 2018 16:44:16 +0000 (17:44 +0100)]
meeeehhhhhh fixed on the top comment, forgot the bottom one

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] cleanup variable usage and code around it
Fabio M. Di Nitto [Thu, 4 Jan 2018 16:38:56 +0000 (17:38 +0100)]
[PMTUd] cleanup variable usage and code around it

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agofix missing space
Christine Caulfield [Thu, 4 Jan 2018 15:43:10 +0000 (15:43 +0000)]
fix missing space

6 years ago[PMTUd] amend warning message
Fabio M. Di Nitto [Sun, 31 Dec 2017 05:44:00 +0000 (06:44 +0100)]
[PMTUd] amend warning message

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] generate warning when there is a timeout receiving a response
Fabio M. Di Nitto [Sun, 31 Dec 2017 05:32:40 +0000 (06:32 +0100)]
[PMTUd] generate warning when there is a timeout receiving a response

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] if PMTUd is rescheduled, then enforce a new run
Fabio M. Di Nitto [Sat, 30 Dec 2017 10:07:41 +0000 (11:07 +0100)]
[PMTUd] if PMTUd is rescheduled, then enforce a new run

the usleep between each PMTUd run will give time to the other threads to grab the wrlock

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] make PMTUd force_run notification more quiet
Fabio M. Di Nitto [Sat, 30 Dec 2017 05:30:41 +0000 (06:30 +0100)]
[PMTUd] make PMTUd force_run notification more quiet

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PTMUd] if any threads receives a EMSGSIZE outside of a PMTUD run, force PTMUd to run
Fabio M. Di Nitto [Sat, 30 Dec 2017 05:19:13 +0000 (06:19 +0100)]
[PTMUd] if any threads receives a EMSGSIZE outside of a PMTUD run, force PTMUd to run

Scenario:

node X has MTU Y on the interface and application is sending packets with size >= Y.

The interface MTU is suddenly reduced to < Y

Before this change, the kernel would be dropping packets till the next PMTUd run.

After this change, the PMTUd will be informed that it has to rerun (overriding
the pmtud_interval), reducing the packet drop to a minimum.

How to test:

force knet_bench to send 1500 size packets with ping_data (requires code change)
and start it.

reduce MTU on the interface from 1500 to 1300 (for example)

Notice an immediate trigger of PMTUd run in debug mode

Note: going up, from 1300 to 1500 will wait for the next PMTUd re-run as there
is no immediate way to detect this change unless we start listening to kernel
netlink sockets with libnl3 (investigation in progress but not critical enough atm).

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] rename pmtud_running to pmtud_waiting
Fabio M. Di Nitto [Sat, 30 Dec 2017 04:33:59 +0000 (05:33 +0100)]
[PMTUd] rename pmtud_running to pmtud_waiting

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PTMUd] by using a safe PMTU to init a link, we can shave down corosync membership...
Fabio M. Di Nitto [Fri, 29 Dec 2017 08:53:49 +0000 (09:53 +0100)]
[PTMUd] by using a safe PMTU to init a link, we can shave down corosync membership creation by 25%

tested on a 9 node cluster with 2 links each node, going down from 4 seconds to 3 seconds

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[PMTUd] Use kernel MTU information to determine next packet size during discovery
Fabio M. Di Nitto [Fri, 29 Dec 2017 05:26:00 +0000 (06:26 +0100)]
[PMTUd] Use kernel MTU information to determine next packet size during discovery

Using this information we can, for good links (*), determine and verify the link
MTU with 2 packets.

* good links means:
node X has MTU Y configured on a given interface. Any network object between node X
and destination is capable of handling MTU >= Y.
In no case the kernel will allow us to send packets > Y.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[stats] report correct MTU for loopback links
Fabio M. Di Nitto [Wed, 27 Dec 2017 05:37:20 +0000 (06:37 +0100)]
[stats] report correct MTU for loopback links

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #108 from kronosnet/minor-fixes
Fabio M. Di Nitto [Wed, 3 Jan 2018 13:29:04 +0000 (14:29 +0100)]
Merge pull request #108 from kronosnet/minor-fixes

Minor fixes

6 years ago[tests] add missing break (detected by newer gcc)
Fabio M. Di Nitto [Wed, 3 Jan 2018 11:38:04 +0000 (12:38 +0100)]
[tests] add missing break (detected by newer gcc)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] knet_bench: allow to specify protocol (UDP/SCTP) per link
Fabio M. Di Nitto [Wed, 3 Jan 2018 10:05:46 +0000 (11:05 +0100)]
[tests] knet_bench: allow to specify protocol (UDP/SCTP) per link

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] knet_bench: add machine parsable output
Fabio M. Di Nitto [Wed, 3 Jan 2018 09:23:15 +0000 (10:23 +0100)]
[tests] knet_bench: add machine parsable output

this is done by adding prefixes to different messages to make it easier
to grep/awk and changing format of [perf] to reflect cpghum syntax.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] knet_bench allow to configure PMTUd interval from CLI
Fabio M. Di Nitto [Wed, 3 Jan 2018 08:27:08 +0000 (09:27 +0100)]
[tests] knet_bench allow to configure PMTUd interval from CLI

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] fix regression in knet_bench introduced accidentaly by 2052faab4376107fe99e8a...
Fabio M. Di Nitto [Wed, 3 Jan 2018 07:58:50 +0000 (08:58 +0100)]
[tests] fix regression in knet_bench introduced accidentaly by 2052faab4376107fe99e8a3f955bbcbfa426f648

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[openssl] drop unnecessary reference counter
Fabio M. Di Nitto [Wed, 3 Jan 2018 06:12:43 +0000 (07:12 +0100)]
[openssl] drop unnecessary reference counter

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #109 from kronosnet/lzo2
wferi [Wed, 3 Jan 2018 11:56:24 +0000 (12:56 +0100)]
Merge pull request #109 from kronosnet/lzo2

build: work around broken pkg-config file in lzo2 version 2.10

6 years agobuild: work around broken pkg-config file in lzo2 version 2.10
Ferenc Wágner [Tue, 2 Jan 2018 21:33:08 +0000 (22:33 +0100)]
build: work around broken pkg-config file in lzo2 version 2.10

In principle this isn't specific to BSD, though 2.10 is only packaged
for BSDs at the moment.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoMerge pull request #106 from kronosnet/openssl-fixes
Fabio M. Di Nitto [Tue, 2 Jan 2018 19:04:52 +0000 (20:04 +0100)]
Merge pull request #106 from kronosnet/openssl-fixes

[openssl] fix openssl1.0 crash by implementing documented locking cal…

6 years ago[openssl] fix openssl1.0 crash by implementing documented locking callbacks
Fabio M. Di Nitto [Tue, 2 Jan 2018 16:23:02 +0000 (17:23 +0100)]
[openssl] fix openssl1.0 crash by implementing documented locking callbacks

openssl < 1.1.0 do not support natively multithread applications and need
some extra help from the application itself to provide locking callbacks.

https://www.openssl.org/docs/man1.0.2/crypto/threads.html
https://www.openssl.org/blog/blog/2017/02/21/threads/

to test this fix is necessary to use knet_bench or corosync with openssl
and lots of heavy load (perf benchmark) workload. Sooner or later
the application will crash with some random tracebacks.

after this patch, the crash cannot be reproduced anymore.

tested using 9 nodes x2 active/active links all running corosync + cpghum

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #99 from kronosnet/skip
Fabio M. Di Nitto [Tue, 19 Dec 2017 14:50:52 +0000 (15:50 +0100)]
Merge pull request #99 from kronosnet/skip

Skip tests if socket buffers are inadequate

6 years agoRemove spaces after function names
Ferenc Wágner [Tue, 19 Dec 2017 14:01:50 +0000 (15:01 +0100)]
Remove spaces after function names

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoAnything that stops operation and returns an error should be log_err
Ferenc Wágner [Tue, 19 Dec 2017 13:58:09 +0000 (14:58 +0100)]
Anything that stops operation and returns an error should be log_err

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoDocument knet-specific errno values
Ferenc Wágner [Tue, 19 Dec 2017 11:18:14 +0000 (12:18 +0100)]
Document knet-specific errno values

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoMore fine-grained error handling
Ferenc Wágner [Tue, 19 Dec 2017 11:17:50 +0000 (12:17 +0100)]
More fine-grained error handling

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agotests: skip if socket buffers are too small
Ferenc Wágner [Mon, 18 Dec 2017 20:38:50 +0000 (21:38 +0100)]
tests: skip if socket buffers are too small

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agotests: replace open coded error handling with knet_handle_start() calls
Ferenc Wágner [Mon, 18 Dec 2017 20:31:45 +0000 (21:31 +0100)]
tests: replace open coded error handling with knet_handle_start() calls

Done by:
$ sed -i -e '1h;2,$H;$!d;g' -e 's/knet_h = knet_handle_new(1, logfds\[1\], \(KNET_LOG_[A-Z]*\));\n\n\tif (!knet_h) {\n\t\tprintf("knet_handle_new failed: %s\\n", strerror(errno));\n\t\tflush_logs(logfds\[0\], stdout);\n\t\tclose_logpipes(logfds);\n\t\texit(FAIL);\n\t}/knet_h = knet_handle_start(logfds, \1);/g' libknet/tests/*.c

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agotests: introduce knet_handle_start helper
Ferenc Wágner [Mon, 18 Dec 2017 18:08:31 +0000 (19:08 +0100)]
tests: introduce knet_handle_start helper

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoReport ENAMETOOLONG if socket buffers are too small
Ferenc Wágner [Sat, 16 Dec 2017 21:00:37 +0000 (22:00 +0100)]
Report ENAMETOOLONG if socket buffers are too small

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoMerge pull request #103 from kronosnet/mtu-lock
Fabio M. Di Nitto [Tue, 19 Dec 2017 10:28:14 +0000 (11:28 +0100)]
Merge pull request #103 from kronosnet/mtu-lock

[PMTUd] fix external API and PMTUd interaction

6 years ago[PMTUd] fix external API and PMTUd interaction
Fabio M. Di Nitto [Sun, 17 Dec 2017 08:33:53 +0000 (09:33 +0100)]
[PMTUd] fix external API and PMTUd interaction

The problem:

PMTUd can take a long time to release the global read lock, mostly due
to the pthread_cond_timedwait required to ack/nack packets from the
other hosts. This delay could block any wrlock operation for several seconds
if not more.

The solution:

each call to the global pthread_rwlock_wrlock has been changed to a wrapper
that will notify the PMTUd to interrupt its operations (and restart) first,
then get a global write lock that is queued as soon as PMTUd is going out.

This solution also improves a lot shutdown speed.

How to test:

This is not super simple to test and verify. I used 2 VMs with known MTU of
1500. Start knet_bench on both (normal ping_data -C is more than enough).
Once they have established data exchange, change the MTU on one of the nodes
to 1600 (or higher). This should guarantee that the PMTUd process will take
a very long time to complete.
First verify that the PMTUd process takes several seconds.
Once the next PMTUd run starts, hit ctrl+c on the node that is executing
the PMTUd and the process should exit much faster than before this patch.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #104 from kronosnet/spelling
Fabio M. Di Nitto [Mon, 18 Dec 2017 19:13:06 +0000 (20:13 +0100)]
Merge pull request #104 from kronosnet/spelling

Spelling fixes

6 years agoFix typo and capitalization
Ferenc Wágner [Sun, 17 Dec 2017 20:49:20 +0000 (21:49 +0100)]
Fix typo and capitalization

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoFix grammar (allow requires an object)
Ferenc Wágner [Sun, 17 Dec 2017 20:48:00 +0000 (21:48 +0100)]
Fix grammar (allow requires an object)

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoMerge pull request #102 from kronosnet/clang v0.9
Fabio M. Di Nitto [Fri, 15 Dec 2017 16:39:27 +0000 (17:39 +0100)]
Merge pull request #102 from kronosnet/clang

Clang

6 years ago[build] define conditionals only once
Fabio M. Di Nitto [Fri, 15 Dec 2017 10:34:01 +0000 (11:34 +0100)]
[build] define conditionals only once

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[build] workaround BSD / clang breakage
Fabio M. Di Nitto [Fri, 15 Dec 2017 08:34:43 +0000 (09:34 +0100)]
[build] workaround BSD / clang breakage

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[build] fix clang builds
Fabio M. Di Nitto [Fri, 15 Dec 2017 07:02:33 +0000 (08:02 +0100)]
[build] fix clang builds

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #101 from kronosnet/mtu2
Fabio M. Di Nitto [Fri, 15 Dec 2017 09:22:17 +0000 (10:22 +0100)]
Merge pull request #101 from kronosnet/mtu2

[PMTUd] fix multiple issues and stability problems

6 years ago[PMTUd] fix multiple issues and stability problems
Fabio M. Di Nitto [Thu, 14 Dec 2017 03:11:56 +0000 (04:11 +0100)]
[PMTUd] fix multiple issues and stability problems

- resolve locking issue with thread_heartbeat that was causing
  spurious up/down link event.
  In the event of a PMTUd run taking too long, the heartbeat
  thread could hang for much longer than ping_timeout.
  Use backoff_mutex to sync between threads instead of the global lock.

- pause the DATA tx thread when sending any PMTUd related packets.
  Similar method as knet_send_sync, using the tx_mutex, allows a much
  more stable communication between nodes without any visible performance
  hit.

- calculate higher timeouts when using crypto to improve stability

- fix an odd race condition with the kernel where, during a single PMTUd run,
  the same packet size was marked both BAD and GOOD (via EMSGSIZE) by the
  kernel. That situation would cause our PMTUd to run away and calculate
  bad values.

- add a minor usleep between sending PMTUd packets to give time to the
  kernel to make its own mind about the link PMTU. This is based on average
  latency.

- since PMTUd can take several seconds before completion, use the "end time"
  to record the last run vs the start time.

- fix a major issue in sending PMTUd reply where an errno was not being
  passed down the link layer and would cause the RX thread to block forever.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #98 from liu4480/add-debuginfo
Fabio M. Di Nitto [Sat, 9 Dec 2017 05:16:58 +0000 (06:16 +0100)]
Merge pull request #98 from liu4480/add-debuginfo

allow to choose whether to build debuginfo packages or not

6 years agoallow to choose whether to build debuginfo packages or not
Bin Liu [Thu, 7 Dec 2017 06:48:57 +0000 (14:48 +0800)]
allow to choose whether to build debuginfo packages or not

1. If not "--enable-rpm-debuginfo" or "--disable-rpm-debuginfo" is
specified, follow the system default behavior
2. If set, then build debuginfo package or not build based on the
flag.

6 years agoMerge pull request #96 from kronosnet/modules2
Fabio M. Di Nitto [Tue, 5 Dec 2017 07:54:24 +0000 (08:54 +0100)]
Merge pull request #96 from kronosnet/modules2

Modules2

6 years agobuild: remove useless assignment
Ferenc Wágner [Mon, 4 Dec 2017 22:27:56 +0000 (23:27 +0100)]
build: remove useless assignment

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agobuild: use AS_HELP_STRING for consistent formatting
Ferenc Wágner [Mon, 4 Dec 2017 22:25:58 +0000 (23:25 +0100)]
build: use AS_HELP_STRING for consistent formatting

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agobuild: recover original option ordering
Ferenc Wágner [Mon, 4 Dec 2017 22:00:52 +0000 (23:00 +0100)]
build: recover original option ordering

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agobuild: move more repetitive module work into our Autoconf macro
Ferenc Wágner [Mon, 4 Dec 2017 21:44:08 +0000 (22:44 +0100)]
build: move more repetitive module work into our Autoconf macro

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years agoCheck ABI version on module load
Ferenc Wágner [Mon, 4 Dec 2017 21:39:20 +0000 (22:39 +0100)]
Check ABI version on module load

Signed-off-by: Ferenc Wágner <wferi@debian.org>
6 years ago[tests] drop obsoleted tests that are broken after moving to the new modules format
Fabio M. Di Nitto [Mon, 4 Dec 2017 20:29:46 +0000 (21:29 +0100)]
[tests] drop obsoleted tests that are broken after moving to the new modules format

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] make module tests dynamic by using internal knowledge of what is built or not
Fabio M. Di Nitto [Mon, 4 Dec 2017 05:25:07 +0000 (06:25 +0100)]
[tests] make module tests dynamic by using internal knowledge of what is built or not

drop all related #ifdef as well

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[modules] update valgrind BSD exceptions
Fabio M. Di Nitto [Wed, 29 Nov 2017 08:34:55 +0000 (09:34 +0100)]
[modules] update valgrind BSD exceptions

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[modules] spec file: fix directory shipping
Fabio M. Di Nitto [Wed, 29 Nov 2017 13:05:57 +0000 (14:05 +0100)]
[modules] spec file: fix directory shipping

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[modules] update spec file to ship modules in separate rpms + meta packages
Fabio M. Di Nitto [Wed, 29 Nov 2017 12:34:37 +0000 (13:34 +0100)]
[modules] update spec file to ship modules in separate rpms + meta packages

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoUnify compress and crypto module loaders
Ferenc Wágner [Thu, 30 Nov 2017 08:41:32 +0000 (09:41 +0100)]
Unify compress and crypto module loaders

6 years agoUnify crypto module initialization functions
Ferenc Wágner [Thu, 30 Nov 2017 00:57:57 +0000 (01:57 +0100)]
Unify crypto module initialization functions

Taken from Fabio M. Di Nitto.

6 years agolibknet.h uses ssize_t, include its definition directly
Ferenc Wágner [Tue, 28 Nov 2017 07:28:24 +0000 (08:28 +0100)]
libknet.h uses ssize_t, include its definition directly

This fixes the BSD build.

6 years agoPass log_msg to the plugins
Ferenc Wágner [Wed, 29 Nov 2017 18:34:21 +0000 (19:34 +0100)]
Pass log_msg to the plugins

6 years agoSwitch over all plugins to the module system
Ferenc Wágner [Tue, 28 Nov 2017 00:13:03 +0000 (01:13 +0100)]
Switch over all plugins to the module system

6 years agoMake the bzip2 compress plugin a proper module
Ferenc Wágner [Mon, 27 Nov 2017 21:35:42 +0000 (22:35 +0100)]
Make the bzip2 compress plugin a proper module

Our current practice of dlopening foreign shared libraries is problematic
for several reasons:
* not portable: modules and shared libraries can be different object types
* dependency information is invisible (our canaries mostly solve this)
* hardwiring SONAMES breaks on transitions (KNET_PKG_SONAME solves this)
* symbol versioning information is lost (theoretically solvable)

The preferred way out is generating dynamically loaded private modules
from the main source, which then rely on the dynamic linker to load the
external symbols as usual.

6 years agoSeparate compress_model_t definition into a new header file
Ferenc Wágner [Mon, 27 Nov 2017 20:52:31 +0000 (21:52 +0100)]
Separate compress_model_t definition into a new header file

We'll use this type together with the zlib headers, which clash with
our compress.h because both define a function named compress.

6 years agoMerge pull request #94 from kronosnet/sock
Fabio M. Di Nitto [Tue, 28 Nov 2017 16:02:54 +0000 (17:02 +0100)]
Merge pull request #94 from kronosnet/sock

[transport] make the new derooted sock management less chatty

6 years ago[transports] add logging around setsockopts that have specific per distro/include...
Fabio M. Di Nitto [Tue, 28 Nov 2017 15:17:34 +0000 (16:17 +0100)]
[transports] add logging around setsockopts that have specific per distro/include requirements

this is helpful to determine if a given option has been built-in and/or activated
properly

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[transport] add missing include files and really fix 86c81a32cfccde1dea
Fabio M. Di Nitto [Tue, 28 Nov 2017 09:48:58 +0000 (10:48 +0100)]
[transport] add missing include files and really fix 86c81a32cfccde1dea

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[transport] consistency is not optional :-)
Fabio M. Di Nitto [Tue, 28 Nov 2017 08:53:21 +0000 (09:53 +0100)]
[transport] consistency is not optional :-)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[transport] fix errno handling
Fabio M. Di Nitto [Tue, 28 Nov 2017 08:52:08 +0000 (09:52 +0100)]
[transport] fix errno handling

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[transport] make the new derooted sock management less chatty
Fabio M. Di Nitto [Tue, 28 Nov 2017 08:49:41 +0000 (09:49 +0100)]
[transport] make the new derooted sock management less chatty

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years agoMerge pull request #91 from kronosnet/no-root
Fabio M. Di Nitto [Mon, 27 Nov 2017 14:51:17 +0000 (15:51 +0100)]
Merge pull request #91 from kronosnet/no-root

Enable testing without root privileges

6 years agoDetailed error reporting about socket buffer sizes
Ferenc Wágner [Mon, 27 Nov 2017 12:02:12 +0000 (13:02 +0100)]
Detailed error reporting about socket buffer sizes

6 years agoRemove the need_root() function
Ferenc Wágner [Sun, 26 Nov 2017 09:29:25 +0000 (10:29 +0100)]
Remove the need_root() function

The point is not having root privileges, but having high enough socket
buffer caps.  Very few of the test can run without it.

6 years agoDon't require root privileges unless necessary
Ferenc Wágner [Wed, 22 Nov 2017 22:10:33 +0000 (23:10 +0100)]
Don't require root privileges unless necessary

On Linux, if /proc/sys/net/core/[rw]mem_max are set to at least
8388608 (KNET_RING_RCVBUFF), setting the socket buffer sizes
doesn't require root privileges.

FreeBSD uses the kern.ipc.maxsockbuf sysctl MIB variable for
capping user buffer requests.

Linux doubles the requested amount for administrative overhead,
but FreeBSD does not, so we can't be too strict when checking
the results.

6 years agoMerge pull request #93 from kronosnet/dynamic-pong
Fabio M. Di Nitto [Sat, 25 Nov 2017 12:29:10 +0000 (13:29 +0100)]
Merge pull request #93 from kronosnet/dynamic-pong

Dynamic pong

6 years ago[tests] workaround buggy valgrind-freebsd implementation.
Fabio M. Di Nitto [Sat, 25 Nov 2017 10:42:10 +0000 (11:42 +0100)]
[tests] workaround buggy valgrind-freebsd implementation.

valgrind is not officially supported on FreeBSD. The current valgrind-freebsd
port is maintained separately and it's lagging several releases behind
vs upstream valgrind.

When running knet+openssl+valgrind on x86_64, with high pthread_cond_timedwait
configuration, valgrind appears to be stuck tracing openssl internal operations
to the point that the internal knet RX thread is not scheduled for minutes.
At that point all processes will go kaboom (heartbeat, PMTUd, etc) almost constantly
failing this test.

Given that all other architectures and OSes can run this test happily, I am adding
this exception to the test suite, to be re-evaluated in future if newer versions
of valgrind will be available on FreeBSD.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] don't duplicate test
Fabio M. Di Nitto [Fri, 24 Nov 2017 14:23:30 +0000 (15:23 +0100)]
[tests] don't duplicate test

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] use a new tunable functions to wait for packets
Fabio M. Di Nitto [Fri, 24 Nov 2017 12:56:42 +0000 (13:56 +0100)]
[tests] use a new tunable functions to wait for packets

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[tests] when running under valgrind, allow a lot more time for host to be reachable
Fabio M. Di Nitto [Fri, 24 Nov 2017 11:29:37 +0000 (12:29 +0100)]
[tests] when running under valgrind, allow a lot more time for host to be reachable

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[links] fix description
Fabio M. Di Nitto [Fri, 24 Nov 2017 11:29:17 +0000 (12:29 +0100)]
[links] fix description

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
6 years ago[links] add pong_timeout backoff mechanism to deal with high latency links
Fabio M. Di Nitto [Fri, 24 Nov 2017 10:36:52 +0000 (11:36 +0100)]
[links] add pong_timeout backoff mechanism to deal with high latency links

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>