DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Yang, Zhiyong" <zhiyong.yang@intel.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix remove the redundant computing
Date: Thu, 23 Feb 2017 06:31:23 +0000	[thread overview]
Message-ID: <E182254E98A5DA4EB1E657AC7CB9BD2A3EB72963@BGSMSX101.gar.corp.intel.com> (raw)
In-Reply-To: <20170223062048.GW18844@yliu-dev.sh.intel.com>

Hi,  yuanhan:

> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Thursday, February 23, 2017 2:21 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; maxime.coquelin@redhat.com
> Subject: Re: [PATCH] net/virtio: fix remove the redundant computing
> 
> On Thu, Feb 23, 2017 at 12:28:33PM +0800, Zhiyong Yang wrote:
> > This is not a bug.
> 
> Then adding "fix" prefix and fixline here doesn't seem proper to me.

Ok. I will remove them. 

> 
> > The minor change aims to remove the redundant computing and make it
> > easier to understand the code.
> > Fixes:01ad44fd374f("net/virtio: split Rx/Tx queue")
> > Cc: yuanhan.liu@linux.intel.com
> > Cc: maxime.coquelin@redhat.com
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> > ---
> >  drivers/net/virtio/virtio_rxtx.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/virtio/virtio_rxtx.c
> > b/drivers/net/virtio/virtio_rxtx.c
> > index cab6e8f..14c88c0 100644
> > --- a/drivers/net/virtio/virtio_rxtx.c
> > +++ b/drivers/net/virtio/virtio_rxtx.c
> > @@ -791,9 +791,9 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf
> > **rx_pkts, uint16_t nb_pkts)
> >
> >  		VIRTIO_DUMP_PACKET(rxm, rxm->data_len);
> >
> > -		rx_pkts[nb_rx++] = rxm;
> > +		rx_pkts[nb_rx] = rxm;
> >
> > -		rxvq->stats.bytes += rx_pkts[nb_rx - 1]->pkt_len;
> > +		rxvq->stats.bytes += rx_pkts[nb_rx++]->pkt_len;
> 
> Why not use "rxm->pkt_len" directly?

Good advice and it's better.

> 
> 	--yliu

  reply	other threads:[~2017-02-23  6:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  4:28 Zhiyong Yang
2017-02-23  6:20 ` Yuanhan Liu
2017-02-23  6:31   ` Yang, Zhiyong [this message]
2017-02-23  7:11 ` [dpdk-dev] [PATCH v2] net/virtio: " Zhiyong Yang
2017-02-23  7:34   ` Yuanhan Liu

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=E182254E98A5DA4EB1E657AC7CB9BD2A3EB72963@BGSMSX101.gar.corp.intel.com \
    --to=zhiyong.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.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).