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 9BDCA45BCB; Fri, 25 Oct 2024 19:02:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8953F402DF; Fri, 25 Oct 2024 19:02:37 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by mails.dpdk.org (Postfix) with ESMTP id 7F2E840264 for ; Fri, 25 Oct 2024 19:02:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729875756; x=1761411756; h=message-id:date:subject:to:references:from:in-reply-to: content-transfer-encoding:mime-version; bh=u3YyqJXi7vLY7zD+i+sfI9PhBr+HGfmv5nZjU1eJpXg=; b=iy5MNSQzkm49MA5cT9/q54FdxQA2wwUGuGJ7AtiMyk4h/gqMc/ISu5nw 6baD8L2FiE/NgBbynqt9Tia8ZgLb9I2ZQdYquIFIZb1fJ73EX5+yI4jvT mRRMud31pTHKtHDUFYOHPcH7+cGGoA8lkyBW7ELqkY1BUlR260IpcFIDl DBeWdh4XKqzHJtiMWUiG+JJcaI3tu9TWNaFKI+YwryFS5lJhsvVEtwDpJ 2B7/gJmx+tMCOHJTQ3GISSIS4Iy3T40LbncHVIoK8IgNn3n1lToQlG0k4 QXXLfa9NQqNRd1k6jyoTdiZLWfnVVK0h69gTTPDV3XhqLCW4eXA6POW2J A==; X-CSE-ConnectionGUID: wHeUb5sIQgSDWScJfZadeA== X-CSE-MsgGUID: HinQRPAaSVqbtsgy4I6bQw== X-IronPort-AV: E=McAfee;i="6700,10204,11236"; a="40929479" X-IronPort-AV: E=Sophos;i="6.11,232,1725346800"; d="scan'208";a="40929479" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2024 10:02:35 -0700 X-CSE-ConnectionGUID: +oDUCyZeQdieiZP5I6k9uw== X-CSE-MsgGUID: GAoFEA6lS6+4wZ3eAjgy7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,232,1725346800"; d="scan'208";a="81117146" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Oct 2024 10:02:36 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 25 Oct 2024 10:02:34 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 25 Oct 2024 10:02:34 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 25 Oct 2024 10:02:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QfLPz/+OQK50qIuvpWUJmSaSNE/u+Z66desahOhitcLDLL8+3zQsAdfDNUhEa+bEmcMZ2K72+63LQRaqs8Cqq6Flkd+K9RbtqRxKdIWYVgiXhxb+3xjsSpfSE2LFVRPUL0wbwZunxLFPiJx3q50d4Y16YdApaOFbfRNbn893OwemUnkkLuXBJbtTC/KRVrXibAU3uZ0lq1GNp+aDhgG4SdaYGWHFokYpFCt1TQw5GPu2G1G2mgZBKQDBsQdOe6czR2kEpgVf+wH8a7p3qApsCDrN322V640bU8934ghN27Qq+K+R1+Nmes7q6K8KuMNMtNJwa9vKzfCrkdlWvd6ucw== 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=FsRUdqQPmq8qH93cAKWcDjrMYFWFKWUPi5dYPnsSeck=; b=Ii2G7CocuDi5e4K77SJsEQRZ3AiSFU0pxugGDC540N5b24O/oyLpfp27STbZ2L0jld7AHzlXV10hMJIeSapjOtmEWbhDJORAhum8TU2TU8aegEgNicS2uX6E5n2VnjpUYrwzyWAdUOASU+iK80YTtXFu1eMl+ZQMpQ78atQzWQDp9yW39/CZsHW3hYGpDIlmpdGL64x6+++xPrqDvuU9h4xNLY+T4uO2uZDkzcIDLrSYITqt5vVieX8S3Y7b4hKBuXg5QWCGFVX/NHv/SpOf7Naj4mmHl+7OV/1uwr3fQIS9ggLCR6owkknwom38g5cO332REeSwhK3E4MTKL7hltA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) by SN7PR11MB7565.namprd11.prod.outlook.com (2603:10b6:806:344::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.18; Fri, 25 Oct 2024 17:02:28 +0000 Received: from SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5851:319:3da6:850b]) by SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5851:319:3da6:850b%4]) with mapi id 15.20.8093.018; Fri, 25 Oct 2024 17:02:27 +0000 Message-ID: <335928a9-3a69-44b9-8a98-a61642699fda@intel.com> Date: Fri, 25 Oct 2024 18:02:23 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 4/5] net/ice: allowing stopping port to apply TM topology To: Bruce Richardson , References: <20240807093407.452784-1-bruce.richardson@intel.com> <20241023165540.893269-1-bruce.richardson@intel.com> <20241023165540.893269-5-bruce.richardson@intel.com> Content-Language: en-US From: "Medvedkin, Vladimir" In-Reply-To: <20241023165540.893269-5-bruce.richardson@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: ZR0P278CA0215.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:6a::25) To SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR11MB5772:EE_|SN7PR11MB7565:EE_ X-MS-Office365-Filtering-Correlation-Id: 805db681-0696-4f3d-25d8-08dcf516ce31 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?NitvMEprQXd2YXhVaDg3ajhPM2cxYnFZcXl5eWJ1ai9uYVY5ak5Ua09OTmJ6?= =?utf-8?B?ekhoYzJvckZJU0M5b1RIdHlJc3dhdXprdkNJSXZOaHRaUXl4UEoyMmlYVFVC?= =?utf-8?B?RERzVjFESWZGY2gxbzVleTk4NnY4VktVQm1GK3Y5b2FOVjZLWWNWdzNkSFR3?= =?utf-8?B?RS9RcjFrVkU0blZBMVFmRjk3dzd2VEw0S1k1SmVYbW5zdlUwRE82SWlRZ3E0?= =?utf-8?B?V1FFTm5vMWRIbEIyM0t2dXM1NStWYW1uSzFIUHVYU2E1aW9iM1VBOXZ5U1Fw?= =?utf-8?B?S1AxaXhUeitadm4wK04rUzV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lkxbjZwOE1RSU1Pa1MrTnNTaUV5bE5WM0tJYlZKRzNXNEZZejFx?= =?utf-8?B?VFZ6eUpZeXFVZDJiRE9sK2pHdUlnMWxlTmZwVDFLK3lrSU1sMjRacTArVkNZ?= =?utf-8?B?VGZoVTV4bExNK1lsM2FRclQyWDBrZ1VBMnZldUIxWkROU0I0ZS95NjJFTnlM?= =?utf-8?B?SWdhVzJDZUVKbWM2Vi9IQkpYR25SNktFYlNmY1FMSitTSkdNWGRFckpEUWRF?= =?utf-8?B?UGNtTTR3TUNuTWlYNGFMVjJSNzh0RVU0MWdmaG0vVlRiREIrUTB1Y2M0REZj?= =?utf-8?B?Tmt3QTYwU0NQT3AwWS9xcWRBWm53WDhZNVJ2b3NwVENDaDVsbldBYjJtbHRR?= =?utf-8?B?WHV5NUR6OVpxQjRvWHdFakpzYUVoT3o3dXpkVzBoT3pEZkwrblVMdUI5OHNG?= =?utf-8?B?R3Z5OGg2YXBQT3hCd0swbDRsZlkycUd4VG1aOEdGU0NCOWdFZnJ2Y1VUc2ZK?= =?utf-8?B?N2w5cE1hU1VPQkNqTGIwRnRja2N5OEJrc3k1ZHUxZlNKSW94SzBvUFJzTGha?= =?utf-8?Q?iBvtexGijiXEEcrDGw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5772.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NXFUVHk1dkw1SkZ1ODRGUWpEYWhJMk9HZEwyYUNudjJVamw3cG50MXZ3OGdM?= =?utf-8?B?ZHEvV21kSEhvYzdlTjR5ZkRjeTR2MUVURHRLUEQwYlZtN3RqYnQyZXpmazVw?= =?utf-8?B?KzRWR25uY05VNFZ2NVFpVnJXQll3bzhkN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=?utf-8?B?c09YMllPMmpMM1luSy9OdGZtZXFDNjE0VS9ZMm1OQzFnN2ZETm8rczVyU0Fi?= =?utf-8?B?NWVnUW42czdPWU15WTZPUlp6aGlXemFEY3RFWmZ1cnVrN2U5RHVyRHBhRDNS?= =?utf-8?B?ekhGUjN5N2NUVmMwZTVKOVJwRWlXL3d1MEhXdFFvakRkbzhlNXdySzdGcjBH?= =?utf-8?B?NVVLMncvK0g2RjZEUFFlY0MrQ2R1dFM5RWtmTDJEQTlTSnRNZ0R4K3dJREdE?= =?utf-8?B?VHc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 805db681-0696-4f3d-25d8-08dcf516ce31 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5772.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2024 17:02:27.9464 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RYH9J6OIEy4GkDgZMrzAMYU4kz+2UwkPgJG6eIUXK75t/lhI8RHanqOqwbXH7SBZgzWx+rWIU5BHAZWZDHrTYiY2Fx1hs+18ubYOfMyy2TQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7565 X-OriginatorOrg: intel.com 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 Acked-by: Vladimir Medvedkin On 23/10/2024 17:55, Bruce Richardson wrote: > The rte_tm topology commit requires the port to be stopped on apply. > Rather than just returning an error when the port is already started, we > can stop the port, apply the topology to it and then restart it. > > Signed-off-by: Bruce Richardson > --- > drivers/net/ice/ice_tm.c | 23 +++++++++++++++++++---- > 1 file changed, 19 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c > index 4809bdde40..09e947a3b1 100644 > --- a/drivers/net/ice/ice_tm.c > +++ b/drivers/net/ice/ice_tm.c > @@ -844,15 +844,30 @@ ice_hierarchy_commit(struct rte_eth_dev *dev, > int clear_on_fail, > struct rte_tm_error *error) > { > - RTE_SET_USED(error); > - /* commit should only be done to topology before start! */ > - if (dev->data->dev_started) > - return -1; > + bool restart = false; > + > + /* commit should only be done to topology before start > + * If port is already started, stop it and then restart when done. > + */ > + if (dev->data->dev_started) { > + if (rte_eth_dev_stop(dev->data->port_id) != 0) { > + error->message = "Device failed to Stop"; > + return -1; > + } > + restart = true; > + } > > int ret = commit_new_hierarchy(dev); > if (ret < 0 && clear_on_fail) { > ice_tm_conf_uninit(dev); > ice_tm_conf_init(dev); > } > + > + if (restart) { > + if (rte_eth_dev_start(dev->data->port_id) != 0) { > + error->message = "Device failed to Start"; > + return -1; > + } > + } > return ret; > } -- Regards, Vladimir