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 D626643F13 for ; Fri, 26 Apr 2024 09:48:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C62E843C67; Fri, 26 Apr 2024 09:48:52 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2051.outbound.protection.outlook.com [40.107.6.51]) by mails.dpdk.org (Postfix) with ESMTP id DE01E402EF; Fri, 26 Apr 2024 09:48:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dt61qjTtkTc6lwcnuB9idXlc6sHtH+p9SFhmL5Ixkk3FbXzKXJurNU2SwBRuwahYikVj+xNQGp5H8wxg8C9QlGMnSE3xOWZJ8fCQlZNXa2gDpXSsXqijNUR97Jm/XIGL50iCxbcOh25/sREsm+1EaaV7H+ClR3xEP1w1HoEdMRicyljDAXccHKEHlUvlXMNdVy+V0T6s7vxFFYryDYu1mM3Bk2uJzXumnnD8oMNNVWsFGlYqdZUGA4X4e8cz8sYTsotlwQEtXRRHhwALcqIAM6YGnCyEsn7uFqhNhTJ5OoRbjKPaIMqinyjlwo4pfEfIZm+nr9BgsIsu4WgZ2GDBZw== 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=/dCMlHpTRYHqhwJaEftB9GagGgUSi4nt1eX5Xc/VPg4=; b=DZC4rK4d5w8Yx49C1FtDCh5MMiEoe5MberFlHY6521xag2f1XvvJgnha9uXFtPT0KEY4C4pXhxGlf/0lXiWmyi9ivT0z6y4lHyl/1qf3tzDRaErs8AM9pt9Z1hvi7FynlZqyAlELWpZ+2LpBESsuS1m6F5vjELdNkENAtBFF2nx+LDcO8ih+71FAsTctHGDlUrZvr5/ScWOYZjl9ycZSl2y31e9JLbK9EIoJjiSwdK0N2ac7dDXTtGvlbnx1PJ4ZA8LBUrU45+f4RpOAlYUVB8iph/SajazJMIJDok1OGv2rU22apbmLRE/gN8yZOxUOLFiYzLEC+2iJWC8DpU2eOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=amd.com 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=/dCMlHpTRYHqhwJaEftB9GagGgUSi4nt1eX5Xc/VPg4=; b=fcQNDdboXK9k/MR658PUdFi8lLmhWyRS3MvFIZiIOazy6zjPnE4PY6gCVJAxbzCnRlhmU5Dq5m3K9uat7NAG7Obhw+98NDI6R4aL7O9+7svqPMSuMowx4n4lkBhbXPL9ol95UqW4yR0EEoQ5fMrJvA6bfVh1yYWV5qtgs68nJZqE7EHp7ZjKgKdem7UPRXJ+8nCwnAb5405wCAtoRgoxfazNSnf1UA3G8PWV9/pHkgDmIMpF6IH1mzL85iHyp2xB6oi03tAy6yj0lsB03CGW0pjWpkMiOAOtdHLy3a/OiZUYWqcyyX1stxncx09EVB8NGoKv7Vmqleln0jX6UQQcNw== Received: from DB3PR08CA0024.eurprd08.prod.outlook.com (2603:10a6:8::37) by PA4PR07MB7695.eurprd07.prod.outlook.com (2603:10a6:102:fb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.22; Fri, 26 Apr 2024 07:48:48 +0000 Received: from DB1PEPF000509E2.eurprd03.prod.outlook.com (2603:10a6:8:0:cafe::15) by DB3PR08CA0024.outlook.office365.com (2603:10a6:8::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.29 via Frontend Transport; Fri, 26 Apr 2024 07:48:48 +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 DB1PEPF000509E2.mail.protection.outlook.com (10.167.242.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.19 via Frontend Transport; Fri, 26 Apr 2024 07:48:48 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.64) with Microsoft SMTP Server id 15.2.1258.12; Fri, 26 Apr 2024 09:48:47 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 82E051C006A; Fri, 26 Apr 2024 09:48:47 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger , Thomas Monjalon , "John W . Linville" , Ferruh Yigit , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Subject: [PATCH] net/af_packet: cache align Rx/Tx structs Date: Fri, 26 Apr 2024 09:38:24 +0200 Message-ID: <20240426073824.100386-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423090813.94110-1-mattias.ronnblom@ericsson.com> References: <20240423090813.94110-1-mattias.ronnblom@ericsson.com> 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: DB1PEPF000509E2:EE_|PA4PR07MB7695:EE_ X-MS-Office365-Filtering-Correlation-Id: 319a6740-8e91-4e8c-9bdf-08dc65c54eb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|1800799015|82310400014|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YkI1b2g5Y2l6QVgrc3lRUmhOWlVoMnlWOHExeFgrN21UVXZyYkpVZU1XeHRE?= =?utf-8?B?WXpNc254alBibGxoVVkvQVNKVktsWHV5Vyt5UWVzdHhMVXp0dUxvdm8zbGo1?= =?utf-8?B?cDMyYXFvZnNEanc4QjBteXMwSDVoNy9GMlNQWUlKOUZtZXorc3AxUUQ3a1hC?= =?utf-8?B?WWtRWmU0SkRmMUxtaXNjajJteGw3eWxoL0VHL1I0VUFHTkZxQXg0Sk5vSkpu?= =?utf-8?B?UzZqN24zSEl1RmtmcWozWjFneGQyMFR0cXF5OER6TlN1OUtsVU03ZGxhNXc5?= =?utf-8?B?akVDa2VhRzhScDBRUXp3SXhnTnVieGUrVzY3VzNiZEw4aXNMeHZlZWNFaEtT?= =?utf-8?B?bVlOSU5STWFkYXVWaHVzVmpYOHR2NjFGLysyM0ZDZ0U4UENhTGRycnVGM24x?= =?utf-8?B?TXROWHBXRU5HK1czNm0zbDJGNWtyR2ZRUzlBYTNHZmRzR1Zvdk5QQWJjYVNW?= =?utf-8?B?UzdLYVYzR2FDUkdjMlM4Q1k2bFp1VDBkaWppaGdYRXgxWXI4ako1L3VkYkls?= =?utf-8?B?QXZOQkJjVnRGTlBCdFdERitrTmpFUHVjb1l2V1NuanRYNGtwcDNVU0JraXR6?= =?utf-8?B?dzJwM05qaEdFa0l5Uz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-8?B?aFQ5ZHVhUVEyTVY5bmZNZmE1WlB1akl3SkU1bFYwT3lQMlZnNVBuR2RTTFhR?= =?utf-8?B?VlJCN1V6cWhIK3NoNzFhOXkvbEZESDVVVHpySVMrY3N0TjVCUUI3bXJZckFD?= =?utf-8?B?bVNHYUYrcit5U05wN0QrZmt6WWs0Ym95aWtkNi9ITGh1elNpM2N1dFppd2ts?= =?utf-8?B?eUNSbStSaUh3N2prcUQ0ekkwSTI3VE9HbitNaStJVGNZWVVBOXNubE1hU0M1?= =?utf-8?B?VnhKL2l6S1Q0R3E0ZmkvbWZod0VWeVJqYmhPR01JN0ttYWdzWU4yUUl3L1Va?= =?utf-8?Q?ERlqFnVBa9RnOU4tdTXox94z/6idgIyjNHJAw=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)(36860700004)(1800799015)(82310400014)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2024 07:48:48.2736 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 319a6740-8e91-4e8c-9bdf-08dc65c54eb9 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: DB1PEPF000509E2.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB7695 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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 has no effect 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. Fixes: 364e08f2bbc0 ("af_packet: add PMD for AF_PACKET-based virtual devices") Cc: stable@dpdk.org 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