From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v13 02/14] eal/linux: add rte_epoll_wait/ctl support Date: Mon, 13 Jul 2015 18:56:09 +0200 Message-ID: <3479933.5lm7YXT529@xps13> References: <1433741351-27005-1-git-send-email-cunming.liang@intel.com> <1434686442-578-1-git-send-email-cunming.liang@intel.com> <1434686442-578-3-git-send-email-cunming.liang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: shemming@brocade.com, dev@dpdk.org, liang-min.wang@intel.com To: Cunming Liang Return-path: Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 09248569A for ; Mon, 13 Jul 2015 18:57:24 +0200 (CEST) Received: by wgmn9 with SMTP id n9so47939941wgm.0 for ; Mon, 13 Jul 2015 09:57:23 -0700 (PDT) In-Reply-To: <1434686442-578-3-git-send-email-cunming.liang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-06-19 12:00, Cunming Liang: > +int > +rte_epoll_wait(int epfd, struct rte_epoll_event *events, > + int maxevents, int timeout) > +{ > + struct epoll_event evs[maxevents]; > + int rc; > + > + if (!events) { > + RTE_LOG(ERR, EAL, "rte_epoll_event can't be NULL\n"); > + return -1; > + } > + > + /* using per thread epoll fd */ > + if (epfd == RTE_EPOLL_PER_THREAD) > + epfd = rte_intr_tls_epfd(); > + > + while (1) { > + rc = epoll_wait(epfd, evs, maxevents, timeout); > + if (likely(rc > 0)) { > + /* epoll_wait has at least one fd ready to read */ > + rc = eal_epoll_process_event(evs, rc, events); > + break; > + } else if (rc < 0) { > + if (errno == EINTR) > + continue; > + /* epoll_wait fail */ > + RTE_LOG(ERR, EAL, "epoll_wait returns with fail %s\n", > + strerror(errno)); > + rc = -1; > + break; > + } > + } > + > + return rc; > +} In general, such loop is application-level. What is the added value of rte_epoll_wait()? Do we need some wrappers to libc in DPDK?