From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B574CA00BE;
	Thu, 11 Jun 2020 05:33:18 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 4DAF329D6;
	Thu, 11 Jun 2020 05:33:14 +0200 (CEST)
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by dpdk.org (Postfix) with ESMTP id 0F58D1C01
 for <dev@dpdk.org>; Thu, 11 Jun 2020 05:33:13 +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 83DE255D;
 Wed, 10 Jun 2020 20:33:12 -0700 (PDT)
Received: from net-arm-thunderx2-03.shanghai.arm.com
 (net-arm-thunderx2-03.shanghai.arm.com [10.169.41.185])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DF7323F66F;
 Wed, 10 Jun 2020 20:33:09 -0700 (PDT)
From: Joyce Kong <joyce.kong@arm.com>
To: maxime.coquelin@redhat.com, jerinj@marvell.com, zhihong.wang@intel.com,
 xiaolong.ye@intel.com, honnappa.nagarahalli@arm.com, phil.yang@arm.com,
 ruifeng.wang@arm.com
Cc: dev@dpdk.org
Date: Thu, 11 Jun 2020 11:32:47 +0800
Message-Id: <20200611033248.39049-2-joyce.kong@arm.com>
X-Mailer: git-send-email 2.27.0
In-Reply-To: <20200611033248.39049-1-joyce.kong@arm.com>
References: <20200611033248.39049-1-joyce.kong@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v1 1/2] 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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
under the 0.001% acceptable packet loss with 2 cores on the vhost
side.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
---
 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 363e2b330..c08dd51fb 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
+		**__restrict rx_pkts, uint16_t nb_pkts)
 {
 	struct virtnet_rx *rxvq = rx_queue;
 	struct virtqueue *vq = rxvq->vq;
-- 
2.27.0