]> git.proxmox.com Git - mirror_kronosnet.git/log
mirror_kronosnet.git
8 years ago[handle] fix fd leak and sock option settings
Fabio M. Di Nitto [Mon, 13 Jun 2016 19:11:12 +0000 (21:11 +0200)]
[handle] fix fd leak and sock option settings

apparently int math has never been my strong side

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[tests] fix running tests with valgrin under libtool
Fabio M. Di Nitto [Mon, 13 Jun 2016 13:09:00 +0000 (15:09 +0200)]
[tests] fix running tests with valgrin under libtool

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate gitignore
Fabio M. Di Nitto [Mon, 13 Jun 2016 12:25:31 +0000 (14:25 +0200)]
Update gitignore

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[tests] fix special check include
Fabio M. Di Nitto [Mon, 13 Jun 2016 12:22:48 +0000 (14:22 +0200)]
[tests] fix special check include

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoRevert "[tests] move all tests to top level directory"
Fabio M. Di Nitto [Mon, 13 Jun 2016 12:21:32 +0000 (14:21 +0200)]
Revert "[tests] move all tests to top level directory"

This reverts commit d9adee9b923776ea5813b5a024c16a58b8d989c0.

8 years ago[tests] move all tests to top level directory
Fabio M. Di Nitto [Mon, 13 Jun 2016 12:14:58 +0000 (14:14 +0200)]
[tests] move all tests to top level directory

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[tests] fix libtap test
Fabio M. Di Nitto [Mon, 13 Jun 2016 12:12:55 +0000 (14:12 +0200)]
[tests] fix libtap test

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[test] Add common check for root user
Fabio M. Di Nitto [Mon, 13 Jun 2016 09:25:58 +0000 (11:25 +0200)]
[test] Add common check for root user

knet tests can't really run as normal user

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[tests] add some common facility to run shell codes within tests
Fabio M. Di Nitto [Mon, 13 Jun 2016 07:55:13 +0000 (09:55 +0200)]
[tests] add some common facility to run shell codes within tests

code stolen from libtap, but useful to drive iptables and alike during
some tests

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoFix core dump on exit path when running as user and related test case.
Fabio M. Di Nitto [Mon, 13 Jun 2016 07:17:41 +0000 (09:17 +0200)]
Fix core dump on exit path when running as user and related test case.

Drop the max host to 1024 for testing.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[tests] add common return codes as understood by automake
Fabio M. Di Nitto [Mon, 13 Jun 2016 03:34:52 +0000 (05:34 +0200)]
[tests] add common return codes as understood by automake

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoMove libknet tests in their subdir in preparation for proper test suite
Fabio M. Di Nitto [Sun, 12 Jun 2016 08:07:53 +0000 (10:07 +0200)]
Move libknet tests in their subdir in preparation for proper test suite

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[PMTUd] export protocol overhead information
Fabio M. Di Nitto [Sun, 12 Jun 2016 05:59:22 +0000 (07:59 +0200)]
[PMTUd] export protocol overhead information

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Sat, 11 Jun 2016 05:51:00 +0000 (07:51 +0200)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[PMTUd] Drop concept of link_mtu and fix data mtu exported values (pass 1)
Fabio M. Di Nitto [Sat, 11 Jun 2016 05:46:03 +0000 (07:46 +0200)]
[PMTUd] Drop concept of link_mtu and fix data mtu exported values (pass 1)

Cleanup a poor attempt to export all MTU data to the users.

The original idea was to provide information about real link onwire mtu
and max user data mtu (that could be sent on wire without fragmentation)
that adjusted the value for IP protocol, knet header and crypto (if configured).

Effectively there is no use for the real link onwire mtu and it only involves
extra complexity to export lots of extra data to the end user that would have
to redo the calculations internally to gather data mtu.

Also fix the status.mtu value to match knet view of every link.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Fri, 3 Jun 2016 07:49:43 +0000 (09:49 +0200)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Fri, 3 Jun 2016 07:26:53 +0000 (09:26 +0200)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[PMTUd] fix link instability due to too short PMTUd timeouts
Fabio M. Di Nitto [Fri, 3 Jun 2016 03:53:37 +0000 (05:53 +0200)]
[PMTUd] fix link instability due to too short PMTUd timeouts

Partially roll back changes from 004bd26a

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO
Fabio M. Di Nitto [Wed, 1 Jun 2016 04:21:45 +0000 (06:21 +0200)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[socket] internal socketpair should use same recvbuf as any other socket
Fabio M. Di Nitto [Wed, 1 Jun 2016 04:20:36 +0000 (06:20 +0200)]
[socket] internal socketpair should use same recvbuf as any other socket

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoMerge pull request #4 from mbaldessari/arm-fix
Fabio M. Di Nitto [Mon, 16 May 2016 03:24:25 +0000 (05:24 +0200)]
Merge pull request #4 from mbaldessari/arm-fix

Initialize savederrno variable

8 years agoInitialize savederrno variable
Michele Baldessari [Sun, 15 May 2016 09:21:02 +0000 (11:21 +0200)]
Initialize savederrno variable

This fixes an error seen on F23 arm/gcc:
In file included from threads_send_recv.c:26:0:
threads_send_recv.c: In function '_handle_send_to_links_thread':
logging.h:19:2: error: 'savederrno' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
  log_msg(knet_h, subsys, KNET_LOG_ERR, fmt, ##args)
  ^
threads_send_recv.c:475:6: note: 'savederrno' was declared here
  int savederrno, docallback = 0;
      ^
cc1: all warnings being treated as errors
Makefile:843: recipe for target 'libknet_la-threads_send_recv.lo' failed
make[2]: *** [libknet_la-threads_send_recv.lo] Error 1
make[2]: Leaving directory
'/home/jenkins/workspace/kronosnet/arm-fedora-23-gcc/libknet'
Makefile:506: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
'/home/jenkins/workspace/kronosnet/arm-fedora-23-gcc'
Makefile:417: recipe for target 'all' failed
make: *** [all] Error 2

8 years ago[PMTUd] fix several issues around PMTUd and improve discovery performances
Fabio M. Di Nitto [Sun, 6 Mar 2016 06:58:47 +0000 (07:58 +0100)]
[PMTUd] fix several issues around PMTUd and improve discovery performances

- Fix a race condition around first time MTU discovery where MTU value
  would be out of the wazooo
- Fix a case where onwire MTU value would be smaller than crypto header
  and generate errors

- Make MTU value a decision factor if a link is usable or not.
  If MTU is not valid (either the discovery process failed) or
  the value is not sane, the link will be removed from the available
  data link pool till the problem is resolved. Once the problem is
  solved the link will recover automatically.

- Have link up/down status trigger a PMTUd process to speed up
  detection.

- Add ability to detect smaller MTU than minimum defined by protocol.

- Improve error reporting across the board.

- Make PMTUd timeout dynamic based on current link latency. This change
  makes detection of small MTU very fast.

- Sanity check values returned by PMTUD to be in range between
  minimum MTU defined by given protocol and maximum that knet can handle.

- Trigger host cache reculaculation on MTU validity change to reduce
  risk of packet loss on bad links.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] fix handling of duplicated HOSTINFO pckt with active-active links
Fabio M. Di Nitto [Tue, 16 Feb 2016 06:47:59 +0000 (07:47 +0100)]
[send/recv] fix handling of duplicated HOSTINFO pckt with active-active links

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[internal] rename list_rwlock to global_rwlock
Fabio M. Di Nitto [Tue, 16 Feb 2016 05:29:43 +0000 (06:29 +0100)]
[internal] rename list_rwlock to global_rwlock

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[host] fix memory leak in knet_host_add in case of failure
Fabio M. Di Nitto [Mon, 15 Feb 2016 07:09:33 +0000 (08:09 +0100)]
[host] fix memory leak in knet_host_add in case of failure

make it easier to read knet_host_remove (no functional changes)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[internal] document usage of mutex and locks
Fabio M. Di Nitto [Mon, 15 Feb 2016 07:07:15 +0000 (08:07 +0100)]
[internal] document usage of mutex and locks

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Mon, 15 Feb 2016 07:04:16 +0000 (08:04 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Mon, 15 Feb 2016 07:02:04 +0000 (08:02 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO
Fabio M. Di Nitto [Thu, 11 Feb 2016 05:53:10 +0000 (06:53 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[docs] Fix docbook typo
Michele Baldessari [Wed, 10 Feb 2016 09:06:59 +0000 (10:06 +0100)]
[docs] Fix docbook typo

Signed-off-by: Michele Baldessari <michele@acksyn.org>
8 years ago[crypto] fix crash when receiving non crypto packets on a crypto socket
Fabio M. Di Nitto [Wed, 10 Feb 2016 07:14:59 +0000 (08:14 +0100)]
[crypto] fix crash when receiving non crypto packets on a crypto socket

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[onwire] let's try to be smart and preallocate space for future features
Fabio M. Di Nitto [Wed, 10 Feb 2016 05:51:05 +0000 (06:51 +0100)]
[onwire] let's try to be smart and preallocate space for future features

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoMerge pull request #3 from mbaldessari/wip_overflow_fedora
Michele Baldessari [Tue, 9 Feb 2016 15:27:02 +0000 (16:27 +0100)]
Merge pull request #3 from mbaldessari/wip_overflow_fedora

Fix small string overflow

8 years agoFix small string overflow
Michele Baldessari [Tue, 9 Feb 2016 15:14:06 +0000 (16:14 +0100)]
Fix small string overflow

In file included from /usr/include/stdio.h:936:0,
                 from ping_test.c:12: In function ‘snprintf’,
    inlined from ‘main’ at ping_test.c:504:3: /usr/include/bits/stdio2.h:64:10: error: call to
__builtin___snprintf_chk will always overflow destination buffer [-Werror]
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,

8 years agoMerge pull request #2 from mbaldessari/smatch_fixes
Michele Baldessari [Tue, 9 Feb 2016 13:07:44 +0000 (14:07 +0100)]
Merge pull request #2 from mbaldessari/smatch_fixes

Assorted fixes found via smatch

8 years agoFix another indentation issue
Michele Baldessari [Tue, 9 Feb 2016 11:44:08 +0000 (12:44 +0100)]
Fix another indentation issue

8 years agoFix equality test
Michele Baldessari [Tue, 9 Feb 2016 11:42:08 +0000 (12:42 +0100)]
Fix equality test

8 years agoFix broken indentations
Michele Baldessari [Tue, 9 Feb 2016 11:41:47 +0000 (12:41 +0100)]
Fix broken indentations

8 years agoMove len to ssize_t
Michele Baldessari [Tue, 9 Feb 2016 11:37:42 +0000 (12:37 +0100)]
Move len to ssize_t

len is used as a return code for both select()(int) and read()(ssize_t)
so make it an ssize_t type instead of size_t which is unsigned.

8 years agoFix error path test equality
Michele Baldessari [Tue, 9 Feb 2016 11:35:29 +0000 (12:35 +0100)]
Fix error path test equality

8 years agoUpdate TODO list
Fabio M. Di Nitto [Tue, 9 Feb 2016 10:55:43 +0000 (11:55 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Sun, 7 Feb 2016 07:36:26 +0000 (08:36 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] add knet_send_sync function
Fabio M. Di Nitto [Sat, 6 Feb 2016 15:05:28 +0000 (16:05 +0100)]
[send/recv] add knet_send_sync function

read carefully the doc in libknet.h or suffer the ethernal doom in hell

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[sockets] first cut at making socket management more consistent
Fabio M. Di Nitto [Sun, 10 Jan 2016 08:36:53 +0000 (09:36 +0100)]
[sockets] first cut at making socket management more consistent

and fix sendmmsg handling

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Tue, 5 Jan 2016 15:31:33 +0000 (16:31 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO
Fabio M. Di Nitto [Thu, 24 Dec 2015 06:05:14 +0000 (07:05 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] rework handling of 0 byte read/write on local sockets
Fabio M. Di Nitto [Sun, 20 Dec 2015 08:46:24 +0000 (09:46 +0100)]
[send/recv] rework handling of 0 byte read/write on local sockets

considering there is no obvious use case trying to send 0 byte packets
and that 0 byte packtes are filtered by iovec calls across the all
code, there is no point trying to handle 0 byte differently from
any other socket error.

this commit makes sure that every time there is an error (-1) or a 0
byte read from the locally provided sockets, a call back is issued.

on read errors (-1) the socket will be removed from the epoll
to avoid spinning and it is safe to call knet_handle_remove_datafd
afterwards to remove it completely.

it is now mandatory to enable a sock_notify callback before adding
datafd.

read libknet.h carefully on what the callback is supposed to do
based on the type of socket your application is adding.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Fri, 18 Dec 2015 14:16:01 +0000 (15:16 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoremove stray comment
Fabio M. Di Nitto [Fri, 18 Dec 2015 13:52:04 +0000 (14:52 +0100)]
remove stray comment

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[lib] Fix typos & English in libknet.h file
Christine Caulfield [Fri, 18 Dec 2015 13:35:34 +0000 (13:35 +0000)]
[lib] Fix typos & English in libknet.h file

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years ago[send/recv] deal properly with 0 bytes packets on local sockets
Fabio M. Di Nitto [Fri, 18 Dec 2015 09:47:24 +0000 (10:47 +0100)]
[send/recv] deal properly with 0 bytes packets on local sockets

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] be consistent between readv and recvmmsg handling 0 bytes packets
Fabio M. Di Nitto [Fri, 18 Dec 2015 09:00:26 +0000 (10:00 +0100)]
[send/recv] be consistent between readv and recvmmsg handling 0 bytes packets

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[PMTUd] improve debug message to add iface mtu
Fabio M. Di Nitto [Fri, 18 Dec 2015 07:09:21 +0000 (08:09 +0100)]
[PMTUd] improve debug message to add iface mtu

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[global] add support for multiple local sockets/fds
Fabio M. Di Nitto [Fri, 18 Dec 2015 06:22:03 +0000 (07:22 +0100)]
[global] add support for multiple local sockets/fds

WARNING: this commit changes API and onwire protocol

It is now possible to configure multiple local sockets to send/recv
data over the same knet handle.

to every send/recv socket a channel is assigned that behaves more
or less like a VLAN.
hostA channel 0 will be delivered to datafd on hostB channel 0
hostA channel 1 to hostB channel 1
etc.

It is possible to configure up to 32 channel, but there is space
to increase this number if necessary.

New API calls:
knet_handle_add_datafd
knet_handle_remove_datafd
knet_handle_enable_sock_notify
knet_handle_get_channel
knet_handle_get_datafd

Notification has been added in cases where a local socket is the result
of accepting a tcp connection that gets disconnected and corrective
action needs to be taken by the application.

Changed API calls:
knet_handle_new
knet_recv
knet_send
knet_handle_enable_filter

onwire changes:
add one byte to transport channel information

channel information are also passed down to the dst_host_filter
in the event the application has needs to modify that on TX/RX
events.

Internal changes:
cleanup how sockpairs are handled in general to make it simpler
to map application side and internal side.

NOTE: callback function has not been properly tested.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Wed, 16 Dec 2015 10:05:12 +0000 (11:05 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[internal] switch from pipe to socketpairs for consistency
Fabio M. Di Nitto [Wed, 16 Dec 2015 09:38:57 +0000 (10:38 +0100)]
[internal] switch from pipe to socketpairs for consistency

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] add support for recvmmsg on local socket
Fabio M. Di Nitto [Wed, 16 Dec 2015 07:16:16 +0000 (08:16 +0100)]
[send/recv] add support for recvmmsg on local socket

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Wed, 16 Dec 2015 07:15:08 +0000 (08:15 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO
Fabio M. Di Nitto [Mon, 14 Dec 2015 04:34:02 +0000 (05:34 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] save some more times dealing with unreachable hosts for mcast pckts
Fabio M. Di Nitto [Sun, 13 Dec 2015 16:51:17 +0000 (17:51 +0100)]
[send/recv] save some more times dealing with unreachable hosts for mcast pckts

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] rework commit 1de7acb8 a bit
Fabio M. Di Nitto [Sun, 13 Dec 2015 13:14:22 +0000 (14:14 +0100)]
[send/recv] rework commit 1de7acb8 a bit

on the exit thread, kh_node is knet_h->host_id, no point
to convert it N times per packet/frag.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] drop too verbose log message and fix comment
Fabio M. Di Nitto [Sun, 13 Dec 2015 09:09:16 +0000 (10:09 +0100)]
[send/recv] drop too verbose log message and fix comment

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] remove TODO comment
Fabio M. Di Nitto [Sun, 13 Dec 2015 08:03:35 +0000 (09:03 +0100)]
[send/recv] remove TODO comment

splitting frags across multiple links is not worth the complexity of
the code or the complexity in re-assemblying the packet if links
are at different speed/status

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] sort code around
Fabio M. Di Nitto [Sun, 13 Dec 2015 07:41:33 +0000 (08:41 +0100)]
[send/recv] sort code around

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Sun, 13 Dec 2015 06:14:46 +0000 (07:14 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] fix bcast data entry for hostinfo packets
Fabio M. Di Nitto [Sun, 13 Dec 2015 06:08:55 +0000 (07:08 +0100)]
[send/recv] fix bcast data entry for hostinfo packets

this should address the issue Chrissie reported where
first data packet would vanish in void

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] drop redundant check
Fabio M. Di Nitto [Sat, 12 Dec 2015 13:48:55 +0000 (14:48 +0100)]
[send/recv] drop redundant check

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] fix logging levels
Fabio M. Di Nitto [Sat, 12 Dec 2015 13:44:23 +0000 (14:44 +0100)]
[send/recv] fix logging levels

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate configure.ac for sendmmsg
Fabio M. Di Nitto [Sat, 12 Dec 2015 13:37:11 +0000 (14:37 +0100)]
Update configure.ac for sendmmsg

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[host] cleanup circular buffer function names
Fabio M. Di Nitto [Sat, 12 Dec 2015 13:06:57 +0000 (14:06 +0100)]
[host] cleanup circular buffer function names

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoSort TODO list
Fabio M. Di Nitto [Sat, 12 Dec 2015 07:56:13 +0000 (08:56 +0100)]
Sort TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[host] add host status change callback notifications
Fabio M. Di Nitto [Sat, 12 Dec 2015 06:40:55 +0000 (07:40 +0100)]
[host] add host status change callback notifications

API is also ready for further expansion (external and remote support),
but they are currently not implemented.

allow both notifications and polling of status via knet_host_get_status

use new notification and api polling in ping_test.c as unit test

use the new host status information in the TX thread to skip some
time consuming pckt processing if the destination host(s) is not
reachable

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] fix data len passed to dst host filter on the RX end
Fabio M. Di Nitto [Fri, 11 Dec 2015 05:04:44 +0000 (06:04 +0100)]
[send/recv] fix data len passed to dst host filter on the RX end

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[filters] be consistent and provide private data for all notifications/callbacks
Fabio M. Di Nitto [Thu, 10 Dec 2015 09:26:13 +0000 (10:26 +0100)]
[filters] be consistent and provide private data for all notifications/callbacks

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] improve dst_host_filter API to include more data to determine destination
Fabio M. Di Nitto [Wed, 9 Dec 2015 06:08:48 +0000 (07:08 +0100)]
[send/recv] improve dst_host_filter API to include more data to determine destination

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] add support for dynamic buffer allocation for packet re-assembly
Fabio M. Di Nitto [Wed, 9 Dec 2015 05:17:34 +0000 (06:17 +0100)]
[send/recv] add support for dynamic buffer allocation for packet re-assembly

this commit changes the on-wire protocol.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] fix host_id value in host_filter
Fabio M. Di Nitto [Tue, 8 Dec 2015 14:24:52 +0000 (15:24 +0100)]
[send/recv] fix host_id value in host_filter

thanks Chrissie for reporting the problem

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] Fix handling of HOSTINFO packets
Fabio M. Di Nitto [Mon, 30 Nov 2015 08:21:33 +0000 (09:21 +0100)]
[send/recv] Fix handling of HOSTINFO packets

HOSTINFO packets are nothing more than special cased DATA packets.

The contents of HOSTINFO is stored inside DATA of DATA packets and
up to the point where we need to use the HOSTINFO data, we need
to treat the packets as DATA for defragmentation and deduplication.

This also fixes a problem when using round-robin and active switching
policy where the HOSTINFO exchange would loop forever in a storm
because duplicate pckts were being handled at once.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Sun, 29 Nov 2015 11:50:58 +0000 (12:50 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoReplace memcpy with memmove across the board
Fabio M. Di Nitto [Sat, 28 Nov 2015 15:08:53 +0000 (16:08 +0100)]
Replace memcpy with memmove across the board

memmove is just a tiny littlebit faster than memcpy.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Sat, 28 Nov 2015 15:07:30 +0000 (16:07 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO
Fabio M. Di Nitto [Sat, 28 Nov 2015 13:42:16 +0000 (14:42 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[PMTUd] Fix crash and calculation when using crypto
Fabio M. Di Nitto [Sat, 28 Nov 2015 08:13:33 +0000 (09:13 +0100)]
[PMTUd] Fix crash and calculation when using crypto

most of the problem was around incorrect typing of variables
and incorrect calculation when using signing without encryption.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[libtap] automatic restore IPv6 address when recovering from MTU flapping
Fabio M. Di Nitto [Fri, 27 Nov 2015 16:38:18 +0000 (17:38 +0100)]
[libtap] automatic restore IPv6 address when recovering from MTU flapping

NOTE: if a user manually changes MTU < 1280, your IPv6 addresses
are gone for good.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Fri, 27 Nov 2015 14:33:09 +0000 (15:33 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO list
Fabio M. Di Nitto [Thu, 26 Nov 2015 13:53:20 +0000 (14:53 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[crypto] align crypto_authenticate_and_decrypt API to crypto_encrypt_and_sign
Fabio M. Di Nitto [Wed, 25 Nov 2015 19:15:22 +0000 (20:15 +0100)]
[crypto] align crypto_authenticate_and_decrypt API to crypto_encrypt_and_sign

2 issues solved by this change:

1) API were different and crypto_authenticate_and_decrypt would trash the
   incoming packet, that we might want to keep for later usage
   (re-switch for example)

2) By using an extre pre-allocated buffer while decrypting incoming packets
   we save a whole memcpy and that reduces latency on crypto communications:

pre-patch:

[root@kronosnet-node1-br0 ~]# ping 192.168.12.2 -f -c 1000 -s 65000
PING 192.168.12.2 (192.168.12.2) 65000(65028) bytes of data.

--- 192.168.12.2 ping statistics ---
1000 packets transmitted, 1000 received, 0% packet loss, time 5302ms
rtt min/avg/max/mdev = 5.102/5.283/22.679/0.947 ms, pipe 3, ipg/ewma 5.307/5.223 ms

post-patch:

[root@kronosnet-node1-br0 ~]# ping 192.168.12.2 -f -c 1000 -s 65000
PING 192.168.12.2 (192.168.12.2) 65000(65028) bytes of data.

--- 192.168.12.2 ping statistics ---
1000 packets transmitted, 1000 received, 0% packet loss, time 5196ms
rtt min/avg/max/mdev = 4.997/5.154/6.661/0.129 ms, ipg/ewma 5.201/5.173 ms

(using aes256 and sha1)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] init recv buffer array only once
Fabio M. Di Nitto [Sun, 22 Nov 2015 14:18:40 +0000 (15:18 +0100)]
[send/recv] init recv buffer array only once

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[internal] define/use PCKT_FRAG_MAX instead of UINT8_MAX
Fabio M. Di Nitto [Sun, 22 Nov 2015 14:01:00 +0000 (15:01 +0100)]
[internal] define/use PCKT_FRAG_MAX instead of UINT8_MAX

makes the code more readable

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoFix error message
Fabio M. Di Nitto [Sun, 22 Nov 2015 08:17:37 +0000 (09:17 +0100)]
Fix error message

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] use recvmmsg on network sockets
Fabio M. Di Nitto [Sun, 22 Nov 2015 08:12:18 +0000 (09:12 +0100)]
[send/recv] use recvmmsg on network sockets

On my test systems this change reduces the latency of fragmented packets
from 0.27ms to 0.235ms in average. There are still some optimizations
on how buffers can be initialized that could shave some time on this code
path.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate TODO
Fabio M. Di Nitto [Sun, 22 Nov 2015 08:12:04 +0000 (09:12 +0100)]
Update TODO

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years agoUpdate copyright dates
Fabio M. Di Nitto [Wed, 18 Nov 2015 09:36:11 +0000 (10:36 +0100)]
Update copyright dates

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[build] update configure.ac
Fabio M. Di Nitto [Wed, 18 Nov 2015 09:31:00 +0000 (10:31 +0100)]
[build] update configure.ac

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] fix data filling in the frag code
Fabio M. Di Nitto [Mon, 16 Nov 2015 06:20:13 +0000 (07:20 +0100)]
[send/recv] fix data filling in the frag code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] use sendmmsg to reduce latency
Fabio M. Di Nitto [Mon, 16 Nov 2015 06:11:34 +0000 (07:11 +0100)]
[send/recv] use sendmmsg to reduce latency

On my test systems this change reduces the latency from 0.7ms to 0.25ms
when sending 65000 bytes packet and using internal re-assembly code.

Internally use N buffers to split the incoming data and reduce by N frags
the amount of memcpy between kernel and userland.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[internal] reduce memory footprint further down
Fabio M. Di Nitto [Mon, 16 Nov 2015 04:16:25 +0000 (05:16 +0100)]
[internal] reduce memory footprint further down

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[global] reduce memory footprint by a long shot
Fabio M. Di Nitto [Sun, 20 Sep 2015 11:30:19 +0000 (13:30 +0200)]
[global] reduce memory footprint by a long shot

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 years ago[send/recv] add simplistic packet re-assembly code
Fabio M. Di Nitto [Sat, 24 Oct 2015 05:23:31 +0000 (07:23 +0200)]
[send/recv] add simplistic packet re-assembly code

this will probably explode if you are using multiple links
in round-robin or active-active mode.

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