From patchwork Wed Sep 18 09:22:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Sosnowski X-Patchwork-Id: 144251 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73C4144191; Wed, 18 Sep 2024 11:23:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E5C042FF3; Wed, 18 Sep 2024 11:22:52 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2063.outbound.protection.outlook.com [40.107.92.63]) by mails.dpdk.org (Postfix) with ESMTP id D950142FC7 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=brh3NL3puTfL4rPN9zrv2GE2XSqXZxGr17b8fLb0NeMbFYhqBClyicBu/WI1UOIwqHmkRMAeIwSf78h0M7VmZCdD8g3DUakOr704Eik335lZnFA6yQxE5ZMFJD0iYxCJUcCbom10IKlOpg9JrR7efpM/49H1h89b5mxQ2kWkGlPGn6H+0GQDldodl0r3cqNllWHC7W4rjwik7iLy1XCPT9PrYmamZras/zDSM8/oUVvdxrYXFsiCt7pKtUzMqAVJxNyVLT1hBNu1MfLOiZniCf1otTGrtPXv95sPNYCyQRnEzQR7Sn0zgNaxnCzA+/Tf6cBl6aBOCpJIWDN/BFNs4Q== 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=Au7iKxb9bgvPId7Tbp8wM/BBNAUk4mzOdT1PrI1X078=; b=Mdz5dVqCcMbDQntD78HFjE7J/NAuMCFUWv/yqDcOwXZVT1hYrf/59inng6SDZQCQZnHixIBMOWqav5A+K7pJ9g8vpwBjQ9Seqt0bCt39i82Mu3vgO6Sh+A+8cSsnlEDJuHvH77Il+WopvujdrwAWgIbF/MVVsb4wllWPDJsNpT7xHeVp1QIvyk0ynEVm5uZmwp1cVRPr/LHO/bKGsVBS8AQtqUa556bLLiXBlCJVj9eapsGYGNv+KQ90ybbvA+yWkkJQrwqUwDqfF6tM5l5Ew3oJgfGuJCLMw1OfcLlK4jX0BJszhsSHLvvZ1VOGKwXklhHZB1E6DaOAz99WwC0i5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=Au7iKxb9bgvPId7Tbp8wM/BBNAUk4mzOdT1PrI1X078=; b=imKJJqfHvyt12yfpxY9ZBnMqealyQl6YTLCH3fMyB4+GGqEGPXHBlv6ZYwMRqkkkQKGjtM+odC+SomFBnDvL4onfiaNoBSMAA2asoOMUzgahSOjnzIyX9xCWlDc+iixWdLEN0bIzGLAL1ukNlI6X8oyE6NR51/p4Y2xkzCu3tpt6J7xmP7eaDRv/F479qSgvz6HzrV9lc2xQb7Gmw62Pd7Q267GXAia4pNs6veU7zwzt1bI/GEf/G1JFo2xsofpQ5BZsReV0bJIL2eVulZVYXVz2tEyFljyhZco19MQtq9tCYhriiUOAhTvKPsSXBuja/ugCdmzVooZpK94nBWYacA== Received: from LV3P220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:234::28) by MN6PR12MB8592.namprd12.prod.outlook.com (2603:10b6:208:478::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Wed, 18 Sep 2024 09:22:47 +0000 Received: from BN1PEPF00004687.namprd05.prod.outlook.com (2603:10b6:408:234:cafe::59) by LV3P220CA0027.outlook.office365.com (2603:10b6:408:234::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 09:22:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN1PEPF00004687.mail.protection.outlook.com (10.167.243.132) 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:47 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) 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 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:30 -0700 From: Dariusz Sosnowski To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: Subject: [RFC 3/4] ethdev: omit all multicast config restore if not required Date: Wed, 18 Sep 2024 11:22:00 +0200 Message-ID: <20240918092201.33772-4-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 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: BN1PEPF00004687:EE_|MN6PR12MB8592:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d1249f5-5964-4d51-5e3b-08dcd7c375cc 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|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: t/B0ij0xf8P+rHA0bdIqIla7O633lbiBfT/jzIRuxvEIYGVPDIa/keFpEZo1HLG9BaiEAoTuzgQm1lMShI25tEMhSSYMeTLIV3KySuuntc65J4PU6GHu+iRm5FOQjKYzMepGnOJ/+KM2P8HbwZRTK+riUis5r3uQtDkQXkXAzBuD15LI4ehmzumETWRi5GwfNwspDeZ3Kud1Ee292A84BJ72mhxEsXA1+tHTftzxpwV9nZvZbfLJhmtMmXawC5rdDudWelx1SOGxuPdnR1uurWWztJaAK/dCXRI9AYvDJU/HDv+nEggpgNrN+YGZAMDGbDkdxbHOzEX9cp1RApoLntnZ3nmZHTKO/gZYn3RTeEGtoIHEUiwC9drl3w5OLCoRSFH3wD/TRbb7H9EY92L9tSqWY++NZjEIWgTwqUu0gwTpc1yaueXUFyaHzTzteNnqcWKeA8NVjQkHC45ytblDctl8Ku6P6J1v/+ftra/sWxQGShj5WWKH4CY7ruaT0xKompHNNmZr03wDpvkWyylXK6M1XDf+iWoe0p+oBiJ8J6Mv0jrnlNVetMJ0Jxsbiz9IAaOn2vKi2gXVX48dm0yBDWwPV4Fo/7kflpNVFF0uVQkyirglT7+4qsukAAEAakoPrf7/xjqm/EbQNaTk2D8BKFf1bmmt8BkvdqbAA3sdlocKJrSe9zkiupUy32S1zXLWntnGYMSfWzyhLvW6Y0gRXvM3BrwfIS02AZRX0YyDyRRZGp9JKa7SY6Hmlf6QMulWbQZu1ykf60b3mi+5fZMinDed/LQos0l8l8EG4cqZVKMqyYIcRT+XIo1n4bfA0Pl/YA5BPa6CJCEqzviNrUM7utEGqG5ul99+T9U7r/aSYfhPYdA37L7N2K/sgqY6IIzhVAebxmbdNHJX5u+CVeZiRppTlYmtXfol2j2EmVbWFTrqFHSTJXzvo13LJYXz13P4C0RsSixE7+mianXYkBa2BJ1YaIzeNGejHoJCwJi/Tq7XP+inJWZKFASKDU/+7LcG5UVSsS3UzYKYi/u6/0POdeguBNCUgTXudcZ1PW+1gCEPiKyIAb+KMBxKVysMtS4vKpiICWM/JFhXk4A/QgcwhVfGZGgrg6GAPd5pmG/dn+pXD1FM1Z5SyJHQHqL5XQpLcCeY3BqdqWyBCGoQ9Ot8wFajJBESN3VY5TsaXPsNwxT2873OkL3YqJJES6CDRVyPcNrFL0Et+t6vbodvwsrx5vW2t0bdIeLuPzK3JxvjZnqspvPj8RiQp5Piy6iRTGmVo4KNKDejrltxDnvXYoIoqe8moK6MuFlaoC2rtqFeKYa+vLP6Sm2QTXdFI4q9ql5cAwx08J9KZUmGPt+T4SJExw+mbEIDpnbWkcXDQ6U0hOOfyYoMXivzOReReRCzOZU0D7g02NnbEjJRaDZIwXT5zN6/Sn9DkbiSEVaNn0TwqEqyJiZrUCG9J8QIelT70QK6 X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 09:22:47.2658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d1249f5-5964-4d51-5e3b-08dcd7c375cc 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004687.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8592 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_ALLMULTI_FORCE_RESTORE. If device driver sets this flag, then it requires that ethdev library forcefully reapplies allmulticast configration, 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 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 | 8 +++++--- lib/ethdev/rte_ethdev.h | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index ff08abd566..a08922a78a 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -1732,9 +1732,11 @@ eth_dev_config_restore(struct rte_eth_dev *dev, return ret; } - ret = eth_dev_allmulticast_restore(dev, port_id); - if (ret != 0) - return ret; + if (*dev_info->dev_flags & RTE_ETH_DEV_ALLMULTI_FORCE_RESTORE) { + ret = eth_dev_allmulticast_restore(dev, port_id); + if (ret != 0) + return ret; + } return 0; } diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 0fc23fb924..73405dd17d 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -2126,6 +2126,12 @@ struct rte_eth_dev_owner { * after driver's dev_start() callback is called. */ #define RTE_ETH_DEV_PROMISC_FORCE_RESTORE RTE_BIT32(7) +/** + * If this flag is set, then device driver requires that + * ethdev library forcefully reapplies allmulticast configuration, + * after driver's dev_start() callback is called. + */ +#define RTE_ETH_DEV_ALLMULTI_FORCE_RESTORE RTE_BIT32(8) /**@}*/ /**