From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Guo, Jia" Subject: Re: [PATCH v4 1/2] eal: add uevent monitor for hot plug Date: Tue, 5 Sep 2017 05:28:03 +0000 Message-ID: <01BA8470C017D6468C8290E4B9C5E1E83B268A4A@shsmsx102.ccr.corp.intel.com> References: <1498712510-44217-2-git-send-email-jia.guo@intel.com> <1504453785-15735-1-git-send-email-jia.guo@intel.com> <1504453785-15735-2-git-send-email-jia.guo@intel.com> <20170903091200.206bb549@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Richardson, Bruce" , "dev@dpdk.org" , "gaetan.rivet@6wind.com" , "shreyansh.jain@nxp.com" , "jblunck@infradead.org" , "Zhang, Helin" , "Yigit, Ferruh" , "Ananyev, Konstantin" , "thomas@monjalon.net" , "Wu, Jingjing" To: Stephen Hemminger Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 779973254 for ; Tue, 5 Sep 2017 07:28:07 +0200 (CEST) In-Reply-To: <20170903091200.206bb549@xeon-e3> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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@networkplumber.org]=20 Sent: Monday, September 4, 2017 12:12 AM To: Guo, Jia Cc: Richardson, Bruce ; dev@dpdk.org; gaetan.ri= vet@6wind.com; shreyansh.jain@nxp.com; jblunck@infradead.org; Zhang, Helin = ; Yigit, Ferruh ; Ananyev, K= onstantin ; thomas@monjalon.net; Wu, Jingjing= Subject: Re: [PATCH v4 1/2] eal: add uevent monitor for hot plug On Sun, 3 Sep 2017 23:49:44 +0800 Jeff Guo wrote: > +int > +rte_eal_uev_enable(int netlink_fd) > +{ > + struct sockaddr_nl addr; > + int ret; > + int size =3D 64 * 1024; > + int nonblock =3D 1; > + memset(&addr, 0, sizeof(addr)); Blank line between declarations and code. Also use C99 style intializations not memset. > + addr.nl_family =3D AF_NETLINK; > + addr.nl_pid =3D 0; > + addr.nl_groups =3D 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 i= s enough.