Thanks Stephen for your review and suggestion, I will involve them in next 
version.

Best regards,
Jeff Guo

-----Original Message-----
From: Stephen Hemminger [mailto:step...@networkplumber.org] 
Sent: Monday, September 4, 2017 12:12 AM
To: Guo, Jia <jia....@intel.com>
Cc: Richardson, Bruce <bruce.richard...@intel.com>; dev@dpdk.org; 
gaetan.ri...@6wind.com; shreyansh.j...@nxp.com; jblu...@infradead.org; Zhang, 
Helin <helin.zh...@intel.com>; Yigit, Ferruh <ferruh.yi...@intel.com>; Ananyev, 
Konstantin <konstantin.anan...@intel.com>; tho...@monjalon.net; Wu, Jingjing 
<jingjing...@intel.com>
Subject: Re: [PATCH v4 1/2] eal: add uevent monitor for hot plug

On Sun,  3 Sep 2017 23:49:44 +0800
Jeff Guo <jia....@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.

Reply via email to