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 9EBAD41D8D for ; Mon, 27 Feb 2023 08:13:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A2CA41143; Mon, 27 Feb 2023 08:13:38 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2044.outbound.protection.outlook.com [40.107.96.44]) by mails.dpdk.org (Postfix) with ESMTP id 6C89540A84 for ; Mon, 27 Feb 2023 08:13:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JkPTYjAWfLs8P3X83pUUprULKWcxm0wotsVHsaExXUBb7WNU6wuJKaNWTuZRqFK7MmUoYqXzdM6N1exeSMcYZDPKGaBV8wIKbEWMDT/kspl3KFxkSZGNlOPLA0hqxGBySvkNlv+Gbesi7FC5S4vi+NNGGArPBPK/QNIbVXeYSrnmfuEJ84QiYZ2nYgnX+pze8u5F6sIfpdLadXek1/YBu58wu4STH3QkkKjQ08aIWcSdIG6Ip10FkCEXh95cUJ4/q5rGgd3yNyQHDRsuGYdLAoekTafpfLk4a4tV7ZldDDQZe3sE5WRoB1q0E0HaCM20pnAIkJKY00K8kc1DlYEqLw== 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=kbTvziPLWW9R/KH6ILconetH9xHhmY+w0eCTguHmyBk=; b=nLRg8A3Bj1t6s6INdrq42jtJiDiDFZ2qlvrTTqixmu/uPU6vLiBkegjK6PLL8jvmkgtfoaNJw8u68sFoj3JOECqSP3Elj7/NsoN+dZP7vt+E0ZddlyxBjMBEIfKzRSvp6V+DXNBdV74nZpxlz17jsd5kYUva3gCStT0fYLKJPm8fc8YEAfP6JrLzIE3vhp2HznfzB4y017Ot9tnF6YI138Cc4K5Z3P8kSuxnFD5plbR8A/5/yo7VuRUuI2vtiJLa0cnL0b/mlN5X8w/HkRt77WTIoj3UEYHywKKJLS5Wyr+mkwf19zP9r0Dc3HovUIJRsg3VTgyt8B7uAY8Fz15ieg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kbTvziPLWW9R/KH6ILconetH9xHhmY+w0eCTguHmyBk=; b=rCPGeDPYS2Dk2B0v3s9PTKPVbWgYLJOHa38b/95dVTZnrN2No5LE6nhvRECfIJku3etNxw4MLtKteoo37ibXJXJf+O6DVafZA9239NdnxYxkwTTOdtdZ+e7v2U9ONebthbzJoXS/+nhc8Iv2cJlUw3Wx9BUO1dU2AT93j8SrG9yXu8RdIXNjaYGDj58MdtfqModLpi9DxEBgs3IKdTz9xafZMziifTuzRiCDrxyLvwG4RSXVVcOBJ7H4ijoX3mou+KW37IO2wXuQQjEpFdcfKWe7omm0Bmq1xrfTwMIPWw/pruEPa2gSwqK5ODktYyfiAV7psqsZPwPRxbDl7JSVow== Received: from MN2PR16CA0062.namprd16.prod.outlook.com (2603:10b6:208:234::31) by BL1PR12MB5803.namprd12.prod.outlook.com (2603:10b6:208:393::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.26; Mon, 27 Feb 2023 07:13:34 +0000 Received: from BL02EPF00010208.namprd05.prod.outlook.com (2603:10b6:208:234:cafe::73) by MN2PR16CA0062.outlook.office365.com (2603:10b6:208:234::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.28 via Frontend Transport; Mon, 27 Feb 2023 07:13:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF00010208.mail.protection.outlook.com (10.167.241.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:13:34 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:13:21 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:13:19 -0800 From: Xueming Li To: Huisong Li CC: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: extract common functions to set Rx/Tx' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 15:00:22 +0800 Message-ID: <20230227070107.15664-114-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00010208:EE_|BL1PR12MB5803:EE_ X-MS-Office365-Filtering-Correlation-Id: 63447467-279c-404f-964a-08db189223cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rqhe+8GYrXZstiklrARzuwINTQqcHuP5Yc93miLfE6Hfh7MrRbnf7fU7pQbUfJdq4BlY4s+4cZ4kGWKEa1ZXKxTcGQXvAE2p+iNweZMy6WT1XwpNj9gIZjeEzt3jZc5odcsfeccLWM2V/cGPZcT9MRFntLZl7fF2WTw4VLc667dk+XMWKmnzLF292xd6c1+trpuybVpfXYjorU0JyPblEuxCrmWXbhFQsXNzZmTFBumEdl7rfePEsWMuY9boB6B6KBhEY4hvp6RBYxAPTdYOdTr6AcxmrskTGvqLvih6bJ3SisGoDbNe4jgakk1Prvsl5Y82RGCmsAqw63fOkXwc9G237covV/YAQn8dZbYlH2vYrJApvSTZ3t3LI5hVXAFwQZ72Xt2m4vwKYe13F7mrAFFy0g4+IfGmoJlQhyF5n1ff0HdIMdEYY4JgZ+P/sLNpiRVqtMoowxVShMh9MnRuSkRYQaCUCP/euW3th9uSun3ixBVYH0hQmJQvvwClTYDqvUUqsInipKlIENGoipfR++m7X1+Fyg7PLvXgoGjdy4Wq/VuERLUbrdAXw/9pznvHRvp2CoVt9ZAHAzfPIr06p8tZyELzPZ+Mi+azKvocqdFhhZAh+/5uoz/mvCEoynKV0GJsedbHYS+o00650pBh6SxrvTdw3KWI7KO6FMDIjXdURbUHO1lVJ1CLy0G50P9O4PcrnESiGDjNYZ6qug5BQhooeCvoUXvDevcLJNKNLg2fjR2tNerevmv5XIo6p/UXNPxRuIHz587gIx35uH4qq91J96ScghXraIunxtHrBWk= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199018)(40470700004)(36840700001)(46966006)(7696005)(478600001)(82310400005)(70586007)(4326008)(8676002)(41300700001)(6916009)(356005)(70206006)(8936002)(40460700003)(86362001)(40480700001)(55016003)(36756003)(186003)(6666004)(16526019)(47076005)(966005)(53546011)(82740400003)(7636003)(26005)(336012)(2616005)(1076003)(426003)(2906002)(316002)(5660300002)(54906003)(6286002)(83380400001)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:13:34.6084 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63447467-279c-404f-964a-08db189223cc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00010208.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5803 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=56789776c674d47587b9809e61602fca517861be Thanks. Xueming Li --- >From 56789776c674d47587b9809e61602fca517861be Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Sat, 11 Feb 2023 17:18:30 +0800 Subject: [PATCH] net/hns3: extract common functions to set Rx/Tx Cc: Xueming Li [ upstream commit 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 ] Extract two common functions to set Rx/Tx function in order to reduce duplicate codes. Fixes: 23d4b61fee5d ("net/hns3: support multiple process") Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_ethdev.c | 20 ++++---------------- drivers/net/hns3/hns3_ethdev_vf.c | 19 ++++--------------- drivers/net/hns3/hns3_mp.c | 4 ++-- drivers/net/hns3/hns3_rxtx.c | 28 ++++++++++++++++++++++++++++ drivers/net/hns3/hns3_rxtx.h | 2 ++ 5 files changed, 40 insertions(+), 33 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index ab565ce128..6babf67fce 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5052,8 +5052,7 @@ hns3_dev_start(struct rte_eth_dev *dev) rte_spinlock_unlock(&hw->lock); hns3_rx_scattered_calc(dev); - hns3_set_rxtx_function(dev); - hns3_mp_req_start_rxtx(dev); + hns3_start_rxtx_datapath(dev); /* Enable interrupt of all rx queues before enabling queues */ hns3_dev_all_rx_queue_intr_enable(hw, true); @@ -5131,12 +5130,7 @@ hns3_dev_stop(struct rte_eth_dev *dev) dev->data->dev_started = 0; hw->adapter_state = HNS3_NIC_STOPPING; - hns3_set_rxtx_function(dev); - rte_wmb(); - /* Disable datapath on secondary process. */ - hns3_mp_req_stop_rxtx(dev); - /* Prevent crashes when queues are still in use. */ - rte_delay_ms(hw->cfg_max_queues); + hns3_stop_rxtx_datapath(dev); rte_spinlock_lock(&hw->lock); if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) { @@ -5752,12 +5746,7 @@ hns3_stop_service(struct hns3_adapter *hns) rte_eal_alarm_cancel(hns3_service_handler, eth_dev); hns3_update_linkstatus_and_event(hw, false); } - - hns3_set_rxtx_function(eth_dev); - rte_wmb(); - /* Disable datapath on secondary process. */ - hns3_mp_req_stop_rxtx(eth_dev); - rte_delay_ms(hw->cfg_max_queues); + hns3_stop_rxtx_datapath(eth_dev); rte_spinlock_lock(&hw->lock); if (hns->hw.adapter_state == HNS3_NIC_STARTED || @@ -5790,8 +5779,7 @@ hns3_start_service(struct hns3_adapter *hns) hw->reset.level == HNS3_GLOBAL_RESET) hns3_set_rst_done(hw); eth_dev = &rte_eth_devices[hw->data->port_id]; - hns3_set_rxtx_function(eth_dev); - hns3_mp_req_start_rxtx(eth_dev); + hns3_start_rxtx_datapath(eth_dev); if (hw->adapter_state == HNS3_NIC_STARTED) { /* * This API parent function already hold the hns3_hw.lock, the diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index d3c1bdf2c5..d051a1357b 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1572,12 +1572,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev) dev->data->dev_started = 0; hw->adapter_state = HNS3_NIC_STOPPING; - hns3_set_rxtx_function(dev); - rte_wmb(); - /* Disable datapath on secondary process. */ - hns3_mp_req_stop_rxtx(dev); - /* Prevent crashes when queues are still in use. */ - rte_delay_ms(hw->cfg_max_queues); + hns3_stop_rxtx_datapath(dev); rte_spinlock_lock(&hw->lock); if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) { @@ -1731,8 +1726,7 @@ hns3vf_dev_start(struct rte_eth_dev *dev) rte_spinlock_unlock(&hw->lock); hns3_rx_scattered_calc(dev); - hns3_set_rxtx_function(dev); - hns3_mp_req_start_rxtx(dev); + hns3_start_rxtx_datapath(dev); /* Enable interrupt of all rx queues before enabling queues */ hns3_dev_all_rx_queue_intr_enable(hw, true); @@ -1902,11 +1896,7 @@ hns3vf_stop_service(struct hns3_adapter *hns) } hw->mac.link_status = RTE_ETH_LINK_DOWN; - hns3_set_rxtx_function(eth_dev); - rte_wmb(); - /* Disable datapath on secondary process. */ - hns3_mp_req_stop_rxtx(eth_dev); - rte_delay_ms(hw->cfg_max_queues); + hns3_stop_rxtx_datapath(eth_dev); rte_spinlock_lock(&hw->lock); if (hw->adapter_state == HNS3_NIC_STARTED || @@ -1938,8 +1928,7 @@ hns3vf_start_service(struct hns3_adapter *hns) struct rte_eth_dev *eth_dev; eth_dev = &rte_eth_devices[hw->data->port_id]; - hns3_set_rxtx_function(eth_dev); - hns3_mp_req_start_rxtx(eth_dev); + hns3_start_rxtx_datapath(eth_dev); rte_eal_alarm_set(HNS3VF_KEEP_ALIVE_INTERVAL, hns3vf_keep_alive_handler, eth_dev); diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c index 7184f9ad58..556f1941c6 100644 --- a/drivers/net/hns3/hns3_mp.c +++ b/drivers/net/hns3/hns3_mp.c @@ -89,12 +89,12 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer) case HNS3_MP_REQ_START_RXTX: PMD_INIT_LOG(INFO, "port %u starting datapath", dev->data->port_id); - hns3_set_rxtx_function(dev); + hns3_start_rxtx_datapath(dev); break; case HNS3_MP_REQ_STOP_RXTX: PMD_INIT_LOG(INFO, "port %u stopping datapath", dev->data->port_id); - hns3_set_rxtx_function(dev); + hns3_stop_rxtx_datapath(dev); break; case HNS3_MP_REQ_START_TX: PMD_INIT_LOG(INFO, "port %u starting Tx datapath", diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index def22bcd30..4065c519c3 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -4765,3 +4765,31 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev) hns3_mp_req_start_tx(dev); } + +void +hns3_stop_rxtx_datapath(struct rte_eth_dev *dev) +{ + struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + hns3_set_rxtx_function(dev); + + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + return; + + rte_wmb(); + /* Disable datapath on secondary process. */ + hns3_mp_req_stop_rxtx(dev); + /* Prevent crashes when queues are still in use. */ + rte_delay_ms(hw->cfg_max_queues); +} + +void +hns3_start_rxtx_datapath(struct rte_eth_dev *dev) +{ + hns3_set_rxtx_function(dev); + + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + return; + + hns3_mp_req_start_rxtx(dev); +} diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h index 1bdc124b7b..fa39f6481a 100644 --- a/drivers/net/hns3/hns3_rxtx.h +++ b/drivers/net/hns3/hns3_rxtx.h @@ -773,5 +773,7 @@ int hns3_dev_tx_descriptor_status(void *tx_queue, uint16_t offset); void hns3_tx_push_init(struct rte_eth_dev *dev); void hns3_stop_tx_datapath(struct rte_eth_dev *dev); void hns3_start_tx_datapath(struct rte_eth_dev *dev); +void hns3_stop_rxtx_datapath(struct rte_eth_dev *dev); +void hns3_start_rxtx_datapath(struct rte_eth_dev *dev); #endif /* HNS3_RXTX_H */ -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:44.557177800 +0800 +++ 0115-net-hns3-extract-common-functions-to-set-Rx-Tx.patch 2023-02-27 14:08:40.869237000 +0800 @@ -1 +1 @@ -From 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 Mon Sep 17 00:00:00 2001 +From 56789776c674d47587b9809e61602fca517861be Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org