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 22559454A2; Wed, 19 Jun 2024 05:07:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69D7B427C7; Wed, 19 Jun 2024 05:07:20 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2129.outbound.protection.outlook.com [40.107.95.129]) by mails.dpdk.org (Postfix) with ESMTP id 857FB4021D for ; Wed, 19 Jun 2024 05:07:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dPPgAU3dQ4Rps8t9cm2lIQi5Hd29IwhNf0P6HtnXTQk023zQ1j4+WFhb0W8sFwEN3iWRMgiZGZpI13+yT1RYTvir72Z2Xatje8SoBs7UqTdl8NpJDjmK+LGnRcnJ1dilung6/ooKfzL03QehqctaAbE+LwWfFPt4eC55nqS5e8Gwy5p28AjsggT5wgiZTh/bniNPYJ0bOqVk7NV+f1OzgkUr4p3IXsK1q1ON0Sr4CasZIlS5A3ySx9S5uJeNMzFA7w864eQnacxJSQJUZ3D5mQRuzvzRh6+PhA1WOf8TdYeVi2r2QI581Z+/pBI6b95R3RI0J4tdE+MPavpLMGwnSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=dIhn8IyeYaVqIikoZC3pBuhznMhMLJYLdrjzRFcAHjA=; b=U615G+iSnFd7+YylsP0+3+zudyq5wavtYaVU5b6huJ7yoh8dvNXu3AEICsjVpQJOtrvtKLlz7IEkgSwsTesyg705oDiA82iFHFm3J6e0ZPt0ZRvQZyeXLmCGzcNqWaF6955Y181GAUhUtZw/0oxUsfDaD2b/AlojPLsypMYSgq5gRj9Q9PK8qNEgF686RbV3Tf3kQH7GlnGnF0CTiK2MVRNEZWlYStQV+TxqztgZM/nK9+ZviMwMafvjFq88/5uV74ocjHBOEJykekho4pgoQfP07KlW2r76clbTp/hzSSC0CIFC9F3MWlLrVV2ZBxcNPHkdtKeXBP3BdBAwyb7sOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dIhn8IyeYaVqIikoZC3pBuhznMhMLJYLdrjzRFcAHjA=; b=uMrnC8qkahwSe6QrG0xeEntB1OfDO4PiizETpVO+HgXSHfN+HDOg/dspdqp3n7BEqb0PaZ2o/aa/pUuH5YDQBEsj68G8zBTriCU2EvADvscd9ILqFJBANHOSD30J8nNKc4JPwoep8DHrUfZxyxKekZa9sWAmFEbaXkHyR8qHyks= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by SN4PR13MB5789.namprd13.prod.outlook.com (2603:10b6:806:218::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.19; Wed, 19 Jun 2024 03:07:15 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7677.030; Wed, 19 Jun 2024 03:07:15 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH 2/6] net/nfp: remove redundant NFP service code Date: Wed, 19 Jun 2024 11:06:51 +0800 Message-Id: <20240619030655.3216268-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619030655.3216268-1-chaoyong.he@corigine.com> References: <20240619030655.3216268-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0239.namprd03.prod.outlook.com (2603:10b6:a03:39f::34) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SN4PR13MB5789:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f8f5ae0-cf9b-4dbe-e4f0-08dc900cebc9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|52116011|376011|1800799021|366013|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?2BMk9W+sUCbC6oIaaNFcok1L8SBjUegchLOEFHkGY1H+DPDI7Reqf9nSuZXC?= =?us-ascii?Q?pnsKskpQ8D22mt5LgMRapbwEzKAoSOLU6WorFSjiKNDGd9n1UFwa7ZAD7odF?= =?us-ascii?Q?CJz5UnJ27+rlp35a4Xq731zTSBSKPfFuSyKu6yD3a/YyyQm+G29ewKTnU0zY?= =?us-ascii?Q?ej+N7/TQxaJMXjy/yEycn2Ycb0RqJobblg8xZobq8/3meAA1lb4gPh5P68Tl?= =?us-ascii?Q?NvL0y0S1PvyDG5vrnMFaO6THY7VWEO4ihxvmFnw3W8wxMvfw+TOz9UD7IJns?= =?us-ascii?Q?IUEHv4lZwpe22SgQLVYmqfYX+IBB0nZ1najd5xwUVBdf6ZaL3p7kUfle9cB+?= =?us-ascii?Q?57vtreVLfEg9gwc2HdVEycpesa1y3JthCmjldPxGbPaD2Vvwjalga6Ok9uBP?= =?us-ascii?Q?xn2plOONKkezFSYv1bGSyPpwuBFcz8n8yfIWUWiCxbp0jjSVvUnLJEV550Y+?= =?us-ascii?Q?dIgSph+HN4ZydKBBTe8MJU6z4RBldVmebB1yYaU/Laoimz0c2Bzl8FuX1nA4?= =?us-ascii?Q?fiV9ChAt1INNplrAraTfrrMi4RHKty7+irpx2EChTlQIAbQaXn/9tibXzjKa?= =?us-ascii?Q?c7qSzS8QMHWXYsGCJVK+1OKTlnQSNgLzlRT8j4p8NwYtRg8tYsD25uz98/eM?= =?us-ascii?Q?fScxNptD0evAYDu2o3WihK0crC22jGQMryCJha70fmgkve6vuK0EtonQA/A5?= =?us-ascii?Q?FAU3Qvc0Ren96Y78m0r6C9hcdRA8d1d22Jg8rRYGRVxSnsZfnKEdCrtL9zLn?= =?us-ascii?Q?GsT4RYJtXyykOn5esuhJDKnK9FL13C8w6NqiDa2bxEiHwej1dk2i1l2K18+m?= =?us-ascii?Q?+emxyComg4A17Aoj+7JG4XbuTeX4c1HaicKup/hIYSl7M1mIF9WHoc8addkf?= =?us-ascii?Q?ccQxTDYon6PRclY9cTInP/E/4hbmHCZeVuZYLterLVJ0OX1hL62ouoaQ4uEL?= =?us-ascii?Q?lwvKtj/6yc+yV2NJGb8IY9mobDST7TLFavlENq7vXjOKfcgVltEb1UuMFCz9?= =?us-ascii?Q?I0h6yyfB9SLBcnvZ2t1CbVkYZ/ISdqjisZsRRGO09RoC/Sm99u4F9rMr6+bs?= =?us-ascii?Q?J+4NnEUUZmqCFZmYCz0Rr47EQBU/yMkhnsq4ouatKy89OmvDsJ7G8BnwHUs6?= =?us-ascii?Q?gxzEl92t+EUQ/OP/0yPoJwKo04y6ow2rHv7f710FXBlT5kNLb+0U5+QhixYz?= =?us-ascii?Q?E0HXkStUU5S8hBATeghH7HaYSYqCksd32TyR5glufXpVMZrr62b2vbCdJDD/?= =?us-ascii?Q?R2yEu/B4uDTgrbPaarKCWFW1/hcLMHm/JxjA75cGpFLiMsQXjSPlYFZPV3LA?= =?us-ascii?Q?AjjAYFCjLrwGSXw0D5pm2cnFWwwWONutKw6TKMfGgQaZdF5wpbT9dHsPj9aL?= =?us-ascii?Q?sAM9pRg=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(52116011)(376011)(1800799021)(366013)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?RfwcgJrN/oN6lxL2rVi4j0wshHl5VH7JYE21YMMzsVJ+w0K+BOMCHX+TyHkI?= =?us-ascii?Q?iZ8kqQn9Ay6W1Vulc0xYIeQKvavHuynhsBCuHZmcpDm1OBVd5zlUL50abCDC?= =?us-ascii?Q?Se7MgmVnlkyVvFr51sfygDQrhS+oJebYAL6rxqapPpTz/nGjCDA0pUH3aERg?= =?us-ascii?Q?QJHlgD98IfusAEhATWmN3xU0RvVPcLWN1tBiYu1EpAGLPaHd+qx2JKT4/BFk?= =?us-ascii?Q?NktoCcfK7Rt2h3lE5+HE6TW3bHBCPt00bx5Hk9GRxVwFCnxmQYcqsNBnT56U?= =?us-ascii?Q?WvxAnBHFk/5zpeaW8TpWOh18MMJFW5IwUzQMiW4MVNB4eIHjreGn4JUMptoe?= =?us-ascii?Q?4GDLwwXKRHTyz6jqI+IqUi9A7FR/6TtUCymS4KBTqyU8IrBzu+b3LCQnyKlB?= =?us-ascii?Q?HmgX4wnqQnO4YRRvsuztyu+vFuvpuS6bG09EELesu2Q4fhtXwpzgmwhy3DGh?= =?us-ascii?Q?Fs+7tx53b40K8Aki+ba8iD6RAAJ/8MucadmkpXLwC0V263O4HBgQAyMTAYpd?= =?us-ascii?Q?0obYwzinA//abqitQ+NaAWXPl8bRqwRf1nxWQKEZOTG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wxAQKad35xMdjGE569lhtasgXhvzPGFAFFbrJbtPgCNORVeyD5?= =?us-ascii?Q?6bJB7y3HGf4wkjSiJBvbFKD7H7jjIe1kAt/c8kMWheFDaZyzUA1a8zLNIIPB?= =?us-ascii?Q?NLp9wIJWZHrIhdvlF230yNcxSsQkPjtJd2CmXNkul6xqh103Z6g/yYhlPr0v?= =?us-ascii?Q?Ew=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f8f5ae0-cf9b-4dbe-e4f0-08dc900cebc9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 03:07:15.2297 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8CVruNnVM5JDsnWZcHz/uv7BAOvshWQ4M3RYIBaLslLzMcNXWKP/4QP873Rt9QoIDR2aTaTD7d4j9YAybK6agnuXooc+0b3husRPH7HlfrQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR13MB5789 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 From: Long Wu The 'rte_eal_init()' will call 'rte_service_start_with_defaults()' to start service core, map service core and set service state. NFP service does not have any special needs for these setps, so remove the redundant NFP service code. Signed-off-by: Long Wu Reviewed-by: Peng Zhang Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_service.c | 76 +++++------------------------------ drivers/net/nfp/nfp_service.h | 1 - 2 files changed, 10 insertions(+), 67 deletions(-) diff --git a/drivers/net/nfp/nfp_service.c b/drivers/net/nfp/nfp_service.c index 24d60857ac..37e2187a3f 100644 --- a/drivers/net/nfp/nfp_service.c +++ b/drivers/net/nfp/nfp_service.c @@ -5,68 +5,24 @@ #include "nfp_service.h" -#include "nfpcore/nfp_cpp.h" +#include +#include + #include "nfp_logs.h" /* Disable service and try to get service status */ #define NFP_SERVICE_DISABLE_WAIT_COUNT 3000 -static int -nfp_map_service(struct nfp_service_info *info) -{ - int32_t ret; - uint32_t slcore = 0; - int32_t slcore_count; - uint8_t service_count; - const char *service_name; - uint32_t slcore_array[RTE_MAX_LCORE]; - uint8_t min_service_count = UINT8_MAX; - - slcore_count = rte_service_lcore_list(slcore_array, RTE_MAX_LCORE); - if (slcore_count <= 0) { - PMD_DRV_LOG(DEBUG, "No service cores found"); - return -ENOENT; - } - - /* - * Find a service core with the least number of services already - * registered to it - */ - while (slcore_count--) { - service_count = rte_service_lcore_count_services(slcore_array[slcore_count]); - if (service_count < min_service_count) { - slcore = slcore_array[slcore_count]; - min_service_count = service_count; - } - } - - service_name = rte_service_get_name(info->id); - PMD_INIT_LOG(INFO, "Mapping service %s to core %u", service_name, slcore); - - ret = rte_service_map_lcore_set(info->id, slcore, 1); - if (ret != 0) { - PMD_DRV_LOG(DEBUG, "Could not map flower service"); - return -ENOENT; - } - - rte_service_runstate_set(info->id, 1); - rte_service_component_runstate_set(info->id, 1); - rte_service_lcore_start(slcore); - if (rte_service_may_be_active(slcore)) - PMD_DRV_LOG(INFO, "The service %s is running", service_name); - else - PMD_DRV_LOG(ERR, "The service %s is not running", service_name); - - info->lcore = slcore; - - return 0; -} - int nfp_service_enable(const struct rte_service_spec *service_spec, struct nfp_service_info *info) { int ret; + int32_t lcore_count; + + lcore_count = rte_service_lcore_count(); + if (lcore_count == 0) + return -ENOTSUP; /* Register the service */ ret = rte_service_component_register(service_spec, &info->id); @@ -75,12 +31,8 @@ nfp_service_enable(const struct rte_service_spec *service_spec, return -EINVAL; } - /* Map it to available service core */ - ret = nfp_map_service(info); - if (ret != 0) { - PMD_DRV_LOG(DEBUG, "Could not map %s", service_spec->name); - return -EINVAL; - } + /* Set the NFP service runstate of a component. */ + rte_service_component_runstate_set(info->id, 1); PMD_DRV_LOG(DEBUG, "Enable service %s successfully", service_spec->name); @@ -90,7 +42,6 @@ nfp_service_enable(const struct rte_service_spec *service_spec, int nfp_service_disable(struct nfp_service_info *info) { - int ret; uint32_t i; const char *service_name; @@ -100,7 +51,6 @@ nfp_service_disable(struct nfp_service_info *info) return -EINVAL; } - rte_service_runstate_set(info->id, 0); rte_service_component_runstate_set(info->id, 0); for (i = 0; i < NFP_SERVICE_DISABLE_WAIT_COUNT; i++) { @@ -112,12 +62,6 @@ nfp_service_disable(struct nfp_service_info *info) if (i == NFP_SERVICE_DISABLE_WAIT_COUNT) PMD_DRV_LOG(ERR, "Could not stop service %s", service_name); - ret = rte_service_map_lcore_set(info->id, info->lcore, 0); - if (ret != 0) { - PMD_DRV_LOG(DEBUG, "Could not unmap flower service"); - return -ENOENT; - } - rte_service_component_unregister(info->id); return 0; diff --git a/drivers/net/nfp/nfp_service.h b/drivers/net/nfp/nfp_service.h index 4b99d5b973..0db4f8b371 100644 --- a/drivers/net/nfp/nfp_service.h +++ b/drivers/net/nfp/nfp_service.h @@ -10,7 +10,6 @@ struct nfp_service_info { uint32_t id; - uint32_t lcore; }; int nfp_service_disable(struct nfp_service_info *info); -- 2.39.1