Commit e526b8bd authored by Hao Chen's avatar Hao Chen Committed by Jiantao Xiao
Browse files

net: hns3: add use limit for 1D torus feature

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8MV8N


CVE: NA

----------------------------------------------------------------------

1D torus feature is not supported for board which version is V4.
So, add judgement for it.

Fixes: 18c7dc4f ("net: hns3: add support to get/set 1d torus param")

Signed-off-by: default avatarHao Chen <chenhao418@huawei.com>
parent 677ddbc7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#define HNAE3_DEVICE_VERSION_V1   0x00020
#define HNAE3_DEVICE_VERSION_V2   0x00021
#define HNAE3_DEVICE_VERSION_V3   0x00030
#define HNAE3_DEVICE_VERSION_V4   0x00032

#define HNAE3_PCI_REVISION_BIT_SIZE		8

+6 −0
Original line number Diff line number Diff line
@@ -281,6 +281,9 @@ static int hclge_set_torus_param(struct hclge_dev *hdev, void *data,
	struct hnae3_torus_param *param = (struct hnae3_torus_param *)data;
	int ret;

	if (hdev->ae_dev->dev_version == HNAE3_DEVICE_VERSION_V4)
		return -EOPNOTSUPP;

	if (length != sizeof(struct hnae3_torus_param))
		return -EINVAL;

@@ -318,6 +321,9 @@ static int hclge_get_torus_param(struct hclge_dev *hdev, void *data,
	struct hclge_desc desc;
	int ret;

	if (hdev->ae_dev->dev_version == HNAE3_DEVICE_VERSION_V4)
		return -EOPNOTSUPP;

	if (length != sizeof(struct hnae3_torus_param))
		return -EINVAL;