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 77B5544191; Wed, 18 Sep 2024 11:23:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C01042F57; Wed, 18 Sep 2024 11:22:51 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2085.outbound.protection.outlook.com [40.107.96.85]) by mails.dpdk.org (Postfix) with ESMTP id 02D5342F9F for ; Wed, 18 Sep 2024 11:22:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kCeO6N14GjgzeNhR0yrIePxBD+hl9s/FOO88sQOCgG6/+C5fMlAcLlB/5Ig62gkp3vIWCxMWzhtRjZ+YwkypknIlspU3O54YGvc1nBFwC35pWC/TrlqJWSIOhYmi3iSzCRCoGQDo02RyexXXDfCatSmsZlzXM3zQ6fRY4MEUaSYCUsgfioAgjkRzdWTZSMSudjbW4N92umYTsbWqsoOVbB5vO/C73LMI+GSzmaD10nAG28NjYdSDuHKuY4aLbAC5P566GyArGjbOcMtxRSuql34sWx/1Fno8TYk2kXboV0tFXXVr86KGZQ1KZ583gwI9dhUTNHonKYGFd9O5BrFnyQ== 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=KL46CubCVFCArvSXMZGAfHMUFF2k9xh5z/dMClencLo=; b=PTi/iI+fQBcJaP0h1GksahzJwvi4v82rM+pJtp4Y55JhcfwJTuPrIsgOao+5V/yBw4kRoyqm/J9b1MKdGZjg7PQMWBq5JAdbRMGhUhCk1ajpdqNm6ZLzWxdqOO2wc7nlTZXACc+s7I4u4ycQ1hB9gbRFTgX5B0adananZ8rNG6r+NnrJDVo1bHWHsxJSru5PbaHAV8sCer7iByZ+aZDBFBjDVrtRERJPzrgJNSlj4OZBQbHNUBHkLvpm5zNSXfi8kSNo8fyF2SW02NYcKRNZgKGWPPYJyHyEv+TYJYhS6+uilkYzBhqwBUp55sOQOo0tC0ap/kYT2i0mbXrM754AVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KL46CubCVFCArvSXMZGAfHMUFF2k9xh5z/dMClencLo=; b=AA3wXw8IsEhGnkx6UxrAheVef1jfbBz+ElRcTikr0PQB0isaMYVzS3f52BGmxA/UeAERr34r7doHQi58JBOSmvf9oIKTDOpC/5F9M/rDKQxng6mdw8VnOJRgq70kBUkLHFRtEGbkPN21LhrYmOa1MGFM0mBGWKHLr38/1gycWE59NbR1sMhRuKMSGIq24Bx2XGOLMNAM+jJRJSZsrIkKbXUDZUqP4plAlHTQdr+144Ck01Xz9qpwv+TPD0N+p+0LwUXXcbE4kKjXYoOl6OI/BlGNgAW8kV7Q4Vo4idZ7D3MNecMaADi8ajtz49WIZQvPzeDgK1Z6/E3XdmgZ5eTAUw== Received: from CH0PR03CA0308.namprd03.prod.outlook.com (2603:10b6:610:118::10) by SA1PR12MB8860.namprd12.prod.outlook.com (2603:10b6:806:38b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Wed, 18 Sep 2024 09:22:44 +0000 Received: from DS3PEPF000099D4.namprd04.prod.outlook.com (2603:10b6:610:118:cafe::ff) by CH0PR03CA0308.outlook.office365.com (2603:10b6:610:118::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.25 via Frontend Transport; Wed, 18 Sep 2024 09:22:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS3PEPF000099D4.mail.protection.outlook.com (10.167.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Wed, 18 Sep 2024 09:22:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Sep 2024 02:22:33 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Sep 2024 02:22:32 -0700 From: Dariusz Sosnowski To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: Subject: [RFC 4/4] ethdev: omit MAC address restore if not required Date: Wed, 18 Sep 2024 11:22:01 +0200 Message-ID: <20240918092201.33772-5-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240918092201.33772-1-dsosnowski@nvidia.com> References: <20240918092201.33772-1-dsosnowski@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D4:EE_|SA1PR12MB8860:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ccf032f-bbf7-47fc-3c4e-08dcd7c373e5 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?h9PjZHcqzJyR0N/ESIxQ9FgT91Ra9I/LK7YyWMw3iWECXoxqedvYzYYjf9ez?= =?us-ascii?Q?yrArYZj37JNyRDSVx2DHU3MeQca8OtHbuJ8w1Y0sVAWSar8n/bkTsMop8u4N?= =?us-ascii?Q?0kuBkMHJ9sMG2wXfyKP3qo81R6u6gU2oDHOexYL7eE6CesEl8hOSaQIojgGC?= =?us-ascii?Q?Z0IbuXZVbCVELQY7rTXIIfAvdTTpprNV6LxMLuMyVSVNNxh0uxtRif5uTj72?= =?us-ascii?Q?w0Q5JWBgii7PHP+ivMlt+ONLYpyPBUmZuHd6t02bh6YByGmU9gvl1qWb0CnX?= =?us-ascii?Q?uqtj3k3oYje+5Td8+70RpX4SoU6OJoCSbrCRBnkdgEE1L5pj5yVrniyUuHIl?= =?us-ascii?Q?kOgBnRTBmxZ+MP28C1oKAj8h90y/VKm5yBb3ZhdqQV6HC5lR9XfCya66V6DQ?= =?us-ascii?Q?yKGLzSPZEWDu4kJ8DSoWk5YVkVUOUNYSJUK6sEWHYXprqMVT55LJRxTY1vWF?= =?us-ascii?Q?S6EfWncXxJiF8V23e++SZEb0L1P37g+Tvyym9NDFsunjKdrZ83vSSn/NI3Ze?= =?us-ascii?Q?eeWE8o0egU2Q+G3LjQxpeVZBZ2YuLRD2u/k7w3JJdROd11NIk2QbnFeyaink?= =?us-ascii?Q?EwM7LR1UatnbcUA9Cw6Ir3WUXT71REW3iDC4SD8mbic+2C5ASyt+b4p7kJb/?= =?us-ascii?Q?og8WMOKTejAA3m5KHadxtlCH2PGznQosarumbeU9aOcPKh8qplovn+w9WCS4?= =?us-ascii?Q?lq0EFjFZyj+wG2eXjRd+DPbDGomhtwQq+u1xbNDtqE0DOn+YYMh2zoj5Xl/r?= =?us-ascii?Q?2qGCLT+/dPaaGIi5OEjJajdXeeqwTJDZC1CJEkfTtiDANVbbldofY+TjCCsO?= =?us-ascii?Q?RW8kVMe5E8WTKTISmqLenVYexlllUkmOwl6IH3HJtWCm4EDznncXB+yYFxQA?= =?us-ascii?Q?qHqRxEI1zVikt7JeLyT5lhQYbMWOq4PRhy4GKKUJtRtXEImbqTOnYL/zbJsF?= =?us-ascii?Q?OaEgKjod8hVGjim+7gKRnE244GDKYLUlrqxFxukgQXQtDkP97BmI6Q2nBc1f?= =?us-ascii?Q?2DYr2wi3et5RxZKSq9KLZvE/GSSKS3mSbBmNy8IVNG33gx7mv3svHdFIx+Uq?= =?us-ascii?Q?Lx3zKv0grNiRwK/8YrnVbZFwa1DsriP247e0EMN5Lg9P2eQMxczrClPFSazG?= =?us-ascii?Q?+vY05SZuGblVtnpNthrWU7lF4RX3e/unQl1S7EeVAwsL4N3Li9FWZXTVlCTt?= =?us-ascii?Q?lzimCpbfM4OhKchUBqp3mkUnWvvsAuqjfblqB205mWbdJ62W0rHaTjLTS/Ba?= =?us-ascii?Q?PIbdhReC5+pi/M6M3TCz/pR1IY+PK0+ZbQwbJFR+WFbydXPICbgsids2/zTQ?= =?us-ascii?Q?4my3wUvk8JIMdC15JDsZx33OxMYdFscYm6trKKZmXFl4CPmYMCWXTZ+VJ2GD?= =?us-ascii?Q?mmHdrny27mkMGdmb4/OwcQpWozb1?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 09:22:44.1359 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ccf032f-bbf7-47fc-3c4e-08dcd7c373e5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D4.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8860 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 This patch adds a new device flag - RTE_ETH_DEV_MAC_ADDR_FORCE_RESTORE. If device driver sets this flag, then it requires that ethdev library forcefully reapplies configured MAC addresses, after the port is started. As a result, unnecessary work can be removed from rte_eth_dev_start() for drivers which apply all available configuration in dev_start() (such drivers do not the set the flag). If RFC is approved, then the next version of this patch should set the new flag for all drivers to maintain the same behavior, until drivers adjust and it can be safely cleared. Signed-off-by: Dariusz Sosnowski --- lib/ethdev/rte_ethdev.c | 3 ++- lib/ethdev/rte_ethdev.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index a08922a78a..e4bb40cad8 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -1723,7 +1723,8 @@ eth_dev_config_restore(struct rte_eth_dev *dev, { int ret; - if (!(*dev_info->dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)) + if ((*dev_info->dev_flags & RTE_ETH_DEV_MAC_ADDR_FORCE_RESTORE) && + !(*dev_info->dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)) eth_dev_mac_restore(dev, dev_info); if (*dev_info->dev_flags & RTE_ETH_DEV_PROMISC_FORCE_RESTORE) { diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 73405dd17d..deab07fbc0 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -2132,6 +2132,12 @@ struct rte_eth_dev_owner { * after driver's dev_start() callback is called. */ #define RTE_ETH_DEV_ALLMULTI_FORCE_RESTORE RTE_BIT32(8) +/** + * If this flag is set, then device driver requires that + * ethdev library forcefully reapplies active MAC addresses, + * after driver's dev_start() callback is called. + */ +#define RTE_ETH_DEV_MAC_ADDR_FORCE_RESTORE RTE_BIT32(9) /**@}*/ /** -- 2.39.5