From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 05/12] net/hns3: fix incorrect use of CMD status enumeration type
Date: Tue, 13 Apr 2021 19:50:04 +0800 [thread overview]
Message-ID: <1618314611-47978-6-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1618314611-47978-1-git-send-email-humin29@huawei.com>
From: Chengchang Tang <tangchengchang@huawei.com>
The type of return value of hns3_cmd_send is int, some function declare
the return value as hns3_cmd_status.
This patch fix the incorrect use of the enum hns3_cmd_status.
Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware")
Fixes: 02a7b55657b2 ("net/hns3: support Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/hns3/hns3_cmd.c | 2 +-
drivers/net/hns3/hns3_cmd.h | 9 +--------
drivers/net/hns3/hns3_ethdev.c | 12 ++++++------
3 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
index 1d8ef7a..df167f1 100644
--- a/drivers/net/hns3/hns3_cmd.c
+++ b/drivers/net/hns3/hns3_cmd.c
@@ -450,7 +450,7 @@ hns3_build_api_caps(void)
return rte_cpu_to_le_32(api_caps);
}
-static enum hns3_cmd_status
+static int
hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
{
struct hns3_query_version_cmd *resp;
diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 9958fde..e88bf4a 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -56,13 +56,6 @@ enum hns3_cmd_return_status {
HNS3_CMD_ROH_CHECK_FAIL = 12
};
-enum hns3_cmd_status {
- HNS3_STATUS_SUCCESS = 0,
- HNS3_ERR_CSQ_FULL = -1,
- HNS3_ERR_CSQ_TIMEOUT = -2,
- HNS3_ERR_CSQ_ERROR = -3,
-};
-
struct hns3_misc_vector {
uint8_t *addr;
int vector_irq;
@@ -72,7 +65,7 @@ struct hns3_cmq {
struct hns3_cmq_ring csq;
struct hns3_cmq_ring crq;
uint16_t tx_timeout;
- enum hns3_cmd_status last_status;
+ enum hns3_cmd_return_status last_status;
};
enum hns3_opcode_type {
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 846e5a2..05ccc2e 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2310,11 +2310,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en,
struct hns3_cmd_desc desc;
struct hns3_ctrl_vector_chain_cmd *req =
(struct hns3_ctrl_vector_chain_cmd *)desc.data;
- enum hns3_cmd_status status;
enum hns3_opcode_type op;
uint16_t tqp_type_and_id = 0;
uint16_t type;
uint16_t gl;
+ int ret;
op = en ? HNS3_OPC_ADD_RING_TO_VECTOR : HNS3_OPC_DEL_RING_TO_VECTOR;
hns3_cmd_setup_basic_desc(&desc, op, false);
@@ -2337,11 +2337,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en,
gl);
req->tqp_type_and_id[0] = rte_cpu_to_le_16(tqp_type_and_id);
req->int_cause_num = 1;
- status = hns3_cmd_send(hw, &desc, 1);
- if (status) {
- hns3_err(hw, "%s TQP %u fail, vector_id is %u, status is %d.",
- en ? "Map" : "Unmap", queue_id, vector_id, status);
- return status;
+ ret = hns3_cmd_send(hw, &desc, 1);
+ if (ret) {
+ hns3_err(hw, "%s TQP %u fail, vector_id = %u, ret = %d.",
+ en ? "Map" : "Unmap", queue_id, vector_id, ret);
+ return ret;
}
return 0;
--
2.7.4
next prev parent reply other threads:[~2021-04-13 11:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 11:49 [dpdk-dev] [PATCH 00/12] Bugfix for hns3 PMD Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 01/12] net/hns3: delete mailbox arq ring Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 02/12] net/hns3: fix possible mismatches response of mailbox Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 03/12] net/hns3: fix VF may report LSC event in secondary process Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 04/12] net/hns3: fix potentially incorrect timing in MBX Min Hu (Connor)
2021-04-13 11:50 ` Min Hu (Connor) [this message]
2021-04-13 11:50 ` [dpdk-dev] [PATCH 06/12] net/hns3: fix miss verification of whether NEON supported Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 07/12] net/hns3: fix missing outer L4 UDP flag for VXLAN packet Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 08/12] net/hns3: add reporting TUNNEL GRE packet type Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 09/12] net/hns3: fix PTP caps report Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 10/12] net/hns3: rename Rx burst API Min Hu (Connor)
2021-04-14 17:41 ` Ferruh Yigit
2021-04-15 1:58 ` Min Hu (Connor)
2021-04-15 7:27 ` Ferruh Yigit
2021-04-15 1:51 ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
2021-04-15 8:35 ` [dpdk-dev] [PATCH v3] " Min Hu (Connor)
2021-04-15 13:12 ` Ferruh Yigit
2021-04-13 11:50 ` [dpdk-dev] [PATCH 11/12] net/hns3: add supported ptypes list for RXD advanced layout Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 12/12] net/hns3: remove VLAN/QINQ ptypes from support list Min Hu (Connor)
2021-04-14 17:47 ` [dpdk-dev] [PATCH 00/12] Bugfix for hns3 PMD Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1618314611-47978-6-git-send-email-humin29@huawei.com \
--to=humin29@huawei.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).