From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 810F145830; Wed, 21 Aug 2024 16:39:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18404410FB; Wed, 21 Aug 2024 16:39:31 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2064.outbound.protection.outlook.com [40.107.220.64]) by mails.dpdk.org (Postfix) with ESMTP id 061D6410F6 for ; Wed, 21 Aug 2024 16:39:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ojIVPcPCxPtZXttHFVP/N7GvyXa9Lx7yFzGdH1+byS6caHXJ2n6luLv6LZrJoGb9Xjd7oJsDwkSKfFVQfvqI5RVRca+1TMhw8EqenAKS3g6axXQhQGoscw6dFxuRWHWZraaC+ApXwtClKRn6NsfsPFB8NKmjdzJSgRH8O56wnXYZ2EjxQ3aWl+j6LvCqX9wgNQiXNKXFha+hTKIYeTCZ/nj+g+sUd1Ln587yY0Id93hYIXWwpW5vvnhOTJ6rgUSQJhbS08gZw/RxRbJ7PgcSysQNHHEPhDeqOmfQ4ZvUKkX++qDWkNSSoJLA22TyMOpamfYJAApLz0jiWW5IzIYFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JhyhoRtaDYwsXQq7n8PbPS71YQRTARBm5tNjlxbuw2w=; b=CyGV/0BdJpKJbEs7OrIygUUmhRa9nCQNWwykU36z9Sg+hzp9z2uxP6Diejlx0lEyrxOsLEmhg+w4sluok15ivAvJq2pjVwgg/KmXgxMLrv5mOu6amQzw0BqpUeYc1E3DK+I2zVgmT7wZS8FmrNB+186xwpI6lqFjisfvI7+nOTCHQgJq0cq/fCEZ1jrUGMB2hWg+xZeQ/oi/aG6ZBlkF/reQaC3WLLwXSxqceXnmcqBfFAioJJyMzKaD7/+uZoUvs11Hc0MzCrtBJX2eKnwSzJXQ2WHZ9CF1hTk7mwEdfk3Z1r09kadhLPB5UkbN68mEmYMYgzeLfzLMKRaJYXR2Gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JhyhoRtaDYwsXQq7n8PbPS71YQRTARBm5tNjlxbuw2w=; b=ABadPphCsSmei1kra88CQclwoPmwKo5fgUrWZsl61HQqze0vZq22mXoYrE33gfHVVkSflHWLPNnQpAOrM3XhdphpW5XvsUvzo0Zsge8xJzc6Sh9L4HtKl1BRgOJQvRvQSc/y2TrYAU586DOljpBIPtiVK9AUt9BCFCBFnDh4kTk= Received: from BN0PR04CA0076.namprd04.prod.outlook.com (2603:10b6:408:ea::21) by DM4PR12MB7695.namprd12.prod.outlook.com (2603:10b6:8:101::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 21 Aug 2024 14:39:25 +0000 Received: from BL6PEPF00020E66.namprd04.prod.outlook.com (2603:10b6:408:ea:cafe::9) by BN0PR04CA0076.outlook.office365.com (2603:10b6:408:ea::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Wed, 21 Aug 2024 14:39:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E66.mail.protection.outlook.com (10.167.249.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 14:39:24 +0000 Received: from BLR-5CG134626B.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 09:39:22 -0500 From: Vipin Varghese To: , , , , Subject: [PATCH v2 3/3] app/testpmd: interleave SSE SIMD Date: Wed, 21 Aug 2024 20:08:57 +0530 Message-ID: <20240821143857.1972-4-vipin.varghese@amd.com> X-Mailer: git-send-email 2.41.0.windows.3 In-Reply-To: <20240821143857.1972-1-vipin.varghese@amd.com> References: <20240716063724.850-1-vipin.varghese@amd.com> <20240821143857.1972-1-vipin.varghese@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E66:EE_|DM4PR12MB7695:EE_ X-MS-Office365-Filtering-Correlation-Id: 421cdb07-8293-447a-7619-08dcc1ef0d6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EGufCS7wpw0LmFmw16qxhHSiGv6XmJL/dj8AfXWGTb2qEU6miZC/hszHPbjU?= =?us-ascii?Q?UyyGhtyI+ye2oqJR8q/8bCgDKbOQsatwoBRvGZsLkwVCbldoxdAHv7Zk7eRo?= =?us-ascii?Q?zxu/7qaNYvaVp9P0yHS9iks6bujCN6H7D0o0tXrru4IpuJPzR2GLLNyIXpXA?= =?us-ascii?Q?jk2+qZhxWXoYD49TyUeybS7kPcavy2Rlz+TESz0zV8kwG0QkGcNdUY9Vlb16?= =?us-ascii?Q?F8ivrwuod+MyzpnLoQ6zjBddedqNnbvTsPoCTlQY92L5jOL5V2zPBCHxJIcw?= =?us-ascii?Q?GSUj92CYhCrgNt4Pwve/zS1XLY0Jhcie1SFNam1PfhHFi5vPjc9NaLqvp5tz?= =?us-ascii?Q?PBgMczIwIdPgfsEV4n/+yp87zy66bICsDATInl8yvsRwwqdRBhfV4hIVmXfq?= =?us-ascii?Q?QHkSwOXz37UuFLyAZ6SFGhtHF5Jh39N5vbKIHOGjiumF41LATcvcl0ruzk+g?= =?us-ascii?Q?aMkmnnk35d6XnLsnPe8thGv01JWjq9JnfxZgqAObR+eqJTUQp60KE/il/BKH?= =?us-ascii?Q?y/lV7/fH60eviJUIYIksG6XkeQTOwxbLZo2kI+SioMrDwMECZX//McKVRreX?= =?us-ascii?Q?22tfCZab2g1/0aWzpWvpADJgYQ2WtZ1dCZvRy5aqRvrdNufq2ZEzc7kyladd?= =?us-ascii?Q?kzFplZe2Nle1uc5JLPtgAirZaS4bT8fyohPOoItVczLcuFQV4alwVd4AIpW6?= =?us-ascii?Q?2m4KpbXTt0+NHaTIGFvlT5Q4oFz7riHPvxm85zbrmT3fA7GCin0+BJUgH6Kr?= =?us-ascii?Q?nocho46NiyQyGrKs9wAB/IvZ+MZzgUqHbA3aVdkxiUeflrROmbOnPQH+WO8+?= =?us-ascii?Q?dbjxt7xwmd76BhT7dhcFPuj/gm6MPh/5H6/Ck5uXLK8LfPWG/iO5LJwl+gQT?= =?us-ascii?Q?g6CcXZoAHLhqKR3vo1lm8NJAf/cM3YrCK/pIAd642P5YBizjTKvKYpiFbF28?= =?us-ascii?Q?33wsVIDtIWvC0USW4CsryANWNkixdQIa7DONUuF0jB/BfhUtaGtVQLz03fdf?= =?us-ascii?Q?X9gzV9QN1003mmfF9SaHryfwWs1co6D3Aivt4MmAO659cdISW5MVbk+6WfHT?= =?us-ascii?Q?GR7XkRA/pzTrJy9NZXDgBOBSuhhnWe26zRDCtgpCiNGC/HFVdaDgySEyeIIP?= =?us-ascii?Q?z355CyMlDq922xsNEGi7y7yzJriJA4pb38+9pOjYljZIqFEmaWstxDDEiU7C?= =?us-ascii?Q?nL3p9aMRo/TplDH9pMU6r5/ewsIcf8PlvMDGRcrzwsI6r1p8E0yAsnvxLTn2?= =?us-ascii?Q?vpOe6gHZSOH3c22cXpGAJQHw1E+e7cnq7A1KGMUjKBD4Lcs61e+RAcPAOasM?= =?us-ascii?Q?nqjuwqsbCNMyzA7AOvN0mkvOQg0HYov1U5b/lc4Cdxg59j4mvSbMLdnNT8SO?= =?us-ascii?Q?bXm1c4qr0y5Gop2qxWAobVu18aRLpXumSNfMbJr1Nz3fXlj0zSAZZVTnBCUI?= =?us-ascii?Q?ykYOH5J5ageKrzjRwuQ7WcxhHjttZvDR?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 14:39:24.5895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 421cdb07-8293-447a-7619-08dcc1ef0d6f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E66.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7695 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 Interleaving SSE SIMD load, shuffle, and store, helps to improve the overall mac-swapp Mpps for both RX and TX. Test Result: * Platform: AMD EPYC 9554 @3.1GHz, no boost * Test scenarios: TEST-PMD 64B IO vs MAC-SWAP * NIC: broadcom P2100: loopback 2*100Gbps ------------------------------------------------ - MAC-SWAP original: 45.75 : 43.8 - MAC-SWAP register mod: 45.73 : 44.83 - MAC-SWAP register+ofl mod: 46.36 : 44.79 - MAC-SWAP register+ofl+interleave mod: 46.0 : 45.1 Signed-off-by: Vipin Varghese --- app/test-pmd/macswap_sse.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/macswap_sse.h b/app/test-pmd/macswap_sse.h index 67ff7fdfbb..1f547388b7 100644 --- a/app/test-pmd/macswap_sse.h +++ b/app/test-pmd/macswap_sse.h @@ -52,23 +52,25 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, addr1 = _mm_loadu_si128((__m128i *)eth_hdr[1]); mbuf_field_set(mb[1], ol_flags); + addr0 = _mm_shuffle_epi8(addr0, shfl_msk); + mb[2] = pkts[i++]; eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct rte_ether_hdr *); addr2 = _mm_loadu_si128((__m128i *)eth_hdr[2]); mbuf_field_set(mb[2], ol_flags); + addr1 = _mm_shuffle_epi8(addr1, shfl_msk); + _mm_storeu_si128((__m128i *)eth_hdr[0], addr0); + mb[3] = pkts[i++]; eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct rte_ether_hdr *); addr3 = _mm_loadu_si128((__m128i *)eth_hdr[3]); mbuf_field_set(mb[3], ol_flags); - addr0 = _mm_shuffle_epi8(addr0, shfl_msk); - addr1 = _mm_shuffle_epi8(addr1, shfl_msk); addr2 = _mm_shuffle_epi8(addr2, shfl_msk); - addr3 = _mm_shuffle_epi8(addr3, shfl_msk); - - _mm_storeu_si128((__m128i *)eth_hdr[0], addr0); _mm_storeu_si128((__m128i *)eth_hdr[1], addr1); + + addr3 = _mm_shuffle_epi8(addr3, shfl_msk); _mm_storeu_si128((__m128i *)eth_hdr[2], addr2); _mm_storeu_si128((__m128i *)eth_hdr[3], addr3); -- 2.34.1