From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 04 Sep 2017 22:28:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,478,1498546800"; d="scan'208";a="1169147962" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 04 Sep 2017 22:28:06 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Sep 2017 22:28:06 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.39]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Tue, 5 Sep 2017 13:28:04 +0800 From: "Guo, Jia" To: Stephen Hemminger 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" Thread-Topic: [PATCH v4 1/2] eal: add uevent monitor for hot plug Thread-Index: AQHTJMwu2r0nwjeYIkyW5DhEfgPDYaKizwoAgAL2VCA= 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> In-Reply-To: <20170903091200.206bb549@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGY5MzhkZjMtM2Y2Ni00YjhlLWE0NzEtYWM3Yzc4ZGEwYzJjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlZUbzhpS3JaVU9TaWxQRHBsRGFqNzJoNzZJVUsrU0dDUUZzQ2hrSjZiZFU9In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 1/2] eal: add uevent monitor for hot plug X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 05:28:08 -0000 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.