Unverified Commit cbb6250d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!2483 Fix bug for init roh client instance

Merge Pull Request from: @svishen 
 
When the ROH client is initialized, all devs are mounted to the client. During the initialization, the ROH driver contains the probe device process, which does not affect non-ROH devices.
However, in the reset process, if there is a client, the reset process starts. As a result, non-ROH devices start the ROH process.
Add a tag that supports ROH to hnae3_dev flag. During initialization, whether to mount the ROH client depends on whether the device supports ROH.

issue:
https://gitee.com/openeuler/kernel/issues/I89FJ8 
 
Link:https://gitee.com/openeuler/kernel/pulls/2483

 

Reviewed-by: default avatarKe Chen <chenke54@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 42f28753 7e6b874a
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)