From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id BA4B02B95 for ; Sat, 23 Apr 2016 00:07:11 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 22 Apr 2016 15:07:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,518,1455004800"; d="scan'208";a="938318423" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 22 Apr 2016 15:07:10 -0700 Date: Fri, 22 Apr 2016 15:08:50 -0700 From: Yuanhan Liu To: Thomas Monjalon Cc: dev@dpdk.org Message-ID: <20160422220850.GF7603@yliu-dev.sh.intel.com> References: <1461332640-24273-1-git-send-email-thomas.monjalon@6wind.com> <1461332640-24273-5-git-send-email-thomas.monjalon@6wind.com> <20160422195110.GE7603@yliu-dev.sh.intel.com> <4685487.eCM9t2Cvuq@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4685487.eCM9t2Cvuq@xps13> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 4/4] eal: add assert macro for debug 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: Fri, 22 Apr 2016 22:07:12 -0000 On Fri, Apr 22, 2016 at 11:14:35PM +0200, Thomas Monjalon wrote: > 2016-04-22 12:51, Yuanhan Liu: > > On Fri, Apr 22, 2016 at 03:44:00PM +0200, Thomas Monjalon wrote: > > > --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c > > > +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c > > > @@ -662,8 +662,8 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) > > > > > > PMD_RX_LOG(DEBUG, "rxd idx: %d ring idx: %d.", idx, ring_idx); > > > > > > - VMXNET3_ASSERT(rcd->len <= rxd->len); > > > - VMXNET3_ASSERT(rbi->m); > > > + RTE_ASSERT(rcd->len <= rxd->len); > > > + RTE_ASSERT(rbi->m); > > > > Seems this piece of code introduces a build error: > > > > drivers/net/vmxnet3/vmxnet3_rxtx.c: In function ‘vmxnet3_recv_pkts’: > > drivers/net/vmxnet3/vmxnet3_rxtx.c:635:18: error: variable ‘rxd’ set but not used > > Vmxnet3_RxDesc *rxd; > > ^ > > Indeed it can be seen with gcc when debug is disabled. > It can be fixed this way: > > --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c > +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c > @@ -658,6 +658,7 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) > idx = rcd->rxdIdx; > ring_idx = (uint8_t)((rcd->rqID == rxq->qid1) ? 0 : 1); > rxd = (Vmxnet3_RxDesc *)rxq->cmd_ring[ring_idx].base + idx; > + RTE_SET_USED(rxd); /* used only for assert when enabled */ How about adding the __rte_unused tag at where we declare it? --yliu