The Linux uevent handler is harded for non-blocking receive behavior

Signed-off-by: Randy Tice <[email protected]>
---
 lib/eal/linux/eal_dev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index ec408649d0..29a889800a 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -241,9 +241,14 @@ dev_uev_handler(__rte_unused void *param)
 
        ret = recv(rte_intr_fd_get(intr_handle), buf, EAL_UEV_MSG_LEN,
                   MSG_DONTWAIT);
-       if (ret < 0 && errno == EAGAIN)
+       if (ret < 0 &&
+               (errno == EAGAIN || errno == EWOULDBLOCK))
                return;
-       else if (ret <= 0) {
+       else if (ret < 0 &&
+                (errno == ENOBUFS || errno == ENOMEM)) {
+               EAL_LOG(ERR, "unexpected error on uvent recv: %d", errno);
+               return;
+       } else if (ret <= 0) {
                /* connection is closed or broken, can not up again. */
                EAL_LOG(ERR, "uevent socket connection is broken.");
                rte_eal_alarm_set(1, dev_delayed_unregister, NULL);
-- 
2.51.0

Reply via email to