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 B1F63A00E6 for ; Thu, 8 Aug 2019 09:35:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 63F01276C; Thu, 8 Aug 2019 09:35:45 +0200 (CEST) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by dpdk.org (Postfix) with ESMTP id F28392C5 for ; Thu, 8 Aug 2019 09:35:43 +0200 (CEST) Received: by mail-ot1-f66.google.com with SMTP id z23so6625432ote.13 for ; Thu, 08 Aug 2019 00:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WVD6BuC6wdehAVO7APtWzq9MQwLxCClYrMJwjOI5GCY=; b=goRr4hZfqvmzrjJMl2QAdSL4ajZJpS0jo9EczJK+l0VYPuklzPABwWZp29BUKSEmNx qDevL3A6+DVDmjYlUqiBY07Bv8kkGFsaAauhDhTNqxW0kO9TTBJShwofALI9A+wKK7gY mZBPXOewDaugS1bivPM2mcfzLm4SToqwC7BC2R+UKpSpLtzxqjdDo9+GeQjb+y28KBxk yG3KY5WGzaAVMI1oBws8zg5znDt1TxA/ANzlpOdlY2skHBM9VNiFwJVeaEXh9veyqzFc qmv2fhPluJcqZQZwtSRcsZTUO5H4W+BHczxHDYy3KvRScn/2F5+4lQaLA7cGoYRUq1VH AR5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WVD6BuC6wdehAVO7APtWzq9MQwLxCClYrMJwjOI5GCY=; b=SOmEq1cORy4H05XAYOBuz7tdpJsxPVkI4fRE2en2qMPew6pk/sEMR3yKMt0M/SK2Pt eXfDD3ASUlrtpTg/vur3YO5sQUgQsgZick8R0hFulNPCc88PyRdurJL71RXOi5ylQy+l /5z/r6XT/Ukb2EsqODgOrkGAmOaSWycythzNutaM5pJdF7VX7TPcbXjfGU8GLGVcTKMg qYVc6JwRGlHzJ6nBHqEsT1KAFlCPFUxnYrHqNlISYBHNLzf5DS0vlqeVd+ZQGaLIZ2Io 3Bmz6THTRoQV+3xQkvNG1v+1L7Yxxt8q/HH4wUZG9PrqP66UrwOMI1J3HG9Nkg2kJE2G B/Mg== X-Gm-Message-State: APjAAAWP5RpTXj1p/UseJxeXtS++sriBu19FETRDIbfoKx5FnLxVukma zZbNYYzIwYiDAbysfO82JdBUtCqnzLOJG4D+eZsUyQ== X-Google-Smtp-Source: APXvYqz9XHrm6uSwzUx+CdQuFZKTZHL5ACUC7ybm6Jo8qIvBnqTtZv6ubrP4fGk1aK40Pbjqdz9wsZpIPZGS1gBzFbA= X-Received: by 2002:a6b:8b0b:: with SMTP id n11mr14041291iod.101.1565249743347; Thu, 08 Aug 2019 00:35:43 -0700 (PDT) MIME-Version: 1.0 References: <20190808051547.GA16478@___> In-Reply-To: <20190808051547.GA16478@___> From: Thibaut Collet Date: Thu, 8 Aug 2019 09:35:32 +0200 Message-ID: To: Tiwei Bie Cc: Thierry Herbelot , dev@dpdk.org, stable@dpdk.org, Thomas Monjalon Content-Type: text/plain; charset="UTF-8" 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 Thu, Aug 8, 2019 at 7:17 AM Tiwei Bie wrote: > > 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? The test has been done with a 6wind application based on dpdk and I have not keep details. With test pmd impact is maybe a little bit higher. > > > > 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. Agree. My correction is an old one, done on the old 18.11 dpdk, and so done before patch https://git.dpdk.org/dpdk/commit/drivers/net/virtio/virtio_rxtx.c?id=81e5cdf19e583c742040d3be83b8cc79b451e243. So the line + rxvq->stats.bytes += ref_rx_pkts[nb_used]->pkt_len; must be removed to be compliant with Ilya Maximets patch. > > > + } > > return nb_pkts_received; > > } > > -- > > 2.11.0 > >