diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2018-03-09 10:37:01 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-09 11:33:14 -0500 |
commit | 0d3e6631de9a56a56e06435f3a2c6196014a059d (patch) | |
tree | 3acc5548000f5d3859c994096cb31fa133e68cdd /drivers/net/ethernet/hisilicon/hns3/hns3vf | |
parent | ec77789032c0d5ab77c32abd762f5a8e65198e1b (diff) |
net: hns3: refactor the get/put_vector function
There is a get_vector function, which allocate the vectors
for a client, but there is not a put_vector to free the
vector.
This patch introduces the put_vector function in order to
fix the coalesce configuration lost problem during reset
process.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3vf')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index c9a916a3d6e8..09a2a66975a6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -627,13 +627,18 @@ static int hclgevf_unmap_ring_from_vector( } ret = hclgevf_bind_ring_to_vector(handle, false, vector, ring_chain); - if (ret) { + if (ret) dev_err(&handle->pdev->dev, "Unmap ring from vector fail. vector=%d, ret =%d\n", vector_id, ret); - return ret; - } + + return ret; +} + +static int hclgevf_put_vector(struct hnae3_handle *handle, int vector) +{ + struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hclgevf_free_vector(hdev, vector); @@ -1466,6 +1471,7 @@ static const struct hnae3_ae_ops hclgevf_ops = { .map_ring_to_vector = hclgevf_map_ring_to_vector, .unmap_ring_from_vector = hclgevf_unmap_ring_from_vector, .get_vector = hclgevf_get_vector, + .put_vector = hclgevf_put_vector, .reset_queue = hclgevf_reset_tqp, .set_promisc_mode = hclgevf_set_promisc_mode, .get_mac_addr = hclgevf_get_mac_addr, |