diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index a4e486c4d45c49b1d713837437b7a18cc11164f0..e6f8a254d3298cea4b8a837602f6a13a4db4a50d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -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) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index c48a69c7888a537df2725ebad52e91b09f7056f7..88efa8f9546fbc32544aed75360481305df7d857 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -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}, diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 7d00bec68e51ef59507ac9af4c23dd7cd1aa9cbf..5ac0d87eb9dae9b3b3823b8a29594d568e5cf584 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -11840,8 +11840,10 @@ static int hclge_init_client_instance(struct hnae3_client *client, break; case HNAE3_CLIENT_ROH: - hdev->roh_client = client; - vport->roh.client = client; + 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)