From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7256CC07E9D for ; Mon, 26 Sep 2022 07:01:49 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8BEE342B92; Mon, 26 Sep 2022 09:00:44 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2121.outbound.protection.outlook.com [40.107.92.121]) by mails.dpdk.org (Postfix) with ESMTP id 8BD4D42B89 for ; Mon, 26 Sep 2022 09:00:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UE7Nw7IHZjtSz2U0PjaACfYk0smVujKtxhJGvz+duTHKDig0baK5X/DfldXyULFcbhJnwon7b/6Ler6AGFwvvx5EbvC1dhSJTFDo65w+j5j/mlwV7PHDg8bn+ZkTAR+71xltm0dBkx5Wsz3rHzPdBfWo9CK2LP5lNd5DhJohVO5+xw8O1vHcP3BBFXDZykkb6cSCERpLU2yk3ITYiJL8i2XGVzCbnYK3Sd+v6jgfJE9CTaOzcYtXUIcElnu6aVLE6GMtS44bgDXf7pRPYk/AQsrw6fucdj9jPOiiLT39Eww54n1K2eLcXCFn6V8CAe6uZ8587fSIIPhAdlb5BcQ1UQ== 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=EWr1gfdOF1wDrXrxxsCT0+nDuKRLZExakHi4mm3hiss=; b=ZpbP+IKK7wFdFU9GiV1+DRsHnG3T2Z8Tg6KhiJYf/khY+GmY0F2bxifrAtgGPV2mUUMFRmQzsQaE5ve1ieY5yimn2bvUrdtm4PM9d71WTFaFzJTJ65bNYPY3oqQo9e0YrVLxgcw/rUv7cCT9RQtq8p6Drrxn/gglyoRqDdhPA8ubhsYkhPRIG1QkuZ8dNUi4d5II+xcYv7Bu24oqc+K7viOz18u20AtQVW+LM/x018n3yyDPnU2RlvTY+o8eBK2avWvgSqXWtXcLwnmefRyE7Y7Oh6+czbOwDhmMwVTcia/k6QDjUwsK2nfH/KKMN46fuFWuIeHUrpP/SPdZ8tgYbQ== 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=EWr1gfdOF1wDrXrxxsCT0+nDuKRLZExakHi4mm3hiss=; b=U96onJ02L9OE2h2IpciGXG7lD9bDsqhDqjNqPTBthsEtDEfWyFCKYhEH4GqNO3hZMs/aWbWlqujL7J2eqjJk8ghTag9Ft7jfeM2YeEtVAMyJkRWT8XiEAf2Yrqe8YP1TpBBhCq5hRlnH+kgdfoN3S5i3Rvvhd7l0VAbqnySgO4I= 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 SA1PR13MB4941.namprd13.prod.outlook.com (2603:10b6:806:1a9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.14; Mon, 26 Sep 2022 07:00:39 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::779:2722:a8e5:503b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::779:2722:a8e5:503b%7]) with mapi id 15.20.5676.014; Mon, 26 Sep 2022 07:00:39 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v10 10/13] net/nfp: add flower PF related routines Date: Mon, 26 Sep 2022 14:59:54 +0800 Message-Id: <1664175597-37248-11-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1664175597-37248-1-git-send-email-chaoyong.he@corigine.com> References: <1664175597-37248-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2P153CA0005.APCP153.PROD.OUTLOOK.COM (2603:1096::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SA1PR13MB4941:EE_ X-MS-Office365-Filtering-Correlation-Id: 930a11e5-734c-416a-1bf2-08da9f8cd1a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: syvssU6CfrUhVWSCcozwcffgZ3kV93U0u9Fwn410t0Kfy4TeyK15B/JieTgWzbNDTSTcnCTOS216KyzB7XMhBVQL5WJQIHoSXlZTXuVTJmHUiHoH8joj6+23ZwXC1Ige7DsR/uSuJrizAXSAD9tHqGxmMhqPcxyNhvLsx42xuVko9GZGeOHY016NvDf//S1QfLphBYmVtVhTD9pu+x1LF516HmkiCpBF2lh48fDtLQLbN09vw7r5m3/issPZxu8G7lwnbCIzFhhyVcG08zd/4edoZhsay5Qs5QoIpna+rM5tV1gmHlP/PLEQs8Jn3ATd3BPBViWNhU8bvUBw9C22Qg6e7lL4DZI1/kVTW/8f+yVq1aj9JPCI51nhVW+NrAh+GCX2DaJNHSccJPkPB1JeKC1C4Y+rBiBI6askZd13ehNiCpTbDtiTjzP8lSSRhYshSK5AAwCXX/n0biFh0WYgq8XVDH1TUrfmI4Tj98BZ4nKiU8/mHAhHhbvW3I5aoVVCuRAHjEpWZHKoR68BunkGMxkOxifInUq4nWs0KBgdkOxWGhjyXU/tILZFHwebnKvkTOa6kFdUru7XNn1O+7glUNZvNitJEig3oQbAHmuoq76gK+A5NPVhOQtLmjZyNomn9tamqbaBfCr/2mQFSfOk0YlPPvwZpjU5re1zH9YQNhWEjNLd5ZswXwDdapeubXmq8EQ3OfMNd51AqD1dXUyBmZI6zEiLxFoCn5hCYd+bfIqQVdzd4sgzlHPY/y0AmpOCnbrlkowtRC1A4mlaLHL0fQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(39830400003)(396003)(366004)(136003)(451199015)(316002)(6916009)(4326008)(66556008)(66946007)(66476007)(6486002)(8676002)(86362001)(26005)(6512007)(8936002)(83380400001)(36756003)(5660300002)(6506007)(44832011)(52116002)(41300700001)(6666004)(107886003)(2616005)(186003)(478600001)(2906002)(66574015)(38350700002)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M0lLVXA1YzVscUhMVUV5MEJja3NJYWlUYmd4Tmk1TWVxbXlPQWJtTDFkVFRE?= =?utf-8?B?d0M4Z3dmN1Q3ckVGNjlCejhlRC9xQjZUMW9jTUhQK0pKVmQ5Mm1INzV2Qmt4?= =?utf-8?B?b1k5YWZMNTFxK3VDTEVueEt4RlNpekpFSVJhWkJHYm1DNmR1MjAxSVl1R091?= =?utf-8?B?U2xBQTIxQVc0QUdmYVBkekt0WlVDK2pKZEtnVit6cE03QUNWREJKWm9JbEFZ?= =?utf-8?B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SndnNDFQY0xLOUVhc052YWd2alFKWHMvRUVBbjJm?= =?utf-8?B?ejUxTzFJTDlVKzdUcHJETDFwNlFJbW5HVnVsdVVRVm8wS1pXVHgyeVBuWVdY?= =?utf-8?B?YUFac1JTZFZqbElVc0ZLbG81dWJxMmZDTEN1SkFEeUxNQWRtZitIQ2EyNUp0?= =?utf-8?B?cUE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 930a11e5-734c-416a-1bf2-08da9f8cd1a0 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 07:00:38.9233 (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: 0ShL9YVi1j3xPQGKCLgSXLa2Ykzr/HqyH/ppI7OqicCspDAKDfqyOMzlAw1AeGEY83kdFH8r44BhEVJYf+YQDYlhWUfDowI0J3bF6aPcpVQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR13MB4941 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 Adds the start/stop/close routine of the flower PF vNIC. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/flower/nfp_flower.c | 210 ++++++++++++++++++++++++ drivers/net/nfp/flower/nfp_flower.h | 2 + drivers/net/nfp/flower/nfp_flower_representor.c | 2 + 3 files changed, 214 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index c79b4a5..c287683 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -25,10 +26,219 @@ #define CTRL_VNIC_NB_DESC 512 #define DEFAULT_FLBUF_SIZE 9216 +static void +nfp_pf_repr_enable_queues(struct rte_eth_dev *dev) +{ + struct nfp_net_hw *hw; + uint64_t enabled_queues = 0; + int i; + struct nfp_flower_representor *repr; + + repr = dev->data->dev_private; + hw = repr->app_fw_flower->pf_hw; + + /* Enabling the required TX queues in the device */ + for (i = 0; i < dev->data->nb_tx_queues; i++) + enabled_queues |= (1 << i); + + nn_cfg_writeq(hw, NFP_NET_CFG_TXRS_ENABLE, enabled_queues); + + enabled_queues = 0; + + /* Enabling the required RX queues in the device */ + for (i = 0; i < dev->data->nb_rx_queues; i++) + enabled_queues |= (1 << i); + + nn_cfg_writeq(hw, NFP_NET_CFG_RXRS_ENABLE, enabled_queues); +} + +static void +nfp_pf_repr_disable_queues(struct rte_eth_dev *dev) +{ + struct nfp_net_hw *hw; + uint32_t new_ctrl; + uint32_t update = 0; + struct nfp_flower_representor *repr; + + repr = (struct nfp_flower_representor *)dev->data->dev_private; + hw = repr->app_fw_flower->pf_hw; + + nn_cfg_writeq(hw, NFP_NET_CFG_TXRS_ENABLE, 0); + nn_cfg_writeq(hw, NFP_NET_CFG_RXRS_ENABLE, 0); + + new_ctrl = hw->ctrl & ~NFP_NET_CFG_CTRL_ENABLE; + update = NFP_NET_CFG_UPDATE_GEN | NFP_NET_CFG_UPDATE_RING | + NFP_NET_CFG_UPDATE_MSIX; + + if (hw->cap & NFP_NET_CFG_CTRL_RINGCFG) + new_ctrl &= ~NFP_NET_CFG_CTRL_RINGCFG; + + /* If an error when reconfig we avoid to change hw state */ + if (nfp_net_reconfig(hw, new_ctrl, update) < 0) + return; + + hw->ctrl = new_ctrl; +} + +int +nfp_flower_pf_start(struct rte_eth_dev *dev) +{ + int ret; + uint32_t new_ctrl; + uint32_t update = 0; + struct nfp_net_hw *hw; + struct nfp_flower_representor *repr; + + repr = (struct nfp_flower_representor *)dev->data->dev_private; + hw = repr->app_fw_flower->pf_hw; + + /* Disabling queues just in case... */ + nfp_pf_repr_disable_queues(dev); + + /* Enabling the required queues in the device */ + nfp_pf_repr_enable_queues(dev); + + new_ctrl = nfp_check_offloads(dev); + + /* Writing configuration parameters in the device */ + nfp_net_params_setup(hw); + + update |= NFP_NET_CFG_UPDATE_RSS; + + if (hw->cap & NFP_NET_CFG_CTRL_RSS2) + new_ctrl |= NFP_NET_CFG_CTRL_RSS2; + else + new_ctrl |= NFP_NET_CFG_CTRL_RSS; + + /* Enable device */ + new_ctrl |= NFP_NET_CFG_CTRL_ENABLE; + + update |= NFP_NET_CFG_UPDATE_GEN | NFP_NET_CFG_UPDATE_RING; + + if (hw->cap & NFP_NET_CFG_CTRL_RINGCFG) + new_ctrl |= NFP_NET_CFG_CTRL_RINGCFG; + + nn_cfg_writel(hw, NFP_NET_CFG_CTRL, new_ctrl); + + /* If an error when reconfig we avoid to change hw state */ + ret = nfp_net_reconfig(hw, new_ctrl, update); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Failed to reconfig PF vnic"); + return -EIO; + } + + hw->ctrl = new_ctrl; + + /* Setup the freelist ring */ + ret = nfp_net_rx_freelist_setup(dev); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Error with flower PF vNIC freelist setup"); + return -EIO; + } + + return 0; +} + +/* Stop device: disable rx and tx functions to allow for reconfiguring. */ +int +nfp_flower_pf_stop(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_hw *hw; + struct nfp_net_txq *this_tx_q; + struct nfp_net_rxq *this_rx_q; + struct nfp_flower_representor *repr; + + repr = (struct nfp_flower_representor *)dev->data->dev_private; + hw = repr->app_fw_flower->pf_hw; + + nfp_pf_repr_disable_queues(dev); + + /* Clear queues */ + for (i = 0; i < dev->data->nb_tx_queues; i++) { + this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + nfp_net_reset_tx_queue(this_tx_q); + } + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + nfp_net_reset_rx_queue(this_rx_q); + } + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + /* Configure the physical port down */ + nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); + else + nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0); + + return 0; +} + +/* Reset and stop device. The device can not be restarted. */ +static int +nfp_flower_pf_close(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_hw *hw; + struct nfp_pf_dev *pf_dev; + struct nfp_net_txq *this_tx_q; + struct nfp_net_rxq *this_rx_q; + struct nfp_flower_representor *repr; + struct nfp_app_fw_flower *app_fw_flower; + + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + + repr = (struct nfp_flower_representor *)dev->data->dev_private; + hw = repr->app_fw_flower->pf_hw; + pf_dev = hw->pf_dev; + app_fw_flower = NFP_PRIV_TO_APP_FW_FLOWER(pf_dev->app_fw_priv); + + /* + * We assume that the DPDK application is stopping all the + * threads/queues before calling the device close function. + */ + nfp_pf_repr_disable_queues(dev); + + /* Clear queues */ + for (i = 0; i < dev->data->nb_tx_queues; i++) { + this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + nfp_net_reset_tx_queue(this_tx_q); + } + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + nfp_net_reset_rx_queue(this_rx_q); + } + + /* Cancel possible impending LSC work here before releasing the port*/ + rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler, (void *)dev); + + nn_cfg_writeb(hw, NFP_NET_CFG_LSC, 0xff); + + rte_eth_dev_release_port(dev); + + /* Now it is safe to free all PF resources */ + PMD_DRV_LOG(INFO, "Freeing PF resources"); + nfp_cpp_area_free(pf_dev->ctrl_area); + nfp_cpp_area_free(pf_dev->hwqueues_area); + free(pf_dev->hwinfo); + free(pf_dev->sym_tbl); + nfp_cpp_free(pf_dev->cpp); + rte_free(app_fw_flower); + rte_free(pf_dev); + + return 0; +} + static const struct eth_dev_ops nfp_flower_pf_vnic_ops = { .dev_infos_get = nfp_net_infos_get, .link_update = nfp_net_link_update, .dev_configure = nfp_net_configure, + + .dev_start = nfp_flower_pf_start, + .dev_stop = nfp_flower_pf_stop, + .dev_close = nfp_flower_pf_close, }; static int diff --git a/drivers/net/nfp/flower/nfp_flower.h b/drivers/net/nfp/flower/nfp_flower.h index e1cd0a3..12b310f 100644 --- a/drivers/net/nfp/flower/nfp_flower.h +++ b/drivers/net/nfp/flower/nfp_flower.h @@ -55,5 +55,7 @@ struct nfp_app_fw_flower { int nfp_init_app_fw_flower(struct nfp_pf_dev *pf_dev); int nfp_secondary_init_app_fw_flower(struct nfp_cpp *cpp); +int nfp_flower_pf_start(struct rte_eth_dev *dev); +int nfp_flower_pf_stop(struct rte_eth_dev *dev); #endif /* _NFP_FLOWER_H_ */ diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 19b1fed..b47b0a5 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -467,7 +467,9 @@ static const struct eth_dev_ops nfp_flower_pf_repr_dev_ops = { .dev_infos_get = nfp_flower_repr_dev_infos_get, + .dev_start = nfp_flower_pf_start, .dev_configure = nfp_flower_repr_dev_configure, + .dev_stop = nfp_flower_pf_stop, .rx_queue_setup = nfp_pf_repr_rx_queue_setup, .tx_queue_setup = nfp_pf_repr_tx_queue_setup, -- 1.8.3.1