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 EB4ABA2EDB for ; Mon, 30 Sep 2019 20:28:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A0A81BE3D; Mon, 30 Sep 2019 20:28:10 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id 8C25B1B94A; Mon, 30 Sep 2019 20:28:08 +0200 (CEST) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8UICFJE030640; Mon, 30 Sep 2019 14:28:00 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2vbp1badrk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Sep 2019 14:28:00 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8UIDC6g033115; Mon, 30 Sep 2019 14:28:00 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 2vbp1badqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Sep 2019 14:28:00 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8UIOWWu015006; Mon, 30 Sep 2019 18:27:59 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma02dal.us.ibm.com with ESMTP id 2v9y57a5ne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Sep 2019 18:27:59 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8UIRvQB50332156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Sep 2019 18:27:57 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2B4F6A047; Mon, 30 Sep 2019 18:27:57 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 179846A051; Mon, 30 Sep 2019 18:27:56 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 30 Sep 2019 18:27:56 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: stable@dpdk.org, thibaut.collet@6wind.com, maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com, jerinj@marvell.com, gavin.hu@arm.com, David Christensen Date: Mon, 30 Sep 2019 11:27:54 -0700 Message-Id: <20190930182754.20494-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <4532a3e5b53802da7e1b35c6c9383b406a18c30d.1568216827.git.thierry.herbelot@6wind.com> References: <4532a3e5b53802da7e1b35c6c9383b406a18c30d.1568216827.git.thierry.herbelot@6wind.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-30_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=795 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909300165 Subject: [dpdk-dev] [PATCH] net/virtio: fix Rx stats with altivec 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" With vectorized functions, only the rx stats for number of packets is incremented. Update also the other statistics. Performance impact is about 2% Fixes: fc3d66212fed ("virtio: add vector Rx") Cc: stable@dpdk.org Cc: thibaut.collet@6wind.com Cc: maxime.coquelin@redhat.com Cc: tiwei.bie@intel.com Cc: zhihong.wang@intel.com Signed-off-by: David Christensen --- drivers/net/virtio/virtio_rxtx_simple_altivec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/virtio/virtio_rxtx_simple_altivec.c b/drivers/net/virtio/virtio_rxtx_simple_altivec.c index 1cd732dec..f856396ab 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_altivec.c +++ b/drivers/net/virtio/virtio_rxtx_simple_altivec.c @@ -49,6 +49,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; const vector unsigned char zero = {0}; @@ -108,6 +109,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;) { vector unsigned char desc[RTE_VIRTIO_DESC_PER_LOOP / 2]; @@ -199,5 +201,8 @@ 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++) + virtio_update_packet_stats(&rxvq->stats, ref_rx_pkts[nb_used]); + return nb_pkts_received; } -- 2.18.1