From: Stephen Hemminger <stephen@networkplumber.org>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Cc: Thomas Monjalon <thomas.monjalon@6wind.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 4/4] eal: add assert macro for debug
Date: Fri, 22 Apr 2016 15:42:39 -0700 [thread overview]
Message-ID: <20160422154239.5a3edecf@xeon-e3> (raw)
In-Reply-To: <20160422220850.GF7603@yliu-dev.sh.intel.com>
On Fri, 22 Apr 2016 15:08:50 -0700
Yuanhan Liu <yuanhan.liu@linux.intel.com> 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_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
Why not just kill the useless assert's all together? They really only helped during the short
time developer is debugging this code.
next prev parent reply other threads:[~2016-04-22 22:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 13:43 [dpdk-dev] [PATCH 0/4] cleanup debug and dead code Thomas Monjalon
2016-04-22 13:43 ` [dpdk-dev] [PATCH 1/4] eal: increase log level of some messages Thomas Monjalon
2016-04-22 13:43 ` [dpdk-dev] [PATCH 2/4] log: increase default level to info Thomas Monjalon
2016-04-22 13:43 ` [dpdk-dev] [PATCH 3/4] examples: remove useless debug flags Thomas Monjalon
2016-04-28 20:15 ` Yuanhan Liu
2016-04-22 13:44 ` [dpdk-dev] [PATCH 4/4] eal: add assert macro for debug Thomas Monjalon
2016-04-22 19:51 ` Yuanhan Liu
2016-04-22 21:14 ` Thomas Monjalon
2016-04-22 22:08 ` Yuanhan Liu
2016-04-22 22:42 ` Stephen Hemminger [this message]
2016-04-29 9:04 ` Thomas Monjalon
2016-05-02 13:37 ` [dpdk-dev] [PATCH 0/4] cleanup debug and dead code Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160422154239.5a3edecf@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.com \
--cc=yuanhan.liu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).