]> git.proxmox.com Git - mirror_kronosnet.git/commitdiff
[listener] fix listener sock configuration to match other sockets
authorFabio M. Di Nitto <fdinitto@redhat.com>
Sat, 15 Oct 2016 12:09:00 +0000 (14:09 +0200)
committerFabio M. Di Nitto <fdinitto@redhat.com>
Sat, 15 Oct 2016 12:09:00 +0000 (14:09 +0200)
add send buffer and avoid EAGAIN issues on high load by delegating
buffering to the kernel

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

index f2944aed74c90cd23e9c7213b053b7361ccbed1b..4278f77924f9be4ec0c7c6133285ddc4c8c756e4 100644 (file)
@@ -80,6 +80,15 @@ int _listener_add(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
                        goto exit_unlock;
                }
 
+               value = KNET_RING_RCVBUFF;
+               if (setsockopt(listener->sock, SOL_SOCKET, SO_SNDBUFFORCE, &value, sizeof(value)) < 0) {
+                       savederrno = errno;
+                       err = -1;
+                       log_err(knet_h, KNET_SUB_LISTENER, "Unable to set listener send buffer: %s",
+                               strerror(savederrno));
+                       goto exit_unlock;
+               }
+
                value = 1;
                if (setsockopt(listener->sock, SOL_IP, IP_FREEBIND, &value, sizeof(value)) <0) {
                        savederrno = errno;