Lines Matching refs:cqp
75 static inline void i40iw_get_cqp_reg_info(struct i40iw_sc_cqp *cqp, in i40iw_get_cqp_reg_info() argument
80 if (cqp->dev->is_pf) { in i40iw_get_cqp_reg_info()
81 *val = i40iw_rd32(cqp->dev->hw, I40E_PFPE_CQPTAIL); in i40iw_get_cqp_reg_info()
85 *val = i40iw_rd32(cqp->dev->hw, I40E_VFPE_CQPTAIL1); in i40iw_get_cqp_reg_info()
98 struct i40iw_sc_cqp *cqp, in i40iw_cqp_poll_registers() argument
107 i40iw_get_cqp_reg_info(cqp, &val, &newtail, &error); in i40iw_cqp_poll_registers()
109 error = (cqp->dev->is_pf) ? in i40iw_cqp_poll_registers()
110 i40iw_rd32(cqp->dev->hw, I40E_PFPE_CQPERRCODES) : in i40iw_cqp_poll_registers()
111 i40iw_rd32(cqp->dev->hw, I40E_VFPE_CQPERRCODES1); in i40iw_cqp_poll_registers()
116 I40IW_RING_MOVE_TAIL(cqp->sq_ring); in i40iw_cqp_poll_registers()
117 cqp->dev->cqp_cmd_stats[OP_COMPLETED_COMMANDS]++; in i40iw_cqp_poll_registers()
455 static enum i40iw_status_code i40iw_sc_cqp_init(struct i40iw_sc_cqp *cqp, in i40iw_sc_cqp_init() argument
466 cqp->size = sizeof(*cqp); in i40iw_sc_cqp_init()
467 cqp->sq_size = info->sq_size; in i40iw_sc_cqp_init()
468 cqp->hw_sq_size = hw_sq_size; in i40iw_sc_cqp_init()
469 cqp->sq_base = info->sq; in i40iw_sc_cqp_init()
470 cqp->host_ctx = info->host_ctx; in i40iw_sc_cqp_init()
471 cqp->sq_pa = info->sq_pa; in i40iw_sc_cqp_init()
472 cqp->host_ctx_pa = info->host_ctx_pa; in i40iw_sc_cqp_init()
473 cqp->dev = info->dev; in i40iw_sc_cqp_init()
474 cqp->struct_ver = info->struct_ver; in i40iw_sc_cqp_init()
475 cqp->scratch_array = info->scratch_array; in i40iw_sc_cqp_init()
476 cqp->polarity = 0; in i40iw_sc_cqp_init()
477 cqp->en_datacenter_tcp = info->en_datacenter_tcp; in i40iw_sc_cqp_init()
478 cqp->enabled_vf_count = info->enabled_vf_count; in i40iw_sc_cqp_init()
479 cqp->hmc_profile = info->hmc_profile; in i40iw_sc_cqp_init()
480 info->dev->cqp = cqp; in i40iw_sc_cqp_init()
482 I40IW_RING_INIT(cqp->sq_ring, cqp->sq_size); in i40iw_sc_cqp_init()
483 cqp->dev->cqp_cmd_stats[OP_REQUESTED_COMMANDS] = 0; in i40iw_sc_cqp_init()
484 cqp->dev->cqp_cmd_stats[OP_COMPLETED_COMMANDS] = 0; in i40iw_sc_cqp_init()
485 INIT_LIST_HEAD(&cqp->dev->cqp_cmd_head); /* for the cqp commands backlog. */ in i40iw_sc_cqp_init()
487 i40iw_wr32(cqp->dev->hw, I40E_PFPE_CQPTAIL, 0); in i40iw_sc_cqp_init()
488 i40iw_wr32(cqp->dev->hw, I40E_PFPE_CQPDB, 0); in i40iw_sc_cqp_init()
490 i40iw_debug(cqp->dev, I40IW_DEBUG_WQE, in i40iw_sc_cqp_init()
492 __func__, cqp->sq_size, cqp->hw_sq_size, in i40iw_sc_cqp_init()
493 cqp->sq_base, cqp->sq_pa, cqp, cqp->polarity); in i40iw_sc_cqp_init()
503 static enum i40iw_status_code i40iw_sc_cqp_create(struct i40iw_sc_cqp *cqp, in i40iw_sc_cqp_create() argument
514 ret_code = i40iw_allocate_dma_mem(cqp->dev->hw, in i40iw_sc_cqp_create()
515 &cqp->sdbuf, in i40iw_sc_cqp_create()
516 I40IW_UPDATE_SD_BUF_SIZE * cqp->sq_size, in i40iw_sc_cqp_create()
522 temp = LS_64(cqp->hw_sq_size, I40IW_CQPHC_SQSIZE) | in i40iw_sc_cqp_create()
523 LS_64(cqp->struct_ver, I40IW_CQPHC_SVER); in i40iw_sc_cqp_create()
525 set_64bit_val(cqp->host_ctx, 0, temp); in i40iw_sc_cqp_create()
526 set_64bit_val(cqp->host_ctx, 8, cqp->sq_pa); in i40iw_sc_cqp_create()
527 temp = LS_64(cqp->enabled_vf_count, I40IW_CQPHC_ENABLED_VFS) | in i40iw_sc_cqp_create()
528 LS_64(cqp->hmc_profile, I40IW_CQPHC_HMC_PROFILE); in i40iw_sc_cqp_create()
529 set_64bit_val(cqp->host_ctx, 16, temp); in i40iw_sc_cqp_create()
530 set_64bit_val(cqp->host_ctx, 24, (uintptr_t)cqp); in i40iw_sc_cqp_create()
531 set_64bit_val(cqp->host_ctx, 32, 0); in i40iw_sc_cqp_create()
532 set_64bit_val(cqp->host_ctx, 40, 0); in i40iw_sc_cqp_create()
533 set_64bit_val(cqp->host_ctx, 48, 0); in i40iw_sc_cqp_create()
534 set_64bit_val(cqp->host_ctx, 56, 0); in i40iw_sc_cqp_create()
536 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CQP_HOST_CTX", in i40iw_sc_cqp_create()
537 cqp->host_ctx, I40IW_CQP_CTX_SIZE * 8); in i40iw_sc_cqp_create()
539 p1 = RS_32_1(cqp->host_ctx_pa, 32); in i40iw_sc_cqp_create()
540 p2 = (u32)cqp->host_ctx_pa; in i40iw_sc_cqp_create()
542 if (cqp->dev->is_pf) { in i40iw_sc_cqp_create()
543 i40iw_wr32(cqp->dev->hw, I40E_PFPE_CCQPHIGH, p1); in i40iw_sc_cqp_create()
544 i40iw_wr32(cqp->dev->hw, I40E_PFPE_CCQPLOW, p2); in i40iw_sc_cqp_create()
546 i40iw_wr32(cqp->dev->hw, I40E_VFPE_CCQPHIGH1, p1); in i40iw_sc_cqp_create()
547 i40iw_wr32(cqp->dev->hw, I40E_VFPE_CCQPLOW1, p2); in i40iw_sc_cqp_create()
551 i40iw_free_dma_mem(cqp->dev->hw, &cqp->sdbuf); in i40iw_sc_cqp_create()
557 if (cqp->dev->is_pf) in i40iw_sc_cqp_create()
558 err_code = i40iw_rd32(cqp->dev->hw, I40E_PFPE_CQPERRCODES); in i40iw_sc_cqp_create()
560 err_code = i40iw_rd32(cqp->dev->hw, I40E_VFPE_CQPERRCODES1); in i40iw_sc_cqp_create()
566 if (cqp->dev->is_pf) in i40iw_sc_cqp_create()
567 val = i40iw_rd32(cqp->dev->hw, I40E_PFPE_CCQPSTATUS); in i40iw_sc_cqp_create()
569 val = i40iw_rd32(cqp->dev->hw, I40E_VFPE_CCQPSTATUS1); in i40iw_sc_cqp_create()
574 cqp->process_cqp_sds = i40iw_update_sds_noccq; in i40iw_sc_cqp_create()
582 void i40iw_sc_cqp_post_sq(struct i40iw_sc_cqp *cqp) in i40iw_sc_cqp_post_sq() argument
584 if (cqp->dev->is_pf) in i40iw_sc_cqp_post_sq()
585 i40iw_wr32(cqp->dev->hw, I40E_PFPE_CQPDB, I40IW_RING_GETCURRENT_HEAD(cqp->sq_ring)); in i40iw_sc_cqp_post_sq()
587 i40iw_wr32(cqp->dev->hw, I40E_VFPE_CQPDB1, I40IW_RING_GETCURRENT_HEAD(cqp->sq_ring)); in i40iw_sc_cqp_post_sq()
589 i40iw_debug(cqp->dev, in i40iw_sc_cqp_post_sq()
593 cqp->sq_ring.head, in i40iw_sc_cqp_post_sq()
594 cqp->sq_ring.tail, in i40iw_sc_cqp_post_sq()
595 cqp->sq_ring.size); in i40iw_sc_cqp_post_sq()
604 static u64 *i40iw_sc_cqp_get_next_send_wqe_idx(struct i40iw_sc_cqp *cqp, in i40iw_sc_cqp_get_next_send_wqe_idx() argument
610 if (I40IW_RING_FULL_ERR(cqp->sq_ring)) { in i40iw_sc_cqp_get_next_send_wqe_idx()
611 i40iw_debug(cqp->dev, in i40iw_sc_cqp_get_next_send_wqe_idx()
615 cqp->sq_ring.head, in i40iw_sc_cqp_get_next_send_wqe_idx()
616 cqp->sq_ring.tail, in i40iw_sc_cqp_get_next_send_wqe_idx()
617 cqp->sq_ring.size); in i40iw_sc_cqp_get_next_send_wqe_idx()
620 I40IW_ATOMIC_RING_MOVE_HEAD(cqp->sq_ring, *wqe_idx, ret_code); in i40iw_sc_cqp_get_next_send_wqe_idx()
621 cqp->dev->cqp_cmd_stats[OP_REQUESTED_COMMANDS]++; in i40iw_sc_cqp_get_next_send_wqe_idx()
625 cqp->polarity = !cqp->polarity; in i40iw_sc_cqp_get_next_send_wqe_idx()
627 wqe = cqp->sq_base[*wqe_idx].elem; in i40iw_sc_cqp_get_next_send_wqe_idx()
628 cqp->scratch_array[*wqe_idx] = scratch; in i40iw_sc_cqp_get_next_send_wqe_idx()
639 u64 *i40iw_sc_cqp_get_next_send_wqe(struct i40iw_sc_cqp *cqp, u64 scratch) in i40iw_sc_cqp_get_next_send_wqe() argument
643 return i40iw_sc_cqp_get_next_send_wqe_idx(cqp, scratch, &wqe_idx); in i40iw_sc_cqp_get_next_send_wqe()
650 static enum i40iw_status_code i40iw_sc_cqp_destroy(struct i40iw_sc_cqp *cqp) in i40iw_sc_cqp_destroy() argument
656 if (cqp->dev->is_pf) { in i40iw_sc_cqp_destroy()
657 i40iw_wr32(cqp->dev->hw, I40E_PFPE_CCQPHIGH, 0); in i40iw_sc_cqp_destroy()
658 i40iw_wr32(cqp->dev->hw, I40E_PFPE_CCQPLOW, 0); in i40iw_sc_cqp_destroy()
661 i40iw_wr32(cqp->dev->hw, I40E_VFPE_CCQPHIGH1, 0); in i40iw_sc_cqp_destroy()
662 i40iw_wr32(cqp->dev->hw, I40E_VFPE_CCQPLOW1, 0); in i40iw_sc_cqp_destroy()
671 val = i40iw_rd32(cqp->dev->hw, cqpstat_addr); in i40iw_sc_cqp_destroy()
674 i40iw_free_dma_mem(cqp->dev->hw, &cqp->sdbuf); in i40iw_sc_cqp_destroy()
725 struct i40iw_sc_cqp *cqp; in i40iw_sc_ccq_get_cqe_info() local
741 cqp = (struct i40iw_sc_cqp *)(unsigned long)qp_ctx; in i40iw_sc_ccq_get_cqe_info()
749 info->scratch = cqp->scratch_array[wqe_idx]; in i40iw_sc_ccq_get_cqe_info()
753 get_64bit_val(cqp->sq_base[wqe_idx].elem, 24, &temp1); in i40iw_sc_ccq_get_cqe_info()
755 info->cqp = cqp; in i40iw_sc_ccq_get_cqe_info()
768 I40IW_RING_MOVE_TAIL(cqp->sq_ring); in i40iw_sc_ccq_get_cqe_info()
781 struct i40iw_sc_cqp *cqp, in i40iw_sc_poll_for_cqp_op_done() argument
791 ccq = cqp->dev->ccq; in i40iw_sc_poll_for_cqp_op_done()
807 i40iw_debug(cqp->dev, I40IW_DEBUG_WQE, in i40iw_sc_poll_for_cqp_op_done()
830 struct i40iw_sc_cqp *cqp, in i40iw_sc_manage_push_page() argument
841 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_manage_push_page()
849 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID) | in i40iw_sc_manage_push_page()
854 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "MANAGE_PUSH_PAGES WQE", in i40iw_sc_manage_push_page()
858 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_manage_push_page()
871 struct i40iw_sc_cqp *cqp, in i40iw_sc_manage_hmc_pm_func_table() argument
882 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_manage_hmc_pm_func_table()
889 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_manage_hmc_pm_func_table()
892 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "MANAGE_HMC_PM_FUNC_TABLE WQE", in i40iw_sc_manage_hmc_pm_func_table()
895 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_manage_hmc_pm_func_table()
909 struct i40iw_sc_cqp *cqp, in i40iw_sc_set_hmc_resource_profile() argument
920 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_set_hmc_resource_profile()
929 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_set_hmc_resource_profile()
933 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "MANAGE_HMC_PM_FUNC_TABLE WQE", in i40iw_sc_set_hmc_resource_profile()
936 i40iw_get_cqp_reg_info(cqp, &val, &tail, &error); in i40iw_sc_set_hmc_resource_profile()
941 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_set_hmc_resource_profile()
943 ret_code = i40iw_cqp_poll_registers(cqp, tail, 1000000); in i40iw_sc_set_hmc_resource_profile()
945 ret_code = i40iw_sc_poll_for_cqp_op_done(cqp, in i40iw_sc_set_hmc_resource_profile()
957 static enum i40iw_status_code i40iw_sc_manage_hmc_pm_func_table_done(struct i40iw_sc_cqp *cqp) in i40iw_sc_manage_hmc_pm_func_table_done() argument
959 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_MANAGE_HMC_PM_FUNC_TABLE, NULL); in i40iw_sc_manage_hmc_pm_func_table_done()
966 static enum i40iw_status_code i40iw_sc_commit_fpm_values_done(struct i40iw_sc_cqp *cqp) in i40iw_sc_commit_fpm_values_done() argument
968 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_COMMIT_FPM_VALUES, NULL); in i40iw_sc_commit_fpm_values_done()
981 struct i40iw_sc_cqp *cqp, in i40iw_sc_commit_fpm_values() argument
993 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_commit_fpm_values()
1001 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_commit_fpm_values()
1005 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "COMMIT_FPM_VALUES WQE", in i40iw_sc_commit_fpm_values()
1008 i40iw_get_cqp_reg_info(cqp, &val, &tail, &error); in i40iw_sc_commit_fpm_values()
1013 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_commit_fpm_values()
1016 ret_code = i40iw_cqp_poll_registers(cqp, tail, I40IW_DONE_COUNT); in i40iw_sc_commit_fpm_values()
1018 ret_code = i40iw_sc_commit_fpm_values_done(cqp); in i40iw_sc_commit_fpm_values()
1029 i40iw_sc_query_rdma_features_done(struct i40iw_sc_cqp *cqp) in i40iw_sc_query_rdma_features_done() argument
1032 cqp, I40IW_CQP_OP_QUERY_RDMA_FEATURES, NULL); in i40iw_sc_query_rdma_features_done()
1042 i40iw_sc_query_rdma_features(struct i40iw_sc_cqp *cqp, in i40iw_sc_query_rdma_features() argument
1048 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_query_rdma_features()
1055 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID) | feat_mem->size; in i40iw_sc_query_rdma_features()
1059 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "QUERY RDMA FEATURES WQE", in i40iw_sc_query_rdma_features()
1062 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_query_rdma_features()
1085 ret_code = i40iw_sc_query_rdma_features(dev->cqp, &feat_buf, 0); in i40iw_get_rdma_features()
1087 ret_code = i40iw_sc_query_rdma_features_done(dev->cqp); in i40iw_get_rdma_features()
1117 static enum i40iw_status_code i40iw_sc_query_fpm_values_done(struct i40iw_sc_cqp *cqp) in i40iw_sc_query_fpm_values_done() argument
1119 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_QUERY_FPM_VALUES, NULL); in i40iw_sc_query_fpm_values_done()
1132 struct i40iw_sc_cqp *cqp, in i40iw_sc_query_fpm_values() argument
1144 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_query_fpm_values()
1152 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_query_fpm_values()
1156 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "QUERY_FPM WQE", in i40iw_sc_query_fpm_values()
1160 i40iw_get_cqp_reg_info(cqp, &val, &tail, &error); in i40iw_sc_query_fpm_values()
1166 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_query_fpm_values()
1168 ret_code = i40iw_cqp_poll_registers(cqp, tail, I40IW_DONE_COUNT); in i40iw_sc_query_fpm_values()
1170 ret_code = i40iw_sc_query_fpm_values_done(cqp); in i40iw_sc_query_fpm_values()
1184 struct i40iw_sc_cqp *cqp, in i40iw_sc_add_arp_cache_entry() argument
1192 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_add_arp_cache_entry()
1210 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_add_arp_cache_entry()
1214 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "ARP_CACHE_ENTRY WQE", in i40iw_sc_add_arp_cache_entry()
1218 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_add_arp_cache_entry()
1230 struct i40iw_sc_cqp *cqp, in i40iw_sc_del_arp_cache_entry() argument
1238 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_del_arp_cache_entry()
1244 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_del_arp_cache_entry()
1247 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "ARP_CACHE_DEL_ENTRY WQE", in i40iw_sc_del_arp_cache_entry()
1251 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_del_arp_cache_entry()
1263 struct i40iw_sc_cqp *cqp, in i40iw_sc_query_arp_cache_entry() argument
1271 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_query_arp_cache_entry()
1278 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_query_arp_cache_entry()
1282 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "QUERY_ARP_CACHE_ENTRY WQE", in i40iw_sc_query_arp_cache_entry()
1286 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_query_arp_cache_entry()
1298 struct i40iw_sc_cqp *cqp, in i40iw_sc_manage_apbvt_entry() argument
1306 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_manage_apbvt_entry()
1314 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_manage_apbvt_entry()
1318 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "MANAGE_APBVT WQE", in i40iw_sc_manage_apbvt_entry()
1322 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_manage_apbvt_entry()
1343 struct i40iw_sc_cqp *cqp, in i40iw_sc_manage_qhash_table_entry() argument
1354 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_manage_qhash_table_entry()
1407 temp = LS_64(cqp->polarity, I40IW_CQPSQ_QHASH_WQEVALID) | in i40iw_sc_manage_qhash_table_entry()
1416 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "MANAGE_QHASH WQE", in i40iw_sc_manage_qhash_table_entry()
1420 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_manage_qhash_table_entry()
1431 struct i40iw_sc_cqp *cqp, in i40iw_sc_alloc_local_mac_ipaddr_entry() argument
1438 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_alloc_local_mac_ipaddr_entry()
1442 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_alloc_local_mac_ipaddr_entry()
1445 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "ALLOCATE_LOCAL_MAC_IPADDR WQE", in i40iw_sc_alloc_local_mac_ipaddr_entry()
1448 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_alloc_local_mac_ipaddr_entry()
1460 struct i40iw_sc_cqp *cqp, in i40iw_sc_add_local_mac_ipaddr_entry() argument
1468 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_add_local_mac_ipaddr_entry()
1482 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_add_local_mac_ipaddr_entry()
1486 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "ADD_LOCAL_MAC_IPADDR WQE", in i40iw_sc_add_local_mac_ipaddr_entry()
1490 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_add_local_mac_ipaddr_entry()
1503 struct i40iw_sc_cqp *cqp, in i40iw_sc_del_local_mac_ipaddr_entry() argument
1512 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_del_local_mac_ipaddr_entry()
1518 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID) | in i40iw_sc_del_local_mac_ipaddr_entry()
1523 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "DEL_LOCAL_MAC_IPADDR WQE", in i40iw_sc_del_local_mac_ipaddr_entry()
1527 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_del_local_mac_ipaddr_entry()
1537 static enum i40iw_status_code i40iw_sc_cqp_nop(struct i40iw_sc_cqp *cqp, in i40iw_sc_cqp_nop() argument
1544 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_cqp_nop()
1548 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_cqp_nop()
1550 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "NOP WQE", in i40iw_sc_cqp_nop()
1554 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_cqp_nop()
1611 struct i40iw_sc_cqp *cqp; in i40iw_sc_ceq_create() local
1615 cqp = ceq->dev->cqp; in i40iw_sc_ceq_create()
1616 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_ceq_create()
1629 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_ceq_create()
1633 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CEQ_CREATE WQE", in i40iw_sc_ceq_create()
1637 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_ceq_create()
1647 struct i40iw_sc_cqp *cqp; in i40iw_sc_cceq_create_done() local
1649 cqp = ceq->dev->cqp; in i40iw_sc_cceq_create_done()
1650 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_CREATE_CEQ, NULL); in i40iw_sc_cceq_create_done()
1659 struct i40iw_sc_cqp *cqp; in i40iw_sc_cceq_destroy_done() local
1661 cqp = ceq->dev->cqp; in i40iw_sc_cceq_destroy_done()
1662 cqp->process_cqp_sds = i40iw_update_sds_noccq; in i40iw_sc_cceq_destroy_done()
1663 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_DESTROY_CEQ, NULL); in i40iw_sc_cceq_destroy_done()
1691 struct i40iw_sc_cqp *cqp; in i40iw_sc_ceq_destroy() local
1695 cqp = ceq->dev->cqp; in i40iw_sc_ceq_destroy()
1696 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_ceq_destroy()
1706 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_ceq_destroy()
1708 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CEQ_DESTROY WQE", in i40iw_sc_ceq_destroy()
1712 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_ceq_destroy()
1795 struct i40iw_sc_cqp *cqp; in i40iw_sc_aeq_create() local
1798 cqp = aeq->dev->cqp; in i40iw_sc_aeq_create()
1799 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_aeq_create()
1811 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_aeq_create()
1814 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "AEQ_CREATE WQE", in i40iw_sc_aeq_create()
1817 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_aeq_create()
1832 struct i40iw_sc_cqp *cqp; in i40iw_sc_aeq_destroy() local
1835 cqp = aeq->dev->cqp; in i40iw_sc_aeq_destroy()
1836 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_aeq_destroy()
1844 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_aeq_destroy()
1847 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "AEQ_DESTROY WQE", in i40iw_sc_aeq_destroy()
1850 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_aeq_destroy()
1999 struct i40iw_sc_cqp *cqp; in i40iw_sc_aeq_create_done() local
2001 cqp = aeq->dev->cqp; in i40iw_sc_aeq_create_done()
2002 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_CREATE_AEQ, NULL); in i40iw_sc_aeq_create_done()
2011 struct i40iw_sc_cqp *cqp; in i40iw_sc_aeq_destroy_done() local
2013 cqp = aeq->dev->cqp; in i40iw_sc_aeq_destroy_done()
2014 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_DESTROY_AEQ, NULL); in i40iw_sc_aeq_destroy_done()
2074 struct i40iw_sc_cqp *cqp; in i40iw_sc_ccq_create_done() local
2076 cqp = ccq->dev->cqp; in i40iw_sc_ccq_create_done()
2077 return i40iw_sc_poll_for_cqp_op_done(cqp, I40IW_CQP_OP_CREATE_CQ, NULL); in i40iw_sc_ccq_create_done()
2093 struct i40iw_sc_cqp *cqp; in i40iw_sc_ccq_create() local
2097 cqp = ccq->dev->cqp; in i40iw_sc_ccq_create()
2098 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_ccq_create()
2122 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_ccq_create()
2126 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CCQ_CREATE WQE", in i40iw_sc_ccq_create()
2130 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_ccq_create()
2135 cqp->process_cqp_sds = i40iw_cqp_sds_cmd; in i40iw_sc_ccq_create()
2150 struct i40iw_sc_cqp *cqp; in i40iw_sc_ccq_destroy() local
2156 cqp = ccq->dev->cqp; in i40iw_sc_ccq_destroy()
2157 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_ccq_destroy()
2171 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_ccq_destroy()
2175 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CCQ_DESTROY WQE", in i40iw_sc_ccq_destroy()
2178 i40iw_get_cqp_reg_info(cqp, &val, &tail, &error); in i40iw_sc_ccq_destroy()
2183 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_ccq_destroy()
2184 ret_code = i40iw_cqp_poll_registers(cqp, tail, 1000); in i40iw_sc_ccq_destroy()
2187 cqp->process_cqp_sds = i40iw_update_sds_noccq; in i40iw_sc_ccq_destroy()
2251 struct i40iw_sc_cqp *cqp; in i40iw_sc_cq_create() local
2260 cqp = cq->dev->cqp; in i40iw_sc_cq_create()
2261 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_cq_create()
2287 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_cq_create()
2291 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CQ_CREATE WQE", in i40iw_sc_cq_create()
2295 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_cq_create()
2309 struct i40iw_sc_cqp *cqp; in i40iw_sc_cq_destroy() local
2313 cqp = cq->dev->cqp; in i40iw_sc_cq_destroy()
2314 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_cq_destroy()
2331 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_cq_destroy()
2335 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CQ_DESTROY WQE", in i40iw_sc_cq_destroy()
2339 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_cq_destroy()
2355 struct i40iw_sc_cqp *cqp; in i40iw_sc_cq_modify() local
2372 cqp = cq->dev->cqp; in i40iw_sc_cq_modify()
2373 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_cq_modify()
2426 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_cq_modify()
2430 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "CQ_MODIFY WQE", in i40iw_sc_cq_modify()
2434 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_cq_modify()
2532 struct i40iw_sc_cqp *cqp; in i40iw_sc_qp_create() local
2540 cqp = qp->pd->dev->cqp; in i40iw_sc_qp_create()
2541 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_qp_create()
2558 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_qp_create()
2561 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "QP_CREATE WQE", in i40iw_sc_qp_create()
2565 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_qp_create()
2583 struct i40iw_sc_cqp *cqp; in i40iw_sc_qp_modify() local
2588 cqp = qp->pd->dev->cqp; in i40iw_sc_qp_modify()
2589 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_qp_modify()
2623 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_qp_modify()
2627 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "QP_MODIFY WQE", in i40iw_sc_qp_modify()
2631 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_qp_modify()
2651 struct i40iw_sc_cqp *cqp; in i40iw_sc_qp_destroy() local
2655 cqp = qp->pd->dev->cqp; in i40iw_sc_qp_destroy()
2656 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_qp_destroy()
2667 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_qp_destroy()
2670 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "QP_DESTROY WQE", in i40iw_sc_qp_destroy()
2674 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_qp_destroy()
2693 struct i40iw_sc_cqp *cqp; in i40iw_sc_qp_flush_wqes() local
2708 cqp = qp->pd->dev->cqp; in i40iw_sc_qp_flush_wqes()
2709 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_qp_flush_wqes()
2735 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_qp_flush_wqes()
2739 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "QP_FLUSH WQE", in i40iw_sc_qp_flush_wqes()
2743 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_qp_flush_wqes()
2762 struct i40iw_sc_cqp *cqp; in i40iw_sc_gen_ae() local
2765 cqp = qp->pd->dev->cqp; in i40iw_sc_gen_ae()
2766 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_gen_ae()
2778 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_gen_ae()
2782 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "GEN_AE WQE", in i40iw_sc_gen_ae()
2786 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_gen_ae()
2804 struct i40iw_sc_cqp *cqp; in i40iw_sc_qp_upload_context() local
2807 cqp = dev->cqp; in i40iw_sc_qp_upload_context()
2808 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_qp_upload_context()
2818 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_qp_upload_context()
2826 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_qp_upload_context()
3032 struct i40iw_sc_cqp *cqp; in i40iw_sc_alloc_stag() local
3037 cqp = dev->cqp; in i40iw_sc_alloc_stag()
3038 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_alloc_stag()
3060 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_alloc_stag()
3068 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_alloc_stag()
3087 struct i40iw_sc_cqp *cqp; in i40iw_sc_mr_reg_non_shared() local
3106 cqp = dev->cqp; in i40iw_sc_mr_reg_non_shared()
3107 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_mr_reg_non_shared()
3143 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_mr_reg_non_shared()
3151 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_mr_reg_non_shared()
3169 struct i40iw_sc_cqp *cqp; in i40iw_sc_mr_reg_shared() local
3180 cqp = dev->cqp; in i40iw_sc_mr_reg_shared()
3181 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_mr_reg_shared()
3206 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_mr_reg_shared()
3214 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_mr_reg_shared()
3233 struct i40iw_sc_cqp *cqp; in i40iw_sc_dealloc_stag() local
3235 cqp = dev->cqp; in i40iw_sc_dealloc_stag()
3236 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_dealloc_stag()
3248 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_dealloc_stag()
3256 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_dealloc_stag()
3274 struct i40iw_sc_cqp *cqp; in i40iw_sc_query_stag() local
3276 cqp = dev->cqp; in i40iw_sc_query_stag()
3277 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_query_stag()
3285 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_query_stag()
3293 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_query_stag()
3313 struct i40iw_sc_cqp *cqp; in i40iw_sc_mw_alloc() local
3316 cqp = dev->cqp; in i40iw_sc_mw_alloc()
3317 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_mw_alloc()
3326 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_mw_alloc()
3334 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_mw_alloc()
3614 dev->cqp, in i40iw_sc_init_iw_hmc()
3696 dev->cqp, in i40iw_sc_configure_iw_fpm()
3721 static enum i40iw_status_code cqp_sds_wqe_fill(struct i40iw_sc_cqp *cqp, in cqp_sds_wqe_fill() argument
3729 struct i40iw_dma_mem *sdbuf = &cqp->sdbuf; in cqp_sds_wqe_fill()
3733 wqe = i40iw_sc_cqp_get_next_send_wqe_idx(cqp, scratch, &wqe_idx); in cqp_sds_wqe_fill()
3742 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID) | in cqp_sds_wqe_fill()
3784 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "UPDATE_PE_SDS WQE", in cqp_sds_wqe_fill()
3799 struct i40iw_sc_cqp *cqp = dev->cqp; in i40iw_update_pe_sds() local
3802 ret_code = cqp_sds_wqe_fill(cqp, info, scratch); in i40iw_update_pe_sds()
3804 i40iw_sc_cqp_post_sq(cqp); in i40iw_update_pe_sds()
3818 struct i40iw_sc_cqp *cqp = dev->cqp; in i40iw_update_sds_noccq() local
3821 ret_code = cqp_sds_wqe_fill(cqp, info, 0); in i40iw_update_sds_noccq()
3824 i40iw_get_cqp_reg_info(cqp, &val, &tail, &error); in i40iw_update_sds_noccq()
3828 i40iw_sc_cqp_post_sq(cqp); in i40iw_update_sds_noccq()
3829 ret_code = i40iw_cqp_poll_registers(cqp, tail, I40IW_DONE_COUNT); in i40iw_update_sds_noccq()
3840 enum i40iw_status_code i40iw_sc_suspend_qp(struct i40iw_sc_cqp *cqp, in i40iw_sc_suspend_qp() argument
3847 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_suspend_qp()
3852 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_suspend_qp()
3856 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "SUSPEND_QP WQE", in i40iw_sc_suspend_qp()
3859 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_suspend_qp()
3869 enum i40iw_status_code i40iw_sc_resume_qp(struct i40iw_sc_cqp *cqp, in i40iw_sc_resume_qp() argument
3876 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_resume_qp()
3885 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_resume_qp()
3889 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "RESUME_QP WQE", in i40iw_sc_resume_qp()
3892 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_resume_qp()
3905 struct i40iw_sc_cqp *cqp, in i40iw_sc_static_hmc_pages_allocated() argument
3916 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); in i40iw_sc_static_hmc_pages_allocated()
3924 LS_64(cqp->polarity, I40IW_CQPSQ_WQEVALID); in i40iw_sc_static_hmc_pages_allocated()
3928 i40iw_debug_buf(cqp->dev, I40IW_DEBUG_WQE, "SHMC_PAGES_ALLOCATED WQE", in i40iw_sc_static_hmc_pages_allocated()
3930 i40iw_get_cqp_reg_info(cqp, &val, &tail, &error); in i40iw_sc_static_hmc_pages_allocated()
3936 i40iw_sc_cqp_post_sq(cqp); in i40iw_sc_static_hmc_pages_allocated()
3939 ret_code = i40iw_cqp_poll_registers(cqp, tail, 1000); in i40iw_sc_static_hmc_pages_allocated()
3941 ret_code = i40iw_sc_poll_for_cqp_op_done(cqp, in i40iw_sc_static_hmc_pages_allocated()
3953 static bool i40iw_ring_full(struct i40iw_sc_cqp *cqp) in i40iw_ring_full() argument
3955 return I40IW_RING_FULL_ERR(cqp->sq_ring); in i40iw_ring_full()
4132 pcmdinfo->in.u.del_local_mac_ipaddr_entry.cqp, in i40iw_exec_cqp_cmd()
4151 pcmdinfo->in.u.del_arp_cache_entry.cqp, in i40iw_exec_cqp_cmd()
4158 pcmdinfo->in.u.manage_apbvt_entry.cqp, in i40iw_exec_cqp_cmd()
4175 pcmdinfo->in.u.alloc_local_mac_ipaddr_entry.cqp, in i40iw_exec_cqp_cmd()
4181 pcmdinfo->in.u.add_local_mac_ipaddr_entry.cqp, in i40iw_exec_cqp_cmd()
4188 pcmdinfo->in.u.manage_qhash_table_entry.cqp, in i40iw_exec_cqp_cmd()
4289 pcmdinfo->in.u.add_arp_cache_entry.cqp, in i40iw_exec_cqp_cmd()
4296 pcmdinfo->in.u.manage_push_page.cqp, in i40iw_exec_cqp_cmd()
4312 pcmdinfo->in.u.manage_hmc_pm.dev->cqp, in i40iw_exec_cqp_cmd()
4320 pcmdinfo->in.u.suspend_resume.cqp, in i40iw_exec_cqp_cmd()
4326 pcmdinfo->in.u.suspend_resume.cqp, in i40iw_exec_cqp_cmd()
4332 pcmdinfo->in.u.manage_vf_pble_bp.cqp, in i40iw_exec_cqp_cmd()
4340 pcmdinfo->in.u.query_fpm_values.cqp, in i40iw_exec_cqp_cmd()
4349 pcmdinfo->in.u.commit_fpm_values.cqp, in i40iw_exec_cqp_cmd()
4360 pcmdinfo->in.u.query_rdma_features.cqp, &values_mem, in i40iw_exec_cqp_cmd()
4383 if (list_empty(&dev->cqp_cmd_head) && !i40iw_ring_full(dev->cqp)) in i40iw_process_cqp_cmd()
4402 while (!list_empty(&dev->cqp_cmd_head) && !i40iw_ring_full(dev->cqp)) { in i40iw_process_bh()