From patchwork Thu Jun 10 06:57:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruifeng Wang X-Patchwork-Id: 94074 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A8109A0C51; Thu, 10 Jun 2021 08:58:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DD1B410E9; Thu, 10 Jun 2021 08:58:01 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id ADB27410D8 for ; Thu, 10 Jun 2021 08:58:00 +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 2D49ED6E; Wed, 9 Jun 2021 23:58:00 -0700 (PDT) Received: from net-arm-n1amp-01.shanghai.arm.com (net-arm-n1amp-01.shanghai.arm.com [10.169.210.99]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 52BB83F719; Wed, 9 Jun 2021 23:57:57 -0700 (PDT) From: Ruifeng Wang To: jerinj@marvell.com, hemant.agrawal@nxp.com, ferruh.yigit@intel.com, thomas@monjalon.net, david.marchand@redhat.com Cc: dev@dpdk.org, nd@arm.com, honnappa.nagarahalli@arm.com, Ruifeng Wang Date: Thu, 10 Jun 2021 06:57:39 +0000 Message-Id: <20210610065740.231799-2-ruifeng.wang@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210610065740.231799-1-ruifeng.wang@arm.com> References: <20210318102550.59265-1-ruifeng.wang@arm.com> <20210610065740.231799-1-ruifeng.wang@arm.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 1/2] examples/l3fwd: eliminate unnecessary calculations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Both L2 and L3 headers will be used in forward processing. And these two headers are in the same cache line. It has the same effect for prefetching with L2 header address and prefetching with L3 header address. Changed to use L2 header address for prefetching. The change showed no measurable performance improvement, but it definitely removed unnecessary instructions for address calculation. Signed-off-by: Ruifeng Wang Acked-by: Jerin Jacob --- examples/l3fwd/l3fwd_lpm_neon.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h index d6c0ba64ab..78ee83b76c 100644 --- a/examples/l3fwd/l3fwd_lpm_neon.h +++ b/examples/l3fwd/l3fwd_lpm_neon.h @@ -98,14 +98,14 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, if (k) { for (i = 0; i < FWDSTEP; i++) { rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i], - struct rte_ether_hdr *) + 1); + void *)); } for (j = 0; j != k - FWDSTEP; j += FWDSTEP) { for (i = 0; i < FWDSTEP; i++) { rte_prefetch0(rte_pktmbuf_mtod( pkts_burst[j + i + FWDSTEP], - struct rte_ether_hdr *) + 1); + void *)); } processx4_step1(&pkts_burst[j], &dip, &ipv4_flag); @@ -125,17 +125,17 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, switch (m) { case 3: rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], - struct rte_ether_hdr *) + 1); + void *)); j++; /* fallthrough */ case 2: rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], - struct rte_ether_hdr *) + 1); + void *)); j++; /* fallthrough */ case 1: rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], - struct rte_ether_hdr *) + 1); + void *)); j++; }