From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C2BE7728E for ; Fri, 2 Feb 2018 11:45:34 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 02:45:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,448,1511856000"; d="scan'208";a="14941215" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.57]) ([10.67.68.57]) by orsmga008.jf.intel.com with ESMTP; 02 Feb 2018 02:45:31 -0800 To: Stephen Hemminger References: <1516938577-27662-3-git-send-email-jia.guo@intel.com> <1517314860-8097-1-git-send-email-jia.guo@intel.com> <20180130164436.5d8babcf@xeon-e3> Cc: bruce.richardson@intel.com, gaetan.rivet@6wind.com, jingjing.wu@intel.com, thomas@monjalon.net, motih@mellanox.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com, harry.van.haaren@intel.com, jianfeng.tan@intel.com From: "Guo, Jia" Message-ID: <8c67f41f-938a-c8b4-5152-254f261b9686@intel.com> Date: Fri, 2 Feb 2018 18:45:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20180130164436.5d8babcf@xeon-e3> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH V14 1/3] eal: add uevent monitor api and callback func 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: Fri, 02 Feb 2018 10:45:35 -0000 On 1/31/2018 8:44 AM, Stephen Hemminger wrote: > On Tue, 30 Jan 2018 20:20:58 +0800 > Jeff Guo wrote: > >> + memset(&ep_kernel, 0, sizeof(struct epoll_event)); >> + ep_kernel.events = EPOLLIN | EPOLLPRI | EPOLLRDHUP | EPOLLHUP; >> + ep_kernel.data.fd = netlink_fd; >> + if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, netlink_fd, >> + &ep_kernel) < 0) { >> + RTE_LOG(ERR, EAL, "error addding fd to epoll: %m\n"); >> + goto out; >> + } >> + >> + while (!service_exit) { >> + int fdcount; >> + struct epoll_event ev[1]; >> + >> + fdcount = epoll_wait(fd_ep, ev, 1, -1); >> + if (fdcount < 0) { >> + if (errno != EINTR) >> + RTE_LOG(ERR, EAL, "error receiving uevent " >> + "message: %m\n"); >> + continue; >> + } >> + >> + /* epoll_wait has at least one fd ready to read */ >> + if (dev_uev_process(ev, fdcount) < 0) { >> + if (errno != EINTR) >> + RTE_LOG(ERR, EAL, "error processing uevent " >> + "message: %m\n"); >> + } >> + } > What is the point of the extra epoll here? > Why not just make netlink_fd blocking and do recv? > Rather than having two syscalls per event. if device event monitor only monitor a netlink fd, that might be right not need to add extra epoll, let me think about that if it is need to restore for future advance or just make it simpler. thanks , stephen.