]> git.proxmox.com Git - mirror_kronosnet.git/commitdiff
UDP: Don't keep retrying send if we get EINVAL
authorChristine Caulfield <ccaulfie@redhat.com>
Mon, 19 Feb 2018 14:13:41 +0000 (14:13 +0000)
committerChristine Caulfield <ccaulfie@redhat.com>
Mon, 19 Feb 2018 14:13:41 +0000 (14:13 +0000)
UDP can return EINVAL if the route is down or not configured, this can
cause knet to 'spin' (well, ish, there is a usleep in there).

With this patch in place knet doesn't hog the CPU anywhere near so much
(and it does recover if the link returns).

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
libknet/transport_udp.c

index e4e6164874d1d9770a31abd5ba4d4de214f80ee3..25e1ae64e19ae7a026535f070b2146895a9703ed 100644 (file)
@@ -401,6 +401,9 @@ int udp_transport_tx_sock_error(knet_handle_t knet_h, int sockfd, int recv_err,
                        read_errs_from_sock(knet_h, sockfd);
                        return 0;
                }
+               if (recv_errno == EINVAL) {
+                       return -1;
+               }
                if ((recv_errno == ENOBUFS) || (recv_errno == EAGAIN)) {
 #ifdef DEBUG
                        log_debug(knet_h, KNET_SUB_TRANSP_UDP, "Sock: %d is overloaded. Slowing TX down", sockfd);