Commit 7e6b874a authored by Ke Chen's avatar Ke Chen Committed by Jiantao Xiao
Browse files

net: hns3: fix bug for init roh client instance

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


CVE: NA

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

add support for the roh capability in hnae3_dev flag.

Signed-off-by: default avatarKe Chen <chenke54@huawei.com>
parent 9358e1f4
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -77,10 +77,15 @@
#define HNAE3_UDMA_CLIENT_INITED_B		0x7
#define HNAE3_DEV_SUPPORT_UDMA_B		0x8
#define HNAE3_DEV_SUPPORT_UBL_B			0x9
#define HNAE3_DEV_SUPPORT_ROH_B			0xA

#define HNAE3_DEV_SUPPORT_ROCE_DCB_BITS (BIT(HNAE3_DEV_SUPPORT_DCB_B) | \
		BIT(HNAE3_DEV_SUPPORT_ROCE_B))

#define HNAE3_DEV_SUPPORT_ROCE_ROH_DCB_BITS \
		(BIT(HNAE3_DEV_SUPPORT_DCB_B) | BIT(HNAE3_DEV_SUPPORT_ROCE_B) | \
		 BIT(HNAE3_DEV_SUPPORT_ROH_B))

#define HNAE3_DEV_SUPPORT_UDMA_OVER_UBL_DCB_BITS \
		(BIT(HNAE3_DEV_SUPPORT_DCB_B) | BIT(HNAE3_DEV_SUPPORT_UDMA_B) | \
		 BIT(HNAE3_DEV_SUPPORT_UBL_B))
@@ -99,7 +104,7 @@
	hnae3_get_bit((ae_dev)->flag, HNAE3_DEV_SUPPORT_UBL_B)

#define hnae3_dev_roh_supported(hdev) \
	hnae3_get_bit((hdev)->ae_dev->flag, HNAE3_ROH_CLIENT_INITED_B)
	hnae3_get_bit((hdev)->ae_dev->flag, HNAE3_DEV_SUPPORT_ROH_B)

#define hnae3_dev_roce_supported(hdev) \
	hnae3_get_bit((hdev)->ae_dev->flag, HNAE3_DEV_SUPPORT_ROCE_B)
+3 −3
Original line number Diff line number Diff line
@@ -98,13 +98,13 @@ static const struct pci_device_id hns3_pci_tbl[] = {
	{PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_100G_RDMA_MACSEC),
	 HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
	 {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_100G_ROH),
	 HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
	 HNAE3_DEV_SUPPORT_ROCE_ROH_DCB_BITS},
	{PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_200G_RDMA),
	 HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
	{PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_200G_ROH),
	 HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
	 HNAE3_DEV_SUPPORT_ROCE_ROH_DCB_BITS},
	{PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_400G_ROH),
	 HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
	 HNAE3_DEV_SUPPORT_ROCE_ROH_DCB_BITS},
	{PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_UDMA),
	 HNAE3_DEV_SUPPORT_UDMA_DCB_BITS},
	{PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_VF), 0},
+4 −2
Original line number Diff line number Diff line
@@ -11840,8 +11840,10 @@ static int hclge_init_client_instance(struct hnae3_client *client,

		break;
	case HNAE3_CLIENT_ROH:
		if (hnae3_dev_roh_supported(hdev)) {
			hdev->roh_client = client;
			vport->roh.client = client;
		}

		ret = hclge_init_roh_client_instance(ae_dev, vport);
		if (ret)