[dpdk-dev] [PATCH v4 1/2] eal: add uevent monitor for hot plug
Guo, Jia
jia.guo at intel.com
Tue Sep 5 07:28:03 CEST 2017
Thanks Stephen for your review and suggestion, I will involve them in next version.
Best regards,
Jeff Guo
-----Original Message-----
From: Stephen Hemminger [mailto:stephen at networkplumber.org]
Sent: Monday, September 4, 2017 12:12 AM
To: Guo, Jia <jia.guo at intel.com>
Cc: Richardson, Bruce <bruce.richardson at intel.com>; dev at dpdk.org; gaetan.rivet at 6wind.com; shreyansh.jain at nxp.com; jblunck at infradead.org; Zhang, Helin <helin.zhang at intel.com>; Yigit, Ferruh <ferruh.yigit at intel.com>; Ananyev, Konstantin <konstantin.ananyev at intel.com>; thomas at monjalon.net; Wu, Jingjing <jingjing.wu at 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.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