]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: hns3: fix ROCE base interrupt vector initialization bug
authorJie Wang <wangjie125@huawei.com>
Wed, 10 Nov 2021 13:42:50 +0000 (21:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Nov 2021 14:20:43 +0000 (14:20 +0000)
Currently, NIC init ROCE interrupt vector with MSIX interrupt. But ROCE use
pci_irq_vector() to get interrupt vector, which adds the relative interrupt
vector again and gets wrong interrupt vector.

So fixes it by assign relative interrupt vector to ROCE instead of MSIX
interrupt vector and delete the unused struct member base_msi_vector
declaration of hclgevf_dev.

Fixes: 22c0e2ce21dd ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h

index eb96bea9e3ce804a8da6bf71b607d27a7409874c..0fc2b81f4712dd7433a8f0ddc8b7145b2331e697 100644 (file)
@@ -2581,7 +2581,7 @@ static int hclge_init_roce_base_info(struct hclge_vport *vport)
        if (hdev->num_msi < hdev->num_nic_msi + hdev->num_roce_msi)
                return -EINVAL;
 
-       roce->rinfo.base_vector = hdev->roce_base_vector;
+       roce->rinfo.base_vector = hdev->num_nic_msi;
 
        roce->rinfo.netdev = nic->kinfo.netdev;
        roce->rinfo.roce_io_base = hdev->hw.io_base;
@@ -2617,10 +2617,6 @@ static int hclge_init_msi(struct hclge_dev *hdev)
        hdev->num_msi = vectors;
        hdev->num_msi_left = vectors;
 
-       hdev->base_msi_vector = pdev->irq;
-       hdev->roce_base_vector = hdev->base_msi_vector +
-                               hdev->num_nic_msi;
-
        hdev->vector_status = devm_kcalloc(&pdev->dev, hdev->num_msi,
                                           sizeof(u16), GFP_KERNEL);
        if (!hdev->vector_status) {
index 9e1eede599ec8fa31711fe954d8a5ea62fc9d326..21013776de559120101d09276675559c744a31e2 100644 (file)
@@ -904,12 +904,10 @@ struct hclge_dev {
        u16 num_msi;
        u16 num_msi_left;
        u16 num_msi_used;
-       u32 base_msi_vector;
        u16 *vector_status;
        int *vector_irq;
        u16 num_nic_msi;        /* Num of nic vectors for this PF */
        u16 num_roce_msi;       /* Num of roce vectors for this PF */
-       int roce_base_vector;
 
        unsigned long service_timer_period;
        unsigned long service_timer_previous;
index 645b2c0011e6bc71cd4ce8bd2e06d9cbdcc93106..98332dad804dd6ddfcb251e68eebfd3c727435c4 100644 (file)
@@ -2557,7 +2557,7 @@ static int hclgevf_init_roce_base_info(struct hclgevf_dev *hdev)
            hdev->num_msi_left == 0)
                return -EINVAL;
 
-       roce->rinfo.base_vector = hdev->roce_base_vector;
+       roce->rinfo.base_vector = hdev->roce_base_msix_offset;
 
        roce->rinfo.netdev = nic->kinfo.netdev;
        roce->rinfo.roce_io_base = hdev->hw.io_base;
@@ -2823,9 +2823,6 @@ static int hclgevf_init_msi(struct hclgevf_dev *hdev)
        hdev->num_msi = vectors;
        hdev->num_msi_left = vectors;
 
-       hdev->base_msi_vector = pdev->irq;
-       hdev->roce_base_vector = pdev->irq + hdev->roce_base_msix_offset;
-
        hdev->vector_status = devm_kcalloc(&pdev->dev, hdev->num_msi,
                                           sizeof(u16), GFP_KERNEL);
        if (!hdev->vector_status) {
index 28288d7e33032c33d679d3667591e30a345793b0..4bd922b475012a7982da57ea75e77019fcc71f97 100644 (file)
@@ -308,8 +308,6 @@ struct hclgevf_dev {
        u16 num_nic_msix;       /* Num of nic vectors for this VF */
        u16 num_roce_msix;      /* Num of roce vectors for this VF */
        u16 roce_base_msix_offset;
-       int roce_base_vector;
-       u32 base_msi_vector;
        u16 *vector_status;
        int *vector_irq;