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 6BBFC43F13 for ; Fri, 26 Apr 2024 11:15:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48C7D40649; Fri, 26 Apr 2024 11:15:29 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2048.outbound.protection.outlook.com [40.107.14.48]) by mails.dpdk.org (Postfix) with ESMTP id 086B340289; Fri, 26 Apr 2024 11:15:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WMsEzUykLTRu2TB5asT6HPqSD2+GjcQu9A6McTaPJKO+0f78hMcs3NtgIIpJNkzVOa7+F8WxJyiduqC+SDRbu50i9cfjcjIJZ8p0D1srreQ9m3QdrdXgj+0szL8K5XBT1gGccbnrDDpO14vJTbFn0u76AaJqLrzoA3vB8naMorj0Tl2hBwCgZJTl3bt3XV67oRCxgLDEUWqzRX9VQlxiQ6f6o4H1r712o908AWN3zj+z/d3obCdwsGVEG1BQwtqUNslLsKZ5iqj4L2GyaWTGaLPxd8OZg1RIFTE9rfVKw1cSu/CSvrTNhj+Tf5qeBQzWwg9kEenIS8r1lv+KqXTBDw== 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=5uZB59glz7vmq0yAbr3ViVcHIYbxEhtkSl6UluLZxqc=; b=PpQaKwCA6g8kFn0q95RKvrM+bKH1I1f7VgH91BvCj4j2fK399Zn2J4Yhju3JwvmBnXEzBIGXo1RLJgu39NEtZW3aEqP/z88TE8vs5YLevNZfwmZE8539FMPaNqWKsbafvd2HS7Eve363o3kHoIzENLnN2fOcS2KDCSlUql2KGfdShcBBdSA85HrVfCbtvhKYZDQT2ySVmdB7WB995RR73SRnT6+284LvRIAp6DB7SqyiAvAiV7c/HlBNGspUB8jeMaX933YKmxSj/EErp0qxHMd23jvhmIaIg/oIJBU7F+GMbFiho17R1NP1DSSTGIpouQFrcHYJKdgbjN/zJxqmDg== 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=5uZB59glz7vmq0yAbr3ViVcHIYbxEhtkSl6UluLZxqc=; b=lvIAz3TG3+KMvrVSZ9SI1M5/WTy2KpWYjjwQlggg2YaTAEr/3FqWHCQL4CjhAMjB8QwOEBkpM/a7oYmKyhrlqH+BNz5H3HyZ0/MaR0ITCqZ9yYRqIwnIIbjU7q9JFVr0fSHgzKCL8GzQldBviaxDlWJ6bnYeUS4g2E5x3u2GK7Ozms9GC5LTNVrX8CP/QfKvChVI4V9gUVhYmS/XEbCCqiH93CCDdc9ZU+gvWCH2dkG6zw8IFr5wKWYDDIRIWdBx8J6U+5w5lA2e3mueGQRO5kIVGwJH8xLTDLW7n+lifF4AtAgN4REQLUEgw4U+j+LDloQrt6VfdiLc/g1syKm79w== Received: from AS4P190CA0063.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:656::14) by DU0PR07MB9242.eurprd07.prod.outlook.com (2603:10a6:10:42d::15) 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 09:15:26 +0000 Received: from AMS0EPF000001AB.eurprd05.prod.outlook.com (2603:10a6:20b:656:cafe::6d) by AS4P190CA0063.outlook.office365.com (2603:10a6:20b:656::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.25 via Frontend Transport; Fri, 26 Apr 2024 09:15:26 +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 AMS0EPF000001AB.mail.protection.outlook.com (10.167.16.151) 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 09:15:25 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.69) with Microsoft SMTP Server id 15.2.1258.12; Fri, 26 Apr 2024 11:15:25 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 935F81C006A; Fri, 26 Apr 2024 11:15:25 +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 v3] net/af_packet: cache align Rx/Tx structs Date: Fri, 26 Apr 2024 11:05:02 +0200 Message-ID: <20240426090502.100487-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426073824.100386-1-mattias.ronnblom@ericsson.com> References: <20240426073824.100386-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: AMS0EPF000001AB:EE_|DU0PR07MB9242:EE_ X-MS-Office365-Filtering-Correlation-Id: 299acc7e-44d9-4f1c-3088-08dc65d168cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|82310400014|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: =?utf-8?B?TVVyaWZxU2gwaG1MWlZOeXQ5eGgzZ2daNkcvSG1rMjFkaHJudkxEQ0V5ZTho?= =?utf-8?B?bGliMGh2T3BIQlU5RkxSdy9DcjVpQnpIVmtxNDlnVDFmZGJlcmY3ZlNYcVVT?= =?utf-8?B?aHFjeG9ieVUyYkJGbm8xRGtwWW1MbUJLbkQwN2ZHcUtoeE5EcGc2UTF5bDhJ?= =?utf-8?B?U2dwTk9iTzZUU3Uzdmw1dm9SbU9SMmpkazU5U0F2SEYyKzJIaVVKUVhmZUZC?= =?utf-8?B?YWFOUDNMMjFENW4vOW9pZFdrL3NrOW1qVWdBZXFsLzBDYndsc0RoUWt4N0JL?= =?utf-8?B?UUliWlBTeUlzM0pyUVk4TXlPWUZXaXFza04zOTVkQnBKT0R3UUpmQlBoZGV0?= =?utf-8?B?L2R3SnV0TzFYSEVuWGJRQ2xIdWVlbVZqNHBtc1JHSk5VMzh4STdNaktVeTVO?= =?utf-8?B?M3BuRXdoN3cxUWU3QTJyR2lVRXMrUDcrbzdIV2lXOEN4aWFzY3pQS0tseXZz?= =?utf-8?B?bVp5SkJVcGxqVTZzSUJsZGlBN2hSTGUzTnFFWGpYTCt4SlNPRXRKb015TlJl?= =?utf-8?B?TWY2Nm5odVNiY01ya3h4T1V0TmtRM2J0SUpCTHJmVEVlc3BOamNjZFlPcFVt?= =?utf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S9zSGEwaEJnUXhl?= =?utf-8?B?Sm9jdjJuUFJJZEVxQytyU3dhSnBZcXgxeFNuN2c1R080UTYxRVU0ZG11ZVNl?= =?utf-8?B?bm05VGFMNktFYVVPVVFPdEVxR3hNWGkvMGU0K0N2Sys1NjJrUFkreThmTlor?= =?utf-8?B?RnpZTHNvdXM2SkVPN1JWK005R1RaSUV3M1Q3ZmNjYnU4eVhuNE44bGRodXlp?= =?utf-8?B?Z1ZVUGxqR1AxZVdveitTYThkUjBYTG5KMVJTRWRCOTJhdncvamwrTkd4R3cx?= =?utf-8?B?emludS9JU0ZDOExBVTI3T3AwclJzT1JLWUF1bndJanFWU2pCNWFuQnU0ZEJF?= =?utf-8?B?dzdaSU1ZVFlnQ1BYc1FMRnRsQzUvVlQ3VDBEbWZXZjJBKzh5WTVxNWhYUzlT?= =?utf-8?Q?dYStDurphVfYZ?= 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)(376005)(82310400014)(1800799015)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2024 09:15:25.9859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 299acc7e-44d9-4f1c-3088-08dc65d168cb 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: AMS0EPF000001AB.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9242 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. The 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. The TX struct is 56 bytes on x86_64. Both structs keep counters, and in the RX case they are updated even for empty polls. v3: Move __rte_cache_aligned directive to a MSVC-compatible location. 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..6b7b16f348 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 @@ -39,7 +40,7 @@ #define DFLT_FRAME_SIZE (1 << 11) #define DFLT_FRAME_COUNT (1 << 9) -struct pkt_rx_queue { +struct __rte_cache_aligned pkt_rx_queue { int sockfd; struct iovec *rd; @@ -55,7 +56,7 @@ struct pkt_rx_queue { volatile unsigned long rx_bytes; }; -struct pkt_tx_queue { +struct __rte_cache_aligned pkt_tx_queue { int sockfd; unsigned int frame_data_size; -- 2.34.1