]> git.proxmox.com Git - mirror_kronosnet.git/log
mirror_kronosnet.git
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>
7 years ago[sockets] move socketpair code into transport common code
Fabio M. Di Nitto [Sun, 15 Jan 2017 06:09:01 +0000 (07:09 +0100)]
[sockets] move socketpair code into transport common code

also use _configure_common_socket for cloexec/nonblock and rx/tx buffers
that should be the same for all socketpairs, outgoing and incoming sockets

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[dstthread] make sure not to get caught in signal when reading from socket
Fabio M. Di Nitto [Sun, 15 Jan 2017 06:05:52 +0000 (07:05 +0100)]
[dstthread] make sure not to get caught in signal when reading from socket

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[host] make sure not to get caught in signal when sending host updates
Fabio M. Di Nitto [Sun, 15 Jan 2017 06:05:08 +0000 (07:05 +0100)]
[host] make sure not to get caught in signal when sending host updates

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transports] drop fd_tracker locking in favour of global locking
Fabio M. Di Nitto [Thu, 12 Jan 2017 07:21:21 +0000 (08:21 +0100)]
[transports] drop fd_tracker locking in favour of global locking

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[udp] drop unnecessary list locking
Fabio M. Di Nitto [Thu, 12 Jan 2017 05:13:08 +0000 (06:13 +0100)]
[udp] drop unnecessary list locking

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[SCTP] temporary disable SCTP support while we fix the implementation
Fabio M. Di Nitto [Wed, 11 Jan 2017 14:54:26 +0000 (15:54 +0100)]
[SCTP] temporary disable SCTP support while we fix the implementation

not the best solution, but it's a quick one to allow master to build again

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[send/recv] report correct errno
Fabio M. Di Nitto [Wed, 11 Jan 2017 14:50:59 +0000 (15:50 +0100)]
[send/recv] report correct errno

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoRevert "[heartbeat] temporary disable usage of transport_connected"
Fabio M. Di Nitto [Wed, 11 Jan 2017 14:33:05 +0000 (15:33 +0100)]
Revert "[heartbeat] temporary disable usage of transport_connected"

This reverts commit 75ca10991fa3e0d9bc8cd9706395ff0e2bc62c38.

whops.. pushed in the wrong branch by mistake

7 years ago[heartbeat] temporary disable usage of transport_connected
Fabio M. Di Nitto [Wed, 11 Jan 2017 08:49:49 +0000 (09:49 +0100)]
[heartbeat] temporary disable usage of transport_connected

this will make it easier to stabilize SCTP and connection oriented
protocols

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

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transports] major rework of APIs and ABIs!
Fabio M. Di Nitto [Mon, 9 Jan 2017 08:18:41 +0000 (09:18 +0100)]
[transports] major rework of APIs and ABIs!

This commit breaks APIs and ABIs and this changelog might be missing
a bit or 5.

External visible changes:

- Change link initialization process API:

  The old method:
   - link_set_config -> link_enable
     where link_set_config would simply store config data (sockaddr and
     such) in the link struct and link_enable would create sockets and
     do the magic. This method didn't work well for complex transports
     such as SCTP and introduced a series of race conditions and deadlocks.

  The new method:
   - link_set_config would now store config in link struct AND create
     all related sockets and such. The link will not be used for data
     traffic till enabled.
   - link_set_enable will enable/disable the link for traffic (including
     heartbeat) and requires a link to be configured (as before)
   - link_clear_config (new API) can/has to be called after disabling
     a link to close all connections and sockets (free resources).

Internal changes:

- Drop the concept of listeners.* and delegate those to
  underlying transports.

- Add the concept of fd_tracker. Each transport is required and it is
  responsible to update the fd_tracking array for the fd that the
  transport itself is creating/using/clearing.
  The fd_tracker is required to perform fast lookups on socket
  errors and RX thread to determine what code is responsible to parse
  given conditions such as errors from the sockets or OOB data/notifications.

- Introduce the concept of link->transport_connected.
  In case the transport requires socket connection to the other end (SCTP for
  example), set to 0 while disconnected and set 1 once connected to the other
  side. This flag will avoid unnecessary errors generated from the TX threads.
  NOTE: still needs better plumbing around. For now it's only partially used
        in the heartbeat thread. UDP sets to 1 by default.

- Rework the transport API to be easier to use.
  - If a transport is not available, get_XXXX_transport() should return NULL.
  - A transport that provides &XXXX_transport_ops MUST have all operations
    implemented as described in internals.h. This is required to skip tons
    of if/else checks on fast code paths.
  - Improve documentation of the transport API in internals.h.
  - transport common: drop some unnecessary functions for now, they might
    can back later in better format once SCTP is working again.
  - provide a locked/unlocked version of _set_fd_tracker but this is an
    artifact of trying to fix SCTP deadlocking. _set_fd_tracker should
    always be locked.
  - cleanup transport_udp.c to match the new API and perform better
    error handling and better cleaning in case of errors.
  - switch mtu_overhead to constant from call into a function.
  - drop usage of _transport_addrtostr/_transport_addrtostr_free for all but
    accepting incoming SCTP connections. All other datas are already available
    and it's unnecessary to perform extra lookups. This will eventually
    move to a proper knet_api and avoid completely the need to build with --debug.

- RX thread:
  - use the new transport hooks to handle socket errors and
    determine if a packet is data or internal OOB info.
  - remove the last transport specific bits and move them into
    transport implementation itself.

- Test suite:
  - Update the test suite to deal with the new API changes
  - Fix a couple of shutdown problems in knet_bench
  - Fix a shutdown issue in test-common.c
  - Document the whole recvmmsg API in details, based on kernel
    implementation. recvmmsg man page is incorrect.

- Fix kronosnetd to use the new APIs

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[send/recv] remove stray unlock operation
Fabio M. Di Nitto [Wed, 21 Dec 2016 08:05:49 +0000 (09:05 +0100)]
[send/recv] remove stray unlock operation

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_SCTP_LINK_T to KNET_SUB_TRANSP_SCTP
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:48:33 +0000 (14:48 +0100)]
[logging] rename KNET_SUB_SCTP_LINK_T to KNET_SUB_TRANSP_SCTP

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_UDP_LINK_T to KNET_SUB_TRANSP_UDP
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:47:35 +0000 (14:47 +0100)]
[logging] rename KNET_SUB_UDP_LINK_T to KNET_SUB_TRANSP_UDP

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_LINK_T to KNET_SUB_RX
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:45:20 +0000 (14:45 +0100)]
[logging] rename KNET_SUB_LINK_T to KNET_SUB_RX

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_SEND_T to KNET_SUB_TX
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:44:09 +0000 (14:44 +0100)]
[logging] rename KNET_SUB_SEND_T to KNET_SUB_TX

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_PMTUD_T to KNET_SUB_PMTUD
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:42:28 +0000 (14:42 +0100)]
[logging] rename KNET_SUB_PMTUD_T to KNET_SUB_PMTUD

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_HB_T to KNET_SUB_HEARTBEAT
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:41:15 +0000 (14:41 +0100)]
[logging] rename KNET_SUB_HB_T to KNET_SUB_HEARTBEAT

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_TRANSPORT_T to KNET_SUB_TRANSPORT
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:39:32 +0000 (14:39 +0100)]
[logging] rename KNET_SUB_TRANSPORT_T to KNET_SUB_TRANSPORT

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] rename KNET_SUB_SWITCH_T to KNET_SUB_DSTCACHE
Fabio M. Di Nitto [Tue, 20 Dec 2016 13:37:57 +0000 (14:37 +0100)]
[logging] rename KNET_SUB_SWITCH_T to KNET_SUB_DSTCACHE

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] assign blocks to different logging subsystems
Fabio M. Di Nitto [Tue, 20 Dec 2016 09:57:18 +0000 (10:57 +0100)]
[logging] assign blocks to different logging subsystems

- drop KNET_SUB_PMTUD that was unused
- add KNET_SUB_TRANSPORT_T that was missing
- switch from "common" to "unknown" for odd logging
- fix up code around to allow holes in the structs
- fix up test suite

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[PMTUd] adjust all values around new transports
Fabio M. Di Nitto [Mon, 19 Dec 2016 09:28:22 +0000 (10:28 +0100)]
[PMTUd] adjust all values around new transports

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[build] cleanup conditionals to build SCTP and other protocols
Fabio M. Di Nitto [Mon, 19 Dec 2016 07:57:51 +0000 (08:57 +0100)]
[build] cleanup conditionals to build SCTP and other protocols

Unsupported protocols just need to return NULL on get_PROTO_transport
and contain all protocol conditionals within the transport_PROTO.c.

There is still one conditional in RX/TX thread that needs cleaning
but it's a rather complex operation and leave it in for now.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[transports] initialize transports with knet_handle and protects from missing proto ops
Fabio M. Di Nitto [Mon, 19 Dec 2016 07:41:46 +0000 (08:41 +0100)]
[transports] initialize transports with knet_handle and protects from missing proto ops

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[listener] drop unnecessary debugging code
Fabio M. Di Nitto [Mon, 19 Dec 2016 04:33:21 +0000 (05:33 +0100)]
[listener] drop unnecessary debugging code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[sctp] _handle_incoming_sctp don't leak accepted_socks on errors
Fabio M. Di Nitto [Sun, 18 Dec 2016 05:52:02 +0000 (06:52 +0100)]
[sctp] _handle_incoming_sctp don't leak accepted_socks on errors

add a check to verify max connections or we will leak FDs somewhere at some point

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[logging] threads should have _t naming
Fabio M. Di Nitto [Sun, 18 Dec 2016 05:49:12 +0000 (06:49 +0100)]
[logging] threads should have _t naming

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[sctp] don't pass notification packets to the decoder
Fabio M. Di Nitto [Sat, 17 Dec 2016 05:38:41 +0000 (06:38 +0100)]
[sctp] don't pass notification packets to the decoder

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[build] make SCTP build optional (default: on)
Fabio M. Di Nitto [Fri, 16 Dec 2016 19:29:14 +0000 (20:29 +0100)]
[build] make SCTP build optional (default: on)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agosctp: Fix a couple of crashes & tidy on_epoll usage
Christine Caulfield [Fri, 16 Dec 2016 14:12:44 +0000 (14:12 +0000)]
sctp: Fix a couple of crashes & tidy on_epoll usage

Also fix locking in sctp shutdown

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years ago[build] don't leak pam libraries all over the place
Fabio M. Di Nitto [Fri, 16 Dec 2016 07:23:44 +0000 (08:23 +0100)]
[build] don't leak pam libraries all over the place

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years ago[links] fix segfault when using dynamic ip addresses
Fabio M. Di Nitto [Fri, 16 Dec 2016 05:23:24 +0000 (06:23 +0100)]
[links] fix segfault when using dynamic ip addresses

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
7 years agoUpdate TODO list
Fabio M. Di Nitto [Fri, 16 Dec 2016 04:57:18 +0000 (05:57 +0100)]
Update TODO list

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