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 C7D5B44191; Wed, 18 Sep 2024 11:23:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DDE643250; Wed, 18 Sep 2024 11:22:57 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) by mails.dpdk.org (Postfix) with ESMTP id A1B5042FFB for ; Wed, 18 Sep 2024 11:22:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xnO28bWKA+mchJymy9xwF68n5wh1zodpJW0B2TDPeFefRNQQ87fPAVDxTmyMJ2cfvRVLaA89Axz6+T1s2ef43Ori/nbElUOwy9DII342KIOhuRM2jDDaYGV7QZPhW0urLuiam5ds+NOYdKxgt9ahOW6iJpl+xJO20S2IXwpV+U97egcbMlUyhol/Ek5GAfuInX0EaTzCu3YxjETLQGxCQhMUzZRzik0R/Xirg3/eCrh8gG/VoIYSVNGbCZASzBV9Yva1rzC0NXjDKz4MP+VutxaWNSpLbZFrR9LmxekNw6tmQ/MjIdE7ZXp9YgDiIEoaKlMWyLY6V616hhQJHf4UkA== 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=XS5kbUkCPcWO6bMD0PgAXpfDyy7k10f+GRKhV5tqhY8=; b=IaCwBfjQnXCb4enoEblSLUr72sMQPL6HW00yqjsvZUtCt1b+ebATkH1D4NaLxVzMHTAJCdHUGEiBbM+PUENOdB5wnGPfGFHFLzyadVDi8kq7HoQmiKlkTzFjQbg4OVGItrubobyD15QTUipLKf4ZvUIz8yOr1oQwITgHjHbwtqHVEoYlQ+J1FLBmQX7npV9DKsJaIDcUsKun2ISBLmQYbXM+k5fBqThDOcMxDleQ5wtFho39oe0zXkvGBYTdLuxELvGIz2YVv2BWBPBRUVFSKPhA233XIa9pQFuhnnt2+9GY6zbPYceO7bNfXbTQYXE8Y/vJN9XnVELcyoqemQp+5g== 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=XS5kbUkCPcWO6bMD0PgAXpfDyy7k10f+GRKhV5tqhY8=; b=rGN/2/oFKWgwTglkaI9RkM7cd2j10nkHITNZYeP/dR+5A0vw7JmIjvxcMeG1BZoBcJ1VcyWspnJg1cwmOnIygzPbIE+rBMHTVk9Lk94C0l0mZoOIlkJ2mlXcAW8ZS2VNy2/X1JPjU/vw5Q4OtNn/K6uFcCxXwfGClhgSFRsO4LGFJZ6Uy3Qt8zuqRbHvlQ8k8uSYpsjX/k13FmNeDazvmT//Zbay4Zks2eC2FgudF5OMN8aIctwmapapi7gongTdyLrLijF24O6d3JnvfNvPX9Q2bnoAR1X1zpIhankCkFE7Be84yT030KnKFmb5qidVQuzo+T7N0n95WH/OIaZeuA== Received: from LV3P220CA0001.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:234::33) by PH7PR12MB7793.namprd12.prod.outlook.com (2603:10b6:510:270::19) 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:45 +0000 Received: from BN1PEPF00004687.namprd05.prod.outlook.com (2603:10b6:408:234:cafe::52) by LV3P220CA0001.outlook.office365.com (2603:10b6:408:234::33) 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:45 +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:45 +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:30 -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:29 -0700 From: Dariusz Sosnowski To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: Subject: [RFC 2/4] ethdev: omit promiscuous config restore if not required Date: Wed, 18 Sep 2024 11:21:59 +0200 Message-ID: <20240918092201.33772-3-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: BN1PEPF00004687:EE_|PH7PR12MB7793:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e4c2957-753c-484d-95b0-08dcd7c3747e 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|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fb6U0GkqRGqgw9Eksp7iyKGMuwysZL6kg/GOs9wmKLInNV2IsfRaDve2NvB4?= =?us-ascii?Q?uZMxbTeQtRZAqGpwbI7wPy2XjwFqZ2A/Lzbeq1ESsxc3qcswnU+QVCrDyy/i?= =?us-ascii?Q?OZrYFPozrHQAdErEKs15+UE2E/UujofNQp/8sydr9IhS7rkjgwc/RvXp+TRT?= =?us-ascii?Q?hbozW90NLCszqIH3y/PQryj5o29SX9ItgZXHvrPmwKb3u18+2pl3PkqmqTcg?= =?us-ascii?Q?I4EIe0283bRPW6kPGd/5IzMIfsXWwWRlrT1K24ypznVsvy124l/gJ4SlUj72?= =?us-ascii?Q?iC8q/jokjd5DwXByLsEIUXpRapjdrO/PhVjoK9pmP/kG5d30yRG4/GqLQ9/c?= =?us-ascii?Q?Lvo3dhJIaDEzPavnH3CAb+F/vgCexnoKFSX42pSuxP6xqcdx3sVOJQC/1SLI?= =?us-ascii?Q?/KNqacC8hDrMuuI4zY6WUQR6KYPd107hV62KQo7CXJ6NREj7tdmdJBCfb9LW?= =?us-ascii?Q?KwPf+K4evr8mLBxZN9cNHtSbpwZn0Wi8OQMiDKFKNlugv8OZI2yCf0uFKtd2?= =?us-ascii?Q?WJ2l8lShG+R219R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us-ascii?Q?cQLpT0PSOr/Ttlc5WntmSgw3MU59opyx?= 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)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 09:22:45.0784 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e4c2957-753c-484d-95b0-08dcd7c3747e 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: PH7PR12MB7793 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_PROMISC_FORCE_RESTORE. If device driver sets this flag, then it requires that ethdev library forcefully reapplies promiscuous mode configuration, 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 362a1883f0..ff08abd566 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -1726,9 +1726,11 @@ eth_dev_config_restore(struct rte_eth_dev *dev, if (!(*dev_info->dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)) eth_dev_mac_restore(dev, dev_info); - ret = eth_dev_promiscuous_restore(dev, port_id); - if (ret != 0) - return ret; + if (*dev_info->dev_flags & RTE_ETH_DEV_PROMISC_FORCE_RESTORE) { + ret = eth_dev_promiscuous_restore(dev, port_id); + if (ret != 0) + return ret; + } ret = eth_dev_allmulticast_restore(dev, port_id); if (ret != 0) diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 548fada1c7..0fc23fb924 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -2120,6 +2120,12 @@ struct rte_eth_dev_owner { * PMDs filling the queue xstats themselves should not set this flag */ #define RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS RTE_BIT32(6) +/** + * If this flag is set, then device driver requires that + * ethdev library forcefully reapplies promiscuous mode configuration, + * after driver's dev_start() callback is called. + */ +#define RTE_ETH_DEV_PROMISC_FORCE_RESTORE RTE_BIT32(7) /**@}*/ /** -- 2.39.5