xlio: fix netlink recv hang in VM Environment
In VM environments, netlink dump responses may arrive with empty data or only NLMSG_DONE. XLIO's netlink_socket_mgr::recv_info() did not check nlmsg_type for NLMSG_DONE and blocked in recv() indefinitely. This patch updates recv_info() to iterate over nlmsghdr chain using NLMSG_NEXT and exit gracefully on NLMSG_DONE or NLMSG_ERROR.
Description
In VM environments, netlink dump responses may arrive with empty data or only NLMSG_DONE. XLIO's netlink_socket_mgr::recv_info() did not check nlmsg_type for NLMSG_DONE and blocked in recv() indefinitely. This patch updates recv_info() to iterate over nlmsghdr chain using NLMSG_NEXT and exit gracefully on NLMSG_DONE or NLMSG_ERROR.
What
_Subject: Netlink: recv_info hang in vm environment
Why ?
It should go over the entire chain of hdr and look for MSG_DONE flag
How ?
This patch updates recv_info() to iterate over nlmsghdr chain using NLMSG_NEXT and exit gracefully on NLMSG_DONE or NLMSG_ERROR
Change type
What kind of change does this PR introduce?
- [x] Bugfix
Can one of the admins verify this patch?
Without these changes route information are not getting populated.
@AlexanderGrissik , please review.
@tomerdbz your PR should fix this issue as well?
@tomerdbz your PR should fix this issue as well?
@tomerdbz ?
@tomerdbz?
@galnoam yup :)
@tomerdbz what is your PR can you give it here? As I gave seen the same issue in latest XLIO. Is it merged?
@susobhandey https://github.com/Mellanox/libxlio/pull/278 - not merged yet
Tomer PR was merged and should fix the issue, thanks.