[dpdk-dev] [PATCH v4 1/2] eal: add uevent monitor for hot plug

Stephen Hemminger stephen at networkplumber.org
Sun Sep 3 18:12:00 CEST 2017


On Sun,  3 Sep 2017 23:49:44 +0800
Jeff Guo <jia.guo at intel.com> wrote:

> +int
> +rte_eal_uev_enable(int netlink_fd)
> +{
> +	struct sockaddr_nl addr;
> +	int ret;
> +	int size = 64 * 1024;
> +	int nonblock = 1;
> +	memset(&addr, 0, sizeof(addr));

Blank line between declarations and code.
Also use C99 style intializations not memset.

> +	addr.nl_family = AF_NETLINK;
> +	addr.nl_pid = 0;
> +	addr.nl_groups = 0xffffffff;

You don't need or want all events. specify which group you want.

> +
> +	setsockopt(netlink_fd, SOL_SOCKET, SO_RCVBUFFORCE, &size, sizeof(size));

Don't user BUFFORCE, that is only available as root. Just doing SO_RCVBUF is enough.


More information about the dev mailing list