From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id A6BC22A5D for ; Sat, 23 Apr 2016 00:42:26 +0200 (CEST) Received: by mail-pf0-f175.google.com with SMTP id n1so45444676pfn.2 for ; Fri, 22 Apr 2016 15:42:26 -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=4v+dyzlPY8JwYU6uGqTYp6aB1ICCOl9cZzlvtchxGgg=; b=cyDTuO0PLRRn1vLYL0uZZUST8AWnG+Mm4Umud0aV4Fzqwmq32GS7Q2ucmJDkEta/pA ltemtHRASI8if8/06aw6+FdyNMGDjnB/O53RxHmZ/hsMWdgxaHUxrl3bLR/prI/iyunC KoCK0AYnZu2tta3xCpAlJS9NEsjwXhh1FH+N6q1C5MsF7t4GHbVI/CxSTBcq+piBzAOK nX8p9tK/+WXq/2wznYurTR7qlEm32P1pznteGftrQzzRpEa+QrBdj47avN08Muhygtgg MVgCNKiud04bvyFpo19NriUp5LuIXUtfMu44FjxIqvpMmKgZuVf0neXn6yluFB1v6F13 nMMw== 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=4v+dyzlPY8JwYU6uGqTYp6aB1ICCOl9cZzlvtchxGgg=; b=Djf4QPpWqq3rHDFfC34T4Nd4ifgIbyGJRzis9+d8bm4TVscVspx7klWwSoXnIdSEQ5 zD2sQq4HU6nHK1bV1JNU0XZTZNmhF3FcigoF6VcpPHN4FHnswUP474sgjmKrCpQFfHof jPSByicFuCtbfR8NEZMZFEsiOTls2whHbEZy3OTpR0an3uZfAg+ryaanJ+EFGSQc3mcX pBWdWoNIRCndCCbMiOEidjEefTQZPG3gF5YKrRnhudN6suqoId0iHu4vtQvCjy46kw5z PXmhqwn1mR+4qBbh+4X7I0ME7UKfUCsc/qYjW3MipSpURPkN35z377hAMGq93gCSPFaS 5hKg== X-Gm-Message-State: AOPr4FU+S8rxhxIwLgeJzXjOXdqgZD06X38t8zRED8UXBpl8mO8TtEvM/znNoGPMxeDBvg== X-Received: by 10.98.71.13 with SMTP id u13mr7521504pfa.123.1461364945942; Fri, 22 Apr 2016 15:42:25 -0700 (PDT) Received: from xeon-e3 (static-50-53-72-186.bvtn.or.frontiernet.net. [50.53.72.186]) by smtp.gmail.com with ESMTPSA id y3sm11887414par.2.2016.04.22.15.42.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 15:42:25 -0700 (PDT) Date: Fri, 22 Apr 2016 15:42:39 -0700 From: Stephen Hemminger To: Yuanhan Liu Cc: Thomas Monjalon , dev@dpdk.org Message-ID: <20160422154239.5a3edecf@xeon-e3> In-Reply-To: <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> <20160422220850.GF7603@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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:42:27 -0000 On Fri, 22 Apr 2016 15:08:50 -0700 Yuanhan Liu wrote: > 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_mb= uf **rx_pkts, uint16_t nb_pkts) > > > > =20 > > > > PMD_RX_LOG(DEBUG, "rxd idx: %d ring idx: %d.", idx, ring_idx); > > > > =20 > > > > - VMXNET3_ASSERT(rcd->len <=3D rxd->len); > > > > - VMXNET3_ASSERT(rbi->m); > > > > + RTE_ASSERT(rcd->len <=3D rxd->len); > > > > + RTE_ASSERT(rbi->m); > > >=20 > > > Seems this piece of code introduces a build error: > > >=20 > > > drivers/net/vmxnet3/vmxnet3_rxtx.c: In function =E2=80=98vmxnet3_= recv_pkts=E2=80=99: > > > drivers/net/vmxnet3/vmxnet3_rxtx.c:635:18: error: variable =E2=80= =98rxd=E2=80=99 set but not used > > > Vmxnet3_RxDesc *rxd; > > > ^ > >=20 > > Indeed it can be seen with gcc when debug is disabled. > > It can be fixed this way: > >=20 > > --- 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 =3D rcd->rxdIdx; > > ring_idx =3D (uint8_t)((rcd->rqID =3D=3D rxq->qid1) ? 0= : 1); > > rxd =3D (Vmxnet3_RxDesc *)rxq->cmd_ring[ring_idx].base = + idx; > > + RTE_SET_USED(rxd); /* used only for assert when enabled= */ >=20 > How about adding the __rte_unused tag at where we declare it? >=20 > --yliu Why not just kill the useless assert's all together? They really only helpe= d during the short time developer is debugging this code.