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 BF8B445495; Wed, 19 Jun 2024 12:00:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 185C742E37; Wed, 19 Jun 2024 11:59:17 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2093.outbound.protection.outlook.com [40.107.243.93]) by mails.dpdk.org (Postfix) with ESMTP id 6549942E0B for ; Wed, 19 Jun 2024 11:59:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PzlTRuB01I1wtEAuBxwjHiyLPt2F6VwSg1jozAN/6fDAygQhUd2aY4N1oF40Ltl6aeTxmauIFzICeHdy2nghMjNg8xOmUjp15ew1z3kmVuQm0A1Kli90RzbNB5CYlVzYZvD+4mZF+7pH1RpWsRtsgFeoWhDbLMZ0Yy6b5ER7wXNrIv36bbMnGW6pTAnBl9UQ/2Zp520FyGMxxQqgOEPZKq6Ib0+wEW6V8MmZBFL0oyhx+URZmZWsvX/Rl9w8aVo2i2DwAvpY/ScRv7TNAfZgF6dKZo3cokGDf7kOjWD1UPvmFpTal9hovpqkEjbqElXdX1Pb3W4iJ75QzhDRUYL5HQ== 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=VfByx1vhE/GEESmo4TpdjsPcchVsw65SpMOMQiU3jLQ=; b=C57m+yGuNSb2mPWJDJteOg6mN3rtcjWtMSVp+ltEF7n8TBxkpXfO5LDG9mzhs5zz5ow3DWPRv3xjOJidJ7RLdcq3l86ivrmLpaAPkkQ+a5RFRiFfCuwf8FqCfhyv1aAR5tsGTjzZ7Ze2wVysFfhy0RlcMyKgBsOkHjnjhH+6O/XzZ+HoSqX5jWf5g70toL4I32TyJSNOz4C+j7iA2WRiDFXu1w4dYELjL44eG41cWaoW8GC7yD34so/6XY1El6hH3PRPfmUDbH8F+Ge8jbjDYqunqAF1YkADXRJDFha7WbKxU0y8EUCsA1hlbSkLp/ZcU742Iqzd/P2zfRvgHmmdAg== 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=VfByx1vhE/GEESmo4TpdjsPcchVsw65SpMOMQiU3jLQ=; b=BCRvPORfld2bfgQ7E1g6NLBsvo+Bt2s27Xe18Gbgssqr4kw2Ly3dMc91qKatoKP2i03OpoE1Tf+imGRl/m1pqEAJ6h89jlB/N+CqPvIemgWOXD017EIv/srUBCSqxwmuVxVZUL1sM4C7CEvufM6BMYX56LjNdbOXch/xzN+2xFM= 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 MN2PR13MB3912.namprd13.prod.outlook.com (2603:10b6:208:263::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Wed, 19 Jun 2024 09:59:12 +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 09:59:12 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Peng Zhang , Chaoyong He , Long Wu Subject: [PATCH 12/23] net/nfp: refactor the logic of flower service Date: Wed, 19 Jun 2024 17:58:19 +0800 Message-Id: <20240619095830.3479757-13-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619095830.3479757-1-chaoyong.he@corigine.com> References: <20240619095830.3479757-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0057.namprd13.prod.outlook.com (2603:10b6:a03:2c2::32) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MN2PR13MB3912:EE_ X-MS-Office365-Filtering-Correlation-Id: a39f1949-d9e7-4a50-7466-08dc9046787b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|366013|376011|52116011|1800799021|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Y0xSKENhOS/k38+yoM/p53CDo/pVZT4rfbdv2XvWWhRt5j7J8AK64jmJ0IQi?= =?us-ascii?Q?R/FOe4up/En6UWDwKCR6Zf/9bzr99U0VN5TPIO6wGMXiZMcVIHZpGLDI26hy?= =?us-ascii?Q?pQH1EN80s9pg9UIHcIFHg17DnLS95F7XPJLLYopOHfB/Y3bkqgITlkrsbbT6?= =?us-ascii?Q?0XbikGcQPWSD7wvrRS4+5c0WBaZuiO+IUkp/M+xXj6mSAmJ9PTecqvaeUxVH?= =?us-ascii?Q?YsZqMPMd9PfpDKziJ/aWN1FWcxO2WlcaEpUH4kWMdg1Bptsztzcw3kvxXVXi?= =?us-ascii?Q?LP1AlfXk0lBYGjt/88zFN3XAXPGbKcpDyZ/vMfw+8GRJ7k0X8o/J2YxCEs0e?= =?us-ascii?Q?8RJVv8LJ33/Wv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iPL/L?= =?us-ascii?Q?tue6NL+20go/NcTm7+kouR6cATuyjgiZmHhg3TL0KsPKBIHEtOz7QjnZX/S7?= =?us-ascii?Q?pM9L1EYf7wy/nLHTOZjMw+lNV7nXRedeqYaKABxLDZK4lObYPGmGr24zG3gI?= =?us-ascii?Q?orCQ43E=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)(366013)(376011)(52116011)(1800799021)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YDNIGlhbDCaTjGpQM4/7y7pe/yGAXESqpAcvOqVsTXRdNUIHrVFRGKC6lVZ4?= =?us-ascii?Q?jBd08dd/fQ3tu61LmI71l+XaCGwFuv9S6v2ZScIwTC/FvTyKIdiA8pP9dtdX?= =?us-ascii?Q?DgXDNeVg9E6ZPnNWKgd8nXEhlva1uXpqE47qCpNBMzrWWJetI8fkkHxAuVd0?= =?us-ascii?Q?oHuRuF+uaIPygmYSHlRKjK2tbFvLbpHwD83bo42337En9WhbGLz/4i69hoVe?= =?us-ascii?Q?/B6amsgGkZ6yqjv9vUntXalNOIyE5V/B6Hem1KfvF+Jfn/dDJ9zf1SPUphrX?= =?us-ascii?Q?7eIwQ8ZApf61DsWbbZYG4SIhWrC0JR1AlDUxgA5WFUKDGHlsDDBHSzNte6tV?= =?us-ascii?Q?ZtT9G8+ZTkL+yVP7lAFvPQ7YMoTZG5oM02HAgddLC8McGfkl1ctbG9VnwTm5?= =?us-ascii?Q?scepkSjm6j6PV9ju9rnSnlcm/NBWz5lpAqc9TzINGC3ofa9K2sQRdxMTyoHx?= =?us-ascii?Q?bhUl5ObcnsVbx431gGe4QLzPB+Omt9Fm3VyVvEJBKh+ZmNCae2Ri0+xOwdV6?= =?us-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QnddVlh+5mxihT?= =?us-ascii?Q?MeNhhP0FiJ0sdzWFcjJSInaO2Bp2p5uhWHmI05SToUkBQS3piFu/xVerR/Yk?= =?us-ascii?Q?NWqnUIW4rdFx2OMLzecjUmVIoDFvgGrU9uibnIToyhXSnsu66+p6Iu67FjzM?= =?us-ascii?Q?6NpyNCwrNH7x9s6qPfKwqt8JJvd0USYF5DGGh+Okly7OE5/JMWNqerkcOveU?= =?us-ascii?Q?Ug=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: a39f1949-d9e7-4a50-7466-08dc9046787b X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 09:59:12.6122 (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: 1odcH0sIrEbBzXHT64BsjS+Cq2Y9sqfh5+NPlemORTMMXFYDK1qYId/zAtYsUU/cdoxjsJL1Hxs1bnLO5cV2kNQytF7Qf0QCiBkGW8m9flk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3912 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: Peng Zhang For flower firmware with multi-PF, the flower service needs to get some information beyond the 'struct nfp_app_fw_flower', so refactor the logic to use 'struct nfp_net_hw_priv' instead. Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Long Wu --- drivers/net/nfp/flower/nfp_flower.c | 4 ++-- drivers/net/nfp/flower/nfp_flower_ctrl.c | 16 +++++++++---- drivers/net/nfp/flower/nfp_flower_ctrl.h | 2 +- .../net/nfp/flower/nfp_flower_representor.c | 2 +- drivers/net/nfp/flower/nfp_flower_service.c | 24 +++++++++---------- drivers/net/nfp/flower/nfp_flower_service.h | 4 ++-- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index 70135574d4..87bd9dda2e 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -754,7 +754,7 @@ nfp_init_app_fw_flower(struct nfp_net_hw_priv *hw_priv) } /* Start up flower services */ - ret = nfp_flower_service_start(app_fw_flower, hw_priv); + ret = nfp_flower_service_start(hw_priv); if (ret != 0) { PMD_INIT_LOG(ERR, "Could not enable flower services"); ret = -ESRCH; @@ -770,7 +770,7 @@ nfp_init_app_fw_flower(struct nfp_net_hw_priv *hw_priv) return 0; ctrl_vnic_service_stop: - nfp_flower_service_stop(app_fw_flower, hw_priv); + nfp_flower_service_stop(hw_priv); ctrl_vnic_cleanup: nfp_flower_cleanup_ctrl_vnic(app_fw_flower, hw_priv); ctrl_cpp_area_cleanup: diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index 8cfafe91c8..01a680eb6d 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -415,13 +415,15 @@ nfp_flower_cmsg_rx_qos_stats(struct nfp_mtr_priv *mtr_priv, } static int -nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower, +nfp_flower_cmsg_port_mod_rx(struct nfp_net_hw_priv *hw_priv, struct rte_mbuf *pkt_burst) { uint32_t port; struct nfp_flower_representor *repr; struct nfp_flower_cmsg_port_mod *msg; + struct nfp_app_fw_flower *app_fw_flower; + app_fw_flower = hw_priv->pf_dev->app_fw_priv; msg = rte_pktmbuf_mtod_offset(pkt_burst, struct nfp_flower_cmsg_port_mod *, NFP_FLOWER_CMSG_HLEN); port = rte_be_to_cpu_32(msg->portnum); @@ -456,7 +458,7 @@ nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower, } static void -nfp_flower_cmsg_rx(struct nfp_app_fw_flower *app_fw_flower, +nfp_flower_cmsg_rx(struct nfp_net_hw_priv *hw_priv, struct rte_mbuf **pkts_burst, uint16_t count) { @@ -467,7 +469,9 @@ nfp_flower_cmsg_rx(struct nfp_app_fw_flower *app_fw_flower, struct nfp_mtr_priv *mtr_priv; struct nfp_flow_priv *flow_priv; struct nfp_flower_cmsg_hdr *cmsg_hdr; + struct nfp_app_fw_flower *app_fw_flower; + app_fw_flower = hw_priv->pf_dev->app_fw_priv; mtr_priv = app_fw_flower->mtr_priv; flow_priv = app_fw_flower->flow_priv; @@ -499,7 +503,7 @@ nfp_flower_cmsg_rx(struct nfp_app_fw_flower *app_fw_flower, nfp_flower_cmsg_rx_qos_stats(mtr_priv, pkts_burst[i]); } else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_PORT_MOD) { /* Handle changes to port configuration/status */ - nfp_flower_cmsg_port_mod_rx(app_fw_flower, pkts_burst[i]); + nfp_flower_cmsg_port_mod_rx(hw_priv, pkts_burst[i]); } rte_pktmbuf_free(pkts_burst[i]); @@ -507,13 +511,15 @@ nfp_flower_cmsg_rx(struct nfp_app_fw_flower *app_fw_flower, } void -nfp_flower_ctrl_vnic_process(struct nfp_app_fw_flower *app_fw_flower) +nfp_flower_ctrl_vnic_process(struct nfp_net_hw_priv *hw_priv) { uint16_t count; struct nfp_net_rxq *rxq; struct rte_eth_dev *ctrl_eth_dev; + struct nfp_app_fw_flower *app_fw_flower; struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; + app_fw_flower = hw_priv->pf_dev->app_fw_priv; ctrl_eth_dev = app_fw_flower->ctrl_ethdev; /* Ctrl vNIC only has a single Rx queue */ @@ -522,6 +528,6 @@ nfp_flower_ctrl_vnic_process(struct nfp_app_fw_flower *app_fw_flower) if (count != 0) { app_fw_flower->ctrl_vnic_rx_count += count; /* Process cmsgs here */ - nfp_flower_cmsg_rx(app_fw_flower, pkts_burst, count); + nfp_flower_cmsg_rx(hw_priv, pkts_burst, count); } } diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.h b/drivers/net/nfp/flower/nfp_flower_ctrl.h index 131d002ac6..b5d0036c01 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.h +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.h @@ -8,7 +8,7 @@ #include "nfp_flower.h" -void nfp_flower_ctrl_vnic_process(struct nfp_app_fw_flower *app_fw_flower); +void nfp_flower_ctrl_vnic_process(struct nfp_net_hw_priv *hw_priv); uint16_t nfp_flower_ctrl_vnic_xmit(struct nfp_app_fw_flower *app_fw_flower, struct rte_mbuf *mbuf); void nfp_flower_ctrl_vnic_xmit_register(struct nfp_app_fw_flower *app_fw_flower); diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index a845253b01..59dc5854b5 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -460,7 +460,7 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev) return 0; /* Stop flower service first */ - nfp_flower_service_stop(app_fw_flower, hw_priv); + nfp_flower_service_stop(hw_priv); /* Now it is safe to free all PF resources */ nfp_uninit_app_fw_flower(hw_priv); diff --git a/drivers/net/nfp/flower/nfp_flower_service.c b/drivers/net/nfp/flower/nfp_flower_service.c index 64753f5bf6..6353015c66 100644 --- a/drivers/net/nfp/flower/nfp_flower_service.c +++ b/drivers/net/nfp/flower/nfp_flower_service.c @@ -22,7 +22,7 @@ struct nfp_flower_service { /** Flower service info */ struct nfp_service_info info; /** Store flower cards' information */ - struct nfp_app_fw_flower *slots[MAX_FLOWER_SERVICE_SLOT]; + struct nfp_net_hw_priv *slots[MAX_FLOWER_SERVICE_SLOT]; /** Spinlock for sync slots when add/remove card */ rte_spinlock_t spinlock; }; @@ -37,7 +37,7 @@ static int nfp_flower_service_func(void *arg) { uint16_t slot; - struct nfp_app_fw_flower *app; + struct nfp_net_hw_priv *hw_priv; struct nfp_flower_service *service_handle; service_handle = arg; @@ -46,11 +46,11 @@ nfp_flower_service_func(void *arg) rte_spinlock_lock(&service_handle->spinlock); for (slot = 0; slot < MAX_FLOWER_SERVICE_SLOT; slot++) { - app = service_handle->slots[slot]; - if (app == NULL) + hw_priv = service_handle->slots[slot]; + if (hw_priv == NULL) continue; - nfp_flower_ctrl_vnic_process(app); + nfp_flower_ctrl_vnic_process(hw_priv); } rte_spinlock_unlock(&service_handle->spinlock); @@ -79,7 +79,7 @@ nfp_flower_service_enable(struct nfp_flower_service *service_handle) } static uint16_t -nfp_flower_service_insert(struct nfp_app_fw_flower *app, +nfp_flower_service_insert(struct nfp_net_hw_priv *hw_priv, struct nfp_flower_service *service_handle) { uint16_t slot; @@ -87,7 +87,7 @@ nfp_flower_service_insert(struct nfp_app_fw_flower *app, rte_spinlock_lock(&service_handle->spinlock); for (slot = 0; slot < MAX_FLOWER_SERVICE_SLOT; slot++) { if (service_handle->slots[slot] == NULL) { - service_handle->slots[slot] = app; + service_handle->slots[slot] = hw_priv; break; } } @@ -97,8 +97,7 @@ nfp_flower_service_insert(struct nfp_app_fw_flower *app, } int -nfp_flower_service_start(void *app_fw_flower, - struct nfp_net_hw_priv *hw_priv) +nfp_flower_service_start(struct nfp_net_hw_priv *hw_priv) { int ret; struct nfp_flower_service *service_handle; @@ -119,7 +118,7 @@ nfp_flower_service_start(void *app_fw_flower, } /* Insert the NIC to flower service slot */ - ret = nfp_flower_service_insert(app_fw_flower, service_handle); + ret = nfp_flower_service_insert(hw_priv, service_handle); if (ret == MAX_FLOWER_SERVICE_SLOT) { PMD_DRV_LOG(ERR, "Flower ctrl vnic service slot over %u", MAX_FLOWER_SERVICE_SLOT); @@ -130,8 +129,7 @@ nfp_flower_service_start(void *app_fw_flower, } void -nfp_flower_service_stop(void *app_fw_flower, - struct nfp_net_hw_priv *hw_priv) +nfp_flower_service_stop(struct nfp_net_hw_priv *hw_priv) { uint16_t slot; uint16_t count; @@ -146,7 +144,7 @@ nfp_flower_service_stop(void *app_fw_flower, rte_spinlock_lock(&service_handle->spinlock); for (slot = 0; slot < MAX_FLOWER_SERVICE_SLOT; slot++) { /* The app only in one slot */ - if (service_handle->slots[slot] != app_fw_flower) + if (service_handle->slots[slot] != hw_priv) continue; service_handle->slots[slot] = NULL; diff --git a/drivers/net/nfp/flower/nfp_flower_service.h b/drivers/net/nfp/flower/nfp_flower_service.h index 2fbe4fa601..bca5f5240e 100644 --- a/drivers/net/nfp/flower/nfp_flower_service.h +++ b/drivers/net/nfp/flower/nfp_flower_service.h @@ -8,8 +8,8 @@ #include "../nfp_net_common.h" -int nfp_flower_service_start(void *app_fw_flower, struct nfp_net_hw_priv *hw_priv); -void nfp_flower_service_stop(void *app_fw_flower, struct nfp_net_hw_priv *hw_priv); +int nfp_flower_service_start(struct nfp_net_hw_priv *hw_priv); +void nfp_flower_service_stop(struct nfp_net_hw_priv *hw_priv); int nfp_flower_service_sync_alloc(struct nfp_net_hw_priv *hw_priv); void nfp_flower_service_sync_free(struct nfp_net_hw_priv *hw_priv); -- 2.39.1