From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by dpdk.org (Postfix) with ESMTP id 684A51B6EC for ; Wed, 31 Jan 2018 01:44:45 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id i66so10819714pfd.7 for ; Tue, 30 Jan 2018 16:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WQ+/6D85LYqMmftQFc4nIqKW3fbCcmXvjfhS95rxXDg=; b=M7XigzoDpjh8lcmAPA/cQeSbPm14HeEOGPq4o4GqA64TS+8ntyoi6XWWuBrqhEgROI YgtlTj++yWI6whwnilkZ+xdr5pZWyt/xZGz7J7bAYC2uhSHyrBDs3FL53jC5x7h3kxko rCJn43Tx4AKcByQrQcAwLBp1JoeCE/QP2MYkJYpAWSpPUAzQgIm2q7sLA7zM2S3b9F9f BtQVENzJfmeEsC7F73T0GMZiUyDrBYcps6cf8hGVGBiYTPFWRSrRGt4ltxqY3L2cafRH tKK1Uxkqw63Ki0UhM4D/QObYkJq7v81GZShqPys5pUS/fDGNG0TXMqw1ukd+fZ8yS3W2 su9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WQ+/6D85LYqMmftQFc4nIqKW3fbCcmXvjfhS95rxXDg=; b=pU59IFCM3ugG8JfRwzD2YlCjL4240fTzsFqgDAN7IauHVPmAAOfBNClgebbk8DBdsD NOBpWLXeJdDcZvzy1ioW1vW81rpuMCQ6PoA5Z5pAjkbMc7PhUc1IgEgXohrKsglRjupZ jGmZp5r4fTr16muxLpSg4JhuSAJOqdFu/SMzvFiikJ9EzpTN0cdatE+/XUmyLCK1+BbF rmYXGZfr++2nZfwSqlTu0M6h9ZeDIogN6EdbbmdbD22LxgNAfCPtdqZ/rZUssWNVR54m LmOFIrT7dJMqfaBh880Al+NZrayb7dfRkEajVIdr4DYdJY7bvDdFDizjuc9q1FIsPTOI C3xQ== X-Gm-Message-State: AKwxytcrbu73vW8NU03c0a/75drzx7Ey28zPphiLVSMdMXNI2JBhWfXE Nl4bBl905PP5IvmCJ9H7konCWQ== X-Google-Smtp-Source: AH8x227V64XNzqmrtVv86+EmRaRmzTi0wTGItEFLoeOHoXkjGxdGa6J+LoLuXHxsFtA1+gk9wFeg3A== X-Received: by 10.98.163.79 with SMTP id s76mr32319668pfe.67.1517359484455; Tue, 30 Jan 2018 16:44:44 -0800 (PST) Received: from xeon-e3 ([172.92.74.152]) by smtp.gmail.com with ESMTPSA id m9sm36675208pff.59.2018.01.30.16.44.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 16:44:44 -0800 (PST) Date: Tue, 30 Jan 2018 16:44:36 -0800 From: Stephen Hemminger To: Jeff Guo 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 Message-ID: <20180130164436.5d8babcf@xeon-e3> In-Reply-To: <1517314860-8097-1-git-send-email-jia.guo@intel.com> References: <1516938577-27662-3-git-send-email-jia.guo@intel.com> <1517314860-8097-1-git-send-email-jia.guo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Wed, 31 Jan 2018 00:44:45 -0000 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.