When rte_eal_cleanup is called, all control threads should exit.
For the mp thread, this best handled by closing the mp_socket
and letting the thread see that.
This also fixes potential problems where the mp_socket gets
another hard error, and the thread runs away repeating itself
by reading the same error.
Fixes:
85d6815fa6d0 ("eal: close multi-process socket during cleanup")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
msgh.msg_control = control;
msgh.msg_controllen = sizeof(control);
msgh.msg_control = control;
msgh.msg_controllen = sizeof(control);
msglen = recvmsg(mp_fd, &msgh, 0);
msglen = recvmsg(mp_fd, &msgh, 0);
+
+ /* zero length message means socket was closed */
+ if (msglen == 0)
+ return 0;
+
+ if (errno == EINTR)
+ goto retry;
+
RTE_LOG(ERR, EAL, "recvmsg failed, %s\n", strerror(errno));
return -1;
}
RTE_LOG(ERR, EAL, "recvmsg failed, %s\n", strerror(errno));
return -1;
}
RTE_LOG(ERR, EAL, "invalid received data length\n");
return -1;
}
RTE_LOG(ERR, EAL, "invalid received data length\n");
return -1;
}
struct sockaddr_un sa;
while (mp_fd >= 0) {
struct sockaddr_un sa;
while (mp_fd >= 0) {
- if (read_msg(&msg, &sa) == 0)
- process_msg(&msg, &sa);
+ int ret;
+
+ ret = read_msg(&msg, &sa);
+ if (ret <= 0)
+ break;
+
+ process_msg(&msg, &sa);