[dpdk-dev] [PATCH V9 1/5] eal: add uevent monitor api and callback func

Stephen Hemminger stephen at networkplumber.org
Wed Jan 10 17:34:39 CET 2018


On Wed, 10 Jan 2018 17:12:20 +0800
Jeff Guo <jia.guo at intel.com> wrote:

> +static int
> +dev_monitor_fd_new(void)
> +{
> +
> +	int uevent_fd;
> +
> +	uevent_fd = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC |
> +			SOCK_NONBLOCK,
> +			NETLINK_KOBJECT_UEVENT);
> +	if (uevent_fd < 0) {

If you used a blocking socket, then epoll would not be necessary.
There is one netlink socket for whole system, and the thread is only
reading from one fd.


More information about the dev mailing list