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 83E5F43EE8; Tue, 23 Apr 2024 11:18:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DDB940E54; Tue, 23 Apr 2024 11:18:52 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2076.outbound.protection.outlook.com [40.107.20.76]) by mails.dpdk.org (Postfix) with ESMTP id 1B5AE402AB for ; Tue, 23 Apr 2024 11:18:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NEdTzCHt4OhupbCPPSSA3PTJak+FUiZQMkkf0pq5EwrsPL5RtMGES0vmNwl6wzg5HmjDn+dstI3EU4tWc43dt1LlpO1BNa5rOvA4cOBYgibg+yhOHyqsQxSTsckwVQO84fDYNmm65NN9xMDTL0tydJnFmrbuDVcpyc7vLnmyEAXE4W2hFeOcYDp7MXUpx1pOUOjF6XmsiCfV+saYKDLhSLMCTdjo8Ps6+4rWqffEfBXOSAYsw1XWONudC007klRpVHHeJAu22N76dF7bjC6WJdzZhR65tQD+Le3/uQkzsC9C0NsanswoV4CejsZZpTCrQ5VeFc/qspiAF0ITuA9GLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=3f+tvjDIJDWqzOqC2Cp7KaqVVOAvedfvnvRkoUaa/4U=; b=gkvXxeBk72XV3bjP0fukkyr1226yiBt7LTUUMFpGzontv9SFlCjiNugm39yheuERZNwto/7SuqgECTb7fe6qq0eTpcQDIolFCcR+GFZh8iGn1ar8Vzcxp5T4JtHcXqWge36KDL2how0w3hNcWwhvwFj8qXG67M3tAZQDBnsK/2MvthvKISnJHPIWNCUqY0MwzxnsYNs8H5EhNk3YrBeYaz1QZbuQRzwTlNFCbXIEOwbs6dpuapp2bXDrpS6RMTsFWyiVir45nJnWLy/wKggmKDeCiAgkWva8CSBjsNQ71G1GttQdGj5jTTzzlwOmiFOllja5Guwg9oiYwiKGTV0Bpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3f+tvjDIJDWqzOqC2Cp7KaqVVOAvedfvnvRkoUaa/4U=; b=Ei9GfnHb1wyDpwLCia6NSbSL0WtlBQmDcFwZOU4RiHm5xHfcS+SnH25kX7B0ws51AsGbG+k5ymeeMVATCy1RSiOAPR21x/z8c2fugMRi9MVk8t33fkW18Mkpfk7fCpl9MyAe4ZfkMcBoUDcY0xb09r2UwwpmaqwaVHVRrEpuSQtBRFKAjmWFzZeGrruZGARSk+DtmSa4+Z3mr+9ZMybYoRLQIMDoA+fBwaZ6V08L9zu4Nc5enSgx1pAQ74EF4xSQX0EBR//5Mp0eit7e8KnC/axT8wArsjUkSiTqep99y8AdVAwH3ak4RgR7zUHz0LGj9YrIRvOJyCoZ5K4puWvGAg== Received: from AS8PR04CA0098.eurprd04.prod.outlook.com (2603:10a6:20b:31e::13) by PAXPR07MB8578.eurprd07.prod.outlook.com (2603:10a6:102:24d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 09:18:43 +0000 Received: from AMS0EPF0000019B.eurprd05.prod.outlook.com (2603:10a6:20b:31e:cafe::51) by AS8PR04CA0098.outlook.office365.com (2603:10a6:20b:31e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.34 via Frontend Transport; Tue, 23 Apr 2024 09:18:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by AMS0EPF0000019B.mail.protection.outlook.com (10.167.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.19 via Frontend Transport; Tue, 23 Apr 2024 09:18:43 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.67) with Microsoft SMTP Server id 15.2.1258.12; Tue, 23 Apr 2024 11:18:38 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id A22231C006A; Tue, 23 Apr 2024 11:18:38 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: "John W . Linville" CC: , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH] net/af_packet: cache align Rx/Tx structs Date: Tue, 23 Apr 2024 11:08:13 +0200 Message-ID: <20240423090813.94110-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF0000019B:EE_|PAXPR07MB8578:EE_ X-MS-Office365-Filtering-Correlation-Id: f0097ac6-7dce-4fc5-a771-08dc63765f69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?B?TThPZTBSTzZiVG1DdUk1QTZMOHBiaDVnNUN2ZUQwYitvVFVQR0Zkb3ZmanZZ?= =?utf-8?B?WDd6emFPbU5UTGdsUmg3UDJBUGRwbmljYjJQYkxmWVVTdWdwWWpPeSsxRlo0?= =?utf-8?B?THU0UmZmYlM0TG43MmU1aXZPRFMyaDFYSmY1NEZabWRiaHdEVTVvQkpQYlVM?= =?utf-8?B?K2l5aU5BWjBjQTMrY1FNL3VQaVBTQm5hU2dhZCtSMnVZQjBxVEt6dUU5RVMz?= =?utf-8?B?Qjd5eHhqaHhEWnFDOXVOSHdaZndnZmdUNENxZXRpMHdaNlN3UW5LT2MxOURr?= =?utf-8?B?TC96MHJsajMva2pqY3dRZzhLdWFJdnd4aHg3RVhQN3VQM3hUT1JHQjc3MGpp?= =?utf-8?B?d0hwc3pWdVlJOGFKMFhvK2xEYnZ1TXRyQXEzSGRiLzZoZGZOMUgvMXJMcWJ0?= =?utf-8?B?WmViVk04ck9xcUxKWEdEWTVlR0RlMFdVRXdwMTNnNk9lc09qMEF6OVlWN3E5?= =?utf-8?B?TDY3dmRBV2t5RTloaXpLYTBYTWJ4bDVzb2pXemsvT1NWdHlBajZxTkVKRHk5?= =?utf-8?B?V3gwQmpzMXYyUUo0U0U3OEFUVzVUcUdsTU9pWXZJM0JBRGVZQnpuQ2ZuNk9y?= =?utf-8?B?UGd0M3RxNFRDZUVlbnhCU3NoYm83ZHQvR1VqOFFEcGh6TWpBRE9zWi9hZXFz?= =?utf-8?B?NlFiZ284cnBRNVo1YTJxSlV5NmltUjduVFRIUHp0dGlWR0FCUkRIUDdmRFpH?= =?utf-8?B?Z0NnRWhHTjVL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Tm1UWlhZcTR3cFhEc3pBL3NBTkxRMkZzSEhiLzNOZXY1dXE3cXBaYnFXclQ0?= =?utf-8?B?Z2ZiR01Qa01TUGpNb0JpZVhtS2NoSTA3UzF3Q3o5Y3BwcW9acW1qc24yK0E1?= =?utf-8?B?S1lpWWRQZ2NEb093ZDFuTWphaTBLcHd0WjdJQmlqeENWWXlXaEZiaVcyeEJC?= =?utf-8?Q?L03DwzZeIsz1vR0Z1gHMWLPKFDWfI8Rkj5xlU=3D?= X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230031)(1800799015)(36860700004)(82310400014)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 09:18:43.7349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0097ac6-7dce-4fc5-a771-08dc63765f69 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF0000019B.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR07MB8578 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 Cache align Rx and Tx queue struct to avoid false sharing. RX struct happens to be 64 bytes on x86_64 already, so cache alignment makes no change there, but it does on 32-bit ISAs. TX struct is 56 bytes on x86_64. Both structs keep counters, and in the RX case they are updated even for empty polls. Signed-off-by: Mattias Rönnblom --- drivers/net/af_packet/rte_eth_af_packet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 397a32db58..28aeb7d08e 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -6,6 +6,7 @@ * All rights reserved. */ +#include #include #include #include @@ -53,7 +54,7 @@ struct pkt_rx_queue { volatile unsigned long rx_pkts; volatile unsigned long rx_bytes; -}; +} __rte_cache_aligned; struct pkt_tx_queue { int sockfd; @@ -67,7 +68,7 @@ struct pkt_tx_queue { volatile unsigned long tx_pkts; volatile unsigned long err_pkts; volatile unsigned long tx_bytes; -}; +} __rte_cache_aligned; struct pmd_internals { unsigned nb_queues; -- 2.34.1