net/iavf: fix mbuf leak
[dpdk.git] / drivers / net / hinic / base / hinic_pmd_hwdev.c
index c132de0..cb9cf6e 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(c) 2017 Huawei Technologies Co., Ltd
  */
 
-#include<rte_ethdev_driver.h>
+#include<ethdev_driver.h>
 #include <rte_bus_pci.h>
 #include <rte_hash.h>
 #include <rte_jhash.h>
@@ -475,7 +475,7 @@ static int wait_for_flr_finish(struct hinic_hwif *hwif)
                rte_delay_ms(10);
        } while (time_before(jiffies, end));
 
-       return -EFAULT;
+       return -ETIMEDOUT;
 }
 
 #define HINIC_WAIT_CMDQ_IDLE_TIMEOUT           1000
@@ -599,7 +599,7 @@ static int hinic_pf_rx_tx_flush(struct hinic_hwdev *hwdev)
 
        err = hinic_msg_to_mgmt_no_ack(hwdev, HINIC_MOD_COMM,
                                       HINIC_MGMT_CMD_START_FLR, &clr_res,
-                                      sizeof(clr_res), NULL, NULL);
+                                      sizeof(clr_res));
        if (err) {
                PMD_DRV_LOG(WARNING, "Notice flush msg failed, err: %d", err);
                ret = err;
@@ -681,17 +681,15 @@ int hinic_set_interrupt_cfg(struct hinic_hwdev *hwdev,
        u16 out_size = sizeof(msix_cfg);
        int err;
 
-       memset(&msix_cfg, 0, sizeof(msix_cfg));
-       msix_cfg.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
-       msix_cfg.func_id = hinic_global_func_id(hwdev);
-       msix_cfg.msix_index = (u16)interrupt_info.msix_index;
-
        temp_info.msix_index = interrupt_info.msix_index;
-
        err = hinic_get_interrupt_cfg(hwdev, &temp_info);
        if (err)
-               return -EINVAL;
+               return -EIO;
 
+       memset(&msix_cfg, 0, sizeof(msix_cfg));
+       msix_cfg.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
+       msix_cfg.func_id = hinic_global_func_id(hwdev);
+       msix_cfg.msix_index = (u16)interrupt_info.msix_index;
        msix_cfg.lli_credit_cnt = temp_info.lli_credit_limit;
        msix_cfg.lli_tmier_cnt = temp_info.lli_timer_cfg;
        msix_cfg.pending_cnt = temp_info.pending_limt;
@@ -1051,7 +1049,7 @@ int hinic_get_board_info(void *hwdev, struct hinic_board_info *info)
        if (err || board_info.mgmt_msg_head.status || !out_size) {
                PMD_DRV_LOG(ERR, "Failed to get board info, err: %d, status: 0x%x, out size: 0x%x",
                        err, board_info.mgmt_msg_head.status, out_size);
-               return -EFAULT;
+               return -EIO;
        }
 
        memcpy(info, &board_info.info, sizeof(*info));
@@ -1364,9 +1362,9 @@ static void hinic_lsc_process(struct hinic_hwdev *hwdev,
        ret = hinic_link_event_process(hwdev, rte_dev, status);
        /* check if link has changed, notify callback */
        if (ret == 0)
-               _rte_eth_dev_callback_process(rte_dev,
-                                             RTE_ETH_EVENT_INTR_LSC,
-                                             NULL);
+               rte_eth_dev_callback_process(rte_dev,
+                                            RTE_ETH_EVENT_INTR_LSC,
+                                            NULL);
 }
 
 void hinic_l2nic_async_event_handle(struct hinic_hwdev *hwdev,