From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0093.outbound.protection.outlook.com [65.55.169.93]) by dpdk.org (Postfix) with ESMTP id 10E032C65 for ; Tue, 3 May 2016 16:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xSbyXeno4vPYW0qEMVcERwuDgqIvI844WTxg0ia7emI=; b=1Hx0pyfOrgoDljQ1+sxruUA/giiLqQX1bp8WsSu14xMn7htsV9ocpNsUMtZO8dzb18wEsDuZIlepqYkFSp9wttxyY9TJIyUHByZJhPgLYMjJv6h1eci1dlDf1blTeYvm/NueKPoEEOiGh64TO4VrtslycoK5JPweYQGJWg1iFh4= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BN3PR0701MB1720.namprd07.prod.outlook.com (10.163.39.19) with Microsoft SMTP Server (TLS) id 15.1.485.9; Tue, 3 May 2016 14:08:18 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob Date: Tue, 3 May 2016 19:37:45 +0530 Message-ID: <1462284465-17663-1-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0042.INDPRD01.PROD.OUTLOOK.COM (10.164.136.142) To BN3PR0701MB1720.namprd07.prod.outlook.com (10.163.39.19) X-MS-Office365-Filtering-Correlation-Id: d1f6ac93-c7d9-431d-85ec-08d3735c61f0 X-Microsoft-Exchange-Diagnostics: 1; B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DhnfhBu9rKj9upoRRFRfEaCe7VNwDxDLnL+Ebw5uu8wCSVHDtEQXNUP75hFMh3uVwQ7GixXTJs3VPs2aDuLowikYXwx2BJw0pJUcYXWJGpr9X1VlbeyU4En1b/9Ui1+wMBTnpKRMKDsqGeGwZb1NgB8A4MGkJgA5fYVTL5RX6Ie//26gDgEAa3rTf4QASzLbE+5olz/4MTeux7EWkC5aYueG1ub+S0l1rI7vosCMTmtgmL+hSaZPP7 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 20:X9XeEy8pohsp0R/OMc3D+xVBIQFmUCKPORl8sNSw7kIE84dI5xwmlqovPZMvdbAxVClX0X3xtlBCi/2pfOIYNIIxaxSW+3sgyQ9McgF3Fi0cF/VlBDxToA8GvnfPvOJjsVhygA70h74AcqQWC/NLKYpgrW6yaZg10L6oTs1UoyQK9Bs9JMUPJ/aiTDQLVBecvV53C+iSH3rvME5XN0Vbc8ckXUbVdSh6oakSx244PUDJ11f10FJ3eVpYEHQgUErpGR2gjqgsux10LSDwvWbw7OBI6LgYm6z2mfbUd7q/5gUsXtAIMKWVTnD4VeV9dkLn0ykG8YFBhnTu0nGSW+ly6dXR69vBvmZzzykQYSHA5dtZ2ByBjQj/z94I71Ev/Ozj5OwgBMTsLb4oVW0raDcWbZn6oTOzfyXWpVdKrTBMsmKptlNFWBUvvsOA4p1eDpQSH8dzqJxASm0HaqgTcKcH47ChMAs6SxasHPWbBiIE2VX1dJVLi4vJxKClsnnDWMYXupSJNDt5rGYzcun5zeyd36ad6O45OzhgQbvo6YyDH9+VysfqM0cSMa8jjKoELf0SY5mfPQNH/Ge+BWDODdV7uzg4bDPuMsUpJsD9GBTYG04= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(9101521096)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BN3PR0701MB1720; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1720; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 4:syLhHnkUIoVl+piSufJo70HXhe5qX97KH0F4zRti7xcXpV+tHpCPdyyWe8WlbojhVd8wmCoAuqbvdzoIrNCj1nbjUg5vUypbOvPxqNSTp6jzS8Z4u+d0wCWaX7///d3aR32dlIi2mATZykY5Vyj4NK2YP+hPtRadeIww5ic4CnBgMbVHh8aBCdlnlkpZ7vRm9O2Oj6cOv0z05cfSwAi72hL5+j3dvkMmDZFEC0IHm747EJZXH4sU375ahZ5cam6ixFzKFwN4cO0/ze8xY8O1/ttYcmdUgS9dxo2DCxTDO3fZfpXJ48/s9Aqc0NCP1qWztFnJSNXVYg/mdcf1cYqRV9x1Bl8/s56yuLPOr3nFS9J23LxDYoiTS2auHMOqW2mRneigDXaPE/VGNt1qKEgD1Q== X-Forefront-PRVS: 0931CB1479 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(229853001)(2351001)(33646002)(19580395003)(19580405001)(48376002)(5004730100002)(189998001)(76176999)(50466002)(107886002)(50986999)(36756003)(81166005)(66066001)(110136002)(15395725005)(5008740100001)(47776003)(5009440100003)(77096005)(4001430100002)(76506005)(50226002)(3846002)(6116002)(15975445007)(2950100001)(4326007)(5003940100001)(53416004)(2906002)(586003)(86362001)(92566002)(42186005)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1720; H:localhost.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1720; 23:0o9hQbgapzNvCcMDs6IUDWtLVobBZq9OQHZLGBz?= =?us-ascii?Q?v8LscihNqYLoBoT66Z+kx1jnzBrcUZimUfqVEHHTCRbrJ0gsp8P0rbKuZOWG?= =?us-ascii?Q?/dOtUH0LWgRGxYhvuhwQuGEN8tW+RlptmJNlW5Q0Sv+D2XpVSlzvOT+4m9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n1kyhJKkXYdh/tDMO0A?= =?us-ascii?Q?2B5XGhFHSIgk37lNohuEjVArcG98w+snb9QY2LPDj/OKokc0wXA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 5:7IGkDj1BcPqFjr5J5Nh17t9qgN0hctdJPQ7FtaRlq07GFSS1GzBi5bZy2wtF34WevjshgkdsqLxhA5wJSid4RQFn7X1HX+Je/LDn9uZFbYhKTRh92UaLbEFPMRjKLsL3iRIErrv4p4NQEl46gp1lUw==; 24:qWznRMd7993BMqZHvHuJPUGQMlZ5x2EaGd1k/PrEJ4Z27QkVZY9yW61j04KWMSrrfegku95p2+BiCc7LGktwCxdaAnyRuys8JJWs/LcswqE=; 7:gggLel4tQCo6cTEOK3YHOuGKYgT19mZ5FSWdLBWRuGYg+ctomJsScmF6xyNoshAytzQA3eNxe9NUc3lkCJLId+hF1e5GTMzFYy8UsgOwJhZSbw/ibdsuGivDmqBfNpI/rJC6CMGSMEK1c3SU77vU6BvglKH7HmhPuDUmnU8fxlHZ67+u2yxFV//Xqr4tUkvM SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2016 14:08:18.5772 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1720 Subject: [dpdk-dev] [PATCH v2] app/testpmd: add packet data pointer prefetch in the forwarding loop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2016 14:08:23 -0000 prefetch the next packet data address in advance in forwarding loop for performance improvement. Signed-off-by: Jerin Jacob --- V2: Extend the packet data prefetch logic to other similar forwarding modes like macfwd, macfwd-retry, csumonly, icmpecho as suggested by Pablo http://dpdk.org/dev/patchwork/patch/12330/ --- app/test-pmd/csumonly.c | 3 +++ app/test-pmd/icmpecho.c | 3 +++ app/test-pmd/macfwd-retry.c | 3 +++ app/test-pmd/macfwd.c | 3 +++ app/test-pmd/macswap.c | 3 +++ 5 files changed, 15 insertions(+) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 7e4f662..1d6cda1 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -676,6 +676,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) info.tso_segsz = txp->tso_segsz; for (i = 0; i < nb_rx; i++) { + if (likely(i < nb_rx - 1)) + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], + void *)); ol_flags = 0; info.is_tunnel = 0; diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index e510f9b..ed6e924 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -346,6 +346,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) fs->rx_packets += nb_rx; nb_replies = 0; for (i = 0; i < nb_rx; i++) { + if (likely(i < nb_rx - 1)) + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], + void *)); pkt = pkts_burst[i]; eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); eth_type = RTE_BE_TO_CPU_16(eth_h->ether_type); diff --git a/app/test-pmd/macfwd-retry.c b/app/test-pmd/macfwd-retry.c index 3a96b3d..d8cd069 100644 --- a/app/test-pmd/macfwd-retry.c +++ b/app/test-pmd/macfwd-retry.c @@ -117,6 +117,9 @@ pkt_burst_mac_retry_forward(struct fwd_stream *fs) #endif fs->rx_packets += nb_rx; for (i = 0; i < nb_rx; i++) { + if (likely(i < nb_rx - 1)) + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], + void *)); mb = pkts_burst[i]; eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); ether_addr_copy(&peer_eth_addrs[fs->peer_addr], diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 3b7fffb..07a399a 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -113,6 +113,9 @@ pkt_burst_mac_forward(struct fwd_stream *fs) if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ) ol_flags |= PKT_TX_QINQ_PKT; for (i = 0; i < nb_rx; i++) { + if (likely(i < nb_rx - 1)) + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], + void *)); mb = pkts_burst[i]; eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); ether_addr_copy(&peer_eth_addrs[fs->peer_addr], diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c index 154889d..c10f4b5 100644 --- a/app/test-pmd/macswap.c +++ b/app/test-pmd/macswap.c @@ -113,6 +113,9 @@ pkt_burst_mac_swap(struct fwd_stream *fs) if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ) ol_flags |= PKT_TX_QINQ_PKT; for (i = 0; i < nb_rx; i++) { + if (likely(i < nb_rx - 1)) + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], + void *)); mb = pkts_burst[i]; eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); -- 2.1.0