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 79CBC44191; Wed, 18 Sep 2024 11:22:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 110D642FAD; Wed, 18 Sep 2024 11:22:49 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2054.outbound.protection.outlook.com [40.107.236.54]) by mails.dpdk.org (Postfix) with ESMTP id CFD7942F17 for ; Wed, 18 Sep 2024 11:22:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XWru/SgekKD/+IAvEWswRz2l1D2+mC9nKrCdQL++Nu/a2xdEnjP5iIhZCEjKwUv6zVRW9x1GOeeADSmvQMmf83TaV5LTQ/Rhches04X1joAtAlf7m0he5LXmc5+8ApUo/JuX84HsNiTwBV+GYzvqMfENxAO1AvSX+s/uKluD9KAiXO6yqXaMutxn/IjfXnacGqcgwUHzmil9i5t133ezUOqRkxIS6+RrKZxy3JR8dhQnyONMDey1QHfaHheYH9hCqlAFCQykMmRrLqQRYTCzhliJxkedGD4rs+Cn/2Liy9Dk67LeeCVPGLUJouXAiLPZqRcEJ4ng6z9rqnPnF/YYrg== 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=Zl78QZvhRlEDKeUUaI3jGd7WPQeAbLTYkpMYHbkKZNxEAPWHXbe9IyxAbOyVtudVMW8iOtL7QuoQLUABcunkfr/6nIWBdOUBKUX/RMiWf0Rz4w/x5bkGtWFxw6dhNG4ljbI9PkOIWa05YNTNy9oDm/nAVvkkFWNAQzum0tunB9+S4fF4nHgIQVtRs9uprxSFVqO0NNQhXnVGLlkc8SDI3Jm3hOfixZDsi9g9ZgQqJlff83OuulX6zq7A/+mjhAj0W6ZsV7PV1MxMPPdCDw9QahG90PUuIcH9pJaqRfDXbCeqzhUdNEzpF2d7EUhO63gbxdevUy5QepS+poijfi6sqw== 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=jHnggngGORBKi6fgtKlAEakgZ81ZFNFcu/QzdB29GfLuA0pKdSdqN0BFTsNSxNffkA7b9hoCZSH/D8nE/WYiDISjW+M8tDrXQ3TkZW0R2OQeh0UCS8ld0BfeG5msfN17BEJna7PULxyDO2Y21NLaFcZvBCfTgcLXeLVkJmTnCNbHqP3KKEOISJ2WQQzGyOvUEeR9EqH97FKS+NOulzO81rtn+bsPc8WTuvljDG9Ye7A68aKXca5PRuvsXsv0/I+yIbdkYG2OB3LJnQrbLE62yFi7bvFrhp82VoVGuy7o6EheN1b1U8p8OjjDryDIoBTW8DUzXz9yQXJTs1U+SX5kIQ== Received: from BN9PR03CA0088.namprd03.prod.outlook.com (2603:10b6:408:fc::33) by CH3PR12MB8187.namprd12.prod.outlook.com (2603:10b6:610:125::5) 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:44 +0000 Received: from BN1PEPF00004689.namprd05.prod.outlook.com (2603:10b6:408:fc:cafe::79) by BN9PR03CA0088.outlook.office365.com (2603:10b6:408:fc::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.26 via Frontend Transport; Wed, 18 Sep 2024 09:22:44 +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 BN1PEPF00004689.mail.protection.outlook.com (10.167.243.134) 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:43 +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:28 -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:27 -0700 From: Dariusz Sosnowski To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: Subject: [RFC 1/4] ethdev: rework config restore Date: Wed, 18 Sep 2024 11:21:58 +0200 Message-ID: <20240918092201.33772-2-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: BN1PEPF00004689:EE_|CH3PR12MB8187:EE_ X-MS-Office365-Filtering-Correlation-Id: 6eb263fa-5ba7-46cf-fb1d-08dcd7c3737f 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: =?us-ascii?Q?ZMl756+52YUUt5x3WQqdLpgS55M4Lq/KKvGcc6mANy3JJZE1YG1yoea2aEoW?= =?us-ascii?Q?Bz5vYop8RwXSY+ESpT9K19Pje4UKh/BaVQSLklfD8PW4YzKvPKN0uVM0cphh?= =?us-ascii?Q?l5Jp0nClTwn7HskHarllSvubmIJkr8nmctiaNOcAIYWxwVfq+HOr4HuClngv?= =?us-ascii?Q?Wo5gsCjaAux2dJmHbLKsb3c5Se8pnnI9Iv7+mZL3Rf/To2oLEwVgiIvi55NM?= =?us-ascii?Q?okhxWpKrFCNnTT5E5fa9+D1QQElY4qzSnERVLyPIKBEZxVYYMjHizWJWie8u?= =?us-ascii?Q?pJc9IFZmBPLd8TiEVjXR+9rJaUQh+bo+AW8kSWhXe46yIP/Q/vMvQpswrCOE?= =?us-ascii?Q?4rO0IwtBiGqHhFv+b9xr3L+XUsCYBqTOzZ/70nA03wYsgrC9H9X/fzBPXoQ0?= =?us-ascii?Q?iqqMQjfqzqv+6uPnJvHjaN0YU3vzmkLE3hQM59n0nqGAOnVbAgSy2F3ASt3h?= =?us-ascii?Q?WReDSeE6yNrJ4EkPWbOZSTmjQPchPvTwuDomF+t3wMUXam1aKyTvh5LQC7+3?= =?us-ascii?Q?uJ7DetzLahI8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Q?a5KmBFzK8Yx9pI9dDNgzG8HTvTfKQeSS?= 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:43.4098 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6eb263fa-5ba7-46cf-fb1d-08dcd7c3737f 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: BN1PEPF00004689.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8187 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