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 73A59A00E6 for ; Thu, 8 Aug 2019 09:35:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3DC152C5; 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 01FD3F04 for ; Thu, 8 Aug 2019 09:35:43 +0200 (CEST) Received: by mail-ot1-f66.google.com with SMTP id l15so57639587oth.7 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=tPU07K/4kjhuju0HueAsXfe/zucQFe/D6Nn8zb2jKZ2VMlaePDh1HRWDl+H8lGFGQz wnyyMKvS+BF8lB+8Qw4o3h4WZbOseZps0h/T3G5lYaGJc7Hm5QYBdetIRhs3nphHRc1p WXhHHkq7sx3CS4qbsfFxo7AVTyP4MIHFiXcaZuYavswfwKqk3bQCntMo7kIlinmY9ZD3 m1cqd0Nle1byXTkRmBk1YviOwxqqAOzBJEumfZr/4MdQe1JTVHwW7tFpZuD4kITSmQKd /Ckxkf7IXa6KYeot5IyLxM/aa3vb1gV1ifaLVVDL+LhKGY+rX8kxyTpBaplReAn48WO4 WDBA== X-Gm-Message-State: APjAAAUi7gM2FlMiamGLR2sOgQuI6RZ76WNYpZqlqbSsVL9gn3dDrJVl BiQbUTSlZhf4ECzfPpa36yB8faXKSjBFpp/kbVi8ruW3ovc= 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-stable] [PATCH 19.11 V2 08/12] virtio: fix rx stats with vectorized functions X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 > >