[dpdk-stable] patch 'net/hns3: fix default error code of command interface' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:20 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 05/21/20. 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.

Thanks.

Luca Boccassi

---
>From 1cd4ab6cf4887dd09f2ccfadc9429bec320e453d Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Tue, 17 Mar 2020 17:12:03 +0800
Subject: [PATCH] net/hns3: fix default error code of command interface

[ upstream commit 4f4ee5b79b85797b92ed3a3b9304d871124f0650 ]

Currently, the hns3 PMD driver can interact with firmware through
command to complete hardware configuration. The driver calls internal
interface function named hns3_cmd_send to issues command to the
firmware, and check the execution result of the command through desc_ret
returned by firmware to driver.

As the design of error code, when device is resetting hns3_cmd_send will
only return -EBUSY or -EIO. But we found that if desc_ret is in
[12,65535], for example the item doesn't exist when issuing the command
to query some table item, hns3_cmd_send also return -EIO. This
phenomenon will affect the processing logic for the return value.

The root cause as below:
When desc_ret is in [12,65535], in the static function named
hns3_cmd_convert_err_code called by hns3_cmd_send, matches the default
case and return -EIO. And then hns3_cmd_send return -EIO.

This patch fixes it with the following modification.
1. Change the return value of the default case in the static function
   named hns3_cmd_convert_err_code from -EIO to -EREMOTEIO.
2. Modify the comment add errcode description of the internal interface
   function named hns3_cmd_send.

Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
---
 drivers/net/hns3/hns3_cmd.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
index 5ec3dfe016..c85168b319 100644
--- a/drivers/net/hns3/hns3_cmd.c
+++ b/drivers/net/hns3/hns3_cmd.c
@@ -289,7 +289,7 @@ hns3_cmd_convert_err_code(uint16_t desc_ret)
 	case HNS3_CMD_INVALID:
 		return -EBADR;
 	default:
-		return -EIO;
+		return -EREMOTEIO;
 	}
 }
 
@@ -349,11 +349,23 @@ static int hns3_cmd_poll_reply(struct hns3_hw *hw)
 
 /*
  * hns3_cmd_send - send command to command queue
- * @hw: pointer to the hw struct
- * @desc: prefilled descriptor for describing the command
- * @num : the number of descriptors to be sent
  *
- * This is the main send command for command queue, it
+ * @param hw
+ *   pointer to the hw struct
+ * @param desc
+ *   prefilled descriptor for describing the command
+ * @param num
+ *   the number of descriptors to be sent
+ * @return
+ *   - -EBUSY if detect device is in resetting
+ *   - -EIO   if detect cmd csq corrupted (due to reset) or
+ *            there is reset pending
+ *   - -ENOMEM/-ETIME/...(Non-Zero) if other error case
+ *   - Zero   if operation completed successfully
+ *
+ * Note -BUSY/-EIO only used in reset case
+ *
+ * Note this is the main send command for command queue, it
  * sends the queue, cleans the queue, etc
  */
 int
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:44.806152210 +0100
+++ 0005-net-hns3-fix-default-error-code-of-command-interface.patch	2020-05-19 14:04:44.052645400 +0100
@@ -1,8 +1,10 @@
-From 4f4ee5b79b85797b92ed3a3b9304d871124f0650 Mon Sep 17 00:00:00 2001
+From 1cd4ab6cf4887dd09f2ccfadc9429bec320e453d Mon Sep 17 00:00:00 2001
 From: Chengwen Feng <fengchengwen at huawei.com>
 Date: Tue, 17 Mar 2020 17:12:03 +0800
 Subject: [PATCH] net/hns3: fix default error code of command interface
 
+[ upstream commit 4f4ee5b79b85797b92ed3a3b9304d871124f0650 ]
+
 Currently, the hns3 PMD driver can interact with firmware through
 command to complete hardware configuration. The driver calls internal
 interface function named hns3_cmd_send to issues command to the
@@ -27,7 +29,6 @@
    function named hns3_cmd_send.
 
 Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware")
-Cc: stable at dpdk.org
 
 Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>


More information about the stable mailing list