From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) by dpdk.org (Postfix) with ESMTP id 27988567F for ; Thu, 17 Mar 2016 18:19:31 +0100 (CET) Received: by mail-oi0-f49.google.com with SMTP id r187so68977126oih.3 for ; Thu, 17 Mar 2016 10:19:31 -0700 (PDT) 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=6buYbfyFeZL8TyayKE2kz/uFrvL5d2RogirwGfv3UNs=; b=qMFHiz+zLy0zMs2KIsiaKBgpTyXfjeMhNiLHeE8GO+8BB1zxnWSTeKDhp3Kc8xVw4U tb78y7l91KSIP+iuGlXQ2G+3fQecfIYWPgDiHOT7OeTkykgt7AaSCEHiZMWF3jMgOkzY 8oCmfeAZOTyvF9CSXVZIhCHyT8G4YYkCGN7/qumuF+3rkTMrjYFrxGQInfuQITsgMoGc YGVIMhx04j6KVPodUFQOvvHcExr3KUVAHMeK9sFFlXoCMOoDRrrca+AVH6QErTM6VpsJ dKnzLaPufv4rK5Di3pFAsi36Pnc5LXwEBdfDW88PfP6hpN4CZiIrAePq/veZ1rNuCwDz zalQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6buYbfyFeZL8TyayKE2kz/uFrvL5d2RogirwGfv3UNs=; b=KxTsAsG3/CNIQzwjw57L3Ijz+9uGnG1s34HUUPdX98haBB5UdqBjbiEsN7BculiaXo DtriicWs0dQ2vci6KqE9PhejzRXxLPVPs+UzhtQ398lKy4zeUmjH8sTC4eRcoFB+6Ppz ddH/IXQnoYByq2PvZJ51/zGchGX8kXV7cHGkUw17B+G0Ki/1sSbyqe7+pw9K+7jSH/mX KXtjWzMUbF5KU1pYZDgfJ4m78DK4wlSai3phyEIwZNljbk10hNPjzlhq8ev2CKEXZuqr vKksiKZEsuGsjx2zW6dkP1uOAae3hsIR9d/pnj9E4fiEQ9tubO5dhxK46iJ1zHgyre3P ZJmg== X-Gm-Message-State: AD7BkJIYKjxNKZwx+Ztr81JLCx0Q0mLRotrA7P9cozfV7iP30BsRgd+Q9TIYREnpuSGkjw== X-Received: by 10.202.213.80 with SMTP id m77mr4909993oig.102.1458235170648; Thu, 17 Mar 2016 10:19:30 -0700 (PDT) Received: from samsung9 (sccc-66-78-236-243.smartcity.com. [66.78.236.243]) by smtp.gmail.com with ESMTPSA id w123sm4026370oiw.28.2016.03.17.10.19.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Mar 2016 10:19:30 -0700 (PDT) Date: Thu, 17 Mar 2016 10:19:24 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, Matthew Hall Message-ID: <20160317101924.16f7bf45@samsung9> In-Reply-To: <1663421.MSGVGpLJHn@xps13> References: <1455345678-17662-1-git-send-email-mhall@mhcomputing.net> <20160214122209.38b0efb6@xeon-e3> <1663421.MSGVGpLJHn@xps13> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 17:19:31 -0000 On Thu, 17 Mar 2016 15:18:15 +0100 Thomas Monjalon wrote: > 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 */ > > Sure I thought Matthew would since he reported the issue and had the ability to test it.