From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: Keith Wiles <keith.wiles@intel.com>,
dev@dpdk.org, huawei.xie@intel.com, adrien.mazarguil@6wind.com
Subject: Re: [dpdk-dev] [PATCH] gcc compiler option -Og warnings fix
Date: Tue, 5 Apr 2016 03:56:39 +0800 [thread overview]
Message-ID: <20160404195639.GJ3080@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <22459074.ccNYgpjxy1@xps13>
On Mon, Apr 04, 2016 at 04:10:54PM +0200, Thomas Monjalon wrote:
> --- a/lib/librte_vhost/vhost_rxtx.c
> +++ b/lib/librte_vhost/vhost_rxtx.c
> @@ -147,8 +147,10 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
> struct virtio_net_hdr_mrg_rxbuf virtio_hdr = {{0, 0, 0, 0, 0, 0}, 0};
>
> desc = &vq->desc[desc_idx];
> - if (unlikely(desc->len < vq->vhost_hlen))
> + if (unlikely(desc->len < vq->vhost_hlen)) {
> + *copied = 0;
> return -1;
> + }
>
> > err = copy_mbuf_to_desc(dev, vq, pkts[i], desc_idx, &copied);
> > @@ -531,7 +531,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
> > {
> > struct vhost_virtqueue *vq;
> > uint32_t pkt_idx = 0, nr_used = 0;
> > - uint16_t start, end;
> > + uint16_t start = 0, end = 0;
>
> I don't understand this one because the variables are not used if
> reserve_avail_buf_mergeable fails.
> I don't see any smart workaround.
> Huawei, Yuanhan, can we expect a little slowdown with this change?
I agree with you that the compiler seems buggy here, I'm okay with
the fix though: it should not introduce slowdown, IMO. However, I'd
ask the opinion from Huawei: he knows this better than me.
--yliu
next prev parent reply other threads:[~2016-04-04 19:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 19:20 Keith Wiles
2016-04-04 14:10 ` Thomas Monjalon
2016-04-04 19:56 ` Yuanhan Liu [this message]
2016-04-04 23:03 ` Wiles, Keith
2016-04-05 8:23 ` 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=20160404195639.GJ3080@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=huawei.xie@intel.com \
--cc=keith.wiles@intel.com \
--cc=thomas.monjalon@6wind.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).