From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=YwVCSHW44TCk2HlkLSrRSH0sUKqaYuUYmirIJUEjYx8=; b=nM70lsuoXhxAJNLm4a5VxGCECD5wxBD9degkAQ5V0wfiNjy4ISXAOxJoFdaPzlkzP1 DKIufzUPgeFcJZ1kCE0iD2nBrpJc3yZ+RTiqJa1f69GNpTGGr5GzXzlthNAKG9wAG2yS kn0sTvHebsYrtKv7glaPAE0Tg3w+N8BkMOVCWAvfwxpR5r4FmPrDZBJgMu1agKu4GVfz g5k8MBdpu5xGfmxlMc83/iinMwCxwsuoM9XlQjrPtbkWv+Uv272LWquvtWmL9zbi1OKD WWfP8BK/LgoL6k/XE8z4TLLxucE4xGvahnwdLGklkdllhwLQFXL5ISJjKVlXyCJj+kk0 zIug== X-Gm-Message-State: ALoCoQkvVtZfPCEHMB3LAEcobXwdOZd6B6UsjmTn+xSQc8n0tcHpKAvwNGyv8ABh5BWI2gZ6ejTw X-Received: by 10.180.80.138 with SMTP id r10mr9890070wix.18.1436806643910; Mon, 13 Jul 2015 09:57:23 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id pn6sm18000515wjb.36.2015.07.13.09.57.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jul 2015 09:57:23 -0700 (PDT) From: Thomas Monjalon To: Cunming Liang Date: Mon, 13 Jul 2015 18:56:09 +0200 Message-ID: <3479933.5lm7YXT529@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1434686442-578-3-git-send-email-cunming.liang@intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: shemming@brocade.com, dev@dpdk.org, liang-min.wang@intel.com Subject: Re: [dpdk-dev] [PATCH v13 02/14] eal/linux: add rte_epoll_wait/ctl support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2015 16:57:24 -0000 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?