| From 6200a1da8a7122e3f9be1da187fab5524c942202 Mon Sep 17 00:00:00 2001 |
| From: Luo bin <luobin9@huawei.com> |
| Date: Thu, 27 Feb 2020 06:34:43 +0000 |
| Subject: [PATCH] hinic: fix a bug of setting hw_ioctxt |
| |
| commit d2ed69ce9ed3477e2a9527e6b89fe4689d99510e upstream. |
| |
| a reserved field is used to signify prime physical function index |
| in the latest firmware version, so we must assign a value to it |
| correctly |
| |
| Signed-off-by: Luo bin <luobin9@huawei.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c |
| index 408705687de6..813f48dede92 100644 |
| --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c |
| +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c |
| @@ -300,6 +300,7 @@ static int set_hw_ioctxt(struct hinic_hwdev *hwdev, unsigned int rq_depth, |
| } |
| |
| hw_ioctxt.func_idx = HINIC_HWIF_FUNC_IDX(hwif); |
| + hw_ioctxt.ppf_idx = HINIC_HWIF_PPF_IDX(hwif); |
| |
| hw_ioctxt.set_cmdq_depth = HW_IOCTXT_SET_CMDQ_DEPTH_DEFAULT; |
| hw_ioctxt.cmdq_depth = 0; |
| diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h |
| index a0a5b7434ad7..e052a2636991 100644 |
| --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h |
| +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h |
| @@ -99,8 +99,8 @@ struct hinic_cmd_hw_ioctxt { |
| |
| u8 rsvd2; |
| u8 rsvd3; |
| + u8 ppf_idx; |
| u8 rsvd4; |
| - u8 rsvd5; |
| |
| u16 rq_depth; |
| u16 rx_buf_sz_idx; |
| diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h |
| index 517794509eb2..c7bb9ceca72c 100644 |
| --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h |
| +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h |
| @@ -137,6 +137,7 @@ |
| #define HINIC_HWIF_FUNC_IDX(hwif) ((hwif)->attr.func_idx) |
| #define HINIC_HWIF_PCI_INTF(hwif) ((hwif)->attr.pci_intf_idx) |
| #define HINIC_HWIF_PF_IDX(hwif) ((hwif)->attr.pf_idx) |
| +#define HINIC_HWIF_PPF_IDX(hwif) ((hwif)->attr.ppf_idx) |
| |
| #define HINIC_FUNC_TYPE(hwif) ((hwif)->attr.func_type) |
| #define HINIC_IS_PF(hwif) (HINIC_FUNC_TYPE(hwif) == HINIC_PF) |
| -- |
| 2.7.4 |
| |