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 3DEF4A0C4C for ; Mon, 12 Jul 2021 15:13:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37C5740685; Mon, 12 Jul 2021 15:13:28 +0200 (CEST) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mails.dpdk.org (Postfix) with ESMTP id 66CB34119D for ; Mon, 12 Jul 2021 15:13:26 +0200 (CEST) Received: by mail-wm1-f50.google.com with SMTP id j25-20020a05600c1c19b02902269686f585so1198148wms.0 for ; Mon, 12 Jul 2021 06:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+1Rak+yEWL+BfwCJYsD/UocEJLVeJSzxmmcasfgn1r4=; b=qojoaxxa8t5VMfTQd1SdnqdiqobNMp2dHw8g7H653pPu4aXbk5rZTENSi3ZISfzmAb 6V+Ye3KPvgQZP5dZHtUwou1glQJxcdigffVVStVp2VL23f0jH+ghbeFPKyMKWxszTjTN QvsgOfG3YyponjXtPUDwT7NERMxW6R6YnygYj6IRgVlfM+05PLyRdxeis9Bu+Q2HEl4x S0qmq+zAwuslzo4XIngdegPHT5QDR8fW+goBISCiTvL3gtWaWn1gxXTBqf2PA4D5gZ9p VnBOhS9tbmEX2GNu4+7eps5wZ9bXxsjZM8/xaatETK+7s6uJmGTaifaXfvYyVWjc8Y+l 0KjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+1Rak+yEWL+BfwCJYsD/UocEJLVeJSzxmmcasfgn1r4=; b=B+aT59ATY9NEUipkXYfMWEn+ZPlEzDeZmiSWF03g3FVcjOUdnpUPpJAaa0Fo92XHbr 9TTkpyrwwloJ35EdLLHbxz8UQzaTMKeSFYJ2S6AZdL9B483eeUfmwKB0LQvyhTRjt+Ts NoMuy20pO0XA8YLwtvfNTaKsWxdnJZVvUWgARZlpvW6duqQ17zVMEKxgq0OqDNLQaCU6 Hv7z/GyagiiBcvfgQTMXhRieGqejDOEyQyFhV6vxvX0j7HGGbbUfl2h/HjfnHzET2UUP 6YhYo5z54yMysusVWzVlJprepzHzZFJL4VA+GjEg2TfYtMptlfB2CEwR7K0MMU0nujhp IQdw== X-Gm-Message-State: AOAM533cD57qG521ra1mm39C23Wsrtgm9Mw5sDVg2MEO92eHuaVBuhh1 2mUNbys5+qvOjN8NDWCAXXI= X-Google-Smtp-Source: ABdhPJyNnBrOBkP3n3O954RuP529yR9HqO+2OsRHzDqt6gbKPflbB94tnGoJ2f15ETTHSfiM5xoxLA== X-Received: by 2002:a05:600c:4a17:: with SMTP id c23mr32487466wmp.7.1626095606154; Mon, 12 Jul 2021 06:13:26 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id d24sm19894224wmb.42.2021.07.12.06.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:13:25 -0700 (PDT) From: luca.boccassi@gmail.com To: Huisong Li Cc: Min Hu , dpdk stable Date: Mon, 12 Jul 2021 14:04:59 +0100 Message-Id: <20210712130551.2462159-64-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix maximum queues on configuration failure' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. 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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/1fa5c27d2d45e71e78b192ae3b022ecaf680765e the Thanks. Luca Boccassi --- >From 1fa5c27d2d45e71e78b192ae3b022ecaf680765e Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Sun, 13 Jun 2021 10:31:55 +0800 Subject: [PATCH] net/hns3: fix maximum queues on configuration failure [ upstream commit 5b96963f9d121cee0eaaa19c19eca0ddbeee73b7 ] The "cfg_max_queues" maintains configured max queue numbers from user, and is equal to the maximum of "nb_rx_queues" and "nb_tx_queues" in "dev->data". >From the ethdev layer framework, "nb_rx/tx_queues" in "dev->data" were set to zero in rte_eth_dev_configure() if ops.dev_configure in PMD fails to be executed, In addition, if ops.dev_configure in HNS3 PMD failed, the fake queues are also cleared on a device that does not support independent Rx/Tx queues. Therefore, the "cfg_max_queues" should be also set to zero when dev_configure fails. Fixes: fa29fe45a7b4 ("net/hns3: support queue start and stop") Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 2 ++ drivers/net/hns3/hns3_ethdev_vf.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 0079b56367..089c94b8e9 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2380,6 +2380,7 @@ hns3_dev_configure(struct rte_eth_dev *dev) ret = hns3_set_fake_rx_or_tx_queues(dev, nb_rx_q, nb_tx_q); if (ret) { hns3_err(hw, "fail to set Rx/Tx fake queues, ret = %d.", ret); + hw->cfg_max_queues = 0; return ret; } @@ -2439,6 +2440,7 @@ hns3_dev_configure(struct rte_eth_dev *dev) return 0; cfg_err: + hw->cfg_max_queues = 0; (void)hns3_set_fake_rx_or_tx_queues(dev, 0, 0); hw->adapter_state = HNS3_NIC_INITIALIZED; diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 04b28a3a21..913484d2e3 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -802,6 +802,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev) ret = hns3_set_fake_rx_or_tx_queues(dev, nb_rx_q, nb_tx_q); if (ret) { hns3_err(hw, "fail to set Rx/Tx fake queues, ret = %d.", ret); + hw->cfg_max_queues = 0; return ret; } @@ -871,6 +872,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev) return 0; cfg_err: + hw->cfg_max_queues = 0; (void)hns3_set_fake_rx_or_tx_queues(dev, 0, 0); hw->adapter_state = HNS3_NIC_INITIALIZED; -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:40.009596888 +0100 +++ 0064-net-hns3-fix-maximum-queues-on-configuration-failure.patch 2021-07-12 13:41:36.554123944 +0100 @@ -1 +1 @@ -From 5b96963f9d121cee0eaaa19c19eca0ddbeee73b7 Mon Sep 17 00:00:00 2001 +From 1fa5c27d2d45e71e78b192ae3b022ecaf680765e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 5b96963f9d121cee0eaaa19c19eca0ddbeee73b7 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index ff219b8b52..d4561ffd90 100644 +index 0079b56367..089c94b8e9 100644 @@ -33 +34 @@ -@@ -2501,6 +2501,7 @@ hns3_dev_configure(struct rte_eth_dev *dev) +@@ -2380,6 +2380,7 @@ hns3_dev_configure(struct rte_eth_dev *dev) @@ -41 +42 @@ -@@ -2549,6 +2550,7 @@ hns3_dev_configure(struct rte_eth_dev *dev) +@@ -2439,6 +2440,7 @@ hns3_dev_configure(struct rte_eth_dev *dev) @@ -50 +51 @@ -index c5f320fc5b..e387cd6177 100644 +index 04b28a3a21..913484d2e3 100644 @@ -53 +54 @@ -@@ -804,6 +804,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev) +@@ -802,6 +802,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev) @@ -61 +62 @@ -@@ -863,6 +864,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev) +@@ -871,6 +872,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev)