]> git.proxmox.com Git - mirror_kronosnet.git/log
mirror_kronosnet.git
7 years agoResolves signed-unsigned comparison warnings
Fabio M. Di Nitto [Sat, 3 Jun 2017 07:22:45 +0000 (09:22 +0200)]
Resolves signed-unsigned comparison warnings

Patch based on:

commit 730a8b6a56820741b361e0907eecb6297a9f0348
Author: Michael Jones <jonesmz@jonesmz.com>

Resolves: https://github.com/fabbione/kronosnet/pull/40

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoFixes format=signedness related warnings
Michael Jones [Mon, 29 May 2017 23:56:42 +0000 (18:56 -0500)]
Fixes format=signedness related warnings

7 years agoAdds additional warning flags to the compiler, no new warnings unhidden
Michael Jones [Mon, 29 May 2017 23:30:38 +0000 (18:30 -0500)]
Adds additional warning flags to the compiler, no new warnings unhidden

7 years ago[sctp] Don't hold global_rwlock while sleeping.
Christine Caulfield [Fri, 26 May 2017 13:18:11 +0000 (14:18 +0100)]
[sctp] Don't hold global_rwlock while sleeping.

The SCTP connect and accept threads can do small sleeps
when there are errors. The global_rwlock should not be held
while this is happening.

While the lock is a read lock and doesn't block sending and
receiving in other threads it can cause a deadlock on shutdown.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years ago[libknet] Unlock the global lock if logging pipe is full.
Christine Caulfield [Fri, 26 May 2017 08:46:21 +0000 (09:46 +0100)]
[libknet] Unlock the global lock if logging pipe is full.

If a write to the logging pipe fails (eg it's busy
waiting on something else, I've seen this in corosync
at shutdown) then we must unlock the global_rwlock
or we'll never get out of this alive.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[libknet] Add TC_PRIO_INTERACTIVE to sockets
Christine Caulfield [Thu, 11 May 2017 09:40:42 +0000 (10:40 +0100)]
[libknet] Add TC_PRIO_INTERACTIVE to sockets

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agoMerge pull request #36 from liu4480/remove-if-defined-i386
Fabio M. Di Nitto [Wed, 19 Apr 2017 09:41:32 +0000 (11:41 +0200)]
Merge pull request #36 from liu4480/remove-if-defined-i386

use PRIu64 to replace #if defined(__i386__)

7 years agouse PRIu64 to replace #if defined(__i386__)
Bin Liu [Wed, 19 Apr 2017 08:44:29 +0000 (16:44 +0800)]
use PRIu64 to replace #if defined(__i386__)

7 years ago[libknet] Add some includes to allow FreeBSD compilation
Christine Caulfield [Thu, 13 Apr 2017 09:53:34 +0000 (10:53 +0100)]
[libknet] Add some includes to allow FreeBSD compilation

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoMerge pull request #35 from liu4480/type-fixes
Fabio M. Di Nitto [Thu, 13 Apr 2017 09:07:07 +0000 (11:07 +0200)]
Merge pull request #35 from liu4480/type-fixes

fix compile errors on i386/i686 for knet_bench.c
Resolves: #34

7 years agofix compile errors on i386/i686 for knet_bench.c
bliu [Thu, 13 Apr 2017 09:00:27 +0000 (17:00 +0800)]
fix compile errors on i386/i686 for knet_bench.c

7 years agoMerge pull request #33 from liu4480/type-fixes
Fabio M. Di Nitto [Thu, 13 Apr 2017 08:21:27 +0000 (10:21 +0200)]
Merge pull request #33 from liu4480/type-fixes

fix compile errors on i686

7 years agofix compile errors on i686
bliu [Thu, 13 Apr 2017 06:19:09 +0000 (14:19 +0800)]
fix compile errors on i686

7 years ago[docs] update slids a tiny bit
Fabio M. Di Nitto [Fri, 17 Mar 2017 07:11:51 +0000 (08:11 +0100)]
[docs] update slids a tiny bit

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tx] reduce memory usage and memmove on big pckts via better iovec mapping
Fabio M. Di Nitto [Sun, 26 Feb 2017 07:06:52 +0000 (08:06 +0100)]
[tx] reduce memory usage and memmove on big pckts via better iovec mapping

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[build] fix clang errors
Fabio M. Di Nitto [Wed, 1 Mar 2017 18:23:59 +0000 (19:23 +0100)]
[build] fix clang errors

this should fix https://github.com/fabbione/kronosnet/issues/32

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoMerge pull request #30 from jfriesse/shadow-time
Fabio M. Di Nitto [Tue, 28 Feb 2017 04:14:38 +0000 (05:14 +0100)]
Merge pull request #30 from jfriesse/shadow-time

[knet_bench]: Fix shadow declaration of time

7 years ago[knet_bench]: Fix shadow declaration of time
Jan Friesse [Mon, 27 Feb 2017 17:05:01 +0000 (18:05 +0100)]
[knet_bench]: Fix shadow declaration of time

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
7 years ago[transports] add option to configure reconnect interval
Fabio M. Di Nitto [Sat, 25 Feb 2017 05:29:06 +0000 (06:29 +0100)]
[transports] add option to configure reconnect interval

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[hb] use savederrno correctly
Fabio M. Di Nitto [Fri, 24 Feb 2017 09:48:29 +0000 (10:48 +0100)]
[hb] use savederrno correctly

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tests] knet_bench add support for perf-by-time
Fabio M. Di Nitto [Thu, 23 Feb 2017 07:52:25 +0000 (08:52 +0100)]
[tests] knet_bench add support for perf-by-time

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tests] add first cut of perf-by-size implementation to knet_bench
Fabio M. Di Nitto [Thu, 23 Feb 2017 07:12:41 +0000 (08:12 +0100)]
[tests] add first cut of perf-by-size implementation to knet_bench

Also port to _sendmmsg/_recvmmsg and fix a couple of minor shutdown issues

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tests] don't spam for no logs
Fabio M. Di Nitto [Wed, 22 Feb 2017 13:40:06 +0000 (14:40 +0100)]
[tests] don't spam for no logs

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] fix sendmmsg and recvmmsg wrappers to return correct data
Fabio M. Di Nitto [Wed, 22 Feb 2017 07:49:23 +0000 (08:49 +0100)]
[transport] fix sendmmsg and recvmmsg wrappers to return correct data

for sendmmsg also don't overwrite the msg_len

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[libknet] drop bad doc copy/paste
Fabio M. Di Nitto [Tue, 21 Feb 2017 08:27:57 +0000 (09:27 +0100)]
[libknet] drop bad doc copy/paste

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoMerge pull request #29 from liu4480/master
Fabio M. Di Nitto [Tue, 21 Feb 2017 08:26:49 +0000 (09:26 +0100)]
Merge pull request #29 from liu4480/master

add doc for knet_handle_get_channel in libknet/libknet.h

7 years agoadd doc for knet_handle_get_channel in libknet/libknet.h
Bin Liu [Tue, 21 Feb 2017 08:16:03 +0000 (16:16 +0800)]
add doc for knet_handle_get_channel in libknet/libknet.h

7 years ago[build] add better header protection
Fabio M. Di Nitto [Tue, 21 Feb 2017 05:18:05 +0000 (06:18 +0100)]
[build] add better header protection

fixes: https://github.com/fabbione/kronosnet/issues/23

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[build] Enforce C99 compile option
Fabio M. Di Nitto [Tue, 21 Feb 2017 05:03:12 +0000 (06:03 +0100)]
[build] Enforce C99 compile option

fixes: https://github.com/fabbione/kronosnet/pull/25

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[sctp] fix more occurrences of link -> kn_link
Fabio M. Di Nitto [Tue, 21 Feb 2017 04:44:13 +0000 (05:44 +0100)]
[sctp] fix more occurrences of link -> kn_link

complete 940833bf99b18e14b08c0a5a24402026131a0884

fixes: https://github.com/fabbione/kronosnet/issues/28

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[build] don't relink the whole test suite on each change
Fabio M. Di Nitto [Tue, 21 Feb 2017 04:33:53 +0000 (05:33 +0100)]
[build] don't relink the whole test suite on each change

fixes: https://github.com/fabbione/kronosnet/issues/27

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoMerge pull request #21 from liu4480/master
Fabio M. Di Nitto [Fri, 17 Feb 2017 15:41:59 +0000 (16:41 +0100)]
Merge pull request #21 from liu4480/master

Fix: remove duplicate judgement of (have_name < 0) in kronosnetd/vty_cli_cmds.c

7 years agoFix: remove duplicate judgement of (have_name < 0) in kronosnetd/vty_cli_cmds.c
Bin Liu [Fri, 17 Feb 2017 07:44:43 +0000 (15:44 +0800)]
Fix: remove duplicate judgement of (have_name < 0) in kronosnetd/vty_cli_cmds.c

In line 1087 of kronosnetd/vty_cli_cmds.c, there is a judgement of
(have_name < 0), when have_name < 0, it will return 0, which make
the judge of have_name < 0 in line 1094 will never be executed.
Remove the unnecessary judgement.

7 years ago[tests] port knet_bench to use internal version recvmmsg
Fabio M. Di Nitto [Wed, 15 Feb 2017 15:51:28 +0000 (16:51 +0100)]
[tests] port knet_bench to use internal version recvmmsg

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[global] drop usage of recvmmsg inside libknet
Fabio M. Di Nitto [Wed, 15 Feb 2017 15:26:37 +0000 (16:26 +0100)]
[global] drop usage of recvmmsg inside libknet

as requested by different kernel developers, we should stop
using both sendmmsg and recvmmsg.

as temporary solution use Jan's compat wrappers. the whole TX/RX
code will need review to do a full proper switch since all
error codes will change and propagate differently to transport hooks
and knet_send_sync users

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[global] drop usage of sendmmsg inside libknet
Fabio M. Di Nitto [Wed, 15 Feb 2017 14:08:34 +0000 (15:08 +0100)]
[global] drop usage of sendmmsg inside libknet

as requested by different kernel developers, we should stop
using both sendmmsg and recvmmsg.

as temporary solution use Jan's compat wrappers. the whole TX/RX
code will need review to do a full proper switch since all
error codes will change and propagate differently to transport hooks
and knet_send_sync users

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[global] create our own copy of mmsghdr in preparation to drop sendmmsg and recvmmsg
Fabio M. Di Nitto [Wed, 15 Feb 2017 13:50:33 +0000 (14:50 +0100)]
[global] create our own copy of mmsghdr in preparation to drop sendmmsg and recvmmsg

knet_bench will drop mmsghdr when dropping sendmmsg and recvmmsg

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[poc] drop PoC sctp-defrag-bug code now that's merged into master
Fabio M. Di Nitto [Wed, 15 Feb 2017 12:36:47 +0000 (13:36 +0100)]
[poc] drop PoC sctp-defrag-bug code now that's merged into master

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[udp] remember to memset freshly allocated memory
Fabio M. Di Nitto [Tue, 14 Feb 2017 08:21:12 +0000 (09:21 +0100)]
[udp] remember to memset freshly allocated memory

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[sctp] drop duplicated definition
Fabio M. Di Nitto [Tue, 14 Feb 2017 08:17:38 +0000 (09:17 +0100)]
[sctp] drop duplicated definition

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[global] revert b525ee6a6b74ec, go back to 64K nodes, and use typedef for nodeid
Fabio M. Di Nitto [Tue, 14 Feb 2017 05:03:56 +0000 (06:03 +0100)]
[global] revert b525ee6a6b74ec, go back to 64K nodes, and use typedef for nodeid

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tx] increase timeres on TX pressure and reduce log noise
Fabio M. Di Nitto [Mon, 13 Feb 2017 17:41:13 +0000 (18:41 +0100)]
[tx] increase timeres on TX pressure and reduce log noise

when TX sockets are overloaded, we spend more time spitting out
logs than recovering from the overload. ifdef the logging on
critical path out (still available with debug build).

also drastically reduce the waiting time by 64x.

this changes increases UDP perf on 3 nodes by 200%

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tx] pass pointers around and save some memory
Fabio M. Di Nitto [Sun, 12 Feb 2017 06:02:35 +0000 (07:02 +0100)]
[tx] pass pointers around and save some memory

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tx] minor optimization in handling packets < MTU
Fabio M. Di Nitto [Tue, 7 Feb 2017 07:29:58 +0000 (08:29 +0100)]
[tx] minor optimization in handling packets < MTU

- reduce of one loop
- reduce one memcpy
- reduce setting a bunch of data

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tx] map any outgoing packets only once and reduce memsets around
Fabio M. Di Nitto [Mon, 6 Feb 2017 11:33:07 +0000 (12:33 +0100)]
[tx] map any outgoing packets only once and reduce memsets around

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tx] map outgoing packet once per host vs once per host per link
Fabio M. Di Nitto [Mon, 6 Feb 2017 10:25:49 +0000 (11:25 +0100)]
[tx] map outgoing packet once per host vs once per host per link

- reduces memsets by 8x
- reduces complexity in resending packets on socket overload
  by changing start mmsghdr vs remapping everything all over again

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] define value only once
Fabio M. Di Nitto [Mon, 6 Feb 2017 08:15:58 +0000 (09:15 +0100)]
[transport] define value only once

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[tx] fix error log
Fabio M. Di Nitto [Mon, 6 Feb 2017 04:37:11 +0000 (05:37 +0100)]
[tx] fix error log

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoMove TODO list to trello
Fabio M. Di Nitto [Sun, 5 Feb 2017 07:39:49 +0000 (08:39 +0100)]
Move TODO list to trello

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[global] Reduce the number of support nodes in a knet from 64K to 256
Fabio M. Di Nitto [Fri, 3 Feb 2017 06:25:29 +0000 (07:25 +0100)]
[global] Reduce the number of support nodes in a knet from 64K to 256

realistically speaking nobody is ever going to deploy more than 32/64 nodes.

NOTE: this commit changes both onwire and API!

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[send/recv] split RX and TX threads in separate files
Fabio M. Di Nitto [Thu, 2 Feb 2017 05:53:30 +0000 (06:53 +0100)]
[send/recv] split RX and TX threads in separate files

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[send/recv] split code into separate files (step 1)
Fabio M. Di Nitto [Thu, 2 Feb 2017 05:45:51 +0000 (06:45 +0100)]
[send/recv] split code into separate files (step 1)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[send/recv] Unify and simplify usage of seq_num in packets
Fabio M. Di Nitto [Thu, 2 Feb 2017 04:13:11 +0000 (05:13 +0100)]
[send/recv] Unify and simplify usage of seq_num in packets

IMPORTANT: this commit changes onwire protocol in an incompatible way!

- remove the concet of bcast and mcast seq num and use one tx_seq_num
- stop using LINK_UP_DOWN messages to broadcast node seq num and
  transfer this data inside heartbeat messages
- LINK_UP_DOWN messages are currently unused but let's keep the
  infrastructure around for future
- minor cleanup in host_set_policy to confirm change of switching
  policy in the logs
- _link_updown should use async call to host dstcache update
  due to locking context
- switch knet_link_set_enable to use write locking context
  since the only reason it was read lock, was due to the need
  to send LINK_UP_DOWN messages
- knet_link_set_priority can now use dstcache in sync mode
- add seq_num and heartbeat type (timed/untimed) data to heartbeat
  messages. timed messages are generated regularly by hb_thread.
  untimed messages are generated by the TX thread to sync seq_num
  on heavy load across all connected node. (see comments in the code)
- access to the node seq_num is now mutex locked
- abstract ability to send pings from multiple threads
- special case seq_num == 0 to detect a node crash and coming back
  to life before hb_thread can detect the disconnection
- forcefully send ping in the TX thread every SEQ_MAX / 8 packets
  to allow nodes to sync seq_num
- optimize TX thread code to prepare the outgoing buffers once
  vs multiple times. There is still work that can be done here
  to optimize sending to multiple host, but this change
  is intrusive enough already as it is
- add logic to clear circular buffers when receiving pings

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[sctp] Allow internal IPC to operate under RX pressure
Fabio M. Di Nitto [Tue, 31 Jan 2017 05:10:54 +0000 (06:10 +0100)]
[sctp] Allow internal IPC to operate under RX pressure

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[rpm] disable build of poc code
Fabio M. Di Nitto [Sat, 28 Jan 2017 06:44:55 +0000 (07:44 +0100)]
[rpm] disable build of poc code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[compat] Fix FreeBSD defines
Christine Caulfield [Fri, 27 Jan 2017 10:59:00 +0000 (10:59 +0000)]
[compat] Fix FreeBSD defines

We need to undefine HAVE_RECVMMSG & HAVE_SENDMMSG for it to compile
on FreeBSD (not sure how that ever worked before).

There is a PR for FreeBSD to fix the recvmmsg bug, but it's not in
a released update yet. So with luck we can remove this soon-ish

https://github.com/freebsd/freebsd/commit/3fa64907439c00965fb0cbb222a6bf073c452630

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years ago[host] remove completely broken host to host communication locking system
Fabio M. Di Nitto [Fri, 27 Jan 2017 10:16:53 +0000 (11:16 +0100)]
[host] remove completely broken host to host communication locking system

the original idea was to have a host-to-host (semi-)reliable communication protocol
but that just isn't possible without flow control and retransmit

IIRC the only side affect of this missing lock is a corner case where:
1) node A totally crashes
2) node A come backs to life, sends it's status info (seq_num information)
3) node B does NOT receive the status info
4) node A starts sending traffic and a few packets might get lost

this will be solved when rewriting the TX thread to optimize the seq_num handling

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[send/recv] make sure to unlock dsthost thread under certain errors
Fabio M. Di Nitto [Fri, 27 Jan 2017 10:00:41 +0000 (11:00 +0100)]
[send/recv] make sure to unlock dsthost thread under certain errors

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] make sctp tx error handling more robust and avoid spinning on dead sockets
Fabio M. Di Nitto [Fri, 27 Jan 2017 09:59:02 +0000 (10:59 +0100)]
[transport] make sctp tx error handling more robust and avoid spinning on dead sockets

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoUpdate TODO
Fabio M. Di Nitto [Fri, 27 Jan 2017 06:35:34 +0000 (07:35 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[build] add build option to enable/disable poc code
Fabio M. Di Nitto [Fri, 27 Jan 2017 06:29:55 +0000 (07:29 +0100)]
[build] add build option to enable/disable poc code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] fix support for dynamic links connections
Fabio M. Di Nitto [Thu, 26 Jan 2017 17:05:44 +0000 (18:05 +0100)]
[transport] fix support for dynamic links connections

- add internal transport API for handling incoming dynamic connections (both UDP and SCTP)
- fix copy/compare address code in RX thread
- make sure to reset sockaddr_storage len in iov

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[netutils] cleanup cmpaddr and add cpyaddrport
Fabio M. Di Nitto [Thu, 26 Jan 2017 17:02:01 +0000 (18:02 +0100)]
[netutils] cleanup cmpaddr and add cpyaddrport

cpyaddrport specifically copies _only_ address and port and skip
over other fields that are unnecessary for what we need

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agocompat: make it work on FreeBSD
Christine Caulfield [Thu, 26 Jan 2017 11:28:09 +0000 (11:28 +0000)]
compat: make it work on FreeBSD

Although FreeBSD 11 has sendmmsg & recvmmsg wrappers, they
don't quite work the same as Linux so I've enabled the (fixed)
compat versions for that platform.

make check now works on FreeBSD 11

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years ago[kronosnetd] add support for multiple transports
Fabio M. Di Nitto [Thu, 26 Jan 2017 04:15:31 +0000 (05:15 +0100)]
[kronosnetd] add support for multiple transports

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoUpdate TODO
Fabio M. Di Nitto [Wed, 25 Jan 2017 15:33:55 +0000 (16:33 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[send/recv] simplify _parse_recv_from_links internal API
Fabio M. Di Nitto [Wed, 25 Jan 2017 15:25:14 +0000 (16:25 +0100)]
[send/recv] simplify _parse_recv_from_links internal API

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transports] add support for transport_tx_sock_error
Fabio M. Di Nitto [Wed, 25 Jan 2017 13:51:47 +0000 (14:51 +0100)]
[transports] add support for transport_tx_sock_error

add IP_RECVERR for UDP to better handle errors on TX sockets

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[PMTUd] Fix global pmtud calculation
Fabio M. Di Nitto [Wed, 25 Jan 2017 07:07:10 +0000 (08:07 +0100)]
[PMTUd] Fix global pmtud calculation

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoUpdate TODO list
Fabio M. Di Nitto [Tue, 24 Jan 2017 18:01:24 +0000 (19:01 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoMerge pull request #20 from jonesmz/travis-ci-for-pull-request
Fabio M. Di Nitto [Tue, 24 Jan 2017 17:30:02 +0000 (18:30 +0100)]
Merge pull request #20 from jonesmz/travis-ci-for-pull-request

Adds Travis CI continuous integration configuration file

7 years ago[transports] SCTP: handle short reads on sockets
Fabio M. Di Nitto [Tue, 24 Jan 2017 16:51:12 +0000 (17:51 +0100)]
[transports] SCTP: handle short reads on sockets

- fix trasport is_data API
- handle per accepted socket reassembly buffer by changing fd_tracker
  data for incoming connections
- allow in-kernel SCTP fragmentation again
- use MSG_EOR on a per socket base to reassemble partial packet delivery
- fix some whitespaces around

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoAdds Travis CI continuous integration configuration file
Michael Jones [Tue, 24 Jan 2017 16:46:18 +0000 (10:46 -0600)]
Adds Travis CI continuous integration configuration file

7 years agotransport: Rename 'link' to 'kn_link' so it doesn't conflict with libc
Christine Caulfield [Tue, 24 Jan 2017 09:32:57 +0000 (09:32 +0000)]
transport: Rename 'link' to 'kn_link' so it doesn't conflict with libc

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agopoc: add option to check CRCs in sctp_defrag_bug
Christine Caulfield [Mon, 23 Jan 2017 13:01:21 +0000 (13:01 +0000)]
poc: add option to check CRCs in sctp_defrag_bug

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years ago[PoC] implement EOR handling code for short reads
Fabio M. Di Nitto [Fri, 20 Jan 2017 13:50:54 +0000 (14:50 +0100)]
[PoC] implement EOR handling code for short reads

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[poc] add sctp potential fragmentation bug trigger
Fabio M. Di Nitto [Thu, 19 Jan 2017 18:58:25 +0000 (19:58 +0100)]
[poc] add sctp potential fragmentation bug trigger

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[build] drop last bits of common/
Fabio M. Di Nitto [Thu, 19 Jan 2017 08:32:56 +0000 (09:32 +0100)]
[build] drop last bits of common/

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] remove duplicate code
Fabio M. Di Nitto [Thu, 19 Jan 2017 08:32:07 +0000 (09:32 +0100)]
[transport] remove duplicate code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoUpdate TODO
Fabio M. Di Nitto [Wed, 18 Jan 2017 12:48:23 +0000 (13:48 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] add knet_handle_get_transport_id_by_name api
Fabio M. Di Nitto [Wed, 18 Jan 2017 11:33:17 +0000 (12:33 +0100)]
[transport] add knet_handle_get_transport_id_by_name api

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] add knet_handle_get_transport_name_by_id api call
Fabio M. Di Nitto [Wed, 18 Jan 2017 09:31:05 +0000 (10:31 +0100)]
[transport] add knet_handle_get_transport_name_by_id api call

also fix a counter in knet_handle_get_transport_name_by_id

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transport] add knet_handle_get_transport_list api call
Fabio M. Di Nitto [Wed, 18 Jan 2017 08:55:59 +0000 (09:55 +0100)]
[transport] add knet_handle_get_transport_list api call

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[handle] fix error messages
Fabio M. Di Nitto [Wed, 18 Jan 2017 05:06:50 +0000 (06:06 +0100)]
[handle] fix error messages

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[compat] Fix some includes for FreeBSD
Christine Caulfield [Tue, 17 Jan 2017 16:29:41 +0000 (16:29 +0000)]
[compat] Fix some includes for FreeBSD

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years ago[compat] minor cleanup on the autotool stuff
Fabio M. Di Nitto [Tue, 17 Jan 2017 16:15:42 +0000 (17:15 +0100)]
[compat] minor cleanup on the autotool stuff

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agogeneral: Add compatibility code & #ifdefs
Christine Caulfield [Tue, 17 Jan 2017 13:50:03 +0000 (13:50 +0000)]
general: Add compatibility code & #ifdefs

This is enough to get knet compiling on FreeBSD 11 and bits of it
working. It's nowhere near ready on BSD though, more work is needed,
but given the fast pace of development it's best to get this in now
rather than track it in a separate branch.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agoUpdate TODO
Fabio M. Di Nitto [Tue, 17 Jan 2017 04:30:36 +0000 (05:30 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoUpdate TODO
Fabio M. Di Nitto [Tue, 17 Jan 2017 04:28:56 +0000 (05:28 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[api] add commodity functions to convert to/from strings/sockaddress
Fabio M. Di Nitto [Mon, 16 Jan 2017 16:58:33 +0000 (17:58 +0100)]
[api] add commodity functions to convert to/from strings/sockaddress

functions are nothing more than wrappers for getnameinfo and getaddrinfo
with some sanity checks, but exposing them around saves lots of
maintanance of duplicate code across different stuff.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agohost: Remove host_tail as it's not used.
Christine Caulfield [Mon, 16 Jan 2017 14:50:17 +0000 (14:50 +0000)]
host: Remove host_tail as it's not used.

it also had a bug which could cause knet to crash after a host was
removed.

This patch puts new nodes at the front of the list rather than at the
end, but I don't think this is a problem.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years ago[test] fix comment
Fabio M. Di Nitto [Mon, 16 Jan 2017 08:53:16 +0000 (09:53 +0100)]
[test] fix comment

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[sctp] enable workaround for in-kernel fragmentation issue
Fabio M. Di Nitto [Mon, 16 Jan 2017 08:51:47 +0000 (09:51 +0100)]
[sctp] enable workaround for in-kernel fragmentation issue

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[test] kill obsoleted ping_test
Fabio M. Di Nitto [Mon, 16 Jan 2017 08:47:01 +0000 (09:47 +0100)]
[test] kill obsoleted ping_test

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoUpdate TODO
Fabio M. Di Nitto [Mon, 16 Jan 2017 06:59:55 +0000 (07:59 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[sctp] port sctp to the new API and fix many issues
Fabio M. Di Nitto [Mon, 16 Jan 2017 06:44:30 +0000 (07:44 +0100)]
[sctp] port sctp to the new API and fix many issues

- use the new transport API
- fix locking context around to avoid race conditions and deadlocking
- fix shutdown code (segfaults and core dumps)
- properly differentiate between connecting sockets and accepted sockets
  and better use of fd_tracker
- abstract as much as possible socket management code from threads
- add lots of comments and debugging messages around
- simplify socket error management reported from RX thread
- rework loop timers for connect_thread to avoid thread overload
- reduce usage of _transport_addrtostr to one call and reuse
  link information around
- improve error handling across the board
- stop using data structs inside epolls and switch back to using fds
  this was necessary to avoid processing stale data from epolls
  and look up data from fd_tracket instead
- add listener stop function
- make functions safer to be called multiple times
- probably more.. but can't remember

NOTE: this is not the most elegant code, but it seems to be doing its job
fine.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[heartbeat] reset PMTUd on link down to trigger a new PMTUd when link come back online
Fabio M. Di Nitto [Mon, 16 Jan 2017 06:11:18 +0000 (07:11 +0100)]
[heartbeat] reset PMTUd on link down to trigger a new PMTUd when link come back online

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[PMTUd] fail early if transport is not connected
Fabio M. Di Nitto [Mon, 16 Jan 2017 05:21:11 +0000 (06:21 +0100)]
[PMTUd] fail early if transport is not connected

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[heartbeat] and make it a tiny little bit faster when transport is not connected
Fabio M. Di Nitto [Mon, 16 Jan 2017 04:01:14 +0000 (05:01 +0100)]
[heartbeat] and make it a tiny little bit faster when transport is not connected

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[heartbeat] make better use of transport_connected option
Fabio M. Di Nitto [Mon, 16 Jan 2017 03:58:56 +0000 (04:58 +0100)]
[heartbeat] make better use of transport_connected option

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