From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 45792B62 for ; Thu, 17 Mar 2016 15:19:45 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id p65so119637240wmp.0 for ; Thu, 17 Mar 2016 07:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=JJ8JqzNSIs/WiB+vQ2GzSepschfdPqGkMOOmME9RSJk=; b=eea73KJTsDKtLwVIwrfS3FE4xyNCXgFVd0R77tyvvBYKCn+r7Lhih63XywNOseEJXJ QFYEbdO2iMVAABO30eRMX8JsLQ022PzirSkDmd8c62tIko9YH5SZjI0L+ucIt9uUyL0Y EXrHdj+Y5a+zrU51qu9VRlDKmdh+8HhvCy3yjwhoMJ5oR7wOyEvq2+OviJR7ddN+Y13T RUH5fXnSgjwQdOoTyMF/KCjkSdvkeyiG5GANeGsjoOidUcSyRlT4lQRTnwiL8MwSRA7U yy2re3y30TAYejZPYr0crPAGRXGAuL9frQKwZciVdN6FSbHdR57vkGSGWos5kj9VT9y7 Y21A== 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; bh=JJ8JqzNSIs/WiB+vQ2GzSepschfdPqGkMOOmME9RSJk=; b=cK6kGKiWyakl0JKZQOzVm1mp+w9ZJWT72QvEkpiiAX9nxjMQU+67JVvox4pzrlpvmt w3SR2B/rzAqd5/YG+a0nRwh5ixCT2L8/SPXGWToxcBDGbhVIag8JwiXrLNIIh0IYKwCa CkPgJRSI0fpa+NFwYLP+iPSxHf6iStQdj65Q34UltYgznFMdSA6PmF10q5wonBUGKWTt pcpqUWHUZc6Ro90BBUJpZtwHGK8igChU2spNooTsXiFWdGhav+9qqZWBbggi3Z/OKFyQ Rql4j+/rRPXzdWsa08Ic209OIblcdqRTzYs6UUbhVr4yVR8hIGNGqvfMX5T4YNLTv4P8 aChQ== X-Gm-Message-State: AD7BkJLs+4gVfziPQO35T87SNoGC16LgnbPGEvFn+/KLIvKJYU2M11FMOEx7Pkwp0WZEEfOm X-Received: by 10.28.101.133 with SMTP id z127mr11374107wmb.84.1458224385055; Thu, 17 Mar 2016 07:19:45 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id w188sm30344595wmw.19.2016.03.17.07.19.43 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Mar 2016 07:19:44 -0700 (PDT) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org, Matthew Hall Date: Thu, 17 Mar 2016 15:18:15 +0100 Message-ID: <1663421.MSGVGpLJHn@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20160214122209.38b0efb6@xeon-e3> References: <1455345678-17662-1-git-send-email-mhall@mhcomputing.net> <20160214122209.38b0efb6@xeon-e3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal_interrupts.c: properly init struct epoll_event (valgrind) 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: Thu, 17 Mar 2016 14:19:45 -0000 Hi Stephen, Please, could you turn it into a real patch with your sign-off? Thanks 2016-02-14 12:22, Stephen Hemminger: > A better patch would be to move the data structure into the > code block used, and get rid of the useless else (rte_panic never returns); > and fix the indentation, and use C99 initialization which should make valgrind > happier. > > The moral is don't just slap memsets around > > diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c > index 06b26a9..d53826e 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c > +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c > @@ -799,8 +799,6 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds) > static __attribute__((noreturn)) void * > eal_intr_thread_main(__rte_unused void *arg) > { > - struct epoll_event ev; > - > /* host thread, never break out */ > for (;;) { > /* build up the epoll fd with all descriptors we are to > @@ -834,20 +832,22 @@ eal_intr_thread_main(__rte_unused void *arg) > TAILQ_FOREACH(src, &intr_sources, next) { > if (src->callbacks.tqh_first == NULL) > continue; /* skip those with no callbacks */ > - ev.events = EPOLLIN | EPOLLPRI; > - ev.data.fd = src->intr_handle.fd; > + > + struct epoll_event ev = { > + .events = EPOLLIN | EPOLLPRI, > + .data.fd = src->intr_handle.fd, > + }; > > /** > * add all the uio device file descriptor > * into wait list. > */ > if (epoll_ctl(pfd, EPOLL_CTL_ADD, > - src->intr_handle.fd, &ev) < 0){ > + src->intr_handle.fd, &ev) < 0) > rte_panic("Error adding fd %d epoll_ctl, %s\n", > src->intr_handle.fd, strerror(errno)); > - } > - else > - numfds++; > + > + numfds++; > } > rte_spinlock_unlock(&intr_lock); > /* serve the interrupt */