Update DPDK version from 19.11 to 20.11 and also support hns3 PMD for Kunpeng 920 and Kunpeng 930. Signed-off-by: speech_white <humin29@huawei.com>
65 lines
2.2 KiB
Diff
65 lines
2.2 KiB
Diff
From 94240428064fc641a78c2189329094acb4059eb8 Mon Sep 17 00:00:00 2001
|
|
From: Chengchang Tang <tangchengchang@huawei.com>
|
|
Date: Fri, 2 Apr 2021 10:58:49 +0800
|
|
Subject: [PATCH 075/189] ethdev: validate input in register info
|
|
|
|
This patch adds validity check of input pointer in regs dump API.
|
|
|
|
Fixes: 7a3f27cbf59b ("ethdev: add access to specific device info")
|
|
Fixes: 936eda25e8da ("net/hns3: support dump register")
|
|
Cc: stable@dpdk.org
|
|
|
|
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
|
|
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
|
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
|
|
---
|
|
drivers/net/hns3/hns3_regs.c | 5 -----
|
|
lib/librte_ethdev/rte_ethdev.c | 2 ++
|
|
lib/librte_ethdev/rte_ethdev.h | 1 +
|
|
3 files changed, 3 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
|
|
index 5b14727..93055a4 100644
|
|
--- a/drivers/net/hns3/hns3_regs.c
|
|
+++ b/drivers/net/hns3/hns3_regs.c
|
|
@@ -484,11 +484,6 @@ hns3_get_regs(struct rte_eth_dev *eth_dev, struct rte_dev_reg_info *regs)
|
|
uint32_t *data;
|
|
int ret;
|
|
|
|
- if (regs == NULL) {
|
|
- hns3_err(hw, "the input parameter regs is NULL!");
|
|
- return -EINVAL;
|
|
- }
|
|
-
|
|
ret = hns3_get_regs_length(hw, &length);
|
|
if (ret)
|
|
return ret;
|
|
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
|
|
index 17ddacc..f311868 100644
|
|
--- a/lib/librte_ethdev/rte_ethdev.c
|
|
+++ b/lib/librte_ethdev/rte_ethdev.c
|
|
@@ -5239,6 +5239,8 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info)
|
|
struct rte_eth_dev *dev;
|
|
|
|
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
|
|
+ if (info == NULL)
|
|
+ return -EINVAL;
|
|
|
|
dev = &rte_eth_devices[port_id];
|
|
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_reg, -ENOTSUP);
|
|
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
|
|
index f5f8919..e89fc50 100644
|
|
--- a/lib/librte_ethdev/rte_ethdev.h
|
|
+++ b/lib/librte_ethdev/rte_ethdev.h
|
|
@@ -4395,6 +4395,7 @@ int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
|
|
* @return
|
|
* - (0) if successful.
|
|
* - (-ENOTSUP) if hardware doesn't support.
|
|
+ * - (-EINVAL) if bad parameter.
|
|
* - (-ENODEV) if *port_id* invalid.
|
|
* - (-EIO) if device is removed.
|
|
* - others depends on the specific operations implementation.
|
|
--
|
|
2.7.4
|
|
|