1 /*******************************************************************************
3 * Copyright (c) 2015-2016 Intel Corporation. All rights reserved.
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenFabrics.org BSD license below:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 *******************************************************************************/
37 #include "i40iw_user.h"
38 #include "i40iw_hmc.h"
40 #include "i40iw_virtchnl.h"
42 struct i40iw_cqp_sq_wqe {
43 u64 buf[I40IW_CQP_WQE_SIZE];
46 struct i40iw_sc_aeqe {
47 u64 buf[I40IW_AEQE_SIZE];
51 u64 buf[I40IW_CEQE_SIZE];
54 struct i40iw_cqp_ctx {
55 u64 buf[I40IW_CQP_CTX_SIZE];
58 struct i40iw_cq_shadow_area {
59 u64 buf[I40IW_SHADOW_AREA_SIZE];
63 struct i40iw_hmc_info;
64 struct i40iw_dev_pestat;
71 struct i40iw_cqp_misc_ops;
73 struct i40iw_priv_qp_ops;
74 struct i40iw_priv_cq_ops;
77 enum i40iw_resource_indicator_type {
78 I40IW_RSRC_INDICATOR_TYPE_ADAPTER = 0,
79 I40IW_RSRC_INDICATOR_TYPE_CQ,
80 I40IW_RSRC_INDICATOR_TYPE_QP,
81 I40IW_RSRC_INDICATOR_TYPE_SRQ
84 enum i40iw_hdrct_flags {
90 enum i40iw_term_layers {
96 enum i40iw_term_error_types {
97 RDMAP_REMOTE_PROT = 1,
100 DDP_TAGGED_BUFFER = 1,
101 DDP_UNTAGGED_BUFFER = 2,
105 enum i40iw_term_rdma_errors {
106 RDMAP_INV_STAG = 0x00,
107 RDMAP_INV_BOUNDS = 0x01,
109 RDMAP_UNASSOC_STAG = 0x03,
110 RDMAP_TO_WRAP = 0x04,
111 RDMAP_INV_RDMAP_VER = 0x05,
112 RDMAP_UNEXPECTED_OP = 0x06,
113 RDMAP_CATASTROPHIC_LOCAL = 0x07,
114 RDMAP_CATASTROPHIC_GLOBAL = 0x08,
115 RDMAP_CANT_INV_STAG = 0x09,
116 RDMAP_UNSPECIFIED = 0xff
119 enum i40iw_term_ddp_errors {
120 DDP_CATASTROPHIC_LOCAL = 0x00,
121 DDP_TAGGED_INV_STAG = 0x00,
122 DDP_TAGGED_BOUNDS = 0x01,
123 DDP_TAGGED_UNASSOC_STAG = 0x02,
124 DDP_TAGGED_TO_WRAP = 0x03,
125 DDP_TAGGED_INV_DDP_VER = 0x04,
126 DDP_UNTAGGED_INV_QN = 0x01,
127 DDP_UNTAGGED_INV_MSN_NO_BUF = 0x02,
128 DDP_UNTAGGED_INV_MSN_RANGE = 0x03,
129 DDP_UNTAGGED_INV_MO = 0x04,
130 DDP_UNTAGGED_INV_TOO_LONG = 0x05,
131 DDP_UNTAGGED_INV_DDP_VER = 0x06
134 enum i40iw_term_mpa_errors {
141 enum i40iw_flush_opcode {
144 FLUSH_REM_ACCESS_ERR,
152 enum i40iw_term_eventtypes {
154 TERM_EVENT_QP_ACCESS_ERR
157 struct i40iw_terminate_hdr {
164 enum i40iw_debug_flag {
165 I40IW_DEBUG_NONE = 0x00000000,
166 I40IW_DEBUG_ERR = 0x00000001,
167 I40IW_DEBUG_INIT = 0x00000002,
168 I40IW_DEBUG_DEV = 0x00000004,
169 I40IW_DEBUG_CM = 0x00000008,
170 I40IW_DEBUG_VERBS = 0x00000010,
171 I40IW_DEBUG_PUDA = 0x00000020,
172 I40IW_DEBUG_ILQ = 0x00000040,
173 I40IW_DEBUG_IEQ = 0x00000080,
174 I40IW_DEBUG_QP = 0x00000100,
175 I40IW_DEBUG_CQ = 0x00000200,
176 I40IW_DEBUG_MR = 0x00000400,
177 I40IW_DEBUG_PBLE = 0x00000800,
178 I40IW_DEBUG_WQE = 0x00001000,
179 I40IW_DEBUG_AEQ = 0x00002000,
180 I40IW_DEBUG_CQP = 0x00004000,
181 I40IW_DEBUG_HMC = 0x00008000,
182 I40IW_DEBUG_USER = 0x00010000,
183 I40IW_DEBUG_VIRT = 0x00020000,
184 I40IW_DEBUG_DCB = 0x00040000,
185 I40IW_DEBUG_CQE = 0x00800000,
186 I40IW_DEBUG_ALL = 0xFFFFFFFF
189 enum i40iw_hw_stat_index_32b {
190 I40IW_HW_STAT_INDEX_IP4RXDISCARD = 0,
191 I40IW_HW_STAT_INDEX_IP4RXTRUNC,
192 I40IW_HW_STAT_INDEX_IP4TXNOROUTE,
193 I40IW_HW_STAT_INDEX_IP6RXDISCARD,
194 I40IW_HW_STAT_INDEX_IP6RXTRUNC,
195 I40IW_HW_STAT_INDEX_IP6TXNOROUTE,
196 I40IW_HW_STAT_INDEX_TCPRTXSEG,
197 I40IW_HW_STAT_INDEX_TCPRXOPTERR,
198 I40IW_HW_STAT_INDEX_TCPRXPROTOERR,
199 I40IW_HW_STAT_INDEX_MAX_32
202 enum i40iw_hw_stat_index_64b {
203 I40IW_HW_STAT_INDEX_IP4RXOCTS = 0,
204 I40IW_HW_STAT_INDEX_IP4RXPKTS,
205 I40IW_HW_STAT_INDEX_IP4RXFRAGS,
206 I40IW_HW_STAT_INDEX_IP4RXMCPKTS,
207 I40IW_HW_STAT_INDEX_IP4TXOCTS,
208 I40IW_HW_STAT_INDEX_IP4TXPKTS,
209 I40IW_HW_STAT_INDEX_IP4TXFRAGS,
210 I40IW_HW_STAT_INDEX_IP4TXMCPKTS,
211 I40IW_HW_STAT_INDEX_IP6RXOCTS,
212 I40IW_HW_STAT_INDEX_IP6RXPKTS,
213 I40IW_HW_STAT_INDEX_IP6RXFRAGS,
214 I40IW_HW_STAT_INDEX_IP6RXMCPKTS,
215 I40IW_HW_STAT_INDEX_IP6TXOCTS,
216 I40IW_HW_STAT_INDEX_IP6TXPKTS,
217 I40IW_HW_STAT_INDEX_IP6TXFRAGS,
218 I40IW_HW_STAT_INDEX_IP6TXMCPKTS,
219 I40IW_HW_STAT_INDEX_TCPRXSEGS,
220 I40IW_HW_STAT_INDEX_TCPTXSEG,
221 I40IW_HW_STAT_INDEX_RDMARXRDS,
222 I40IW_HW_STAT_INDEX_RDMARXSNDS,
223 I40IW_HW_STAT_INDEX_RDMARXWRS,
224 I40IW_HW_STAT_INDEX_RDMATXRDS,
225 I40IW_HW_STAT_INDEX_RDMATXSNDS,
226 I40IW_HW_STAT_INDEX_RDMATXWRS,
227 I40IW_HW_STAT_INDEX_RDMAVBND,
228 I40IW_HW_STAT_INDEX_RDMAVINV,
229 I40IW_HW_STAT_INDEX_MAX_64
232 struct i40iw_dev_hw_stat_offsets {
233 u32 stat_offset_32[I40IW_HW_STAT_INDEX_MAX_32];
234 u32 stat_offset_64[I40IW_HW_STAT_INDEX_MAX_64];
237 struct i40iw_dev_hw_stats {
238 u64 stat_value_32[I40IW_HW_STAT_INDEX_MAX_32];
239 u64 stat_value_64[I40IW_HW_STAT_INDEX_MAX_64];
242 struct i40iw_device_pestat_ops {
243 void (*iw_hw_stat_init)(struct i40iw_dev_pestat *, u8, struct i40iw_hw *, bool);
244 void (*iw_hw_stat_read_32)(struct i40iw_dev_pestat *, enum i40iw_hw_stat_index_32b, u64 *);
245 void (*iw_hw_stat_read_64)(struct i40iw_dev_pestat *, enum i40iw_hw_stat_index_64b, u64 *);
246 void (*iw_hw_stat_read_all)(struct i40iw_dev_pestat *, struct i40iw_dev_hw_stats *);
247 void (*iw_hw_stat_refresh_all)(struct i40iw_dev_pestat *);
250 struct i40iw_dev_pestat {
252 struct i40iw_device_pestat_ops ops;
253 struct i40iw_dev_hw_stats hw_stats;
254 struct i40iw_dev_hw_stats last_read_hw_stats;
255 struct i40iw_dev_hw_stat_offsets hw_stat_offsets;
256 struct timer_list stats_timer;
257 spinlock_t stats_lock; /* rdma stats lock */
263 struct i40iw_hmc_info hmc;
267 struct list_head rxlist;
285 struct i40iw_sc_dev *dev;
289 struct i40iw_cqp_quanta {
290 u64 elem[I40IW_CQP_WQE_SIZE];
293 struct i40iw_sc_cqp {
298 struct i40iw_sc_dev *dev;
299 enum i40iw_status_code (*process_cqp_sds)(struct i40iw_sc_dev *,
300 struct i40iw_update_sds_info *);
301 struct i40iw_dma_mem sdbuf;
302 struct i40iw_ring sq_ring;
303 struct i40iw_cqp_quanta *sq_base;
311 bool en_datacenter_tcp;
317 struct i40iw_sc_aeq {
320 struct i40iw_sc_dev *dev;
321 struct i40iw_sc_aeqe *aeqe_base;
324 struct i40iw_ring aeq_ring;
327 u32 first_pm_pbl_idx;
331 struct i40iw_sc_ceq {
334 struct i40iw_sc_dev *dev;
335 struct i40iw_ceqe *ceqe_base;
339 struct i40iw_ring ceq_ring;
344 u32 first_pm_pbl_idx;
349 struct i40iw_cq_uk cq_uk;
352 struct i40iw_sc_dev *dev;
356 u32 shadow_read_threshold;
364 u32 first_pm_pbl_idx;
369 struct i40iw_qp_uk qp_uk;
375 struct i40iw_sc_dev *dev;
376 struct i40iw_sc_pd *pd;
378 void *llp_stream_handle;
380 struct i40iw_pfpdu pfpdu;
384 u16 exception_lan_queue;
401 enum i40iw_flush_opcode flush_code;
402 enum i40iw_term_eventtypes eventtype;
406 struct i40iw_hmc_fpm_misc {
415 struct i40iw_vchnl_if {
416 enum i40iw_status_code (*vchnl_recv)(struct i40iw_sc_dev *, u32, u8 *, u16);
417 enum i40iw_status_code (*vchnl_send)(struct i40iw_sc_dev *dev, u32, u8 *, u16);
420 #define I40IW_VCHNL_MAX_VF_MSG_SIZE 512
422 struct i40iw_vchnl_vf_msg_buffer {
423 struct i40iw_virtchnl_op_buf vchnl_msg;
424 char parm_buffer[I40IW_VCHNL_MAX_VF_MSG_SIZE - 1];
428 struct i40iw_sc_dev *pf_dev;
430 struct i40iw_dev_pestat dev_pestat;
431 struct i40iw_hmc_pble_info *pble_info;
432 struct i40iw_hmc_info hmc_info;
433 struct i40iw_vchnl_vf_msg_buffer vf_msg_buffer;
434 u64 fpm_query_buf_pa;
438 bool pf_hmc_initialized;
440 u16 iw_vf_idx; /* VF Device table index */
441 bool stats_initialized;
444 struct i40iw_sc_dev {
445 struct list_head cqp_cmd_head; /* head of the CQP command list */
446 spinlock_t cqp_lock; /* cqp list sync */
447 struct i40iw_dev_uk dev_uk;
448 struct i40iw_dev_pestat dev_pestat;
449 struct i40iw_dma_mem vf_fpm_query_buf[I40IW_MAX_PE_ENABLED_VF_COUNT];
450 u64 fpm_query_buf_pa;
451 u64 fpm_commit_buf_pa;
457 struct i40iw_hmc_info *hmc_info;
458 struct i40iw_hmc_pble_info *pble_info;
459 struct i40iw_vfdev *vf_dev[I40IW_MAX_PE_ENABLED_VF_COUNT];
460 struct i40iw_sc_cqp *cqp;
461 struct i40iw_sc_aeq *aeq;
462 struct i40iw_sc_ceq *ceq[I40IW_CEQ_MAX_COUNT];
463 struct i40iw_sc_cq *ccq;
464 struct i40iw_cqp_ops *cqp_ops;
465 struct i40iw_ccq_ops *ccq_ops;
466 struct i40iw_ceq_ops *ceq_ops;
467 struct i40iw_aeq_ops *aeq_ops;
468 struct i40iw_pd_ops *iw_pd_ops;
469 struct i40iw_priv_qp_ops *iw_priv_qp_ops;
470 struct i40iw_priv_cq_ops *iw_priv_cq_ops;
471 struct i40iw_mr_ops *mr_ops;
472 struct i40iw_cqp_misc_ops *cqp_misc_ops;
473 struct i40iw_hmc_ops *hmc_ops;
474 struct i40iw_vchnl_if vchnl_if;
476 struct i40iw_virt_mem ilq_mem;
477 struct i40iw_puda_rsrc *ilq;
479 struct i40iw_virt_mem ieq_mem;
480 struct i40iw_puda_rsrc *ieq;
482 struct i40iw_vf_cqp_ops *iw_vf_cqp_ops;
484 struct i40iw_hmc_fpm_misc hmc_fpm_misc;
487 u16 exception_lan_queue;
492 u64 cqp_cmd_stats[OP_SIZE_CQP_STAT_ARRAY];
493 struct i40iw_vchnl_vf_msg_buffer vchnl_vf_msg_buf;
497 struct i40iw_modify_cq_info {
499 struct i40iw_cqe *cq_base;
503 u32 shadow_read_threshold;
509 bool check_overflow_change;
510 u32 first_pm_pbl_idx;
514 struct i40iw_create_qp_info {
520 bool arp_cache_idx_valid;
523 struct i40iw_modify_qp_info {
533 bool arp_cache_idx_valid;
535 bool remove_hash_idx;
538 bool cached_var_valid;
543 struct i40iw_ccq_cqe_info {
544 struct i40iw_sc_cqp *cqp;
553 struct i40iw_l2params {
554 u16 qs_handle_list[I40IW_MAX_USER_PRIORITY];
558 struct i40iw_device_init_info {
559 u64 fpm_query_buf_pa;
560 u64 fpm_commit_buf_pa;
565 enum i40iw_status_code (*vchnl_send)(struct i40iw_sc_dev *, u32, u8 *, u16);
567 u16 exception_lan_queue;
573 enum i40iw_cqp_hmc_profile {
574 I40IW_HMC_PROFILE_DEFAULT = 1,
575 I40IW_HMC_PROFILE_FAVOR_VF = 2,
576 I40IW_HMC_PROFILE_EQUAL = 3,
579 struct i40iw_cqp_init_info {
583 struct i40iw_sc_dev *dev;
584 struct i40iw_cqp_quanta *sq;
589 bool en_datacenter_tcp;
594 struct i40iw_ceq_init_info {
596 struct i40iw_sc_dev *dev;
605 u32 first_pm_pbl_idx;
608 struct i40iw_aeq_init_info {
610 struct i40iw_sc_dev *dev;
616 u32 first_pm_pbl_idx;
619 struct i40iw_ccq_init_info {
622 struct i40iw_sc_dev *dev;
623 struct i40iw_cqe *cq_base;
628 u32 shadow_read_threshold;
633 bool avoid_mem_cflct;
636 u32 first_pm_pbl_idx;
639 struct i40iwarp_offload_info {
662 struct i40iw_tcp_offload_info {
665 bool insert_vlan_tag;
672 bool avoid_stretch_ack;
688 u32 time_stamp_recent;
709 bool ignore_tcp_uns_opt;
712 struct i40iw_qp_host_ctx_info {
714 struct i40iw_tcp_offload_info *tcp_info;
715 struct i40iwarp_offload_info *iwarp_info;
721 bool iwarp_info_valid;
722 bool err_rq_idx_valid;
726 struct i40iw_aeqe_info {
742 struct i40iw_allocate_stag_info {
750 bool use_hmc_fcn_index;
755 struct i40iw_reg_ns_stag_info {
762 u32 first_pm_pbl_index;
763 enum i40iw_addressing_type addr_type;
764 i40iw_stag_index stag_idx;
767 i40iw_stag_key stag_key;
768 bool use_hmc_fcn_index;
773 struct i40iw_fast_reg_stag_info {
781 u32 first_pm_pbl_index;
782 enum i40iw_addressing_type addr_type;
783 i40iw_stag_index stag_idx;
786 i40iw_stag_key stag_key;
790 bool use_hmc_fcn_index;
796 struct i40iw_dealloc_stag_info {
803 struct i40iw_register_shared_stag {
805 enum i40iw_addressing_type addr_type;
806 i40iw_stag_index new_stag_idx;
807 i40iw_stag_index parent_stag_idx;
810 i40iw_stag_key new_stag_key;
813 struct i40iw_qp_init_info {
814 struct i40iw_qp_uk_init_info qp_uk_init_info;
815 struct i40iw_sc_pd *pd;
833 struct i40iw_cq_init_info {
834 struct i40iw_sc_dev *dev;
838 u32 shadow_read_threshold;
842 u32 first_pm_pbl_idx;
847 struct i40iw_cq_uk_init_info cq_uk_init_info;
850 struct i40iw_upload_context_info {
858 struct i40iw_add_arp_cache_entry_info {
865 struct i40iw_apbvt_info {
870 enum i40iw_quad_entry_type {
871 I40IW_QHASH_TYPE_TCP_ESTABLISHED = 1,
872 I40IW_QHASH_TYPE_TCP_SYN,
875 enum i40iw_quad_hash_manage_type {
876 I40IW_QHASH_MANAGE_TYPE_DELETE = 0,
877 I40IW_QHASH_MANAGE_TYPE_ADD,
878 I40IW_QHASH_MANAGE_TYPE_MODIFY
881 struct i40iw_qhash_table_info {
882 enum i40iw_quad_hash_manage_type manage;
883 enum i40iw_quad_entry_type entry_type;
896 struct i40iw_local_mac_ipaddr_entry_info {
901 struct i40iw_cqp_manage_push_page_info {
907 struct i40iw_qp_flush_info {
920 struct i40iw_cqp_commit_fpm_values {
925 u32 apbvt_inuse_base;
949 struct i40iw_cqp_query_fpm_values {
950 u16 first_pe_sd_index;
975 struct i40iw_cqp_ops {
976 enum i40iw_status_code (*cqp_init)(struct i40iw_sc_cqp *,
977 struct i40iw_cqp_init_info *);
978 enum i40iw_status_code (*cqp_create)(struct i40iw_sc_cqp *, bool, u16 *, u16 *);
979 void (*cqp_post_sq)(struct i40iw_sc_cqp *);
980 u64 *(*cqp_get_next_send_wqe)(struct i40iw_sc_cqp *, u64 scratch);
981 enum i40iw_status_code (*cqp_destroy)(struct i40iw_sc_cqp *);
982 enum i40iw_status_code (*poll_for_cqp_op_done)(struct i40iw_sc_cqp *, u8,
983 struct i40iw_ccq_cqe_info *);
986 struct i40iw_ccq_ops {
987 enum i40iw_status_code (*ccq_init)(struct i40iw_sc_cq *,
988 struct i40iw_ccq_init_info *);
989 enum i40iw_status_code (*ccq_create)(struct i40iw_sc_cq *, u64, bool, bool);
990 enum i40iw_status_code (*ccq_destroy)(struct i40iw_sc_cq *, u64, bool);
991 enum i40iw_status_code (*ccq_create_done)(struct i40iw_sc_cq *);
992 enum i40iw_status_code (*ccq_get_cqe_info)(struct i40iw_sc_cq *,
993 struct i40iw_ccq_cqe_info *);
994 void (*ccq_arm)(struct i40iw_sc_cq *);
997 struct i40iw_ceq_ops {
998 enum i40iw_status_code (*ceq_init)(struct i40iw_sc_ceq *,
999 struct i40iw_ceq_init_info *);
1000 enum i40iw_status_code (*ceq_create)(struct i40iw_sc_ceq *, u64, bool);
1001 enum i40iw_status_code (*cceq_create_done)(struct i40iw_sc_ceq *);
1002 enum i40iw_status_code (*cceq_destroy_done)(struct i40iw_sc_ceq *);
1003 enum i40iw_status_code (*cceq_create)(struct i40iw_sc_ceq *, u64);
1004 enum i40iw_status_code (*ceq_destroy)(struct i40iw_sc_ceq *, u64, bool);
1005 void *(*process_ceq)(struct i40iw_sc_dev *, struct i40iw_sc_ceq *);
1008 struct i40iw_aeq_ops {
1009 enum i40iw_status_code (*aeq_init)(struct i40iw_sc_aeq *,
1010 struct i40iw_aeq_init_info *);
1011 enum i40iw_status_code (*aeq_create)(struct i40iw_sc_aeq *, u64, bool);
1012 enum i40iw_status_code (*aeq_destroy)(struct i40iw_sc_aeq *, u64, bool);
1013 enum i40iw_status_code (*get_next_aeqe)(struct i40iw_sc_aeq *,
1014 struct i40iw_aeqe_info *);
1015 enum i40iw_status_code (*repost_aeq_entries)(struct i40iw_sc_dev *, u32);
1016 enum i40iw_status_code (*aeq_create_done)(struct i40iw_sc_aeq *);
1017 enum i40iw_status_code (*aeq_destroy_done)(struct i40iw_sc_aeq *);
1020 struct i40iw_pd_ops {
1021 void (*pd_init)(struct i40iw_sc_dev *, struct i40iw_sc_pd *, u16);
1024 struct i40iw_priv_qp_ops {
1025 enum i40iw_status_code (*qp_init)(struct i40iw_sc_qp *, struct i40iw_qp_init_info *);
1026 enum i40iw_status_code (*qp_create)(struct i40iw_sc_qp *,
1027 struct i40iw_create_qp_info *, u64, bool);
1028 enum i40iw_status_code (*qp_modify)(struct i40iw_sc_qp *,
1029 struct i40iw_modify_qp_info *, u64, bool);
1030 enum i40iw_status_code (*qp_destroy)(struct i40iw_sc_qp *, u64, bool, bool, bool);
1031 enum i40iw_status_code (*qp_flush_wqes)(struct i40iw_sc_qp *,
1032 struct i40iw_qp_flush_info *, u64, bool);
1033 enum i40iw_status_code (*qp_upload_context)(struct i40iw_sc_dev *,
1034 struct i40iw_upload_context_info *,
1036 enum i40iw_status_code (*qp_setctx)(struct i40iw_sc_qp *, u64 *,
1037 struct i40iw_qp_host_ctx_info *);
1039 void (*qp_send_lsmm)(struct i40iw_sc_qp *, void *, u32, i40iw_stag);
1040 void (*qp_send_lsmm_nostag)(struct i40iw_sc_qp *, void *, u32);
1041 void (*qp_send_rtt)(struct i40iw_sc_qp *, bool);
1042 enum i40iw_status_code (*qp_post_wqe0)(struct i40iw_sc_qp *, u8);
1045 struct i40iw_priv_cq_ops {
1046 enum i40iw_status_code (*cq_init)(struct i40iw_sc_cq *, struct i40iw_cq_init_info *);
1047 enum i40iw_status_code (*cq_create)(struct i40iw_sc_cq *, u64, bool, bool);
1048 enum i40iw_status_code (*cq_destroy)(struct i40iw_sc_cq *, u64, bool);
1049 enum i40iw_status_code (*cq_modify)(struct i40iw_sc_cq *,
1050 struct i40iw_modify_cq_info *, u64, bool);
1053 struct i40iw_mr_ops {
1054 enum i40iw_status_code (*alloc_stag)(struct i40iw_sc_dev *,
1055 struct i40iw_allocate_stag_info *, u64, bool);
1056 enum i40iw_status_code (*mr_reg_non_shared)(struct i40iw_sc_dev *,
1057 struct i40iw_reg_ns_stag_info *,
1059 enum i40iw_status_code (*mr_reg_shared)(struct i40iw_sc_dev *,
1060 struct i40iw_register_shared_stag *,
1062 enum i40iw_status_code (*dealloc_stag)(struct i40iw_sc_dev *,
1063 struct i40iw_dealloc_stag_info *,
1065 enum i40iw_status_code (*query_stag)(struct i40iw_sc_dev *, u64, u32, bool);
1066 enum i40iw_status_code (*mw_alloc)(struct i40iw_sc_dev *, u64, u32, u16, bool);
1069 struct i40iw_cqp_misc_ops {
1070 enum i40iw_status_code (*manage_push_page)(struct i40iw_sc_cqp *,
1071 struct i40iw_cqp_manage_push_page_info *,
1073 enum i40iw_status_code (*manage_hmc_pm_func_table)(struct i40iw_sc_cqp *,
1074 u64, u8, bool, bool);
1075 enum i40iw_status_code (*set_hmc_resource_profile)(struct i40iw_sc_cqp *,
1076 u64, u8, u8, bool, bool);
1077 enum i40iw_status_code (*commit_fpm_values)(struct i40iw_sc_cqp *, u64, u8,
1078 struct i40iw_dma_mem *, bool, u8);
1079 enum i40iw_status_code (*query_fpm_values)(struct i40iw_sc_cqp *, u64, u8,
1080 struct i40iw_dma_mem *, bool, u8);
1081 enum i40iw_status_code (*static_hmc_pages_allocated)(struct i40iw_sc_cqp *,
1082 u64, u8, bool, bool);
1083 enum i40iw_status_code (*add_arp_cache_entry)(struct i40iw_sc_cqp *,
1084 struct i40iw_add_arp_cache_entry_info *,
1086 enum i40iw_status_code (*del_arp_cache_entry)(struct i40iw_sc_cqp *, u64, u16, bool);
1087 enum i40iw_status_code (*query_arp_cache_entry)(struct i40iw_sc_cqp *, u64, u16, bool);
1088 enum i40iw_status_code (*manage_apbvt_entry)(struct i40iw_sc_cqp *,
1089 struct i40iw_apbvt_info *, u64, bool);
1090 enum i40iw_status_code (*manage_qhash_table_entry)(struct i40iw_sc_cqp *,
1091 struct i40iw_qhash_table_info *, u64, bool);
1092 enum i40iw_status_code (*alloc_local_mac_ipaddr_table_entry)(struct i40iw_sc_cqp *, u64, bool);
1093 enum i40iw_status_code (*add_local_mac_ipaddr_entry)(struct i40iw_sc_cqp *,
1094 struct i40iw_local_mac_ipaddr_entry_info *,
1096 enum i40iw_status_code (*del_local_mac_ipaddr_entry)(struct i40iw_sc_cqp *, u64, u8, u8, bool);
1097 enum i40iw_status_code (*cqp_nop)(struct i40iw_sc_cqp *, u64, bool);
1098 enum i40iw_status_code (*commit_fpm_values_done)(struct i40iw_sc_cqp
1100 enum i40iw_status_code (*query_fpm_values_done)(struct i40iw_sc_cqp *);
1101 enum i40iw_status_code (*manage_hmc_pm_func_table_done)(struct i40iw_sc_cqp *);
1102 enum i40iw_status_code (*update_suspend_qp)(struct i40iw_sc_cqp *, struct i40iw_sc_qp *, u64);
1103 enum i40iw_status_code (*update_resume_qp)(struct i40iw_sc_cqp *, struct i40iw_sc_qp *, u64);
1106 struct i40iw_hmc_ops {
1107 enum i40iw_status_code (*init_iw_hmc)(struct i40iw_sc_dev *, u8);
1108 enum i40iw_status_code (*parse_fpm_query_buf)(u64 *, struct i40iw_hmc_info *,
1109 struct i40iw_hmc_fpm_misc *);
1110 enum i40iw_status_code (*configure_iw_fpm)(struct i40iw_sc_dev *, u8);
1111 enum i40iw_status_code (*parse_fpm_commit_buf)(u64 *, struct i40iw_hmc_obj_info *);
1112 enum i40iw_status_code (*create_hmc_object)(struct i40iw_sc_dev *dev,
1113 struct i40iw_hmc_create_obj_info *);
1114 enum i40iw_status_code (*del_hmc_object)(struct i40iw_sc_dev *dev,
1115 struct i40iw_hmc_del_obj_info *,
1117 enum i40iw_status_code (*pf_init_vfhmc)(struct i40iw_sc_dev *, u8, u32 *);
1118 enum i40iw_status_code (*vf_configure_vffpm)(struct i40iw_sc_dev *, u32 *);
1124 struct i40iw_sc_qp *qp;
1125 struct i40iw_create_qp_info info;
1130 struct i40iw_sc_qp *qp;
1131 struct i40iw_modify_qp_info info;
1136 struct i40iw_sc_qp *qp;
1138 bool remove_hash_idx;
1143 struct i40iw_sc_cq *cq;
1145 bool check_overflow;
1149 struct i40iw_sc_cq *cq;
1154 struct i40iw_sc_dev *dev;
1155 struct i40iw_allocate_stag_info info;
1160 struct i40iw_sc_dev *dev;
1167 struct i40iw_sc_dev *dev;
1168 struct i40iw_reg_ns_stag_info info;
1170 } mr_reg_non_shared;
1173 struct i40iw_sc_dev *dev;
1174 struct i40iw_dealloc_stag_info info;
1179 struct i40iw_sc_cqp *cqp;
1180 struct i40iw_local_mac_ipaddr_entry_info info;
1182 } add_local_mac_ipaddr_entry;
1185 struct i40iw_sc_cqp *cqp;
1186 struct i40iw_add_arp_cache_entry_info info;
1188 } add_arp_cache_entry;
1191 struct i40iw_sc_cqp *cqp;
1194 u8 ignore_ref_count;
1195 } del_local_mac_ipaddr_entry;
1198 struct i40iw_sc_cqp *cqp;
1201 } del_arp_cache_entry;
1204 struct i40iw_sc_cqp *cqp;
1205 struct i40iw_manage_vf_pble_info info;
1207 } manage_vf_pble_bp;
1210 struct i40iw_sc_cqp *cqp;
1211 struct i40iw_cqp_manage_push_page_info info;
1216 struct i40iw_sc_dev *dev;
1217 struct i40iw_upload_context_info info;
1219 } qp_upload_context;
1222 struct i40iw_sc_cqp *cqp;
1224 } alloc_local_mac_ipaddr_entry;
1227 struct i40iw_sc_dev *dev;
1228 struct i40iw_hmc_fcn_info info;
1233 struct i40iw_sc_ceq *ceq;
1238 struct i40iw_sc_ceq *ceq;
1243 struct i40iw_sc_aeq *aeq;
1248 struct i40iw_sc_aeq *aeq;
1253 struct i40iw_sc_qp *qp;
1254 struct i40iw_qp_flush_info info;
1259 struct i40iw_sc_cqp *cqp;
1260 void *fpm_values_va;
1267 struct i40iw_sc_cqp *cqp;
1268 void *fpm_values_va;
1272 } commit_fpm_values;
1275 struct i40iw_sc_cqp *cqp;
1276 struct i40iw_apbvt_info info;
1278 } manage_apbvt_entry;
1281 struct i40iw_sc_cqp *cqp;
1282 struct i40iw_qhash_table_info info;
1284 } manage_qhash_table_entry;
1287 struct i40iw_sc_dev *dev;
1288 struct i40iw_update_sds_info info;
1293 struct i40iw_sc_cqp *cqp;
1294 struct i40iw_sc_qp *qp;
1300 struct cqp_commands_info {
1301 struct list_head cqp_cmd_entry;
1307 struct i40iw_virtchnl_work_info {
1308 void (*callback_fcn)(void *vf_dev);
1309 void *worker_vf_dev;