From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A3EEA00E6 for ; Thu, 8 Aug 2019 07:17:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44CEC29AC; Thu, 8 Aug 2019 07:17:56 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 04E8FF04; Thu, 8 Aug 2019 07:17:54 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2019 22:17:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,360,1559545200"; d="scan'208";a="326199500" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.71]) by orsmga004.jf.intel.com with ESMTP; 07 Aug 2019 22:17:52 -0700 Date: Thu, 8 Aug 2019 13:15:47 +0800 From: Tiwei Bie To: Thierry Herbelot Cc: dev@dpdk.org, Thibaut Collet , stable@dpdk.org, Thomas Monjalon Message-ID: <20190808051547.GA16478@___> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 19.11 V2 08/12] virtio: fix rx stats with vectorized functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Aug 07, 2019 at 05:09:17PM +0200, Thierry Herbelot wrote: > From: Thibaut Collet > > With vectorized functions, only the rx stats for number of packets is > incremented. > Update also the other statistics. > Performance impact is about 2% Could you share some details about your performance test? > diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c > index af76708d66ae..c757e8c9d601 100644 > --- a/drivers/net/virtio/virtio_rxtx_simple_sse.c > +++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c > @@ -48,6 +48,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > struct vring_used_elem *rused; > struct rte_mbuf **sw_ring; > struct rte_mbuf **sw_ring_end; > + struct rte_mbuf **ref_rx_pkts; > uint16_t nb_pkts_received = 0; > __m128i shuf_msk1, shuf_msk2, len_adjust; > > @@ -107,6 +108,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > virtqueue_notify(vq); > } > > + ref_rx_pkts = rx_pkts; > for (nb_pkts_received = 0; > nb_pkts_received < nb_used;) { > __m128i desc[RTE_VIRTIO_DESC_PER_LOOP / 2]; > @@ -190,5 +192,9 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > vq->vq_used_cons_idx += nb_pkts_received; > vq->vq_free_cnt += nb_pkts_received; > rxvq->stats.packets += nb_pkts_received; > + for (nb_used = 0; nb_used < nb_pkts_received; nb_used++) { > + rxvq->stats.bytes += ref_rx_pkts[nb_used]->pkt_len; > + virtio_update_packet_stats(&rxvq->stats, ref_rx_pkts[nb_used]); The stats.bytes was updated twice by above code. > + } > return nb_pkts_received; > } > -- > 2.11.0 >