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 5600645B12; Fri, 11 Oct 2024 11:21:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17A2A4028B; Fri, 11 Oct 2024 11:21:44 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2087.outbound.protection.outlook.com [40.107.102.87]) by mails.dpdk.org (Postfix) with ESMTP id E9086400D5 for ; Fri, 11 Oct 2024 11:21:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VVAhIPIqopglRFXPgrIuWTuAUfjsJcRhzB4Xqk3U/PP7MxgLQlZYz3xxnMmif33G9N5Kfs8HnBECtvf+RT67t8zgu1pWojHnqZ4CiX2r8T3N0aXSFYL2iRGyAzqf0ivnPj6P/9FKhCsOwRZ8R6Ovth5CJmlryGBD2Uz3q5XuUb/vPGsdI0M8vr7BZg6dbnLaNBJERMUH1FV0CTFtsMhYv04fEeeS8At/LCtvB6XyG0C3XHlfbubgjkFiKYiir9yA6k6UcMzd9wXsULbvbLotlyv/Zj3VTMr4xWekj1wDB8zdn5XJZzqUI01NUSAYc83QDwAoirQYRQOwjFmyncOZ4w== 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=v18FVZTy19GHT+uXJYb74hcJ7B2/68aGGBO3VmbBLNw=; b=mAQR2LtbcKKo42aLSS/uy6Nxn3L/urvwpNm7iJ/cvesbds4CW4OfAF3/PztHn4dQSnYEmvmCZdWer4qkVi406J91Bm9rlhu9NzAW1ludXOzZ2axJg9/qPo8+LlHllfuyhtJ9C266kqgYOdXsAiAZ0sNFHwVQV4tb/0S/1Rxr1Gk7obKtss/Hik7sq2bIN7Re6RShWvigAi5zjEgScXMaQvq39Cf6eOD4s0lD4r7cmLlL6QLYn82uPmoBGo225vjolhoAR68m98N+54QzWkMs7tkif7C8wuj4NthXClh2H6P6T5HlH/kdJZGhbhJqMUqy8H0te6TvPzOYYEh+J7PP2g== 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=v18FVZTy19GHT+uXJYb74hcJ7B2/68aGGBO3VmbBLNw=; b=iEqJeqHNINa/8oZlnWiLTeUB5PKnF8pKSmidmNdm+MHcXDyS/eWQo0grcMK4dQP6SP6QYlJCOXC2OMdM72qVuMx9cJ0LlDp/b7S0gWiKBSfwga2h0EXomVw59FRostZWBfOgYDP9BiAuSBkCK3zzXJQpmrAAS1KzbaC0tSHINHStDH6V3Th3YLYUV6jVxv36gdZ5Iisvh6QCiW4W4bV7q4iIvqOydftaD6aiVjBblyIfNf/gPcyieksFKdOr8aC8HRfFZ9rwy5g+VYgnWVqPF6PaP6tGqRnlwXAmsiSmzMKvF8qicb7nlH55m1aSh0ugy03+xbsrsuoj6IN/JcZ7/g== Received: from SA0PR11CA0029.namprd11.prod.outlook.com (2603:10b6:806:d3::34) by MW4PR12MB8611.namprd12.prod.outlook.com (2603:10b6:303:1ed::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Fri, 11 Oct 2024 09:21:37 +0000 Received: from SA2PEPF00003F66.namprd04.prod.outlook.com (2603:10b6:806:d3:cafe::10) by SA0PR11CA0029.outlook.office365.com (2603:10b6:806:d3::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.20 via Frontend Transport; Fri, 11 Oct 2024 09:21:37 +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 SA2PEPF00003F66.mail.protection.outlook.com (10.167.248.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.13 via Frontend Transport; Fri, 11 Oct 2024 09:21:36 +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; Fri, 11 Oct 2024 02:21:23 -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; Fri, 11 Oct 2024 02:21:21 -0700 From: Dariusz Sosnowski To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: , Konstantin Ananyev Subject: [PATCH 1/4] ethdev: rework config restore Date: Fri, 11 Oct 2024 11:21:00 +0200 Message-ID: <20241011092103.181145-2-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241011092103.181145-1-dsosnowski@nvidia.com> References: <20241011092103.181145-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: SA2PEPF00003F66:EE_|MW4PR12MB8611:EE_ X-MS-Office365-Filtering-Correlation-Id: c1a61fa5-fe67-438b-96fc-08dce9d61b4b 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|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/CIhIiq/rbiFPC2+Yj8mLEklkuTUAA+iCFTqtSTOkstqvx3gZy5EqRp+QKf0?= =?us-ascii?Q?6iZRysE+HaYTEQXK1bTJW6r4swR1q+P8tsUDVYsq1t72xnms5pVGq2T1SR0V?= =?us-ascii?Q?DlbGMm0gg3XdQXgn7k9Rj+Gw4QDhFhi7giaufMc6+XSPIwgiMKXt3kEnH809?= =?us-ascii?Q?u8JA4Pb0y/ZieLAkXEnSHQDzr/OFGUWQhey0aNsQMh0mFBffcOErWNI6wcYk?= =?us-ascii?Q?2XMlrPEAUFiPg3hPsiAc1Sn0q/f2bIqALQ2fo1chsZzZI+T1X72oHX/KvdLu?= =?us-ascii?Q?QTFawylIsVyMkpazWqhD030ftOFzCwq8YS6mbvLsonMiKaLvE475wJrTpSz+?= =?us-ascii?Q?E8ahDE/ac28kHCI7W/fxV4kpWc0FaVFHYOExt0mK6ztlvG9p0QcUHaUpb5ps?= =?us-ascii?Q?xb7nn+WHXcsnPJVdWLdOutul5KiRlv8Km5p7UvpLRyv24pcl9TsREvfDN//L?= =?us-ascii?Q?feMAt02tGFJSl/99r/sUj74HzJX+UGOXaF42LXLUAf+nnk2SAFZzBbo7S+Bu?= =?us-ascii?Q?r3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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)(1800799024)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 09:21:36.8573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1a61fa5-fe67-438b-96fc-08dce9d61b4b 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: SA2PEPF00003F66.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB8611 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 Extract promiscuous and all multicast configuration restore to separate functions. This change will allow easier integration of disabling these procedures for supporting PMDs in follow up commits. Signed-off-by: Dariusz Sosnowski --- lib/ethdev/rte_ethdev.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index f1c658f49e..362a1883f0 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -1648,14 +1648,10 @@ eth_dev_mac_restore(struct rte_eth_dev *dev, } static int -eth_dev_config_restore(struct rte_eth_dev *dev, - struct rte_eth_dev_info *dev_info, uint16_t port_id) +eth_dev_promiscuous_restore(struct rte_eth_dev *dev, uint16_t port_id) { int ret; - if (!(*dev_info->dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)) - eth_dev_mac_restore(dev, dev_info); - /* replay promiscuous configuration */ /* * use callbacks directly since we don't need port_id check and @@ -1683,6 +1679,14 @@ eth_dev_config_restore(struct rte_eth_dev *dev, } } + return 0; +} + +static int +eth_dev_allmulticast_restore(struct rte_eth_dev *dev, uint16_t port_id) +{ + int ret; + /* replay all multicast configuration */ /* * use callbacks directly since we don't need port_id check and @@ -1713,6 +1717,26 @@ eth_dev_config_restore(struct rte_eth_dev *dev, return 0; } +static int +eth_dev_config_restore(struct rte_eth_dev *dev, + struct rte_eth_dev_info *dev_info, uint16_t port_id) +{ + int ret; + + 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; + + ret = eth_dev_allmulticast_restore(dev, port_id); + if (ret != 0) + return ret; + + return 0; +} + int rte_eth_dev_start(uint16_t port_id) { -- 2.39.5