Fix allmodconfig build error in hiroce3 driver.
Fixes: ae52f9c522dd ("infiniband/hw/hiroce3: Add Huawei Intelligent Network Card RDMA Driver") Shuai Wu (1): net/ethernet/huawei/hiroce3: Fix allmodconfig build error
.../hw/hiroce3/bond/roce_bond_common.c | 38 +- .../hw/hiroce3/cq/roce_cq_destroy.c | 15 +- .../hw/hiroce3/host/hmm/hmm_comp_mtt.c | 1 + .../hw/hiroce3/host/hmm/hmm_comp_mw_mr.c | 1 + .../hw/hiroce3/host/hmm/hmm_comp_res.c | 1 + .../infiniband/hw/hiroce3/host/hmm/hmm_mr.c | 98 +---- .../infiniband/hw/hiroce3/host/hmm/hmm_umem.c | 4 +- .../infiniband/hw/hiroce3/host/hmm/hmm_umem.h | 2 +- .../include/rdma/rdma_context_format.h | 4 +- .../include/rdma/rdma_ext_ctx_format.h | 5 +- .../hw/hiroce3/include/rdma/roce_ccf_format.h | 4 +- .../hw/hiroce3/include/rdma/roce_verbs_attr.h | 4 +- .../include/rdma/roce_verbs_attr_qpc_chip.h | 4 +- .../hiroce3/include/rdma/roce_verbs_cq_attr.h | 4 +- .../include/rdma/roce_verbs_ext_attr.h | 4 +- .../include/rdma/roce_verbs_gid_attr.h | 4 +- .../hiroce3/include/rdma/roce_verbs_mr_attr.h | 4 +- .../hw/hiroce3/include/rdma/roce_verbs_pub.h | 4 +- .../include/rdma/roce_verbs_srq_attr.h | 4 +- drivers/infiniband/hw/hiroce3/mr/roce_mr.c | 37 -- drivers/infiniband/hw/hiroce3/roce.h | 1 - drivers/infiniband/hw/hiroce3/roce_main.c | 7 +- .../ethernet/huawei/hinic3/bond/hinic3_bond.c | 1 - .../ethernet/huawei/hinic3/bond/hinic3_bond.h | 4 +- .../ethernet/huawei/hinic3/cqm/cqm_bat_cla.c | 198 +++------ .../huawei/hinic3/cqm/cqm_bitmap_table.c | 10 +- .../huawei/hinic3/cqm/cqm_bloomfilter.c | 69 +--- .../net/ethernet/huawei/hinic3/cqm/cqm_cmd.c | 139 ++----- .../net/ethernet/huawei/hinic3/cqm/cqm_cmd.h | 2 - .../net/ethernet/huawei/hinic3/cqm/cqm_db.c | 192 +++------ .../ethernet/huawei/hinic3/cqm/cqm_define.h | 4 - .../net/ethernet/huawei/hinic3/cqm/cqm_main.c | 178 +++------ .../ethernet/huawei/hinic3/cqm/cqm_object.c | 378 +++++------------- .../huawei/hinic3/cqm/cqm_object_intern.c | 194 +++------ .../ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c | 2 +- .../ethernet/huawei/hinic3/hw/hinic3_hwif.c | 38 -- .../huawei/hinic3/hw/hinic3_multi_host_mgmt.c | 56 ++- .../hinic3/include/bond/bond_common_defs.h | 4 +- .../huawei/hinic3/include/hinic3_common.h | 2 - .../huawei/hinic3/include/hinic3_cqm.h | 11 - .../huawei/hinic3/include/hinic3_cqm_define.h | 4 - .../include/mpu/mpu_outband_ncsi_cmd_defs.h | 4 +- 42 files changed, 474 insertions(+), 1266 deletions(-)
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/7814 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/G...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/7814 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/G...
driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9QSJD CVE: NA
---------------------------------
Fix allmodconfig build error in hiroce3 driver.
Fixes: ae52f9c522dd ("infiniband/hw/hiroce3: Add Huawei Intelligent Network Card RDMA Driver") Signed-off-by: Shuai Wu wushuai51@huawei.com --- .../hw/hiroce3/bond/roce_bond_common.c | 38 +- .../hw/hiroce3/cq/roce_cq_destroy.c | 15 +- .../hw/hiroce3/host/hmm/hmm_comp_mtt.c | 1 + .../hw/hiroce3/host/hmm/hmm_comp_mw_mr.c | 1 + .../hw/hiroce3/host/hmm/hmm_comp_res.c | 1 + .../infiniband/hw/hiroce3/host/hmm/hmm_mr.c | 98 +---- .../infiniband/hw/hiroce3/host/hmm/hmm_umem.c | 4 +- .../infiniband/hw/hiroce3/host/hmm/hmm_umem.h | 2 +- .../include/rdma/rdma_context_format.h | 4 +- .../include/rdma/rdma_ext_ctx_format.h | 5 +- .../hw/hiroce3/include/rdma/roce_ccf_format.h | 4 +- .../hw/hiroce3/include/rdma/roce_verbs_attr.h | 4 +- .../include/rdma/roce_verbs_attr_qpc_chip.h | 4 +- .../hiroce3/include/rdma/roce_verbs_cq_attr.h | 4 +- .../include/rdma/roce_verbs_ext_attr.h | 4 +- .../include/rdma/roce_verbs_gid_attr.h | 4 +- .../hiroce3/include/rdma/roce_verbs_mr_attr.h | 4 +- .../hw/hiroce3/include/rdma/roce_verbs_pub.h | 4 +- .../include/rdma/roce_verbs_srq_attr.h | 4 +- drivers/infiniband/hw/hiroce3/mr/roce_mr.c | 37 -- drivers/infiniband/hw/hiroce3/roce.h | 1 - drivers/infiniband/hw/hiroce3/roce_main.c | 7 +- .../ethernet/huawei/hinic3/bond/hinic3_bond.c | 1 - .../ethernet/huawei/hinic3/bond/hinic3_bond.h | 4 +- .../ethernet/huawei/hinic3/cqm/cqm_bat_cla.c | 198 +++------ .../huawei/hinic3/cqm/cqm_bitmap_table.c | 10 +- .../huawei/hinic3/cqm/cqm_bloomfilter.c | 69 +--- .../net/ethernet/huawei/hinic3/cqm/cqm_cmd.c | 139 ++----- .../net/ethernet/huawei/hinic3/cqm/cqm_cmd.h | 2 - .../net/ethernet/huawei/hinic3/cqm/cqm_db.c | 192 +++------ .../ethernet/huawei/hinic3/cqm/cqm_define.h | 4 - .../net/ethernet/huawei/hinic3/cqm/cqm_main.c | 178 +++------ .../ethernet/huawei/hinic3/cqm/cqm_object.c | 378 +++++------------- .../huawei/hinic3/cqm/cqm_object_intern.c | 194 +++------ .../ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c | 2 +- .../ethernet/huawei/hinic3/hw/hinic3_hwif.c | 38 -- .../huawei/hinic3/hw/hinic3_multi_host_mgmt.c | 56 ++- .../hinic3/include/bond/bond_common_defs.h | 4 +- .../huawei/hinic3/include/hinic3_common.h | 2 - .../huawei/hinic3/include/hinic3_cqm.h | 11 - .../huawei/hinic3/include/hinic3_cqm_define.h | 4 - .../include/mpu/mpu_outband_ncsi_cmd_defs.h | 4 +- 42 files changed, 474 insertions(+), 1266 deletions(-)
diff --git a/drivers/infiniband/hw/hiroce3/bond/roce_bond_common.c b/drivers/infiniband/hw/hiroce3/bond/roce_bond_common.c index 8b9db6ca9..cddcf5922 100644 --- a/drivers/infiniband/hw/hiroce3/bond/roce_bond_common.c +++ b/drivers/infiniband/hw/hiroce3/bond/roce_bond_common.c @@ -418,7 +418,7 @@ int roce3_bond_is_eth_port_of_netdev(struct roce3_device *rdev, struct net_devic return 0; }
-struct roce3_bond_device *roce3_get_bond_dev(const char *bond_name) +static struct roce3_bond_device *roce3_get_bond_dev(const char *bond_name) { struct roce3_bond_device *bdev = NULL;
@@ -430,7 +430,7 @@ struct roce3_bond_device *roce3_get_bond_dev(const char *bond_name) return NULL; }
-struct roce3_bond_device *roce3_get_bond_dev_by_name(const char *bond_name) +static struct roce3_bond_device *roce3_get_bond_dev_by_name(const char *bond_name) { struct roce3_bond_device *bdev = NULL;
@@ -440,8 +440,8 @@ struct roce3_bond_device *roce3_get_bond_dev_by_name(const char *bond_name) return bdev; }
-void roce3_bond_init_slave(struct roce3_bond_slave *slave, struct bond_tracker *tracker, int index, - struct bond_attr *attr) +static void roce3_bond_init_slave(struct roce3_bond_slave *slave, + struct bond_tracker *tracker, int index, struct bond_attr *attr) { void *hwdev;
@@ -465,7 +465,7 @@ void roce3_bond_init_slave(struct roce3_bond_slave *slave, struct bond_tracker * hinic3_detach_service(slave->lld_dev, SERVICE_T_ROCE); }
-bool roce3_bond_before_active_check(struct bond_tracker *tracker, struct bond_attr *attr) +static bool roce3_bond_before_active_check(struct bond_tracker *tracker, struct bond_attr *attr) { int i; struct hinic3_lld_dev *lld_dev = NULL; @@ -501,7 +501,7 @@ bool roce3_bond_before_active_check(struct bond_tracker *tracker, struct bond_at return true; }
-void roce3_detach_nic_bond_work(struct work_struct *work) +static void roce3_detach_nic_bond_work(struct work_struct *work) { struct roce3_detach_work *detach_work = container_of(work, struct roce3_detach_work, work);
@@ -520,7 +520,8 @@ static void roce3_attach_bond_work(struct work_struct *_work)
kfree(work); } -void roce3_deatch_bond(u16 bond_id) + +static void roce3_deatch_bond(u16 bond_id) { struct roce3_detach_work *detach_work = NULL;
@@ -533,7 +534,7 @@ void roce3_deatch_bond(u16 bond_id) queue_work(g_bond_wq, &detach_work->work); }
-bool roce3_bond_tracker_get(const char *bond_name, struct bond_tracker *tracker) +static bool roce3_bond_tracker_get(const char *bond_name, struct bond_tracker *tracker) { int ret = 0;
@@ -555,7 +556,7 @@ bool roce3_bond_tracker_get(const char *bond_name, struct bond_tracker *tracker) return false; }
-void roce3_before_bond_active(const char *bond_name, struct bond_attr *attr) +static void roce3_before_bond_active(const char *bond_name, struct bond_attr *attr) { struct roce3_bond_device *bond_dev = NULL; struct roce3_bond_slave *slave = NULL; @@ -602,7 +603,7 @@ void roce3_before_bond_active(const char *bond_name, struct bond_attr *attr) roce3_deatch_bond(attr->bond_id); }
-void roce3_after_bond_active(const char *bond_name, struct bond_attr *attr) +static void roce3_after_bond_active(const char *bond_name, struct bond_attr *attr) { int ret; struct roce3_bond_device *bond_dev = NULL; @@ -620,7 +621,7 @@ void roce3_after_bond_active(const char *bond_name, struct bond_attr *attr) } }
-void roce3_after_bond_modify(const char *bond_name, struct bond_attr *attr) +static void roce3_after_bond_modify(const char *bond_name, struct bond_attr *attr) { struct roce3_bond_device *bond_dev = NULL; struct bond_tracker tracker; @@ -654,15 +655,15 @@ void roce3_after_bond_modify(const char *bond_name, struct bond_attr *attr) mutex_unlock(&bond_dev->slave_lock); }
-void roce3_before_bond_deactive(const char *bond_name, struct bond_attr *attr) +static void roce3_before_bond_deactive(const char *bond_name, struct bond_attr *attr) { }
-void roce3_after_bond_deactive(const char *bond_name, struct bond_attr *attr) +static void roce3_after_bond_deactive(const char *bond_name, struct bond_attr *attr) { }
-void roce3_bond_destroy(const char *bond_name) +static void roce3_bond_destroy(const char *bond_name) { int ret; int i; @@ -702,7 +703,7 @@ void roce3_bond_destroy(const char *bond_name) kfree(bond_dev); }
-void roce3_before_bond_modify(const char *bond_name, struct bond_attr *attr) +static void roce3_before_bond_modify(const char *bond_name, struct bond_attr *attr) { struct roce3_bond_device *bond_dev = NULL; struct bond_tracker tracker; @@ -751,7 +752,8 @@ static roce3_bond_service_func g_roce3_bond_proc[] = { roce3_after_bond_deactive, };
-void roce3_bond_service_proc(const char *bond_name, void *bond_attr, enum bond_service_proc_pos pos) +static void roce3_bond_service_proc(const char *bond_name, + void *bond_attr, enum bond_service_proc_pos pos) { struct bond_attr *attr = (struct bond_attr *)bond_attr;
@@ -807,7 +809,7 @@ static void roce3_detach_bond_work(struct work_struct *_work) kfree(work); }
-void roce3_queue_bond_work(struct net_device *upper_netdev, work_func_t func) +static void roce3_queue_bond_work(struct net_device *upper_netdev, work_func_t func) { struct roce3_bond_work *work; struct bonding *bond = netdev_priv(upper_netdev); @@ -826,7 +828,7 @@ void roce3_queue_bond_work(struct net_device *upper_netdev, work_func_t func) queue_work(g_bond_wq, &work->work); }
-int roce3_bond_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) +static int roce3_bond_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *net_dev = NULL; struct netdev_notifier_changeupper_info *info = NULL; diff --git a/drivers/infiniband/hw/hiroce3/cq/roce_cq_destroy.c b/drivers/infiniband/hw/hiroce3/cq/roce_cq_destroy.c index c9e555ce0..f2624f37e 100644 --- a/drivers/infiniband/hw/hiroce3/cq/roce_cq_destroy.c +++ b/drivers/infiniband/hw/hiroce3/cq/roce_cq_destroy.c @@ -47,20 +47,7 @@ static int roce3_check_cqc_data_state(struct roce3_device *rdev, const struct ro return 0; }
-/* - **************************************************************************** - Prototype : roce3_cq_hw2sw - Description : roce3_cq_hw2sw - Input : struct roce3_device *rdev - struct roce3_cq *cq - Output : None - - 1.Date : 2015/5/27 - Modification : Created function - -**************************************************************************** -*/ -int roce3_cq_hw2sw(struct roce3_device *rdev, struct roce3_cq *cq) +static int roce3_cq_hw2sw(struct roce3_device *rdev, struct roce3_cq *cq) { int ret; struct tag_cqm_cmd_buf *cqm_cmd_inbuf = NULL; diff --git a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mtt.c b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mtt.c index 906ca476e..8ec1e851b 100644 --- a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mtt.c +++ b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mtt.c @@ -7,6 +7,7 @@ #include "hinic3_hw.h" #include "hinic3_rdma.h" #include "hmm_comp.h" +#include "hinic3_hmm.h" #include "hmm_mr.h"
static int hmm_set_mtt_layer(const struct hmm_comp_priv *comp_priv, diff --git a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mw_mr.c b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mw_mr.c index fce8f5c01..bc1206c4a 100644 --- a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mw_mr.c +++ b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_mw_mr.c @@ -6,6 +6,7 @@
#include "hinic3_hw.h" #include "hmm_comp.h" +#include "hmm_mr.h"
static void hmm_roce_mpt_to_big_endian(struct roce_mpt_context *mpt_ctx) { diff --git a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_res.c b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_res.c index 84f4c37d9..9539f3382 100644 --- a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_res.c +++ b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_comp_res.c @@ -6,6 +6,7 @@
#include "hinic3_hw.h" #include "hmm_comp.h" +#include "hmm_mr.h"
int hmm_rdma_mpt_alloc(void *hwdev, struct rdma_mpt *mpt, u32 service_type) { diff --git a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_mr.c b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_mr.c index 3dd48a511..271a1ac32 100644 --- a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_mr.c +++ b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_mr.c @@ -66,15 +66,7 @@ static int hmm_alloc_tpt(struct hinic3_hwdev *hwdev, struct rdma_mr *mr, return ret; }
-/* - **************************************************************************** - Prototype : hmm_free_tpt - Description : free mpt and mtt - Input : struct hinic3_hwdev *hwdev - struct rdma_mr *mr -**************************************************************************** -*/ -void hmm_free_tpt(void *hwdev, struct rdma_mr *mr, u32 service_type) +static void hmm_free_tpt(void *hwdev, struct rdma_mr *mr, u32 service_type) { hmm_rdma_mtt_free(hwdev, &mr->mtt, service_type); hmm_rdma_mpt_free(hwdev, &mr->mpt); @@ -105,78 +97,6 @@ static void hmm_set_rdma_mr(struct rdma_mr *mr, enum rdma_mr_type mr_type, u32 p mr->mr_type = mr_type; }
-/* - **************************************************************************** - Prototype : hmm_alloc_mr - Description : register DMA_MR - Input : struct hinic3_hwdev *hwdev - enum rdma_mr_type mr_type - u32 max_num_sg - u32 service_type - Output : None -**************************************************************************** -*/ -struct hmm_mr *hmm_alloc_mr(struct hinic3_hwdev *hwdev, u32 pdn, enum rdma_mr_type mr_type, - u32 max_num_sg, u32 service_type, u16 channel) -{ - u32 access_flag; - int ret = 0; - struct hmm_mr *mr = NULL; - - if (hwdev == NULL) { - ret = -EINVAL; - pr_err("[HMM, ERR] %s(%d): dev is null\n", __func__, __LINE__); - goto err_out; - } -#ifndef PANGEA_V6 - if (mr_type != RDMA_DMA_MR && mr_type != RDMA_INDIRECT_MR) { -#else - if (mr_type != RDMA_DMA_MR) { -#endif - ret = -EINVAL; - pr_err("[HMM, ERR] %s(%d): mr_type is invalid\n", __func__, __LINE__); - goto err_out; - } - - mr = kzalloc(sizeof(*mr), GFP_KERNEL); - if (mr == NULL) { - ret = -ENOMEM; - goto err_out; - } - - ret = hmm_alloc_tpt(hwdev->dev_hdl, &mr->rdmamr, 0, 0, service_type); - if (ret != 0) { - dev_err(hwdev->dev_hdl, - "[HMM, ERR] %s(%d): Failed to alloc mpt and mtt, func_id(%d)\n", - __func__, __LINE__, hinic3_global_func_id(hwdev)); - goto err_alloc_tpt; - } - - access_flag = (RDMA_IB_ACCESS_REMOTE_READ | RDMA_IB_ACCESS_REMOTE_WRITE | - RDMA_IB_ACCESS_LOCAL_WRITE | RDMA_IB_ACCESS_REMOTE_ATOMIC); - - hmm_set_rdma_mr(&mr->rdmamr, mr_type, pdn, 0ULL, ROCE_DMA_MR_SIZE, access_flag); - - ret = hmm_rdma_enable_mr_mpt(hwdev->dev_hdl, &(mr->rdmamr), channel); - if (ret != 0) { - dev_err(hwdev->dev_hdl, - "[HMM, ERR] %s(%d): Failed to enable mpt of DMA mr, func_id(%d)\n", - __func__, __LINE__, hinic3_global_func_id(hwdev)); - goto err_enable_mpt; - } - - return mr; - -err_enable_mpt: - hmm_free_tpt(hwdev->dev_hdl, &mr->rdmamr, service_type); - -err_alloc_tpt: - kfree(mr); - -err_out: - return (struct hmm_mr *)ERR_PTR((long)ret); -} - static int hmm_umem_write_mtt_check(const void *hwdev, const struct rdma_mtt *mtt, const struct hmm_umem *umem) { @@ -238,18 +158,8 @@ static int hmm_umem_write_mtt_update(struct hinic3_hwdev *hwdev, struct rdma_mtt return ret; }
-/* - **************************************************************************** - Prototype : hmm_umem_write_mtt - Description : write mtt for umem(get from memory alloced by user) - Input : struct hinic3_hwdev *hwdev - struct rdma_mtt *mtt - struct hmm_umem *umem - Output : None -**************************************************************************** -*/ -int hmm_umem_write_mtt(struct hinic3_hwdev *hwdev, struct rdma_mtt *mtt, - struct hmm_umem *umem, u32 service_type) +static int hmm_umem_write_mtt(struct hinic3_hwdev *hwdev, struct rdma_mtt *mtt, + struct hmm_umem *umem, u32 service_type) { int ret; u64 *page_list = NULL; /* 要写入mtt的page_list */ @@ -363,7 +273,7 @@ struct hmm_mr *hmm_reg_user_mr(struct hinic3_hwdev *hwdev, u64 start, u32 pd,
mr->hwdev = hwdev; mr->rdmamr.iova = virt_addr; - mr->umem = hmm_umem_get(hwdev->dev_hdl, start, (size_t)length, hmm_access, 0); + mr->umem = hmm_umem_get(hwdev->dev_hdl, start, (size_t)length, hmm_access); if (IS_ERR(mr->umem)) { ret = (int)PTR_ERR(mr->umem); dev_err(hwdev->dev_hdl, diff --git a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.c b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.c index c3a296568..460f6c4cb 100644 --- a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.c +++ b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.c @@ -8,7 +8,6 @@ #include <linux/sched/signal.h> #include <linux/hugetlb.h> #include <linux/slab.h> -#include <linux/version.h> #include "hinic3_rdma.h" #include "hmm_umem.h"
@@ -42,10 +41,9 @@ static void hmm_umemsg_release(struct device *device, struct hmm_umem *hmm_umem, * @addr: userspace virtual address to start at * @size: length of region to pin * @access: RDMA_IB_ACCESS_xxx flags for memory being pinned - * @dmasync: flush in-flight DMA when the memory region is written */ struct hmm_umem *hmm_umem_get(struct device *device, unsigned long addr, - size_t size, int access, int dmasync) + size_t size, int access) { int ret; int i; diff --git a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.h b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.h index 61cc59f6e..e6e3decfe 100644 --- a/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.h +++ b/drivers/infiniband/hw/hiroce3/host/hmm/hmm_umem.h @@ -71,7 +71,7 @@ struct ib_ucontext { struct ib_umem_odp;
struct hmm_umem *hmm_umem_get(struct device *device, unsigned long addr, - size_t size, int access, int dmasync); + size_t size, int access);
void hmm_umem_release(struct hmm_umem *hmem);
diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/rdma_context_format.h b/drivers/infiniband/hw/hiroce3/include/rdma/rdma_context_format.h index d68648540..0c1bec923 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/rdma_context_format.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/rdma_context_format.h @@ -9,7 +9,7 @@
/* Align each field with 4bytes. */ -#pragma pack(4) +#pragma pack(push, 4)
/* **************** Macro Definition ****************** */ #define ROCE_BASE_GID_IDX 1 @@ -5176,6 +5176,6 @@ struct racl_value { u32 value; } dw4; }; -#pragma pack(0) +#pragma pack(pop)
#endif // RDMA_CONTEXT_FORMAT_H diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/rdma_ext_ctx_format.h b/drivers/infiniband/hw/hiroce3/include/rdma/rdma_ext_ctx_format.h index 7d0252849..40bc1ecfd 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/rdma_ext_ctx_format.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/rdma_ext_ctx_format.h @@ -14,8 +14,7 @@
#include "roce_dif_format.h" /* Align each field with 4bytes. */ -#pragma pack(4) - +#pragma pack(push, 4)
#ifndef BIG_ENDIAN #define BIG_ENDIAN 0x4321 @@ -374,6 +373,6 @@ struct ucode_nofaa_ctx { u32 rsvd[2]; };
-#pragma pack(0) +#pragma pack(pop)
#endif // RDMA_EXT_CTX_FORMAT_H diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_ccf_format.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_ccf_format.h index cc8c6f55e..c37457f6a 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_ccf_format.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_ccf_format.h @@ -5,7 +5,7 @@ #define ROCE_CCF_FORMAT_H
/* Align each field with 4bytes. */ -#pragma pack(4) +#pragma pack(push, 4)
#ifndef BIG_ENDIAN #define BIG_ENDIAN 0x4321 @@ -717,6 +717,6 @@ struct tag_ipqcn_hash_value { u32 rsvd[2]; };
-#pragma pack(0) +#pragma pack(pop)
#endif // ROCE_CCF_FORMAT_H diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr.h index 05b3363c0..f35f07e00 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr.h @@ -17,7 +17,7 @@ #define ROCE_VERBS_SQ_WQEBB_SIZE (2) #define ROCE_VERBS_SQ_PI_VLD (1)
-#pragma pack(4) +#pragma pack(push, 4) /* qpc_attr_com info ,12*4B */ struct tag_roce_verbs_qpc_attr_com { /* DW0 */ @@ -408,6 +408,6 @@ struct tag_roce_verbs_modify_ctx_info { u32 mask; };
-#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_ATTR_H */ diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr_qpc_chip.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr_qpc_chip.h index 8eb2dcf6f..0a518784c 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr_qpc_chip.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_attr_qpc_chip.h @@ -8,7 +8,7 @@ #define BIG_ENDIAN 0x4321 #endif
-#pragma pack(4) +#pragma pack(push, 4) struct tag_roce_verbs_qpc_attr_chip { /* DW0~1 */ union { @@ -355,6 +355,6 @@ struct tag_roce_verbs_qpc_attr_chip { } dw19; };
-#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_ATTR_QPC_CHIP_H */ diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_cq_attr.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_cq_attr.h index 19c275024..06fab68db 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_cq_attr.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_cq_attr.h @@ -10,7 +10,7 @@ #define BIG_ENDIAN 0x4321 #endif
-#pragma pack(4) +#pragma pack(push, 4) struct roce_verbs_cq_attr { /* DW0 */ union { @@ -191,6 +191,6 @@ struct tag_roce_verbs_modify_cq_info { u32 max_cnt; u32 timeout; }; -#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_CQ_ATTR_H */ diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_ext_attr.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_ext_attr.h index 471824a0f..30be4ad35 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_ext_attr.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_ext_attr.h @@ -18,7 +18,7 @@ enum VERBS_ATTR_EXT_TYPE_E {
#define ROCE_VERBS_SQP_WQE_SIZE (2)
-#pragma pack(4) +#pragma pack(push, 4)
struct tag_roce_verbs_sqp_attr { /* DW0 */ @@ -43,6 +43,6 @@ struct tag_roce_verbs_sqp_attr { } dw1; };
-#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_EXT_ATTR_H */ diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_gid_attr.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_gid_attr.h index b4d58bd8d..13c37c374 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_gid_attr.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_gid_attr.h @@ -8,7 +8,7 @@ #define BIG_ENDIAN 0x4321 #endif
-#pragma pack(4) +#pragma pack(push, 4) struct tag_roce_verbs_gid_ipv4_attr { /* DW0 */ union { @@ -106,6 +106,6 @@ struct tag_roce_verbs_gid_attr { struct tag_roce_verbs_clear_gid_info { u32 gid_num; }; -#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_GID_ATTR_H */ diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_mr_attr.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_mr_attr.h index d684dd778..311cb2849 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_mr_attr.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_mr_attr.h @@ -9,7 +9,7 @@ #define BIG_ENDIAN 0x4321 #endif
-#pragma pack(4) +#pragma pack(push, 4) struct tag_roce_verbs_mr_sge { u32 rsvd; u32 new_key; @@ -325,6 +325,6 @@ struct tag_roce_verbs_mr_attr { /* DW17 */ u32 rsvd; }; -#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_MR_ATTR_H */ diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_pub.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_pub.h index 77bf31694..bf3b97542 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_pub.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_pub.h @@ -181,7 +181,7 @@ enum QP_OPTPAR_E { #define ROCE_MODIFY_QP_RTS2SQD_SQD_EVENT_OPT (0x80000000) /* ************************************************* */
-#pragma pack(4) +#pragma pack(push, 4) struct tag_roce_verbs_cmd_header { union { u32 value; @@ -220,6 +220,6 @@ union tag_roce_verbs_seg_hdr { } bs; };
-#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_PUB_H */ diff --git a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_srq_attr.h b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_srq_attr.h index a0e6412f5..c27c6f62a 100644 --- a/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_srq_attr.h +++ b/drivers/infiniband/hw/hiroce3/include/rdma/roce_verbs_srq_attr.h @@ -10,7 +10,7 @@ #define BIG_ENDIAN 0x4321 #endif
-#pragma pack(4) +#pragma pack(push, 4) struct tag_roce_verbs_srq_cont_attr { /* DW0 */ u32 head_gpa_h; @@ -259,6 +259,6 @@ union tag_roce_verbs_arm_srq_info { #endif } bs; }; -#pragma pack() +#pragma pack(pop)
#endif /* ROCE_VERBS_SRQ_ATTR_H */ diff --git a/drivers/infiniband/hw/hiroce3/mr/roce_mr.c b/drivers/infiniband/hw/hiroce3/mr/roce_mr.c index 62ee3ac9e..231e483e8 100644 --- a/drivers/infiniband/hw/hiroce3/mr/roce_mr.c +++ b/drivers/infiniband/hw/hiroce3/mr/roce_mr.c @@ -910,40 +910,3 @@ int roce3_dealloc_mw(struct ib_mw *ibmw)
return 0; } - -int roce3_check_mr_status(struct ib_mr *ibmr, u32 check_mask, struct ib_mr_status *mr_status) -{ - int ret = 0; - struct roce3_mr *mr = NULL; - - if ((ibmr == NULL) || (mr_status == NULL)) { - pr_err("[ROCE, ERR] ibmr or mr_status is NULL ptr.\n"); - return -EINVAL; - } - - mr = to_roce3_mr(ibmr); - if ((check_mask & (~IB_MR_CHECK_SIG_STATUS)) != 0) { - pr_err("[ROCE, ERR] check_mask(%#x) invalid\n", check_mask); - return -EINVAL; - } - - if (!mr->signature_en) { - pr_err("[ROCE, ERR] mr not configure dif info\n"); - ret = -EINVAL; - return ret; - } - - mr->sig.sig_status_checked = true; - mr_status->fail_status = 0; - - /* If err does not exist, return 0 */ - if (!mr->sig.sig_err_exists) - return 0; - - memcpy((void *)&mr_status->sig_err, (void *)&mr->sig.sig_err_item, - sizeof(struct ib_sig_err)); - mr->sig.sig_err_exists = false; - mr_status->fail_status |= IB_MR_CHECK_SIG_STATUS; - - return 0; -} diff --git a/drivers/infiniband/hw/hiroce3/roce.h b/drivers/infiniband/hw/hiroce3/roce.h index 436d3f836..d191628d9 100644 --- a/drivers/infiniband/hw/hiroce3/roce.h +++ b/drivers/infiniband/hw/hiroce3/roce.h @@ -8,7 +8,6 @@ #include <linux/io-mapping.h> #include <linux/list.h> #include <linux/cdev.h> -#include <linux/version.h>
#include <rdma/ib_verbs.h> #include <rdma/ib_user_verbs.h> diff --git a/drivers/infiniband/hw/hiroce3/roce_main.c b/drivers/infiniband/hw/hiroce3/roce_main.c index 1f252161e..7b18894b8 100644 --- a/drivers/infiniband/hw/hiroce3/roce_main.c +++ b/drivers/infiniband/hw/hiroce3/roce_main.c @@ -1252,7 +1252,7 @@ static void roce3_remove(struct hinic3_lld_dev *lld_dev, void *uld_dev) __func__, glb_func_id, dev_name); }
-bool roce3_need_proc_link_event(void *hwdev) +static bool roce3_need_proc_link_event(void *hwdev) { int ret = 0; u16 func_id; @@ -1292,7 +1292,7 @@ bool roce3_need_proc_link_event(void *hwdev) return false; }
-bool roce3_need_proc_bond_event(void *hwdev) +static bool roce3_need_proc_bond_event(void *hwdev) { return !roce3_need_proc_link_event(hwdev); } @@ -1397,7 +1397,8 @@ static int roce3_set_ib_event(struct roce3_device *rdev, const struct hinic3_eve } }
-void roce3_event(struct hinic3_lld_dev *lld_dev, void *uld_dev, struct hinic3_event_info *event) +static void roce3_event(struct hinic3_lld_dev *lld_dev, + void *uld_dev, struct hinic3_event_info *event) { struct ib_event ibevent; struct roce3_device *rdev = NULL; diff --git a/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.c b/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.c index 1a41170cb..ba3076c95 100644 --- a/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.c +++ b/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.c @@ -9,7 +9,6 @@ #include <linux/net.h> #include <linux/mutex.h> #include <linux/netdevice.h> -#include <linux/version.h>
#include "hinic3_lld.h" #include "hinic3_srv_nic.h" diff --git a/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.h b/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.h index 3ee99d906..024de95ae 100644 --- a/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.h +++ b/drivers/net/ethernet/huawei/hinic3/bond/hinic3_bond.h @@ -44,14 +44,14 @@ struct hinic3_bond_info_s { char slaves_name[HINIC3_MAX_PORT][HINIC3_IFNAMSIZ]; };
-#pragma pack(1) +#pragma pack(push, 1) struct netdev_lower_state_info { u8 link_up : 1; u8 tx_enabled : 1; u8 rsvd : 6; };
-#pragma pack() +#pragma pack(pop)
struct bond_tracker { struct netdev_lower_state_info netdev_state[BOND_PORT_MAX_NUM]; diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bat_cla.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bat_cla.c index 2d2f54cbc..76e128e9d 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bat_cla.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bat_cla.c @@ -237,13 +237,8 @@ static void cqm_bat_fill_cla_invalid(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_bat_fill_cla - * Description : Fill the base address of the CLA table into the BAT table. - * Input : struct tag_cqm_handle *cqm_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_bat_fill_cla - Fill the base address of the CLA table into the BAT table + * @cqm_handle: CQM handle */ static void cqm_bat_fill_cla(struct tag_cqm_handle *cqm_handle) { @@ -415,13 +410,8 @@ static s32 cqm_bat_update_cmd(struct tag_cqm_handle *cqm_handle, struct tag_cqm_ }
/** - * Prototype : cqm_bat_update - * Description : Send a command to tile to update the BAT table through cmdq. - * Input : struct tag_cqm_handle *cqm_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_bat_update - Send a command to tile to update the BAT table through cmdq + * @cqm_handle: CQM handle */ static s32 cqm_bat_update(struct tag_cqm_handle *cqm_handle) { @@ -600,15 +590,10 @@ static s32 cqm_bat_init_ft_rdma(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_bat_init - * Description : Initialize the BAT table. Only the items to be initialized and - * the entry sequence are selected. The content of the BAT entry - * is filled after the CLA is allocated. - * Input : struct tag_cqm_handle *cqm_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_bat_init - Initialize the BAT table. Only the items to be initialized and + * the entry sequence are selected. The content of the BAT entry + * is filled after the CLA is allocated. + * @cqm_handle: CQM handle */ s32 cqm_bat_init(struct tag_cqm_handle *cqm_handle) { @@ -637,13 +622,8 @@ s32 cqm_bat_init(struct tag_cqm_handle *cqm_handle) }
/** - * Prototype : cqm_bat_uninit - * Description : Deinitialize the BAT table. - * Input : struct tag_cqm_handle *cqm_handle - * Output : None - * Return Value : void - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_bat_uninit - Deinitialize the BAT table + * @cqm_handle: CQM handle */ void cqm_bat_uninit(struct tag_cqm_handle *cqm_handle) { @@ -1036,15 +1016,10 @@ static s32 cqm_cla_xyz_lvl0(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_cla_xyz - * Description : Calculate the number of levels of CLA tables and allocate - * space for each level of CLA table. - * Input : struct tag_cqm_handle *cqm_handle - * struct tag_cqm_cla_table *cla_table - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_cla_xyz - Calculate the number of levels of CLA tables and allocate + * space for each level of CLA table. + * @cqm_handle: CQM handle + * @cla_table: CLA table */ static s32 cqm_cla_xyz(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table *cla_table) { @@ -1329,13 +1304,8 @@ static s32 cqm_cla_init_entry(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_cla_init - * Description : Initialize the CLA table. - * Input : struct tag_cqm_handle *cqm_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_cla_init - Initialize the CLA table + * @cqm_handle: CQM handle */ s32 cqm_cla_init(struct tag_cqm_handle *cqm_handle) { @@ -1394,13 +1364,9 @@ s32 cqm_cla_init(struct tag_cqm_handle *cqm_handle) }
/** - * Prototype : cqm_cla_uninit - * Description : Deinitialize the CLA table. - * Input : struct tag_cqm_handle *cqm_handle - * Output : None - * Return Value : void - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_cla_uninit - Deinitialize the CLA table + * @cqm_handle: CQM handle + * @entry_numb: entry number */ void cqm_cla_uninit(struct tag_cqm_handle *cqm_handle, u32 entry_numb) { @@ -1484,18 +1450,12 @@ static s32 cqm_cla_update_cmd(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_cla_update - * Description : Send a command to update the CLA table. - * Input : struct tag_cqm_handle *cqm_handle, - * struct tag_cqm_buf_list *buf_node_parent parent node of the content to - * be updated - * struct tag_cqm_buf_list *buf_node_child Subnode for which the buffer - * is to be applied - * u32 child_index Index of a child node. - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_cla_update - Send a command to update the CLA table + * @cqm_handle: CQM handle + * @buf_node_parent: parent node of the content to be updated + * @buf_node_child: Subnode for which the buffer is to be applied + * @child_index: Index of a child node + * @cla_update_mode: CLA update mod */ static s32 cqm_cla_update(struct tag_cqm_handle *cqm_handle, const struct tag_cqm_buf_list *buf_node_parent, @@ -1608,19 +1568,12 @@ static s32 cqm_cla_update(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_cla_alloc - * Description : Trunk page for applying for a CLA. - * Input : struct tag_cqm_handle *cqm_handle, - * struct tag_cqm_cla_table *cla_table, - * struct tag_cqm_buf_list *buf_node_parent parent node of the content to - * be updated - * struct tag_cqm_buf_list *buf_node_child subnode for which the buffer - * is to be applied - * u32 child_index index of a child node - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_cla_alloc - Trunk page for applying for a CLA. + * @cqm_handle: CQM handle + * @cla_table: BAT table entry + * @buf_node_parent: parent node of the content to be updated + * @buf_node_child: subnode for which the buffer is to be applied + * @child_index: index of a child node */ static s32 cqm_cla_alloc(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table *cla_table, @@ -1666,15 +1619,13 @@ static s32 cqm_cla_alloc(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_cla_free - * Description : Release trunk page of a CLA - * Input : struct tag_cqm_handle *cqm_handle - * struct tag_cqm_cla_table *cla_table - * struct tag_cqm_buf_list *buf_node - * Output : None - * Return Value : void - * 1.Date : 2015/5/15 - * Modification : Created function + * cqm_cla_free - Release trunk page of a CLA + * @cqm_handle: CQM handle + * @cla_table: BAT table entry + * @buf_node_parent: parent node of the content to be updated + * @buf_node_child: subnode for which the buffer is to be applied + * @child_index: index of a child node + * @cla_update_mode: the update mode of CLA */ static void cqm_cla_free(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table *cla_table, @@ -1858,19 +1809,14 @@ static u8 *cqm_cla_get_unlock_lvl2(struct tag_cqm_handle *cqm_handle, }
/** - * Prototype : cqm_cla_get_unlock - * Description : Apply for block buffer in number of count from the index - * position in the cla table, The unlocked process is used for - * static buffer application. - * Input : struct tag_cqm_handle *cqm_handle, - * struct tag_cqm_cla_table *cla_table, - * u32 index, - * u32 count, - * dma_addr_t *pa - * Output : None - * Return Value : u8 * - * 1.Date : 2019/7/11 - * Modification : Created function + * cqm_cla_get_unlock - Apply for block buffer in number of count from the index + * position in the cla table, The unlocked process is used for + * static buffer application. + * @cqm_handle: CQM handle + * @cla_table: BAT table entry + * @index: the index position in the cla table + * @count: number of block buffer + * @pa: dma physical address */ u8 *cqm_cla_get_unlock(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table *cla_table, u32 index, u32 count, dma_addr_t *pa) @@ -1891,19 +1837,13 @@ u8 *cqm_cla_get_unlock(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_tab }
/** - * Prototype : cqm_cla_get_lock - * Description : Apply for block buffer in number of count from the index - * position in the cla table. The lock process is used during - * dynamic buffer application. - * Input : struct tag_cqm_handle *cqm_handle, - * struct tag_cqm_cla_table *cla_table, - * u32 index, - * u32 count, - * dma_addr_t *pa - * Output : None - * Return Value : u8 * - * 1.Date : 2019/7/11 - * Modification : Created function + * cqm_cla_get_lock - Apply for block buffer in number of count from the index position + * in the cla table. The lock process is used during dynamic buffer application. + * @cqm_handle: CQM handle + * @cla_table: BAT table entry + * @index: the index position in the cla table + * @count: number of block buffer + * @pa: dma physical address */ u8 *cqm_cla_get_lock(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table *cla_table, u32 index, u32 count, dma_addr_t *pa) @@ -1920,17 +1860,12 @@ u8 *cqm_cla_get_lock(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table }
/** - * Prototype : cqm_cla_put - * Description : Decrease the value of reference counting on the trunk page. - * If the value is 0, the trunk page is released. - * Input : struct tag_cqm_handle *cqm_handle, - * struct tag_cqm_cla_table *cla_table, - * u32 index, - * u32 count - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_cla_put - Decrease the value of reference counting on the trunk page. If the value is 0, + * the trunk page is released. + * @cqm_handle: CQM handle + * @cla_table: BAT table entry + * @index: the index position in the cla table + * @count: number of block buffer */ void cqm_cla_put(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table *cla_table, u32 index, u32 count) @@ -2030,15 +1965,12 @@ void cqm_cla_put(struct tag_cqm_handle *cqm_handle, struct tag_cqm_cla_table *cl }
/** - * Prototype : cqm_cla_table_get - * Description : Searches for the CLA table data structure corresponding to a - * BAT entry. - * Input : struct tag_cqm_bat_table *bat_table, - * u32 entry_type - * Output : None - * Return Value : struct tag_cqm_cla_table * - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_cla_table_get - Searches for the CLA table data structure corresponding to a BAT entry + * @bat_table: bat entry + * @entry_type: cla table type + * + * RETURNS: + * Queried cla table */ struct tag_cqm_cla_table *cqm_cla_table_get(struct tag_cqm_bat_table *bat_table, u32 entry_type) diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c index e43b1679c..f4844d567 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c @@ -367,19 +367,21 @@ static s32 cqm_buf_unused_node_alloc_page(struct hinic3_hwdev *handle, struct ta return CQM_SUCCESS; }
-static const struct malloc_memory g_malloc_funcs[] = { +#define MALLOC_FUNCS_COUNT 2 +#define FREE_FUNCS_COUNT 1 +static const struct malloc_memory g_malloc_funcs[MALLOC_FUNCS_COUNT] = { {check_for_use_node_alloc, cqm_buf_use_node_alloc_page}, {check_for_nouse_node_alloc, cqm_buf_unused_node_alloc_page} };
-static const struct free_memory g_free_funcs[] = { +static const struct free_memory g_free_funcs[FREE_FUNCS_COUNT] = { {check_use_non_vram, cqm_buf_free_page_common} };
static s32 cqm_buf_alloc_page(struct tag_cqm_handle *cqm_handle, struct tag_cqm_buf *buf) { struct hinic3_hwdev *handle = cqm_handle->ex_handle; - u32 malloc_funcs_num = ARRAY_SIZE(g_malloc_funcs); + u32 malloc_funcs_num = MALLOC_FUNCS_COUNT; u32 i;
for (i = 0; i < malloc_funcs_num; i++) { @@ -396,7 +398,7 @@ static s32 cqm_buf_alloc_page(struct tag_cqm_handle *cqm_handle, struct tag_cqm_
static void cqm_buf_free_page(struct tag_cqm_buf *buf) { - u32 free_funcs_num = ARRAY_SIZE(g_free_funcs); + u32 free_funcs_num = FREE_FUNCS_COUNT; u32 i;
for (i = 0; i < free_funcs_num; i++) { diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c index 5ff669733..1d9198f09 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c @@ -23,13 +23,8 @@ #include "cqm_npu_cmd_defs.h"
/** - * Prototype : bloomfilter_init_cmd - * Description : host send cmd to ucode to init bloomfilter mem - * Input : void *ex_handle - * Output : None - * Return Value : s32 - * 1.Date : 2016/8/13 - * Modification : Created function + * bloomfilter_init_cmd - host send cmd to ucode to init bloomfilter mem + * @cqm_handle: CQM handle */ static s32 bloomfilter_init_cmd(struct tag_cqm_handle *cqm_handle) { @@ -195,13 +190,8 @@ static s32 cqm_fake_bloomfilter_init(struct tag_cqm_handle *cqm_handle) }
/** - * Prototype : cqm_bloomfilter_init - * Description : initialize the bloomfilter of cqm - * Input : void *ex_handle - * Output : None - * Return Value : s32 - * 1.Date : 2016/7/6 - * Modification : Created function + * cqm_bloomfilter_init - initialize the bloomfilter of cqm + * @ex_handle: device pointer that represents the PF */ s32 cqm_bloomfilter_init(void *ex_handle) { @@ -230,13 +220,8 @@ s32 cqm_bloomfilter_init(void *ex_handle) }
/** - * Prototype : cqm_bloomfilter_uninit - * Description : uninitialize the bloomfilter of cqm - * Input : void *ex_handle - * Output : None - * Return Value : void - * 1.Date : 2016/7/6 - * Modification : Created function + * cqm_bloomfilter_uninit - uninitialize the bloomfilter of cqm + * @ex_handle: device pointer that represents the PF */ void cqm_bloomfilter_uninit(void *ex_handle) { @@ -250,16 +235,12 @@ void cqm_bloomfilter_uninit(void *ex_handle) }
/** - * Prototype : cqm_bloomfilter_cmd - * Description : host send bloomfilter api cmd to ucode - * Input : void *ex_handle - * u32 op, - * u32 k_flag - * u64 id, - * Output : None - * Return Value : s32 - * 1.Date : 2016/7/7 - * Modification : Created function + * cqm_bloomfilter_cmd - host send bloomfilter api cmd to ucode + * @ex_handle: device pointer that represents the PF + * @func_id: function id + * @op: operation code + * @k_flag: kernel enable flag + * @id: the ID of the bloomfilter */ s32 cqm_bloomfilter_cmd(void *ex_handle, u16 func_id, u32 op, u32 k_flag, u64 id) { @@ -349,15 +330,10 @@ static struct tag_cqm_handle *cqm_get_func_cqm_handle(struct hinic3_hwdev *ex_ha }
/** - * Prototype : cqm_bloomfilter_inc - * Description : The reference counting field is added to the ID of the - * bloomfilter. - * Input : void *ex_handle - * u64 id--hash value - * Output : None - * Return Value : s32 - * 1.Date : 2016/7/7 - * Modification : Created function + * cqm_bloomfilter_inc - The reference counting field is added to the ID of the bloomfilter + * @ex_handle: device pointer that represents the PF + * @func_id: function id + * @id: the ID of the bloomfilter */ s32 cqm_bloomfilter_inc(void *ex_handle, u16 func_id, u64 id) { @@ -446,15 +422,10 @@ s32 cqm_bloomfilter_inc(void *ex_handle, u16 func_id, u64 id) EXPORT_SYMBOL(cqm_bloomfilter_inc);
/** - * Prototype : cqm_bloomfilter_dec - * Description : The reference counting field is decreased to the ID of the - * bloomfilter. - * Input : void *ex_handle - * u64 id--hash value - * Output : None - * Return Value : s32 - * 1.Date : 2016/7/7 - * Modification : Created function + * cqm_bloomfilter_dec - The reference counting field is decreased to the ID of the bloomfilter + * @ex_handle: device pointer that represents the PF + * @func_id: function id + * @id: the ID of the bloomfilter */ s32 cqm_bloomfilter_dec(void *ex_handle, u16 func_id, u64 id) { diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c index 413629ac1..cf7df37f2 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c @@ -15,17 +15,12 @@ #include "cqm_bitmap_table.h" #include "cqm_bat_cla.h" #include "cqm_main.h" +#include "cqm_cmd.h"
/** - * Prototype : cqm_cmd_alloc - * Description : Apply for a cmd buffer. The buffer size is fixed to 2 KB. - * The buffer content is not cleared and needs to be cleared by - * services. - * Input : void *ex_handle - * Output : None - * Return Value : struct tag_cqm_cmd_buf * - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_cmd_alloc - Apply for a cmd buffer. The buffer size is fixed to 2 KB, + * The buffer content is not cleared and needs to be cleared by services. + * @ex_handle: device pointer that represents the PF */ struct tag_cqm_cmd_buf *cqm_cmd_alloc(void *ex_handle) { @@ -43,14 +38,9 @@ struct tag_cqm_cmd_buf *cqm_cmd_alloc(void *ex_handle) EXPORT_SYMBOL(cqm_cmd_alloc);
/** - * Prototype : cqm_cmd_free - * Description : Release for a cmd buffer. - * Input : void *ex_handle - * struct tag_cqm_cmd_buf *cmd_buf - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_cmd_free - Release for a cmd buffer + * @ex_handle: device pointer that represents the PF + * @cmd_buf: command buffer */ void cqm_cmd_free(void *ex_handle, struct tag_cqm_cmd_buf *cmd_buf) { @@ -76,21 +66,16 @@ void cqm_cmd_free(void *ex_handle, struct tag_cqm_cmd_buf *cmd_buf) EXPORT_SYMBOL(cqm_cmd_free);
/** - * Prototype : cqm_send_cmd_box - * Description : Send a cmd message in box mode. - * This interface will mount a completion quantity, - * causing sleep. - * Input : void *ex_handle - * u8 mod - * u8 cmd, - * struct tag_cqm_cmd_buf *buf_in - * struct tag_cqm_cmd_buf *buf_out - * u64 *out_param - * u32 timeout - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_send_cmd_box - Send a cmd message in box mode, + * This interface will mount a completion quantity, causing sleep. + * @ex_handle: device pointer that represents the PF + * @mod: command module + * @cmd:command type + * @buf_in: data buffer in address + * @buf_out: data buffer out address + * @out_param: out paramer + * @timeout: out of time + * @channel: mailbox channel */ s32 cqm_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, struct tag_cqm_cmd_buf *buf_out, u64 *out_param, u32 timeout, @@ -121,22 +106,17 @@ s32 cqm_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *bu EXPORT_SYMBOL(cqm_send_cmd_box);
/** - * Prototype : cqm_lb_send_cmd_box - * Description : Send a cmd message in box mode and open cos_id. - * This interface will mount a completion quantity, - * causing sleep. - * Input : void *ex_handle - * u8 mod - * u8 cmd - * u8 cos_id - * struct tag_cqm_cmd_buf *buf_in - * struct tag_cqm_cmd_buf *buf_out - * u64 *out_param - * u32 timeout - * Output : None - * Return Value : s32 - * 1.Date : 2020/4/9 - * Modification : Created function + * cqm_lb_send_cmd_box - Send a cmd message in box mode and open cos_id, + * This interface will mount a completion quantity, causing sleep. + * @ex_handle: device pointer that represents the PF + * @mod: command module + * @cmd:command type + * @cos_id: cos id + * @buf_in: data buffer in address + * @buf_out: data buffer out address + * @out_param: out paramer + * @timeout: out of time + * @channel: mailbox channel */ s32 cqm_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, struct tag_cqm_cmd_buf *buf_in, struct tag_cqm_cmd_buf *buf_out, @@ -167,19 +147,14 @@ s32 cqm_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, EXPORT_SYMBOL(cqm_lb_send_cmd_box);
/** - * Prototype : cqm_lb_send_cmd_box_async - * Description : Send a cmd message in box mode and open cos_id. - * This interface will not wait completion - * Input : void *ex_handle - * u8 mod - * u8 cmd - * u8 cos_id - * struct tag_cqm_cmd_buf *buf_in - * u16 channel - * Output : None - * Return Value : s32 - * 1.Date : 2023/5/19 - * Modification : Created function + * cqm_lb_send_cmd_box_async - Send a cmd message in box mode and open cos_id, + * This interface will not wait completion + * @ex_handle: device pointer that represents the PF + * @mod: command module + * @cmd:command type + * @cos_id: cos id + * @buf_in: data buffer in address + * @channel: mailbox channel */ s32 cqm_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, struct tag_cqm_cmd_buf *buf_in, @@ -206,45 +181,3 @@ s32 cqm_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, (struct hinic3_cmd_buf *)buf_in, channel); } EXPORT_SYMBOL(cqm_lb_send_cmd_box_async); - -/** - * Prototype : cqm_send_cmd_imm - * Description : Send a cmd message in imm mode. - * This interface will mount a completion quantity, - * causing sleep. - * Input : void *ex_handle - * u8 mod - * u8 cmd - * struct tag_cqm_cmd_buf *buf_in - * u64 *out_param - * u32 timeout - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function - */ -s32 cqm_send_cmd_imm(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, - u64 *out_param, u32 timeout, u16 channel) -{ - struct hinic3_hwdev *handle = (struct hinic3_hwdev *)ex_handle; - - if (unlikely(!ex_handle)) { - pr_err("[CQM]%s: ex_handle is null\n", __func__); - return CQM_FAIL; - } - if (unlikely(!buf_in)) { - pr_err("[CQM]%s: buf_in is null\n", __func__); - return CQM_FAIL; - } - if (unlikely(!buf_in->buf)) { - pr_err("[CQM]%s: buf is null\n", __func__); - return CQM_FAIL; - } - - atomic_inc(&handle->hw_stats.cqm_stats.cqm_send_cmd_imm_cnt); - - return hinic3_cmdq_direct_resp((void *)ex_handle, mod, cmd, - (struct hinic3_cmd_buf *)buf_in, - out_param, timeout, channel); -} -EXPORT_SYMBOL(cqm_send_cmd_imm); diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.h b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.h index a5b85f12b..46eb8ec2c 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.h +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.h @@ -27,8 +27,6 @@ s32 cqm_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, s32 cqm_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, struct tag_cqm_cmd_buf *buf_in, u16 channel); -s32 cqm_send_cmd_imm(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, - u64 *out_param, u32 timeout, u16 channel);
#ifdef __cplusplus #if __cplusplus diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c index 59ed378ac..9a13ae072 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c @@ -21,17 +21,12 @@ #include "cqm_db.h"
/** - * Prototype : cqm_db_addr_alloc - * Description : Apply for a page of hardware doorbell and dwqe. - * The indexes are the same. The obtained addresses are physical - * addresses. Each function has a maximum of 1K addresses(DB). - * Input : void *ex_handle - * void __iomem **db_addr, - * void __iomem **dwqe_addr - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_db_addr_alloc - Apply for a page of hardware doorbell and dwqe. + * The indexes are the same. The obtained addresses are physical + * addresses. Each function has a maximum of 1K addresses(DB). + * @ex_handle: device pointer that represents the PF + * @db_addr: doorbell address + * @dwqe_addr: DWQE address */ s32 cqm_db_addr_alloc(void *ex_handle, void __iomem **db_addr, void __iomem **dwqe_addr) @@ -62,18 +57,12 @@ s32 cqm_db_phy_addr_alloc(void *ex_handle, u64 *db_paddr, u64 *dwqe_addr) }
/** - * Prototype : cqm_db_addr_free - * Description : Release a page of hardware doorbell and dwqe. - * Input : void *ex_handle - * const void __iomem **db_addr, - * void __iomem **dwqe_addr - * Output : None - * Return Value : void - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_db_addr_free - Release a page of hardware doorbell and dwqe + * @ex_handle: device pointer that represents the PF + * @db_addr: doorbell address + * @dwqe_addr: DWQE address */ -void cqm_db_addr_free(void *ex_handle, const void __iomem *db_addr, - void __iomem *dwqe_addr) +static void cqm_db_addr_free(void *ex_handle, const void __iomem *db_addr, void __iomem *dwqe_addr) { struct hinic3_hwdev *handle = (struct hinic3_hwdev *)ex_handle;
@@ -112,13 +101,8 @@ static bool cqm_need_db_init(s32 service) }
/** - * Prototype : cqm_db_init - * Description : Initialize the doorbell of the CQM. - * Input : void *ex_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/7/6 - * Modification : Created function + * cqm_db_init - Initialize the doorbell of the CQM + * @ex_handle: device pointer that represents the PF */ s32 cqm_db_init(void *ex_handle) { @@ -173,13 +157,8 @@ s32 cqm_db_init(void *ex_handle) }
/** - * Prototype : cqm_db_uninit - * Description : Deinitialize the doorbell of the CQM. - * Input : void *ex_handle - * Output : None - * Return Value : void - * 1.Date : 2015/7/6 - * Modification : Created function + * cqm_db_uninit - Deinitialize the doorbell of the CQM + * @ex_handle: device pointer that represents the PF */ void cqm_db_uninit(void *ex_handle) { @@ -203,14 +182,9 @@ void cqm_db_uninit(void *ex_handle) }
/** - * Prototype : cqm_get_db_addr - * Description : Return hardware DB vaddr. - * Input : void *ex_handle - * u32 service_type - * Output : None - * Return Value : void * - * 1.Date : 2015/7/6 - * Modification : Created function + * cqm_get_db_addr - Return hardware DB vaddr + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type */ void *cqm_get_db_addr(void *ex_handle, u32 service_type) { @@ -230,50 +204,13 @@ void *cqm_get_db_addr(void *ex_handle, u32 service_type) } EXPORT_SYMBOL(cqm_get_db_addr);
-s32 cqm_get_hardware_db_addr(void *ex_handle, u64 *addr, - enum hinic3_service_type service_type) -{ - struct tag_cqm_handle *cqm_handle = NULL; - struct tag_cqm_service *service = NULL; - struct hinic3_hwdev *handle = NULL; - - if (unlikely(!ex_handle)) { - pr_err("[CQM]%s: ex_handle is null\n", __func__); - return CQM_FAIL; - } - if (unlikely(!addr)) { - pr_err("[CQM]%s: addr is null\n", __func__); - return CQM_FAIL; - } - - if (service_type < SERVICE_T_NIC || service_type >= SERVICE_T_MAX) { - pr_err("%s service_type = %d state is error\n", __func__, - service_type); - return CQM_FAIL; - } - - handle = (struct hinic3_hwdev *)ex_handle; - cqm_handle = (struct tag_cqm_handle *)(handle->cqm_hdl); - service = &cqm_handle->service[service_type]; - - *addr = service->hardware_db_paddr; - return CQM_SUCCESS; -} -EXPORT_SYMBOL(cqm_get_hardware_db_addr); - /** - * Prototype : cqm_ring_hardware_db - * Description : Ring hardware DB to chip. - * Input : void *ex_handle - * u32 service_type: Each kernel-mode service is allocated a - * hardware db page. - * u8 db_count: The bit[7:0] of PI can't be store in 64-bit db. - * u64 db: It contains the content of db, whitch is organized by - * service, including big-endian conversion - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_ring_hardware_db - Ring hardware DB to chip + * @ex_handle: device pointer that represents the PF + * @service_type: Each kernel-mode service is allocated a hardware db page + * @db_count: The bit[7:0] of PI can't be store in 64-bit db + * @db: It contains the content of db, whitch is organized by + * service, including big-endian conversion. */ s32 cqm_ring_hardware_db(void *ex_handle, u32 service_type, u8 db_count, u64 db) { @@ -295,20 +232,13 @@ s32 cqm_ring_hardware_db(void *ex_handle, u32 service_type, u8 db_count, u64 db) EXPORT_SYMBOL(cqm_ring_hardware_db);
/** - * Prototype : cqm_ring_hardware_db_fc // Todo cqm_ring_fakevf_hardware_db - * Description : Ring fake vf hardware DB to chip. - * Input : void *ex_handle - * u32 service_type: Each kernel-mode service is allocated a - * hardware db page. - * u8 db_count: The bit[7:0] of PI can't be store in 64-bit db. - * u8 pagenum: Indicates the doorbell address offset of the fake - * VFID. - * u64 db: It contains the content of db, whitch is organized by - * service, including big-endian conversion. - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_ring_hardware_db_fc - Ring fake vf hardware DB to chip + * @ex_handle: device pointer that represents the PF + * @service_type: Each kernel-mode service is allocated a hardware db page + * @db_count: The bit[7:0] of PI can't be store in 64-bit db + * @pagenum: Indicates the doorbell address offset of the fake VFID + * @db: It contains the content of db, whitch is organized by + * service, including big-endian conversion. */ s32 cqm_ring_hardware_db_fc(void *ex_handle, u32 service_type, u8 db_count, u8 pagenum, u64 db) @@ -333,18 +263,11 @@ s32 cqm_ring_hardware_db_fc(void *ex_handle, u32 service_type, u8 db_count, }
/** - * Prototype : cqm_ring_direct_wqe_db // Todo <--cqm_ring_direct_wqe_db_fc - * Description : Ring direct wqe hardware DB to chip. - * Input : void *ex_handle - * u32 service_type: Each kernel-mode service is allocated a - * hardware db page. - * u8 db_count: The bit[7:0] of PI can't be store in 64-bit db. - * void *direct_wqe: The content of direct_wqe. - * u16 length: The length of direct_wqe. - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_ring_direct_wqe_db - Ring direct wqe hardware DB to chip + * @ex_handle: device pointer that represents the PF + * @service_type: Each kernel-mode service is allocated a hardware db page + * @db_count: The bit[7:0] of PI can't be store in 64-bit db + * @direct_wqe: The content of direct_wqe */ s32 cqm_ring_direct_wqe_db(void *ex_handle, u32 service_type, u8 db_count, void *direct_wqe) @@ -403,21 +326,15 @@ s32 cqm_ring_direct_wqe_db_fc(void *ex_handle, u32 service_type, }
/** - * Prototype : cqm_ring_hardware_db_update_pri - * Description : Provides the doorbell interface for the CQM to convert the PRI - * to the CoS. The doorbell transmitted by the service must be - * the host sequence. This interface converts the network - * sequence. - * Input : void *ex_handle - * u32 service_type: Each kernel-mode service is allocated a - * hardware db page. - * u8 db_count: The bit[7:0] of PI can't be store in 64-bit db. - * u64 db: It contains the content of db, whitch is organized by - * service, including big-endian conversion. - * Output : None - * Return Value : s32 - * 1.Date : 2016/11/24 - * Modification : Created function + * cqm_ring_hardware_db_update_pri - Provides the doorbell interface for the CQM to convert the PRI + * to the CoS. The doorbell transmitted by the service must be + * the host sequence. This interface converts the network + * sequence. + * @ex_handle: device pointer that represents the PF + * @service_type: Each kernel-mode service is allocated a hardware db page + * @db_count: The bit[7:0] of PI can't be store in 64-bit db + * @db: It contains the content of db, whitch is organized by + * service, including big-endian conversion. */ s32 cqm_ring_hardware_db_update_pri(void *ex_handle, u32 service_type, u8 db_count, u64 db) @@ -447,19 +364,12 @@ s32 cqm_ring_hardware_db_update_pri(void *ex_handle, u32 service_type, }
/** - * Prototype : cqm_ring_software_db - * Description : Ring software db. - * Input : struct tag_cqm_object *object - * u64 db_record: It contains the content of db, whitch is - * organized by service, including big-endian - * conversion. For RQ/SQ: This field is filled - * with the doorbell_record area of queue_header. - * For CQ: This field is filled with the value of - * ci_record in queue_header. - * Output : None - * Return Value : s32 - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_ring_software_db - Ring software db + * @object: CQM object + * @db_record: It contains the content of db, whitch is organized by service, + * including big-endian conversion. For RQ/SQ: This field is filled + * with the doorbell_record area of queue_header. For CQ: This field + * is filled with the value of ci_record in queue_header. */ s32 cqm_ring_software_db(struct tag_cqm_object *object, u64 db_record) { diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h index fd56354d4..2c227ae5e 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h @@ -11,12 +11,10 @@ #define cqm_bloomfilter_dec cqm3_bloomfilter_dec #define cqm_bloomfilter_inc cqm3_bloomfilter_inc #define cqm_cmd_alloc cqm3_cmd_alloc -#define cqm_get_hardware_db_addr cqm3_get_hardware_db_addr #define cqm_cmd_free cqm3_cmd_free #define cqm_send_cmd_box cqm3_send_cmd_box #define cqm_lb_send_cmd_box cqm3_lb_send_cmd_box #define cqm_lb_send_cmd_box_async cqm3_lb_send_cmd_box_async -#define cqm_send_cmd_imm cqm3_send_cmd_imm #define cqm_db_addr_alloc cqm3_db_addr_alloc #define cqm_db_addr_free cqm3_db_addr_free #define cqm_ring_hardware_db cqm3_ring_hardware_db @@ -43,8 +41,6 @@ #define cqm_function_hash_buf_clear cqm3_function_hash_buf_clear #define cqm_srq_used_rq_container_delete cqm3_srq_used_rq_container_delete #define cqm_timer_base cqm3_timer_base -#define cqm_dtoe_free_srq_bitmap_index cqm3_dtoe_free_srq_bitmap_index -#define cqm_dtoe_share_recv_queue_create cqm3_dtoe_share_recv_queue_create #define cqm_get_db_addr cqm3_get_db_addr #define cqm_ring_direct_wqe_db cqm3_ring_direct_wqe_db #define cqm_fake_vf_num_set cqm3_fake_vf_num_set diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_main.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_main.c index 4232ae0f3..19a8b56e0 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_main.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_main.c @@ -201,21 +201,16 @@ static s32 cqm_init_all(void *ex_handle) }
/** - * Prototype : cqm_init - * Description : Complete CQM initialization. - * If the function is a parent fake function, copy the fake. - * If it is a child fake function (in the fake copy function, - * not in this function), set fake_en in the BAT/CLA table. - * cqm_init->cqm_mem_init->cqm_fake_init(copy) - * If the child fake conflict occurs, resources are not - * initialized, but the timer must be enabled. - * If the function is of the normal type, - * follow the normal process. - * Input : void *ex_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_init - Complete CQM initialization. + * If the function is a parent fake function, copy the fake. + * If it is a child fake function (in the fake copy function, + * not in this function), set fake_en in the BAT/CLA table. + * cqm_init->cqm_mem_init->cqm_fake_init(copy) + * If the child fake conflict occurs, resources are not + * initialized, but the timer must be enabled. + * If the function is of the normal type, + * follow the normal process. + * @ex_handle: device pointer that represents the PF */ s32 cqm_init(void *ex_handle) { @@ -280,14 +275,9 @@ s32 cqm_init(void *ex_handle) }
/** - * Prototype : cqm_uninit - * Description : Deinitializes the CQM module. This function is called once - * each time a function is removed. - * Input : void *ex_handle - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_uninit - Deinitializes the CQM module. This function is called once each time + * a function is removed. + * @ex_handle: device pointer that represents the PF */ void cqm_uninit(void *ex_handle) { @@ -954,15 +944,9 @@ static void cqm_capability_init_cap_print(struct hinic3_hwdev *handle) }
/** - * Prototype : cqm_capability_init - * Description : Initializes the function and service capabilities of the CQM. - * Information needs to be read from the configuration management - * module. - * Input : void *ex_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/12/9 - * Modification : Created function + * cqm_capability_init - Initializes the function and service capabilities of the CQM. + * Information needs to be read from the configuration management module. + * @ex_handle: device pointer that represents the PF */ s32 cqm_capability_init(void *ex_handle) { @@ -1045,14 +1029,9 @@ static void set_fake_cqm_attr(struct hinic3_hwdev *handle, struct tag_cqm_handle }
/** - * Prototype : cqm_fake_init - * Description : When the fake VF mode is supported, the CQM handles of - * the fake VFs need to be copied. - * Input : struct tag_cqm_handle *cqm_handle: Parent CQM handle of the current PF - * Output : None - * Return Value : s32 - * 1.Date : 2020/4/15 - * Modification : Created function + * cqm_fake_init - When the fake VF mode is supported, the CQM handles of the fake VFs + * need to be copied. + * @cqm_handle: Parent CQM handle of the current PF */ static s32 cqm_fake_init(struct tag_cqm_handle *cqm_handle) { @@ -1128,13 +1107,8 @@ static void cqm_fake_mem_uninit(struct tag_cqm_handle *cqm_handle) }
/** - * Prototype : cqm_fake_mem_init - * Description : Initialize resources of the extended fake function. - * Input : struct tag_cqm_handle *cqm_handle: Parent CQM handle of the current PF - * Output : None - * Return Value : s32 - * 1.Date : 2020/4/15 - * Modification : Created function + * cqm_fake_mem_init - Initialize resources of the extended fake function + * @cqm_handle: Parent CQM handle of the current PF */ static s32 cqm_fake_mem_init(struct tag_cqm_handle *cqm_handle) { @@ -1191,13 +1165,8 @@ static s32 cqm_fake_mem_init(struct tag_cqm_handle *cqm_handle) }
/** - * Prototype : cqm_mem_init - * Description : Initialize CQM memory, including tables at different levels. - * Input : void *ex_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/7/6 - * Modification : Created function + * cqm_mem_init - Initialize CQM memory, including tables at different levels. + * @ex_handle: device pointer that represents the PF */ s32 cqm_mem_init(void *ex_handle) { @@ -1255,13 +1224,8 @@ s32 cqm_mem_init(void *ex_handle) }
/** - * Prototype : cqm_mem_uninit - * Description : Deinitialize CQM memory, including tables at different levels. - * Input : void *ex_handle - * Output : None - * Return Value : void - * 1.Date : 2015/7/6 - * Modification : Created function + * cqm_mem_uninit - Deinitialize CQM memory, including tables at different levels + * @ex_handle: device pointer that represents the PF */ void cqm_mem_uninit(void *ex_handle) { @@ -1279,13 +1243,8 @@ void cqm_mem_uninit(void *ex_handle) }
/** - * Prototype : cqm_event_init - * Description : Initialize CQM event callback. - * Input : void *ex_handle - * Output : None - * Return Value : s32 - * 1.Date : 2015/7/6 - * Modification : Created function + * cqm_event_init - Initialize CQM event callback + * @ex_handle: device pointer that represents the PF */ s32 cqm_event_init(void *ex_handle) { @@ -1328,13 +1287,8 @@ s32 cqm_event_init(void *ex_handle) }
/** - * Prototype : cqm_event_uninit - * Description : Deinitialize CQM event callback. - * Input : void *ex_handle - * Output : None - * Return Value : void - * 1.Date : 2015/7/6 - * Modification : Created function + * cqm_event_uninit - Deinitialize CQM event callback + * @ex_handle: device pointer that represents the PF */ void cqm_event_uninit(void *ex_handle) { @@ -1345,15 +1299,9 @@ void cqm_event_uninit(void *ex_handle) }
/** - * Prototype : cqm_scq_callback - * Description : CQM module callback processing for the ceq, - * which processes NON_L2NIC_SCQ. - * Input : void *ex_handle - * u32 ceqe_data - * Output : None - * Return Value : void - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_scq_callback - CQM module callback processing for the ceq, which processes NON_L2NIC_SCQ + * @ex_handle: device pointer that represents the PF + * @ceqe_data: CEQE data */ void cqm_scq_callback(void *ex_handle, u32 ceqe_data) { @@ -1406,15 +1354,9 @@ void cqm_scq_callback(void *ex_handle, u32 ceqe_data) }
/** - * Prototype : cqm_ecq_callback - * Description : CQM module callback processing for the ceq, - * which processes NON_L2NIC_ECQ. - * Input : void *ex_handle - * u32 ceqe_data - * Output : None - * Return Value : void - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_ecq_callback - CQM module callback processing for the ceq, which processes NON_L2NIC_ECQ. + * @ex_handle: device pointer that represents the PF + * @ceqe_data: CEQE data */ void cqm_ecq_callback(void *ex_handle, u32 ceqe_data) { @@ -1467,15 +1409,10 @@ void cqm_ecq_callback(void *ex_handle, u32 ceqe_data) }
/** - * Prototype : cqm_nocq_callback - * Description : CQM module callback processing for the ceq, - * which processes NON_L2NIC_NO_CQ_EQ. - * Input : void *ex_handle - * u32 ceqe_data - * Output : None - * Return Value : void - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_nocq_callback - CQM module callback processing for the ceq, + * which processes NON_L2NIC_NO_CQ_EQ + * @ex_handle: device pointer that represents the PF + * @ceqe_data: CEQE data */ void cqm_nocq_callback(void *ex_handle, u32 ceqe_data) { @@ -1555,15 +1492,10 @@ static u32 cqm_aeq_event2type(u8 event) }
/** - * Prototype : cqm_aeq_callback - * Description : CQM module callback processing for the aeq. - * Input : void *ex_handle - * u8 event - * u64 data - * Output : None - * Return Value : void - * 1.Date : 2015/5/5 - * Modification : Created function + * cqm_aeq_callback - CQM module callback processing for the aeq + * @ex_handle: device pointer that represents the PF + * @event: QEQ event + * @data: callback private data */ u8 cqm_aeq_callback(void *ex_handle, u8 event, u8 *data) { @@ -1619,15 +1551,9 @@ u8 cqm_aeq_callback(void *ex_handle, u8 event, u8 *data) }
/** - * Prototype : cqm_service_register - * Description : Callback template for the service driver - * to register with the CQM. - * Input : void *ex_handle - * struct tag_service_register_template *service_template - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/5 - * Modification : Created function + * cqm_service_register - Callback template for the service driver to register with the CQM + * @ex_handle: device pointer that represents the PF + * @service_template: CQM service template */ s32 cqm_service_register(void *ex_handle, struct tag_service_register_template *service_template) { @@ -1677,15 +1603,9 @@ s32 cqm_service_register(void *ex_handle, struct tag_service_register_template * EXPORT_SYMBOL(cqm_service_register);
/** - * Prototype : cqm_service_unregister - * Description : The service driver deregisters the callback function - * from the CQM. - * Input : void *ex_handle - * u32 service_type - * Output : None - * Return Value : void - * 1.Date : 2015/4/5 - * Modification : Created function + * cqm_service_unregister - The service driver deregisters the callback function from the CQM + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type */ void cqm_service_unregister(void *ex_handle, u32 service_type) { diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c index ea21ebf9b..7d1bd357a 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c @@ -23,21 +23,14 @@ #include "cqm_object.h"
/** - * Prototype : cqm_object_qpc_mpt_create - * Description : create QPC/MPT - * Input : void *ex_handle - * u32 service_type - * enum cqm_object_type object_type: must be mpt or ctx. - * u32 object_size: unit is Byte - * void *object_priv: private structure of the service layer, - * it can be NULL. - * u32 index: apply for the reserved qpn based on this value; - * if automatic allocation is required, - * please fill CQM_INDEX_INVALID. - * Output : None - * Return Value : struct tag_cqm_qpc_mpt * - * 1.Date : 2016/2/16 - * Modification : Created function + * cqm_object_qpc_mpt_create - create QPC/MPT + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type + * @object_type: object type, must be MPT or CTX. + * @object_size: object size, unit is Byte + * @object_priv: private structure of the service layer, it can be NULL. + * @index: apply for the reserved qpn based on this value, if automatic allocation is required, + * please fill CQM_INDEX_INVALID. */ struct tag_cqm_qpc_mpt *cqm_object_qpc_mpt_create(void *ex_handle, u32 service_type, enum cqm_object_type object_type, @@ -114,19 +107,14 @@ struct tag_cqm_qpc_mpt *cqm_object_qpc_mpt_create(void *ex_handle, u32 service_t EXPORT_SYMBOL(cqm_object_qpc_mpt_create);
/** - * Prototype : cqm_object_recv_queue_create - * Description : when srq is used, create rq. - * Input : void *ex_handle - * u32 service_type - * enum cqm_object_type object_type - * u32 init_rq_num - * u32 container_size - * u32 wqe_size - * void *object_priv - * Output : None - * Return Value : struct tag_cqm_queue * - * 1.Date : 2016/2/16 - * Modification : Created function + * cqm_object_recv_queue_create - when srq is used, create rq + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type + * @object_type: object type + * @init_rq_num: init RQ number + * @container_size: CQM queue container size + * @wqe_size: CQM WQE size + * @object_priv: RQ privite data */ struct tag_cqm_queue *cqm_object_recv_queue_create(void *ex_handle, u32 service_type, enum cqm_object_type object_type, @@ -233,13 +221,8 @@ struct tag_cqm_queue *cqm_object_recv_queue_create(void *ex_handle, u32 service_ EXPORT_SYMBOL(cqm_object_recv_queue_create);
/** - * Prototype : cqm_object_share_recv_queue_add_container - * Description : allocate new container for srq - * Input : struct tag_cqm_queue *common - * Output : None - * Return Value : tail_container address - * 1.Date : 2016/2/14 - * Modification : Created function + * cqm_object_share_recv_queue_add_container - allocate new container for srq + * @common: queue structure pointer */ s32 cqm_object_share_recv_queue_add_container(struct tag_cqm_queue *common) { @@ -305,18 +288,13 @@ static bool cqm_object_share_recv_queue_param_check(struct hinic3_hwdev *handle, }
/** - * Prototype : cqm_object_share_recv_queue_create - * Description : create srq - * Input : void *ex_handle - * u32 service_type - * enum cqm_object_type object_type - * u32 container_number - * u32 container_size - * u32 wqe_size - * Output : None - * Return Value : struct tag_cqm_queue * - * 1.Date : 2016/2/1 - * Modification : Created function + * cqm_object_share_recv_queue_create - create srq + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type + * @object_type: object type + * @container_number: CQM queue container number + * @container_size: CQM queue container size + * @wqe_size: CQM WQE size */ struct tag_cqm_queue *cqm_object_share_recv_queue_create(void *ex_handle, u32 service_type, enum cqm_object_type object_type, @@ -379,22 +357,18 @@ struct tag_cqm_queue *cqm_object_share_recv_queue_create(void *ex_handle, u32 se EXPORT_SYMBOL(cqm_object_share_recv_queue_create);
/** - * Prototype : cqm_object_fc_rq_create - * Description : RQ creation temporarily provided for the FC service. - * Special requirement: The number of valid WQEs in the queue - * must meet the number of transferred WQEs. Linkwqe can only be - * filled at the end of the page. The actual valid number exceeds - * the requirement. In this case, the service needs to be - * informed of the additional number to be created. - * Input : void *ex_handle - * u32 service_type - * enum cqm_object_type object_type - * u32 wqe_number: Number of valid WQEs - * u32 wqe_size - * void *object_priv - * Output : None - * 1.Date : 2016/3/1 - * Modification : Created function + * cqm_object_fc_srq_create - RQ creation temporarily provided for the FC service. + * Special requirement: The number of valid WQEs in the queue + * must meet the number of transferred WQEs. Linkwqe can only be + * filled at the end of the page. The actual valid number exceeds + * the requirement. In this case, the service needs to be + * informed of the additional number to be created. + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type + * @object_type: object type + * @wqe_number: number of valid WQEs + * @wqe_size: size of valid WQEs + * @object_priv: private structure of the service layer, it can be NULL */ struct tag_cqm_queue *cqm_object_fc_srq_create(void *ex_handle, u32 service_type, enum cqm_object_type object_type, @@ -533,20 +507,13 @@ static bool cqm_object_nonrdma_queue_param_check(struct hinic3_hwdev *handle, u3 }
/** - * Prototype : cqm_object_nonrdma_queue_create - * Description : create nonrdma queue - * Input : void *ex_handle - * u32 service_type - * enum cqm_object_type object_type: can be embedded RQ/SQ/CQ and - * SRQ/SCQ. - * u32 wqe_number: include link wqe - * u32 wqe_size: fixed length, must be power of 2 - * void *object_priv: private structure of the service layer, - * it can be NULL. - * Output : None - * Return Value : struct tag_cqm_queue * - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_nonrdma_queue_create - create nonrdma queue + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type + * @object_type: object type, can be embedded RQ/SQ/CQ and SRQ/SCQ + * @wqe_number: include link wqe + * @wqe_size: fixed length, must be power of 2 + * @object_priv: private structure of the service layer, it can be NULL */ struct tag_cqm_queue *cqm_object_nonrdma_queue_create(void *ex_handle, u32 service_type, enum cqm_object_type object_type, @@ -650,21 +617,14 @@ static bool cqm_object_rdma_queue_param_check(struct hinic3_hwdev *handle, u32 s }
/** - * Prototype : cqm_object_rdma_queue_create - * Description : create rdma queue - * Input : void *ex_handle - * u32 service_type - * enum cqm_object_type object_type: can be QP and SRQ/SCQ. - * u32 object_size - * void *object_priv: private structure of the service layer, - * it can be NULL. - * bool room_header_alloc: Whether to apply for queue room and - * header space - * u32 xid - * Output : None - * Return Value : struct tag_cqm_queue * - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_rdma_queue_create - create rdma queue + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type + * @object_type: object type, can be QP and SRQ/SCQ + * @object_size: object size + * @object_priv: private structure of the service layer, it can be NULL + * @room_header_alloc: Whether to apply for queue room and header space + * @xid: common index */ struct tag_cqm_queue *cqm_object_rdma_queue_create(void *ex_handle, u32 service_type, enum cqm_object_type object_type, @@ -737,17 +697,12 @@ struct tag_cqm_queue *cqm_object_rdma_queue_create(void *ex_handle, u32 service_ EXPORT_SYMBOL(cqm_object_rdma_queue_create);
/** - * Prototype : cqm_object_rdma_table_get - * Description : create mtt and rdmarc of the rdma service - * Input : void *ex_handle - * u32 service_type - * enum cqm_object_type object_type - * u32 index_base: start of index - * u32 index_number - * Output : None - * Return Value : struct tag_cqm_mtt_rdmarc * - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_rdma_table_get - create mtt and rdmarc of the rdma service + * @ex_handle: device pointer that represents the PF + * @service_type: CQM service type + * @object_type: object type + * @index_base: start of index + * @index_number: number of created */ struct tag_cqm_mtt_rdmarc *cqm_object_rdma_table_get(void *ex_handle, u32 service_type, enum cqm_object_type object_type, @@ -884,14 +839,9 @@ static s32 cqm_rdma_table_delete_ret(struct tag_cqm_object *object) }
/** - * Prototype : cqm_object_delete - * Description : Deletes a created object. This function will be sleep and wait - * for all operations on this object to be performed. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_delete - Deletes a created object. This function will be sleep and wait + * for all operations on this object to be performed. + * @object: CQM object */ void cqm_object_delete(struct tag_cqm_object *object) { @@ -952,17 +902,11 @@ void cqm_object_delete(struct tag_cqm_object *object) EXPORT_SYMBOL(cqm_object_delete);
/** - * Prototype : cqm_object_offset_addr - * Description : Only the rdma table can be searched to obtain the PA and VA - * at the specified offset of the object buffer. - * Input : struct tag_cqm_object *object - * u32 offset: For a rdma table, the offset is the absolute index - * number. - * dma_addr_t *paddr: PA(physical address) - * Output : None - * Return Value : u8 * - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_offset_addr - Only the rdma table can be searched to obtain the PA and VA + * at the specified offset of the object buffer. + * @object: CQM object + * @offset: For a rdma table, the offset is the absolute index number + * @paddr: physical address */ u8 *cqm_object_offset_addr(struct tag_cqm_object *object, u32 offset, dma_addr_t *paddr) { @@ -984,16 +928,11 @@ u8 *cqm_object_offset_addr(struct tag_cqm_object *object, u32 offset, dma_addr_t EXPORT_SYMBOL(cqm_object_offset_addr);
/** - * Prototype : cqm_object_get - * Description : Obtain an object based on the index. - * Input : void *ex_handle - * enum cqm_object_type object_type - * u32 index: support qpn,mptn,scqn,srqn (n->number) - * bool bh - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_get - Obtain an object based on the index + * @ex_handle: device pointer that represents the PF + * @object_type: object type + * @index: support qpn,mptn,scqn,srqn (n->number) + * @bh: barrier or not */ struct tag_cqm_object *cqm_object_get(void *ex_handle, enum cqm_object_type object_type, u32 index, bool bh) @@ -1038,14 +977,9 @@ struct tag_cqm_object *cqm_object_get(void *ex_handle, enum cqm_object_type obje EXPORT_SYMBOL(cqm_object_get);
/** - * Prototype : cqm_object_put - * Description : This function must be called after the cqm_object_get - * function. Otherwise, the object cannot be released. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_put - This function must be called after the cqm_object_get function. + * Otherwise, the object cannot be released. + * @object: CQM object */ void cqm_object_put(struct tag_cqm_object *object) { @@ -1058,14 +992,8 @@ void cqm_object_put(struct tag_cqm_object *object) EXPORT_SYMBOL(cqm_object_put);
/** - * Prototype : cqm_object_funcid - * Description : Obtain the ID of the function to which the object belongs. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : If successful, the ID of the function will be returned. - * If fail CQM_FAIL(-1) will be returned. - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_funcid - Obtain the ID of the function to which the object belongs + * @object: CQM object */ s32 cqm_object_funcid(struct tag_cqm_object *object) { @@ -1087,17 +1015,12 @@ s32 cqm_object_funcid(struct tag_cqm_object *object) EXPORT_SYMBOL(cqm_object_funcid);
/** - * Prototype : cqm_object_resize_alloc_new - * Description : Currently this function is only used for RoCE. - * The CQ buffer is ajusted, but the cqn and cqc remain - * unchanged. This function allocates new buffer, but do not - * release old buffer. The valid buffer is still old buffer. - * Input : struct tag_cqm_object *object - * u32 object_size - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_resize_alloc_new - Currently this function is only used for RoCE. The CQ buffer + * is ajusted, but the cqn and cqc remain unchanged. + * This function allocates new buffer, but do not release old buffer. + * The valid buffer is still old buffer. + * @object: CQM object + * @object_size: new buffer size */ s32 cqm_object_resize_alloc_new(struct tag_cqm_object *object, u32 object_size) { @@ -1162,16 +1085,10 @@ s32 cqm_object_resize_alloc_new(struct tag_cqm_object *object, u32 object_size) EXPORT_SYMBOL(cqm_object_resize_alloc_new);
/** - * Prototype : cqm_object_resize_free_new - * Description : Currently this function is only used for RoCE. - * The CQ buffer is ajusted, but the cqn and cqc remain - * unchanged. This function frees new buffer, and is used to deal - * with exceptions. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_resize_free_new - Currently this function is only used for RoCE. The CQ buffer + * is ajusted, but the cqn and cqc remain unchanged. This function + * frees new buffer, and is used to deal with exceptions. + * @object: CQM object */ void cqm_object_resize_free_new(struct tag_cqm_object *object) { @@ -1212,16 +1129,10 @@ void cqm_object_resize_free_new(struct tag_cqm_object *object) EXPORT_SYMBOL(cqm_object_resize_free_new);
/** - * Prototype : cqm_object_resize_free_old - * Description : Currently this function is only used for RoCE. - * The CQ buffer is ajusted, but the cqn and cqc remain - * unchanged. This function frees old buffer and switches the - * valid buffer to new buffer. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_object_resize_free_old - Currently this function is only used for RoCE. The CQ buffer + * is ajusted, but the cqn and cqc remain unchanged. This function + * frees old buffer and switches the valid buffer to new buffer. + * @object: CQM object */ void cqm_object_resize_free_old(struct tag_cqm_object *object) { @@ -1259,13 +1170,8 @@ void cqm_object_resize_free_old(struct tag_cqm_object *object) EXPORT_SYMBOL(cqm_object_resize_free_old);
/** - * Prototype : cqm_gid_base - * Description : Obtain the base virtual address of the gid table for FT - * debug. - * Input : void *ex_handle - * Output : None - * 1.Date : 2015/9/8 - * Modification : Created function + * cqm_gid_base - Obtain the base virtual address of the gid table for FT debug + * @ex_handle: device pointer that represents the PF */ void *cqm_gid_base(void *ex_handle) { @@ -1302,14 +1208,8 @@ void *cqm_gid_base(void *ex_handle) }
/** - * Prototype : cqm_timer_base - * Description : Obtain the base virtual address of the timer for live - * migration. - * Input : void *ex_handle - * Output : None - * Return Value : void - * 1.Date : 2020/5/21 - * Modification : Created function + * cqm_timer_base - Obtain the base virtual address of the timer for live migration + * @ex_handle: device pointer that represents the PF */ void *cqm_timer_base(void *ex_handle) { @@ -1449,16 +1349,11 @@ static void cqm_clear_timer(void *ex_handle, u32 function_id, struct hinic3_hwde }
/** - * Prototype : cqm_function_timer_clear - * Description : Clear the timer buffer based on the function ID. - * The function ID starts from 0 and the timer buffer is arranged - * in sequence by function ID. - * Input : void *ex_handle - * u32 functionid - * Output : None - * Return Value : void - * 1.Date : 2016/12/19 - * Modification : Created function + * cqm_function_timer_clear - Clear the timer buffer based on the function ID. + * The function ID starts from 0 and the timer buffer is arranged + * in sequence by function ID. + * @ex_handle: device pointer that represents the PF + * @function_id: the function id of CQM timer */ void cqm_function_timer_clear(void *ex_handle, u32 function_id) { @@ -1502,16 +1397,9 @@ void cqm_function_timer_clear(void *ex_handle, u32 function_id) EXPORT_SYMBOL(cqm_function_timer_clear);
/** - * Prototype : cqm_function_hash_buf_clear - * Description : clear hash buffer based on global function_id - * Input : void *ex_handle - * s32 global_funcid - * Output : None - * Return Value : None - * 1.Date : 2017/11/27 - * Modification : Created function - * 2.Date : 2021/02/23 - * Modification : Add para func_id; clear hash buf by func_id + * cqm_function_hash_buf_clear - clear hash buffer based on global function_id + * @ex_handle: device pointer that represents the PF + * @global_funcid: the function id of clear hash buf */ void cqm_function_hash_buf_clear(void *ex_handle, s32 global_funcid) { @@ -1600,65 +1488,3 @@ void cqm_srq_used_rq_container_delete(struct tag_cqm_object *object, u8 *contain kfree((void *)addr); } EXPORT_SYMBOL(cqm_srq_used_rq_container_delete); - -s32 cqm_dtoe_share_recv_queue_create(void *ex_handle, u32 contex_size, - u32 *index_count, u32 *index) -{ - struct hinic3_hwdev *handle = (struct hinic3_hwdev *)ex_handle; - struct tag_cqm_toe_private_capability *tow_own_cap = NULL; - struct tag_cqm_handle *cqm_handle = NULL; - struct tag_cqm_bitmap *bitmap = NULL; - u32 step; - - if (unlikely(!ex_handle)) { - pr_err("[CQM]%s: ex_handle is null\n", __func__); - return CQM_FAIL; - } - if (unlikely(!index_count)) { - pr_err("[CQM]%s: index_count is null\n", __func__); - return CQM_FAIL; - } - if (unlikely(!index)) { - pr_err("[CQM]%s: index is null\n", __func__); - return CQM_FAIL; - } - - cqm_handle = (struct tag_cqm_handle *)(handle->cqm_hdl); - tow_own_cap = &cqm_handle->toe_own_capability; - - bitmap = &tow_own_cap->srqc_bitmap; - *index_count = (ALIGN(contex_size, tow_own_cap->toe_srqc_basic_size)) / - tow_own_cap->toe_srqc_basic_size; - /* toe srqc number must align of 2 */ - step = ALIGN(tow_own_cap->toe_srqc_number, 2); - *index = cqm_bitmap_alloc(bitmap, step, *index_count, - cqm_handle->func_capability.xid_alloc_mode); - if (*index >= bitmap->max_num) { - cqm_err(handle->dev_hdl, "Srq create: queue index %u exceeds max_num %u\n", - *index, bitmap->max_num); - return CQM_FAIL; - } - *index += tow_own_cap->toe_srqc_start_id; - - atomic_inc(&handle->hw_stats.cqm_stats.cqm_srq_create_cnt); - - return CQM_SUCCESS; -} -EXPORT_SYMBOL(cqm_dtoe_share_recv_queue_create); - -void cqm_dtoe_free_srq_bitmap_index(void *ex_handle, u32 index_count, u32 index) -{ - struct hinic3_hwdev *handle = (struct hinic3_hwdev *)ex_handle; - struct tag_cqm_handle *cqm_handle = NULL; - struct tag_cqm_bitmap *bitmap = NULL; - - if (unlikely(!ex_handle)) { - pr_err("[CQM]%s: ex_handle is null\n", __func__); - return; - } - - cqm_handle = (struct tag_cqm_handle *)(handle->cqm_hdl); - bitmap = &cqm_handle->toe_own_capability.srqc_bitmap; - cqm_bitmap_free(bitmap, index, index_count); -} -EXPORT_SYMBOL(cqm_dtoe_free_srq_bitmap_index); diff --git a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c index d149d54f7..92c19c42a 100644 --- a/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c +++ b/drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c @@ -24,20 +24,13 @@ #define srq_obj_intern_if_section
/** - * Prototype : cqm_container_free - * Description : Only the container buffer is released. The buffer in the WQE - * and fast link tables are not involved. - * Containers can be released from head to tail, including head - * and tail. This function does not modify the start and - * end pointers of qinfo records. - * Input : u8 *srq_head_container - * u8 *srq_tail_container: If it is NULL, it means to release - * container from head to tail. - * struct tag_cqm_queue *common - * Output : None - * Return Value : void - * 1.Date : 2016/2/1 - * Modification : Created function + * cqm_container_free - Only the container buffer is released. The buffer in the WQE + * and fast link tables are not involved. Containers can be released + * from head to tail, including head and tail. This function does not + * modify the start and end pointers of qinfo records. + * @srq_head_container: head pointer of the containers be released + * @srq_tail_container: If it is NULL, it means to release container from head to tail + * @common: CQM nonrdma queue info */ void cqm_container_free(u8 *srq_head_container, u8 *srq_tail_container, struct tag_cqm_queue *common) @@ -111,16 +104,11 @@ void cqm_container_free(u8 *srq_head_container, u8 *srq_tail_container, }
/** - * Prototype : cqm_container_create - * Description : Create a container for the RQ or SRQ, link it to the tail of - * the queue, and update the tail container pointer of the queue. - * Input : struct tag_cqm_object *object - * u8 **container_addr - * bool link - * Output : None - * Return Value : s32 - * 1.Date : 2016/2/16 - * Modification : Created function + * cqm_container_create - Create a container for the RQ or SRQ, link it to the tail of the queue, + * and update the tail container pointer of the queue. + * @object: CQM object + * @container_addr: the pointer of container created + * @link: if the SRQ is not empty, update the linkwqe of the tail container */ s32 cqm_container_create(struct tag_cqm_object *object, u8 **container_addr, bool link) { @@ -216,13 +204,8 @@ s32 cqm_container_create(struct tag_cqm_object *object, u8 **container_addr, boo }
/** - * Prototype : cqm_srq_container_init - * Description : Initialize the SRQ to create all containers and link them. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : s32 - * 1.Date : 2016/2/3 - * Modification : Created function + * cqm_srq_container_init - Initialize the SRQ to create all containers and link them + * @object: CQM object */ static s32 cqm_srq_container_init(struct tag_cqm_object *object) { @@ -268,13 +251,8 @@ static s32 cqm_srq_container_init(struct tag_cqm_object *object) }
/** - * Prototype : cqm_share_recv_queue_create - * Description : Create SRQ(share receive queue) - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : s32 - * 1.Date : 2016/1/27 - * Modification : Created function + * cqm_share_recv_queue_create - Create SRQ(share receive queue) + * @object: CQM object */ s32 cqm_share_recv_queue_create(struct tag_cqm_object *object) { @@ -336,13 +314,8 @@ s32 cqm_share_recv_queue_create(struct tag_cqm_object *object) }
/** - * Prototype : cqm_srq_used_rq_delete - * Description : Delete RQ in TOE SRQ mode. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2016/5/19 - * Modification : Created function + * cqm_srq_used_rq_delete - Delete RQ in TOE SRQ mode + * @object: CQM object */ static void cqm_srq_used_rq_delete(const struct tag_cqm_object *object) { @@ -394,15 +367,10 @@ static void cqm_srq_used_rq_delete(const struct tag_cqm_object *object) }
/** - * Prototype : cqm_share_recv_queue_delete - * Description : The SRQ object is deleted. Delete only containers that are not - * used by SRQ, that is, containers from the head to the tail. - * The RQ releases containers that have been used by the RQ. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2016/2/2 - * Modification : Created function + * cqm_share_recv_queue_delete - The SRQ object is deleted. Delete only containers that are not + * used by SRQ, that is, containers from the head to the tail. + * The RQ releases containers that have been used by the RQ. + * @object: CQM object */ void cqm_share_recv_queue_delete(struct tag_cqm_object *object) { @@ -444,14 +412,10 @@ void cqm_share_recv_queue_delete(struct tag_cqm_object *object) #define CQM_IDX_VALID_SHIFT 29
/** - * Prototype : cqm_qpc_mpt_bitmap_alloc - * Description : Apply for index from the bitmap when creating QPC or MPT. - * Input : struct tag_cqm_object *object - * struct tag_cqm_cla_table *cla_table - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_qpc_mpt_bitmap_alloc - Apply for index from the bitmap when creating QPC or MPT + * @object: CQM object + * @cla_table: CLA table entry + * @low2bit_align_en: enable alignment of the lower two bits */ static s32 cqm_qpc_mpt_bitmap_alloc(struct tag_cqm_object *object, struct tag_cqm_cla_table *cla_table, bool low2bit_align_en) @@ -511,13 +475,9 @@ static s32 cqm_qpc_mpt_bitmap_alloc(struct tag_cqm_object *object, }
/** - * Prototype : cqm_qpc_mpt_create - * Description : Create QPC or MPT - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_qpc_mpt_create - Create QPC or MPT + * @object: CQM object + * @low2bit_align_en: enable alignment of the lower two bits */ s32 cqm_qpc_mpt_create(struct tag_cqm_object *object, bool low2bit_align_en) { @@ -610,13 +570,8 @@ s32 cqm_qpc_mpt_create(struct tag_cqm_object *object, bool low2bit_align_en) }
/** - * Prototype : cqm_qpc_mpt_delete - * Description : Delete QPC or MPT. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_qpc_mpt_delete - Delete QPC or MPT + * @object: CQM object */ void cqm_qpc_mpt_delete(struct tag_cqm_object *object) { @@ -687,17 +642,14 @@ void cqm_qpc_mpt_delete(struct tag_cqm_object *object) }
/** - * Prototype : cqm_linkwqe_fill - * Description : Used to organize the queue buffer of non-RDMA services and - * fill the link wqe. - * Input : wqe_per_buf: Linkwqe is not included. - * wqe_number: Linkwqe is not included. - * tail: true - The linkwqe must be at the end of the page; - * false - The linkwqe can be not at the end of the page. - * Output : None - * Return Value : void - * 1.Date : 2015/6/15 - * Modification : Created function + * cqm_linkwqe_fill - Used to organize the queue buffer of non-RDMA services and fill the link wqe + * @buf: CQM queue buffer + * @wqe_per_buf: Linkwqe is not included + * @wqe_size: Linkwqe size + * @wqe_number: Linkwqe number + * @tail: true - The linkwqe must be at the end of the page; + * false - The linkwqe can be not at the end of the page. + * @link_mode: Link mode */ static void cqm_linkwqe_fill(struct tag_cqm_buf *buf, u32 wqe_per_buf, u32 wqe_size, u32 wqe_number, bool tail, u8 link_mode) @@ -877,13 +829,8 @@ static s32 cqm_nonrdma_queue_ctx_create(struct tag_cqm_object *object) }
/** - * Prototype : cqm_nonrdma_queue_create - * Description : Create a queue for non-RDMA services. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_nonrdma_queue_create - Create a queue for non-RDMA services + * @object: CQM object */ s32 cqm_nonrdma_queue_create(struct tag_cqm_object *object) { @@ -984,13 +931,8 @@ s32 cqm_nonrdma_queue_create(struct tag_cqm_object *object) }
/** - * Prototype : cqm_nonrdma_queue_delete - * Description : Delete the queues of non-RDMA services. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_nonrdma_queue_delete - Delete the queues of non-RDMA services + * @object: CQM object */ void cqm_nonrdma_queue_delete(struct tag_cqm_object *object) { @@ -1162,13 +1104,8 @@ static s32 cqm_rdma_queue_ctx_create(struct tag_cqm_object *object) }
/** - * Prototype : cqm_rdma_queue_create - * Description : Create rdma queue. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_rdma_queue_create - Create rdma queue + * @object: CQM object */ s32 cqm_rdma_queue_create(struct tag_cqm_object *object) { @@ -1246,13 +1183,8 @@ s32 cqm_rdma_queue_create(struct tag_cqm_object *object) }
/** - * Prototype : cqm_rdma_queue_delete - * Description : Create rdma queue. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_rdma_queue_delete - Create rdma queue + * @object: CQM object */ void cqm_rdma_queue_delete(struct tag_cqm_object *object) { @@ -1330,13 +1262,8 @@ void cqm_rdma_queue_delete(struct tag_cqm_object *object) }
/** - * Prototype : cqm_rdma_table_create - * Description : Create RDMA-related entries. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : s32 - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_rdma_table_create - Create RDMA-related entries + * @object: CQM object */ s32 cqm_rdma_table_create(struct tag_cqm_object *object) { @@ -1379,13 +1306,8 @@ s32 cqm_rdma_table_create(struct tag_cqm_object *object) }
/** - * Prototype : cqm_rdma_table_create - * Description : Delete RDMA-related Entries. - * Input : struct tag_cqm_object *object - * Output : None - * Return Value : void - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_rdma_table_delete - Delete RDMA-related Entries + * @object: CQM object */ void cqm_rdma_table_delete(struct tag_cqm_object *object) { @@ -1411,16 +1333,10 @@ void cqm_rdma_table_delete(struct tag_cqm_object *object) }
/** - * Prototype : cqm_rdma_table_offset_addr - * Description : Obtain the address of the RDMA entry based on the offset. - * The offset is the index. - * Input : struct tag_cqm_object *object - * u32 offset - * dma_addr_t *paddr - * Output : None - * Return Value : u8 * - * 1.Date : 2015/4/15 - * Modification : Created function + * cqm_rdma_table_offset_addr - Obtain the address of the RDMA entry based on the offset + * @object: CQM object + * @offset: The offset is the index + * @paddr: dma physical addr */ u8 *cqm_rdma_table_offset_addr(struct tag_cqm_object *object, u32 offset, dma_addr_t *paddr) { diff --git a/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c b/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c index 21951bde3..cea7581cf 100644 --- a/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c +++ b/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c @@ -1090,7 +1090,7 @@ void free_cfg_mgmt(struct hinic3_hwdev *dev) }
/** - * hinic_set_vf_dev_cap - Set max queue num for VF + * hinic3_init_vf_dev_cap - Set max queue num for VF * @hwdev: the HW device for VF */ int hinic3_init_vf_dev_cap(void *hwdev) diff --git a/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c b/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c index 648454042..33f121035 100644 --- a/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c +++ b/drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c @@ -856,44 +856,6 @@ u16 hinic3_global_func_id(void *hwdev) } EXPORT_SYMBOL(hinic3_global_func_id);
-/** - * get function id from register,used by sriov hot migration process - * @hwdev: the pointer to hw device - */ -u16 hinic3_global_func_id_hw(void *hwdev) -{ - u32 addr, attr0; - struct hinic3_hwdev *dev; - - dev = (struct hinic3_hwdev *)hwdev; - addr = HINIC3_CSR_FUNC_ATTR0_ADDR; - attr0 = hinic3_hwif_read_reg(dev->hwif, addr); - - return HINIC3_AF0_GET(attr0, FUNC_GLOBAL_IDX); -} - -/** - * get function id, used by sriov hot migratition process. - * @hwdev: the pointer to hw device - * @func_id: function id - */ -int hinic3_global_func_id_get(void *hwdev, u16 *func_id) -{ - struct hinic3_hwdev *dev = (struct hinic3_hwdev *)hwdev; - - if (!hwdev || !func_id) - return -EINVAL; - - /* only vf get func_id from chip reg for sriov migrate */ - if (!HINIC3_IS_VF(dev)) { - *func_id = hinic3_global_func_id(hwdev); - return 0; - } - - *func_id = hinic3_global_func_id_hw(dev); - return 0; -} - u16 hinic3_intr_num(void *hwdev) { struct hinic3_hwif *hwif = NULL; diff --git a/drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c b/drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c index 254fcd165..354841080 100644 --- a/drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c @@ -20,7 +20,6 @@ #include "hinic3_api_cmd.h" #include "hinic3_mgmt.h" #include "hinic3_mbox.h" -#include "hinic3_hwif.h" #include "hinic3_multi_host_mgmt.h" #include "hinic3_hw_cfg.h"
@@ -43,7 +42,7 @@ void set_master_host_mbox_enable(struct hinic3_hwdev *hwdev, bool enable) enable, reg_val); }
-bool hinic3_get_master_host_mbox_enable(void *hwdev) +static bool hinic3_get_master_host_mbox_enable(void *hwdev) { u32 reg_val; struct hinic3_hwdev *dev = hwdev; @@ -145,10 +144,10 @@ static int __send_mbox_to_host(struct hinic3_hwdev *mbox_hwdev, mod, cmd, buf_in, in_size, channel); }
-int __mbox_to_host(struct hinic3_hwdev *hwdev, enum hinic3_mod_type mod, - u8 cmd, void *buf_in, u16 in_size, void *buf_out, - u16 *out_size, u32 timeout, - enum hinic3_mbox_ack_type ack_type, u16 channel) +static int __mbox_to_host(struct hinic3_hwdev *hwdev, enum hinic3_mod_type mod, + u8 cmd, void *buf_in, u16 in_size, void *buf_out, + u16 *out_size, u32 timeout, + enum hinic3_mbox_ack_type ack_type, u16 channel) { struct hinic3_hwdev *mbox_hwdev = hwdev; int err; @@ -544,9 +543,9 @@ static int __slave_host_sw_func_handler(struct hinic3_hwdev *hwdev, u16 pf_idx, return err; }
-int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, - void *buf_in, u16 in_size, void *buf_out, - u16 *out_size) +static int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, + void *buf_in, u16 in_size, void *buf_out, + u16 *out_size) { struct hinic3_hwdev *hwdev = handle; int err; @@ -567,9 +566,9 @@ int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, return err; }
-int __ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, - enum hinic3_mod_type mod, u8 cmd, void *buf_in, - u16 in_size, void *buf_out, u16 *out_size) +static int __ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, + enum hinic3_mod_type mod, u8 cmd, void *buf_in, + u16 in_size, void *buf_out, u16 *out_size) { /* when not support return err */ int err = -EFAULT; @@ -596,9 +595,9 @@ int __ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, return err; }
-int hinic3_ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, - enum hinic3_mod_type mod, u8 cmd, void *buf_in, - u16 in_size, void *buf_out, u16 *out_size) +static int hinic3_ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, + enum hinic3_mod_type mod, u8 cmd, void *buf_in, + u16 in_size, void *buf_out, u16 *out_size) { bool same_host = false; int err = -EFAULT; @@ -640,34 +639,34 @@ int hinic3_ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_i return err; }
-int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, - void *buf_in, u16 in_size, void *buf_out, - u16 *out_size) +static int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, + void *buf_in, u16 in_size, void *buf_out, + u16 *out_size) { return hinic3_ppf_process_mbox_msg(handle, pf_idx, vf_id, HINIC3_MOD_COMM, (u8)cmd, buf_in, in_size, buf_out, out_size); }
-int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, - void *buf_in, u16 in_size, - void *buf_out, u16 *out_size) +static int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, + void *buf_in, u16 in_size, + void *buf_out, u16 *out_size) { return hinic3_ppf_process_mbox_msg(handle, pf_idx, vf_id, HINIC3_MOD_HILINK, (u8)cmd, buf_in, in_size, buf_out, out_size); }
-int hinic3_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, - void *buf_in, u16 in_size, - void *buf_out, u16 *out_size) +static int hinic3_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, + void *buf_in, u16 in_size, + void *buf_out, u16 *out_size) { return hinic3_ppf_process_mbox_msg(handle, pf_idx, vf_id, HINIC3_MOD_L2NIC, (u8)cmd, buf_in, in_size, buf_out, out_size); }
-int hinic3_register_slave_ppf(struct hinic3_hwdev *hwdev, bool registered) +static int hinic3_register_slave_ppf(struct hinic3_hwdev *hwdev, bool registered) { struct register_slave_host *host_info = NULL; u16 out_size = sizeof(struct register_slave_host); @@ -740,8 +739,8 @@ static int get_host_id_by_func_id(struct hinic3_hwdev *hwdev, u16 func_idx, return -EFAULT; }
-int set_slave_func_nic_state(struct hinic3_hwdev *hwdev, - struct hinic3_func_nic_state *state) +static int set_slave_func_nic_state(struct hinic3_hwdev *hwdev, + struct hinic3_func_nic_state *state) { struct hinic3_slave_func_nic_state nic_state = {0}; u16 out_size = sizeof(nic_state); @@ -773,8 +772,7 @@ int set_slave_func_nic_state(struct hinic3_hwdev *hwdev, return 0; }
-int get_slave_func_netdev_state(struct hinic3_hwdev *hwdev, u16 func_idx, - int *opened) +static int get_slave_func_netdev_state(struct hinic3_hwdev *hwdev, u16 func_idx, int *opened) { struct hinic3_slave_func_nic_state nic_state = {0}; u16 out_size = sizeof(nic_state); diff --git a/drivers/net/ethernet/huawei/hinic3/include/bond/bond_common_defs.h b/drivers/net/ethernet/huawei/hinic3/include/bond/bond_common_defs.h index 5ae3f4e5e..9e8fc750c 100644 --- a/drivers/net/ethernet/huawei/hinic3/include/bond/bond_common_defs.h +++ b/drivers/net/ethernet/huawei/hinic3/include/bond/bond_common_defs.h @@ -16,7 +16,7 @@ enum bond_group_id { BOND_MAX_NUM, };
-#pragma pack(4) +#pragma pack(push, 4) /** * bond per port statistics */ @@ -33,7 +33,7 @@ struct tag_bond_port_stat { u64 tx_errors; };
-#pragma pack() +#pragma pack(pop)
/** * bond port attribute diff --git a/drivers/net/ethernet/huawei/hinic3/include/hinic3_common.h b/drivers/net/ethernet/huawei/hinic3/include/hinic3_common.h index 73cb1335a..d9f67e26a 100644 --- a/drivers/net/ethernet/huawei/hinic3/include/hinic3_common.h +++ b/drivers/net/ethernet/huawei/hinic3/include/hinic3_common.h @@ -149,8 +149,6 @@ int hinic3_wait_for_timeout(void *priv_data, wait_cpl_handler handler, /* func_attr.glb_func_idx, global function index */ u16 hinic3_global_func_id(void *hwdev);
-int hinic3_global_func_id_get(void *hwdev, u16 *func_id); - /* func_attr.p2p_idx, belongs to which pf */ u8 hinic3_pf_id_of_vf(void *hwdev);
diff --git a/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm.h b/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm.h index 6653460fc..47857a3c4 100644 --- a/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm.h +++ b/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm.h @@ -293,10 +293,6 @@ s32 cqm3_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, s32 cqm3_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, struct tag_cqm_cmd_buf *buf_in, u16 channel);
-s32 cqm3_send_cmd_imm(void *ex_handle, u8 mod, u8 cmd, - struct tag_cqm_cmd_buf *buf_in, u64 *out_param, - u32 timeout, u16 channel); - s32 cqm3_db_addr_alloc(void *ex_handle, void __iomem **db_addr, void __iomem **dwqe_addr); void cqm3_db_addr_free(void *ex_handle, const void __iomem *db_addr, void __iomem *dwqe_addr); @@ -304,8 +300,6 @@ void cqm3_db_addr_free(void *ex_handle, const void __iomem *db_addr, void *cqm3_get_db_addr(void *ex_handle, u32 service_type); s32 cqm3_ring_hardware_db(void *ex_handle, u32 service_type, u8 db_count, u64 db);
-s32 cqm3_get_hardware_db_addr(void *ex_handle, u64 *addr, u32 service_type); - s32 cqm_ring_hardware_db_fc(void *ex_handle, u32 service_type, u8 db_count, u8 pagenum, u64 db); s32 cqm3_ring_hardware_db_update_pri(void *ex_handle, u32 service_type, u8 db_count, u64 db); s32 cqm3_bloomfilter_inc(void *ex_handle, u16 func_id, u64 id); @@ -355,10 +349,5 @@ void cqm3_object_delete(struct tag_cqm_object *object); */ u8 *cqm3_object_offset_addr(struct tag_cqm_object *object, u32 offset, dma_addr_t *paddr);
-s32 cqm3_dtoe_share_recv_queue_create(void *ex_handle, u32 contex_size, - u32 *index_count, u32 *index); - -void cqm3_dtoe_free_srq_bitmap_index(void *ex_handle, u32 index_count, u32 index); - #endif /* CQM_H */
diff --git a/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm_define.h b/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm_define.h index 608b12510..71d6166e5 100644 --- a/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm_define.h +++ b/drivers/net/ethernet/huawei/hinic3/include/hinic3_cqm_define.h @@ -11,12 +11,10 @@ #define cqm_bloomfilter_dec cqm3_bloomfilter_dec #define cqm_bloomfilter_inc cqm3_bloomfilter_inc #define cqm_cmd_alloc cqm3_cmd_alloc -#define cqm_get_hardware_db_addr cqm3_get_hardware_db_addr #define cqm_cmd_free cqm3_cmd_free #define cqm_send_cmd_box cqm3_send_cmd_box #define cqm_lb_send_cmd_box cqm3_lb_send_cmd_box #define cqm_lb_send_cmd_box_async cqm3_lb_send_cmd_box_async -#define cqm_send_cmd_imm cqm3_send_cmd_imm #define cqm_db_addr_alloc cqm3_db_addr_alloc #define cqm_db_addr_free cqm3_db_addr_free #define cqm_ring_hardware_db cqm3_ring_hardware_db @@ -42,8 +40,6 @@ #define cqm_function_hash_buf_clear cqm3_function_hash_buf_clear #define cqm_srq_used_rq_container_delete cqm3_srq_used_rq_container_delete #define cqm_timer_base cqm3_timer_base -#define cqm_dtoe_free_srq_bitmap_index cqm3_dtoe_free_srq_bitmap_index -#define cqm_dtoe_share_recv_queue_create cqm3_dtoe_share_recv_queue_create #define cqm_get_db_addr cqm3_get_db_addr #define cqm_ring_direct_wqe_db cqm3_ring_direct_wqe_db #define cqm_fake_vf_num_set cqm3_fake_vf_num_set diff --git a/drivers/net/ethernet/huawei/hinic3/include/mpu/mpu_outband_ncsi_cmd_defs.h b/drivers/net/ethernet/huawei/hinic3/include/mpu/mpu_outband_ncsi_cmd_defs.h index 4e2e1eb91..fde8617e2 100644 --- a/drivers/net/ethernet/huawei/hinic3/include/mpu/mpu_outband_ncsi_cmd_defs.h +++ b/drivers/net/ethernet/huawei/hinic3/include/mpu/mpu_outband_ncsi_cmd_defs.h @@ -4,7 +4,7 @@ #ifndef MPU_OUTBAND_NCSI_CMD_DEFS_H #define MPU_OUTBAND_NCSI_CMD_DEFS_H
-#pragma pack(1) +#pragma pack(push, 1)
enum NCSI_RESPONSE_CODE_E { COMMAND_COMPLETED = 0x00, /**< command completed */ @@ -200,6 +200,6 @@ struct tg_g_ncsi_parameters { u16 vlan_tag[VLAN_FL_MAX_ID]; };
-#pragma pack() +#pragma pack(pop)
#endif