From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH V9 1/5] eal: add uevent monitor api and callback func Date: Wed, 10 Jan 2018 08:34:39 -0800 Message-ID: <20180110083439.0a9f4fe8@xeon-e3> References: <1515555037-9419-4-git-send-email-jia.guo@intel.com> <1515575544-2141-1-git-send-email-jia.guo@intel.com> <1515575544-2141-2-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com, gaetan.rivet@6wind.com, konstantin.ananyev@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, jingjing.wu@intel.com, dev@dpdk.org, thomas@monjalon.net, helin.zhang@intel.com, motih@mellanox.com To: Jeff Guo Return-path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id B0BF61B21B for ; Wed, 10 Jan 2018 17:34:48 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id j2so10011980pgv.3 for ; Wed, 10 Jan 2018 08:34:48 -0800 (PST) In-Reply-To: <1515575544-2141-2-git-send-email-jia.guo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 10 Jan 2018 17:12:20 +0800 Jeff Guo wrote: > +static int > +dev_monitor_fd_new(void) > +{ > + > + int uevent_fd; > + > + uevent_fd = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC | > + SOCK_NONBLOCK, > + NETLINK_KOBJECT_UEVENT); > + if (uevent_fd < 0) { If you used a blocking socket, then epoll would not be necessary. There is one netlink socket for whole system, and the thread is only reading from one fd.