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

Yuanhan Liu yuanhan.liu at linux.intel.com
Thu Feb 23 07:20:48 CET 2017


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.

> 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?

	--yliu


More information about the dev mailing list