[dpdk-dev] [PATCH] net/virtio: fix remove the redundant computing

Yang, Zhiyong zhiyong.yang at intel.com
Thu Feb 23 07:31:23 CET 2017


Hi,  yuanhan:

> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu at linux.intel.com]
> Sent: Thursday, February 23, 2017 2:21 PM
> To: Yang, Zhiyong <zhiyong.yang at intel.com>
> Cc: dev at dpdk.org; maxime.coquelin at 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 at linux.intel.com
> > Cc: maxime.coquelin at redhat.com
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang at 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


More information about the dev mailing list