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 8669645830; Wed, 21 Aug 2024 16:39:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67F814111C; Wed, 21 Aug 2024 16:39:33 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by mails.dpdk.org (Postfix) with ESMTP id 6EAE8410FD for ; Wed, 21 Aug 2024 16:39:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oCbtz/pzFrCZZvJgMlq9Wu7ixDway8ppckjwQPevXCMlKsUPN8JCcMDW3cyIqKIMAJ5IgkttrfHoNfUItzVfYUtt6s06Ij2ifDxIB4H79dufRHgPGPvUESZ1vGc74jrWixuK7+cIRigTlN6Xn6qyXPHNfI+99kurcOKS5Uchmrq2eYHAJS2W0nFJxTUqJDVuaCy/z2/vWHhE2FF7BTL2hLfr01OPA/DoazTOY77RZ4PNe6w83J1yi89QZJXegvqEb5Y46Jeb8joomXelD3kz8va2mRGgbtYu1G0nzmNeGIsVFWajlqHJpxc6VHYymPCqFVhIETmGQWRAohwx+IYE1Q== 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=wH8eu23twaAPtA2Sczy5/FEzDAqFYyZDusjIui0ehNc=; b=WnFfFa1aH3WkIVv4BSgLMvFkKLw9v26sb7DNX803VTRP0Ba4fazOBsgpQZVRMFqMq/JK4luRl5kGkThm5xfY8N1O7Ca0tkV84KnU4GJNFWQAemjPZcp8/BocNeVnDdMdcU+9Svb7D6uzLFzN6prNvCGr6oYsOVGQR3tNJv4Cf9IKmuYCcuwWv2Vdn02jP/T1su5Z36/NWVhar+bUpiNI1ihASUP+uw89q/iaTOOBemNla0sKU4Vn13XAT6cAJng/Grnm367Y62HgYQ8hZiFMlBbL0e/zHjs0u0QglhThdplhrQTifWJ0LnjFOfOCFcAEsp5Q9EoZqCxSro3+PduNtA== 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=wH8eu23twaAPtA2Sczy5/FEzDAqFYyZDusjIui0ehNc=; b=dijqZaHh2qmM1G6MOsVm7oz/npoMhLHaHWVjeEL1uAOAseFRHbyIsQG7VRX7zMzCHXf4VDlTDkLkqO5gNSjRjkdYae12iDiZPgc8rDvK1HvzhW4ZN1seOb/7Mn+cpqQGzCa1yc+EwJAS+UyJIm3pNoSE3564/u1WzfA3OMNqWGk= Received: from BN0PR02CA0037.namprd02.prod.outlook.com (2603:10b6:408:e5::12) by CH3PR12MB8755.namprd12.prod.outlook.com (2603:10b6:610:17e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Wed, 21 Aug 2024 14:39:22 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:408:e5:cafe::25) by BN0PR02CA0037.outlook.office365.com (2603:10b6:408:e5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.26 via Frontend Transport; Wed, 21 Aug 2024 14:39:21 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) 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:21 +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:19 -0500 From: Vipin Varghese To: , , , , Subject: [PATCH v2 2/3] app/testpmd: move offload update Date: Wed, 21 Aug 2024 20:08:56 +0530 Message-ID: <20240821143857.1972-3-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: BL6PEPF00020E64:EE_|CH3PR12MB8755:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b549d98-0b65-46b2-c992-08dcc1ef0bbc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|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NlNCSU8SSUwDBA24YiTmjabqb30XjgtsA0Yh3q0YlfZoSPNStd4vInzcb8?= =?us-ascii?Q?bIHKpRMl0gXENwNAdeRJ8jVw92OVKotewlsjuzaA3vOdiOJG0LLGMpFsCTTZ?= =?us-ascii?Q?RwEWZ1hVM6hc1bPPXBysCcLoNnRAbW9tjmB6bbJaJScjtPllNCNc1vLt6Ys9?= =?us-ascii?Q?trCGwNm/ct4rlw7EzlD00SCPfkaq3w/CyDp6A7+Vcw51M8lo42KwVQVQNHlp?= =?us-ascii?Q?0WBTiqWohQv11ZPHmzpRo2jM90TtDwD2yrSnXaX7vPmMhpMjpCE2Es8zWhHE?= =?us-ascii?Q?Hv6wbHw8UnVe4/UMBnsWd7yh9AHGmrgoXDuH7APwwWV4BI6v0KeT2zuZ81tD?= =?us-ascii?Q?l5doWxpiAmifJ02vjuYNSwrNciPd9hj0oYg4b6g4lzA3JZGQibEifK96RUsl?= =?us-ascii?Q?og0hAM4DOWjbQgbe96Ay9Nlwja8iinUI7VoW3vem7xyBRJBTP8VNvXS/EFqp?= =?us-ascii?Q?pWVKVK/Ah4cBYZ2yCV1a8dcN2L/17KALd/AawHeBTHu1cRtwP9kRUoRbaIP+?= =?us-ascii?Q?i5cAuGHZ4L3isGDGoZlZQfma0VXB3cplp7tLPsaPFf7jucx37YZ1hK9msHlr?= =?us-ascii?Q?PY3MG/JGa0Mrkeg/faxhEW2OQvMsPzHt?= 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)(1800799024)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 14:39:21.7252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b549d98-0b65-46b2-c992-08dcc1ef0bbc 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8755 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 Moving the offload flag update from end to start of the loop, helps to reduce L1 or L2 cache evictions and amortize shuffle. This helps to improve RX packet in mac-swap processing. 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 modified: 46.36 : 44.79 Signed-off-by: Vipin Varghese --- app/test-pmd/macswap_sse.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/macswap_sse.h b/app/test-pmd/macswap_sse.h index 29088843b7..67ff7fdfbb 100644 --- a/app/test-pmd/macswap_sse.h +++ b/app/test-pmd/macswap_sse.h @@ -45,19 +45,22 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, mb[0] = pkts[i++]; eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *); addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]); + mbuf_field_set(mb[0], ol_flags); mb[1] = pkts[i++]; eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct rte_ether_hdr *); addr1 = _mm_loadu_si128((__m128i *)eth_hdr[1]); - + mbuf_field_set(mb[1], ol_flags); 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); 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); @@ -69,10 +72,6 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, _mm_storeu_si128((__m128i *)eth_hdr[2], addr2); _mm_storeu_si128((__m128i *)eth_hdr[3], addr3); - mbuf_field_set(mb[0], ol_flags); - mbuf_field_set(mb[1], ol_flags); - mbuf_field_set(mb[2], ol_flags); - mbuf_field_set(mb[3], ol_flags); r -= 4; } @@ -84,10 +83,10 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, /* Swap dest and src mac addresses. */ addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]); + mbuf_field_set(mb[0], ol_flags); + addr0 = _mm_shuffle_epi8(addr0, shfl_msk); _mm_storeu_si128((__m128i *)eth_hdr[0], addr0); - - mbuf_field_set(mb[0], ol_flags); } } -- 2.34.1