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 510B6454A2; Wed, 19 Jun 2024 05:07:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7277A427D3; Wed, 19 Jun 2024 05:07:21 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2133.outbound.protection.outlook.com [40.107.95.133]) by mails.dpdk.org (Postfix) with ESMTP id 78997427A5 for ; Wed, 19 Jun 2024 05:07:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zn14v2YAnBtkVvzGNW9y/1h+8EPqL4YLmO162ShwpfG8DWEtEFC8Lnc3qHde5mBXZB502wMVWak7sYS1AMoW4VDqT7msIA+XscW0sqE+UWbd/i/AaZH2LlX4jrT30l0jq+xya/yKBehCWApRLI03C06vEstfCy9D/nF25r4b8KpPy+98UDsm60aQkvBgqWMsn7mzRPjGf6isfhrKxFrmYmYHykZkApBclEVj8heMRkO4LQXqXfT0SYfgCPPiK/sxdmBuCNGYlJWiIQmpaXnAUQmddl5+cNpVCVeCN13O3WyGwOpBytmMyp3sPvRg1mGM2h+P4mukeYP0ufkAsytsUg== 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=GlIqv4lrj/W82gg8lREkaBQzWyeD+l9DdP4iD+NiCfk=; b=W7OP313UTHD67/sqmU0CGLBUpYRixZ/0RRX0iIIePzC17NOr/WiIqso/qRkc3YMV7kUzBKAXtlp2uM3fnBmRgqmoZA5LPms3+z6ortvE9t7ke6TV9Iu8CDmMhv5QmKOWRdxT8L/y+yGS2e3PycGfsB8vAx5jhhFemYoT1CaFH6RFKYPJ0NzkJsDzQOlnkCRVvJkhkga3L8+hAzB+31m5Andt1azBmxEH9+YBq1FWNH+sNQ8ttF2ymSaRzPJI6w8aijT0GYequrAA8zKQ9LeeXcwlkda8283hLVb7326wvfesFjXKqt+N39pPYglE3M+FPrc3Wc/0Z3Kk1CUO5KsEWA== 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=GlIqv4lrj/W82gg8lREkaBQzWyeD+l9DdP4iD+NiCfk=; b=LjTylaQmQFYts2V9SXuYLUME5CGt0mK/mj8c/BkKC98wPG4ZkMYtjdMwSBikd7S7aKz76mU/rzAU/1T0Cj9jnlv7+ZoxNzL80byJeNBvLyPQgJnnyYzwZ9H2rTSbZLbjxJHzFdrD8rPzVCNvMgJLKBCr2ucQljSKn92yVIdmfyA= 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:17 +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:17 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH 3/6] net/nfp: remove the flower service dead loop Date: Wed, 19 Jun 2024 11:06:52 +0800 Message-Id: <20240619030655.3216268-4-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: 4327b33d-0080-4aaf-7489-08dc900cece7 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?VO+kG4vyXgPzkigp4D6riV2y07qWdVgRmgALU8amv0yUqtxxWDm54FrL3VYX?= =?us-ascii?Q?/1EsK4hNRCrt3TLvdpggjqKrOoVZ1KyeNf7myrKw9g4jCiy48Rgmv5Q5w0tf?= =?us-ascii?Q?340IZZgWFeYeQz58TJn7ff85OVCFe9zNlH0iyJaHMwpkm3FNpjVw+fegY+aD?= =?us-ascii?Q?0hbKamKWabG4JqgQorj5vdL7Wp1dNBSGWDlw156NR5bznVyDWwI53liZ79IN?= =?us-ascii?Q?70XW2JBl9o5+rYLqTkpGQUALtrkHtgurAeqbjo/W/6Xc3gWr5tubk55yJjOB?= =?us-ascii?Q?QwVZewit42K6HmBwAazChegN1GFdgeBPAVgEhF4MNpbupoAD/j6e7mNcrUZC?= =?us-ascii?Q?9K/c1C3IApliG1JfDt1xC7zmv9KOpaSHcYnR8f0B9MVqwr1DjRtt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Q9bwZpijSqGzUfPOR0xoeVQki+G4z1LShD/Bb?= =?us-ascii?Q?/hM0C/cPhGMH+hU0iCThBmcoL0yXFSuFqqAf99ng1XXZi4BToWGNVBN1EXPt?= =?us-ascii?Q?easQdaU=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?JhEzUuhSvMkzvPni5jAK3tIuCm6FQorBN+e01eSnMwAgExTCpFn8/7Tshwr9?= =?us-ascii?Q?tBz80Tio6jydrRWOjWlYWS34YbuR2hUZLz1Oz471qU18do4M4nQG8kJ2ch+D?= =?us-ascii?Q?azzld+h+/+A4G7R904l+8C/PNkFVgKkfrD42WaF/EtH9Nb0IzLHpqFdNQ4G4?= =?us-ascii?Q?7W+lEaJAQohoQOlJMp0bPA/QGobHgVwOvd7dLYlHvx4E3utACBpJHRcDRNXH?= =?us-ascii?Q?KlyycEXOrHUVvjGQc4aWJ7fEM89rbXVfo/8yaQs3dtrCLMpkNYjdyLTfS8wn?= =?us-ascii?Q?dDG+8LizBJbWVnaZ+Sv6XYG07kpTGxihLiWt0PVfa8gSkST4aorOGvlxJkKb?= =?us-ascii?Q?7uXSehKX8UnSbgH+4fbsqFJD3P7B87W0oJdjX3RrZnL8TRSgsIEQa7ohjmdt?= =?us-ascii?Q?bJ8x8ublZmbE8ORWpzooxNZ8uSCYf5pGrX8Z+HsoMvEJal19o5VBHYrbWXIp?= =?us-ascii?Q?QNt/S2rGYLGdxPIl7TOZWuF4AdEi3Vwb1v4njufO62Wd6EH92MlyXXhxue5a?= =?us-ascii?Q?g9zxS5fbewPEnqzpnW3xCszxAR2uroy841nG2KmJu+GoEd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1yEaR7GKyyh/KK4iYwfolsKi9MZqpMLSl5mxli4xbR?= =?us-ascii?Q?U4KDYJysDTCJ9HXQdJIPnRIvXH3JLR6av/9BtowHPRZY3AYHh/XfwD7MFIFA?= =?us-ascii?Q?qr2VsKzMJ3/z26vNn2jMVVR8X/UWW4rp/vXFlelRY4bcmSaatOwabb0DFM9m?= =?us-ascii?Q?rA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4327b33d-0080-4aaf-7489-08dc900cece7 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:17.1098 (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: kV6nnHaL8Wkwn+OscexSHySGf8wiuDJNDAbTmMU2uBH3WZQx5Zl7XEFDMFlhVihYmN+S1bzzS60YduDy9rPsJaW8mOpvuwkK89haZkqa1iA= 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 flower service does not require high real-time performance, so remove the dead loop to share service core with other services. Signed-off-by: Long Wu Reviewed-by: Peng Zhang Reviewed-by: Chaoyong He --- drivers/net/nfp/flower/nfp_flower_service.c | 29 +++++++++------------ 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_service.c b/drivers/net/nfp/flower/nfp_flower_service.c index 515b4abef0..64753f5bf6 100644 --- a/drivers/net/nfp/flower/nfp_flower_service.c +++ b/drivers/net/nfp/flower/nfp_flower_service.c @@ -34,28 +34,25 @@ nfp_flower_service_handle_get(struct nfp_net_hw_priv *hw_priv) } static int -nfp_flower_service_loop(void *arg) +nfp_flower_service_func(void *arg) { uint16_t slot; struct nfp_app_fw_flower *app; struct nfp_flower_service *service_handle; service_handle = arg; - /* Waiting for enabling service */ - while (!service_handle->enabled) - rte_delay_ms(1); - - while (rte_service_runstate_get(service_handle->info.id) != 0) { - rte_spinlock_lock(&service_handle->spinlock); - for (slot = 0; slot < MAX_FLOWER_SERVICE_SLOT; slot++) { - app = service_handle->slots[slot]; - if (app == NULL) - continue; - - nfp_flower_ctrl_vnic_process(app); - } - rte_spinlock_unlock(&service_handle->spinlock); + if (!service_handle->enabled) + return 0; + + rte_spinlock_lock(&service_handle->spinlock); + for (slot = 0; slot < MAX_FLOWER_SERVICE_SLOT; slot++) { + app = service_handle->slots[slot]; + if (app == NULL) + continue; + + nfp_flower_ctrl_vnic_process(app); } + rte_spinlock_unlock(&service_handle->spinlock); return 0; } @@ -67,7 +64,7 @@ nfp_flower_service_enable(struct nfp_flower_service *service_handle) const struct rte_service_spec flower_service = { .name = "flower_ctrl_vnic_service", - .callback = nfp_flower_service_loop, + .callback = nfp_flower_service_func, .callback_userdata = (void *)service_handle, }; -- 2.39.1