From patchwork Fri Jul 10 02:38:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 73679 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BAD4A0526; Fri, 10 Jul 2020 04:42:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A11A71DD2F; Fri, 10 Jul 2020 04:42:03 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 92AA61DA9A for ; Fri, 10 Jul 2020 04:42:02 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 15D1931B; Thu, 9 Jul 2020 19:42:02 -0700 (PDT) Received: from net-arm-thunderx2-03.shanghai.arm.com (net-arm-thunderx2-03.shanghai.arm.com [10.169.208.204]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2048C3F9AB; Thu, 9 Jul 2020 19:41:56 -0700 (PDT) From: Joyce Kong To: maxime.coquelin@redhat.com, jerinj@marvell.com, zhihong.wang@intel.com, amorenoz@redhat.com, mb@smartsharesystems.com, xiaolong.ye@intel.com, beilei.xing@intel.com, jia.guo@intel.com, john.mcnamara@intel.com, matan@mellanox.com, shahafs@mellanox.com, viacheslavo@mellanox.com, honnappa.nagarahalli@arm.com, phil.yang@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Fri, 10 Jul 2020 10:38:49 +0800 Message-Id: <20200710023850.43898-3-joyce.kong@arm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710023850.43898-1-joyce.kong@arm.com> References: <20200611033248.39049-1-joyce.kong@arm.com> <20200710023850.43898-1-joyce.kong@arm.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 2/3] net/virtio: restrict pointer aliasing for NEON vpmd 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" Restrict pointer aliasing to allow the compiler to vectorize loops more aggressively. With this patch, a 9.6% improvement is observed in throughput for the virtio-net PVP case, and a 2.4% perf improvement in throughput for the virtio-user PVP case. All performance data are measured on ThunderX-2 platform under the 0.001% acceptable packet loss with 2 cores on the vhost side and 1 core on the virtio side. Signed-off-by: Joyce Kong Reviewed-by: Phil Yang --- drivers/net/virtio/virtio_rxtx_simple_neon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c index 8e6fa1fd7..a9b649814 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_neon.c +++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c @@ -36,8 +36,8 @@ * - nb_pkts < RTE_VIRTIO_DESC_PER_LOOP, just return no packet */ uint16_t -virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts) +virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf + **__rte_restrict rx_pkts, uint16_t nb_pkts) { struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq;