net/hns3: replace interrupt vector zero with common macro
authorWei Hu (Xavier) <xavier.huwei@huawei.com>
Fri, 10 Apr 2020 11:09:23 +0000 (19:09 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:07 +0000 (13:57 +0200)
This patch replaces the specific macro named RTE_INTR_VEC_ZERO_OFFSET
provided by DPDK framework instead of the magic number 0.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_ethdev_vf.c

index e67b951..5f754bf 100644 (file)
@@ -4185,9 +4185,9 @@ hns3_map_rx_interrupt(struct rte_eth_dev *dev)
        struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+       uint8_t base = RTE_INTR_VEC_ZERO_OFFSET;
+       uint8_t vec = RTE_INTR_VEC_ZERO_OFFSET;
        uint32_t intr_vector;
-       uint8_t base = 0;
-       uint8_t vec = 0;
        uint16_t q_id;
        int ret;
 
@@ -4319,8 +4319,8 @@ hns3_unmap_rx_interrupt(struct rte_eth_dev *dev)
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct hns3_adapter *hns = dev->data->dev_private;
        struct hns3_hw *hw = &hns->hw;
-       uint8_t base = 0;
-       uint8_t vec = 0;
+       uint8_t base = RTE_INTR_VEC_ZERO_OFFSET;
+       uint8_t vec = RTE_INTR_VEC_ZERO_OFFSET;
        uint16_t q_id;
 
        if (dev->data->dev_conf.intr_conf.rxq == 0)
index eca585d..16623a7 100644 (file)
@@ -1542,8 +1542,8 @@ hns3vf_unmap_rx_interrupt(struct rte_eth_dev *dev)
        struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
-       uint8_t base = 0;
-       uint8_t vec = 0;
+       uint8_t base = RTE_INTR_VEC_ZERO_OFFSET;
+       uint8_t vec = RTE_INTR_VEC_ZERO_OFFSET;
        uint16_t q_id;
 
        if (dev->data->dev_conf.intr_conf.rxq == 0)
@@ -1683,9 +1683,9 @@ hns3vf_map_rx_interrupt(struct rte_eth_dev *dev)
        struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+       uint8_t base = RTE_INTR_VEC_ZERO_OFFSET;
+       uint8_t vec = RTE_INTR_VEC_ZERO_OFFSET;
        uint32_t intr_vector;
-       uint8_t base = 0;
-       uint8_t vec = 0;
        uint16_t q_id;
        int ret;