Add Support for DLB v2.5
PATCH v4 8/27 event/dlb2: add v2.5 create ldb queue
In reply to Timothy McDanielUpdated low level hardware functions related to configuring load balanced queues. These functions create the queues, as well as attach related resources required by load balanced queues, such as sequence numbers.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 397 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 391 +++++++++++++++++ 2 files changed, 391 insertions(+), 397 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -397
@@ -1149,403 +1149,6 @@ unsigned int dlb2_finish_map_qid_procedures(struct dlb2_hw *hw)return num; } - -static void dlb2_configure_ldb_queue (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue, -struct dlb2_create_ldb_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_vf_ldb_vqid_v r0 = { {0 } }; -union dlb2_sys_vf_ldb_vqid2qid r1 = { {0 } }; -union dlb2_sys_ldb_qid2vqid r2 = { {0 } }; -union dlb2_sys_ldb_vasqid_v r3 = { {0 } }; -union dlb2_lsp_qid_ldb_infl_lim r4 = { {0 } }; -union dlb2_lsp_qid_aqed_active_lim r5 = { {0 } }; -union dlb2_aqed_pipe_qid_hid_width r6 = { {0 } }; -union dlb2_sys_ldb_qid_its r7 = { {0 } }; -union dlb2_lsp_qid_atm_depth_thrsh r8 = { {0 } }; -union dlb2_lsp_qid_naldb_depth_thrsh r9 = { {0 } }; -union dlb2_aqed_pipe_qid_fid_lim r10 = { {0 } }; -union dlb2_chp_ord_qid_sn_map r11 = { {0 } }; -union dlb2_sys_ldb_qid_cfg_v r12 = { {0 } }; -union dlb2_sys_ldb_qid_v r13 = { {0 } }; - -struct dlb2_sn_group *sn_group; -unsigned int offs; - -/* QID write permissions are turned on when the domain is started */ - r3.field.vasqid_v =0 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_LDB_QUEUES + - queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_VASQID_V (offs), r3.val); - -/* -* Unordered QIDs get 4K inflights, ordered get as many as the number -* of sequence numbers. -*/ - r4.field.limit = args->num_qid_inflights; - -DLB2_CSR_WR (hw,DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id), r4.val); - - r5.field.limit = queue->aqed_limit; - -if (r5.field.limit >DLB2_MAX_NUM_AQED_ENTRIES ) - r5.field.limit =DLB2_MAX_NUM_AQED_ENTRIES ; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_AQED_ACTIVE_LIM (queue->id.phys_id), - r5.val); - -switch (args->lock_id_comp_level) { -case 64 : - r6.field.compress_code =1 ; -break ; -case 128 : - r6.field.compress_code =2 ; -break ; -case 256 : - r6.field.compress_code =3 ; -break ; -case 512 : - r6.field.compress_code =4 ; -break ; -case 1024 : - r6.field.compress_code =5 ; -break ; -case 2048 : - r6.field.compress_code =6 ; -break ; -case 4096 : - r6.field.compress_code =7 ; -break ; -case 0 : -case 65536 : - r6.field.compress_code =0 ; - } - -DLB2_CSR_WR (hw, -DLB2_AQED_PIPE_QID_HID_WIDTH (queue->id.phys_id), - r6.val); - -/* Don't timestamp QEs that pass through this queue */ - r7.field.qid_its =0 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_QID_ITS (queue->id.phys_id), - r7.val); - - r8.field.thresh = args->depth_threshold; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_ATM_DEPTH_THRSH (queue->id.phys_id), - r8.val); - - r9.field.thresh = args->depth_threshold; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_NALDB_DEPTH_THRSH (queue->id.phys_id), - r9.val); - -/* -* This register limits the number of inflight flows a queue can have -* at one time. It has an upper bound of 2048, but can be -* over-subscribed. 512 is chosen so that a single queue doesn't use -* the entire atomic storage, but can use a substantial portion if -* needed. -*/ - r10.field.qid_fid_limit =512 ; - -DLB2_CSR_WR (hw, -DLB2_AQED_PIPE_QID_FID_LIM (queue->id.phys_id), - r10.val); - -/* Configure SNs */ - sn_group = &hw->rsrcs.sn_groups[queue->sn_group]; - r11.field.mode = sn_group->mode; - r11.field.slot = queue->sn_slot; - r11.field.grp = sn_group->id; - -DLB2_CSR_WR (hw,DLB2_CHP_ORD_QID_SN_MAP (queue->id.phys_id), r11.val); - - r12.field.sn_cfg_v = (args->num_sequence_numbers !=0 ); - r12.field.fid_cfg_v = (args->num_atomic_inflights !=0 ); - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_QID_CFG_V (queue->id.phys_id), r12.val); - -if (vdev_req) { - offs = vdev_id *DLB2_MAX_NUM_LDB_QUEUES + queue->id.virt_id; - - r0.field.vqid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VQID_V (offs), r0.val); - - r1.field.qid = queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VQID2QID (offs), r1.val); - - r2.field.vqid = queue->id.virt_id; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_QID2VQID (queue->id.phys_id), - r2.val); - } - - r13.field.qid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_QID_V (queue->id.phys_id), r13.val); -} - -static int -dlb2_ldb_queue_attach_to_sn_group (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue, -struct dlb2_create_ldb_queue_args *args) -{ -int slot =-1 ; -int i; - - queue->sn_cfg_valid = false; - -if (args->num_sequence_numbers ==0 ) -return 0 ; - -for (i =0 ; i <DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ; i++) { -struct dlb2_sn_group *group = &hw->rsrcs.sn_groups[i]; - -if (group->sequence_numbers_per_queue == - args->num_sequence_numbers && - !dlb2_sn_group_full (group)) { - slot =dlb2_sn_group_alloc_slot (group); -if (slot >=0 ) -break ; - } - } - -if (slot ==-1 ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no sequence number slots available\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue->sn_cfg_valid = true; - queue->sn_group = i; - queue->sn_slot = slot; -return 0 ; -} - -static int -dlb2_ldb_queue_attach_resources (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue, -struct dlb2_create_ldb_queue_args *args) -{ -int ret; - - ret =dlb2_ldb_queue_attach_to_sn_group (hw, queue, args); -if (ret) -return ret; - -/* Attach QID inflights */ - queue->num_qid_inflights = args->num_qid_inflights; - -/* Attach atomic inflights */ - queue->aqed_limit = args->num_atomic_inflights; - - domain->num_avail_aqed_entries -= args->num_atomic_inflights; - domain->num_used_aqed_entries += args->num_atomic_inflights; - -return 0 ; -} - -static int -dlb2_verify_create_ldb_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -int i; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -if (dlb2_list_empty (&domain->avail_ldb_queues)) { - resp->status =DLB2_ST_LDB_QUEUES_UNAVAILABLE ; -return -EINVAL ; - } - -if (args->num_sequence_numbers) { -for (i =0 ; i <DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ; i++) { -struct dlb2_sn_group *group = &hw->rsrcs.sn_groups[i]; - -if (group->sequence_numbers_per_queue == - args->num_sequence_numbers && - !dlb2_sn_group_full (group)) -break ; - } - -if (i ==DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) { - resp->status =DLB2_ST_SEQUENCE_NUMBERS_UNAVAILABLE ; -return -EINVAL ; - } - } - -if (args->num_qid_inflights >4096 ) { - resp->status =DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION ; -return -EINVAL ; - } - -/* Inflights must be <= number of sequence numbers if ordered */ -if (args->num_sequence_numbers !=0 && - args->num_qid_inflights > args->num_sequence_numbers) { - resp->status =DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION ; -return -EINVAL ; - } - -if (domain->num_avail_aqed_entries < args->num_atomic_inflights) { - resp->status =DLB2_ST_ATOMIC_INFLIGHTS_UNAVAILABLE ; -return -EINVAL ; - } - -if (args->num_atomic_inflights && - args->lock_id_comp_level !=0 && - args->lock_id_comp_level !=64 && - args->lock_id_comp_level !=128 && - args->lock_id_comp_level !=256 && - args->lock_id_comp_level !=512 && - args->lock_id_comp_level !=1024 && - args->lock_id_comp_level !=2048 && - args->lock_id_comp_level !=4096 && - args->lock_id_comp_level !=65536 ) { - resp->status =DLB2_ST_INVALID_LOCK_ID_COMP_LEVEL ; -return -EINVAL ; - } - -return 0 ; -} - -static void -dlb2_log_create_ldb_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create load-balanced queue arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tNumber of sequence numbers: %d\n" , - args->num_sequence_numbers); -DLB2_HW_DBG (hw,"\tNumber of QID inflights: %d\n" , - args->num_qid_inflights); -DLB2_HW_DBG (hw,"\tNumber of ATM inflights: %d\n" , - args->num_atomic_inflights); -} - -/** -* dlb2_hw_create_ldb_queue() - Allocate and initialize a DLB LDB queue. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_ldb_queue (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -int ret; - -dlb2_log_create_ldb_queue_args (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_ldb_queue_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue =DLB2_DOM_LIST_HEAD (domain->avail_ldb_queues,typeof (*queue)); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available ldb queues\n" , - __func__, __LINE__); -return -EFAULT ; - } - - ret =dlb2_ldb_queue_attach_resources (hw, domain, queue, args); -if (ret <0 ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: failed to attach the ldb queue resources\n" , - __func__, __LINE__); -return ret; - } - -dlb2_configure_ldb_queue (hw, domain, queue, args, vdev_req, vdev_id); - - queue->num_mappings =0 ; - - queue->configured = true; - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list. -*/ -dlb2_list_del (&domain->avail_ldb_queues, &queue->domain_list); - -dlb2_list_add (&domain->used_ldb_queues, &queue->domain_list); - - resp->status =0 ; - resp->id = (vdev_req) ? queue->id.virt_id : queue->id.phys_id; - -return 0 ; -} -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) {if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS )
drivers/event/dlb2/pf/base/dlb2_resource_new.c +391 -0
394 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 9/27 event/dlb2: add v2.5 create ldb port
In reply to Timothy McDanielUpdate the low level HW functions responsible for creating load balanced ports. These functions create the producer port (PP), configure the consumer queue (CQ), and validate the port creation arguments.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 490 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 471 +++++++++++++++++ 2 files changed, 471 insertions(+), 490 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -490
@@ -1216,496 +1216,6 @@ int dlb2_set_group_sequence_numbers(struct dlb2_hw *hw,return 0 ; } -static void dlb2_ldb_port_configure_pp (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_ldb_pp2vas r0 = { {0 } }; -union dlb2_sys_ldb_pp_v r4 = { {0 } }; - - r0.field.vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_PP2VAS (port->id.phys_id), r0.val); - -if (vdev_req) { -union dlb2_sys_vf_ldb_vpp2pp r1 = { {0 } }; -union dlb2_sys_ldb_pp2vdev r2 = { {0 } }; -union dlb2_sys_vf_ldb_vpp_v r3 = { {0 } }; -unsigned int offs; -u32 virt_id; - -/* -* DLB uses producer port address bits 17:12 to determine the -* producer port ID. In Scalable IOV mode, PP accesses come -* through the PF MMIO window for the physical producer port, -* so for translation purposes the virtual and physical port -* IDs are equal. -*/ -if (hw->virt_mode ==DLB2_VIRT_SRIOV ) - virt_id = port->id.virt_id; -else - virt_id = port->id.phys_id; - - r1.field.pp = port->id.phys_id; - - offs = vdev_id *DLB2_MAX_NUM_LDB_PORTS + virt_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VPP2PP (offs), r1.val); - - r2.field.vdev = vdev_id; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_PP2VDEV (port->id.phys_id), - r2.val); - - r3.field.vpp_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VPP_V (offs), r3.val); - } - - r4.field.pp_v =1 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_PP_V (port->id.phys_id), - r4.val); -} - -static int dlb2_ldb_port_configure_cq (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_ldb_cq_addr_l r0 = { {0 } }; -union dlb2_sys_ldb_cq_addr_u r1 = { {0 } }; -union dlb2_sys_ldb_cq2vf_pf_ro r2 = { {0 } }; -union dlb2_chp_ldb_cq_tkn_depth_sel r3 = { {0 } }; -union dlb2_lsp_cq_ldb_tkn_depth_sel r4 = { {0 } }; -union dlb2_chp_hist_list_lim r5 = { {0 } }; -union dlb2_chp_hist_list_base r6 = { {0 } }; -union dlb2_lsp_cq_ldb_infl_lim r7 = { {0 } }; -union dlb2_chp_hist_list_push_ptr r8 = { {0 } }; -union dlb2_chp_hist_list_pop_ptr r9 = { {0 } }; -union dlb2_sys_ldb_cq_at r10 = { {0 } }; -union dlb2_sys_ldb_cq_pasid r11 = { {0 } }; -union dlb2_chp_ldb_cq2vas r12 = { {0 } }; -union dlb2_lsp_cq2priov r13 = { {0 } }; - -/* The CQ address is 64B-aligned, and the DLB only wants bits [63:6] */ - r0.field.addr_l = cq_dma_base >>6 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ_ADDR_L (port->id.phys_id), r0.val); - - r1.field.addr_u = cq_dma_base >>32 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ_ADDR_U (port->id.phys_id), r1.val); - -/* -* 'ro' == relaxed ordering. This setting allows DLB2 to write -* cache lines out-of-order (but QEs within a cache line are always -* updated in-order). -*/ - r2.field.vf = vdev_id; - r2.field.is_pf = !vdev_req && (hw->virt_mode !=DLB2_VIRT_SIOV ); - r2.field.ro =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ2VF_PF_RO (port->id.phys_id), r2.val); - -if (args->cq_depth <=8 ) { - r3.field.token_depth_select =1 ; - }else if (args->cq_depth ==16 ) { - r3.field.token_depth_select =2 ; - }else if (args->cq_depth ==32 ) { - r3.field.token_depth_select =3 ; - }else if (args->cq_depth ==64 ) { - r3.field.token_depth_select =4 ; - }else if (args->cq_depth ==128 ) { - r3.field.token_depth_select =5 ; - }else if (args->cq_depth ==256 ) { - r3.field.token_depth_select =6 ; - }else if (args->cq_depth ==512 ) { - r3.field.token_depth_select =7 ; - }else if (args->cq_depth ==1024 ) { - r3.field.token_depth_select =8 ; - }else { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: invalid CQ depth\n" , - __func__, __LINE__); -return -EFAULT ; - } - -DLB2_CSR_WR (hw, -DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL (port->id.phys_id), - r3.val); - -/* -* To support CQs with depth less than 8, program the token count -* register with a non-zero initial value. Operations such as domain -* reset must take this initial value into account when quiescing the -* CQ. -*/ - port->init_tkn_cnt =0 ; - -if (args->cq_depth <8 ) { -union dlb2_lsp_cq_ldb_tkn_cnt r14 = { {0 } }; - - port->init_tkn_cnt =8 - args->cq_depth; - - r14.field.token_count = port->init_tkn_cnt; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_LDB_TKN_CNT (port->id.phys_id), - r14.val); - }else { -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_LDB_TKN_CNT (port->id.phys_id), -DLB2_LSP_CQ_LDB_TKN_CNT_RST ); - } - - r4.field.token_depth_select = r3.field.token_depth_select; - r4.field.ignore_depth =0 ; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_LDB_TKN_DEPTH_SEL (port->id.phys_id), - r4.val); - -/* Reset the CQ write pointer */ -DLB2_CSR_WR (hw, -DLB2_CHP_LDB_CQ_WPTR (port->id.phys_id), -DLB2_CHP_LDB_CQ_WPTR_RST ); - - r5.field.limit = port->hist_list_entry_limit -1 ; - -DLB2_CSR_WR (hw,DLB2_CHP_HIST_LIST_LIM (port->id.phys_id), r5.val); - - r6.field.base = port->hist_list_entry_base; - -DLB2_CSR_WR (hw,DLB2_CHP_HIST_LIST_BASE (port->id.phys_id), r6.val); - -/* -* The inflight limit sets a cap on the number of QEs for which this CQ -* can owe completions at one time. -*/ - r7.field.limit = args->cq_history_list_size; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_LDB_INFL_LIM (port->id.phys_id), r7.val); - - r8.field.push_ptr = r6.field.base; - r8.field.generation =0 ; - -DLB2_CSR_WR (hw, -DLB2_CHP_HIST_LIST_PUSH_PTR (port->id.phys_id), - r8.val); - - r9.field.pop_ptr = r6.field.base; - r9.field.generation =0 ; - -DLB2_CSR_WR (hw,DLB2_CHP_HIST_LIST_POP_PTR (port->id.phys_id), r9.val); - -/* -* Address translation (AT) settings: 0: untranslated, 2: translated -* (see ATS spec regarding Address Type field for more details) -*/ - r10.field.cq_at =0 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ_AT (port->id.phys_id), r10.val); - -if (vdev_req && hw->virt_mode ==DLB2_VIRT_SIOV ) { - r11.field.pasid = hw->pasid[vdev_id]; - r11.field.fmt2 =1 ; - } - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_CQ_PASID (port->id.phys_id), - r11.val); - - r12.field.cq2vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_CHP_LDB_CQ2VAS (port->id.phys_id), r12.val); - -/* Disable the port's QID mappings */ - r13.field.v =0 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (port->id.phys_id), r13.val); - -return 0 ; -} - -static int dlb2_configure_ldb_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -int ret, i; - - port->hist_list_entry_base = domain->hist_list_entry_base + - domain->hist_list_entry_offset; - port->hist_list_entry_limit = port->hist_list_entry_base + - args->cq_history_list_size; - - domain->hist_list_entry_offset += args->cq_history_list_size; - domain->avail_hist_list_entries -= args->cq_history_list_size; - - ret =dlb2_ldb_port_configure_cq (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); -if (ret <0 ) -return ret; - -dlb2_ldb_port_configure_pp (hw, - domain, - port, - vdev_req, - vdev_id); - -dlb2_ldb_port_cq_enable (hw, port); - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) - port->qid_map[i].state =DLB2_QUEUE_UNMAPPED ; - port->num_mappings =0 ; - - port->enabled = true; - - port->configured = true; - -return 0 ; -} - -static void -dlb2_log_create_ldb_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create load-balanced port arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tCQ depth: %d\n" , - args->cq_depth); -DLB2_HW_DBG (hw,"\tCQ hist list size: %d\n" , - args->cq_history_list_size); -DLB2_HW_DBG (hw,"\tCQ base address: 0x%lx\n" , - cq_dma_base); -DLB2_HW_DBG (hw,"\tCoS ID: %u\n" , args->cos_id); -DLB2_HW_DBG (hw,"\tStrict CoS allocation: %u\n" , - args->cos_strict); -} - -static int -dlb2_verify_create_ldb_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -int i; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -if (args->cos_id >=DLB2_NUM_COS_DOMAINS ) { - resp->status =DLB2_ST_INVALID_COS_ID ; -return -EINVAL ; - } - -if (args->cos_strict) { -if (dlb2_list_empty (&domain->avail_ldb_ports[args->cos_id])) { - resp->status =DLB2_ST_LDB_PORTS_UNAVAILABLE ; -return -EINVAL ; - } - }else { -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { -if (!dlb2_list_empty (&domain->avail_ldb_ports[i])) -break ; - } - -if (i ==DLB2_NUM_COS_DOMAINS ) { - resp->status =DLB2_ST_LDB_PORTS_UNAVAILABLE ; -return -EINVAL ; - } - } - -/* Check cache-line alignment */ -if ((cq_dma_base &0x3F ) !=0 ) { - resp->status =DLB2_ST_INVALID_CQ_VIRT_ADDR ; -return -EINVAL ; - } - -if (args->cq_depth !=1 && - args->cq_depth !=2 && - args->cq_depth !=4 && - args->cq_depth !=8 && - args->cq_depth !=16 && - args->cq_depth !=32 && - args->cq_depth !=64 && - args->cq_depth !=128 && - args->cq_depth !=256 && - args->cq_depth !=512 && - args->cq_depth !=1024 ) { - resp->status =DLB2_ST_INVALID_CQ_DEPTH ; -return -EINVAL ; - } - -/* The history list size must be >= 1 */ -if (!args->cq_history_list_size) { - resp->status =DLB2_ST_INVALID_HIST_LIST_DEPTH ; -return -EINVAL ; - } - -if (args->cq_history_list_size > domain->avail_hist_list_entries) { - resp->status =DLB2_ST_HIST_LIST_ENTRIES_UNAVAILABLE ; -return -EINVAL ; - } - -return 0 ; -} - - -/** -* dlb2_hw_create_ldb_port() - Allocate and initialize a load-balanced port and -* its resources. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @cq_dma_base: Base DMA address for consumer queue memory -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_ldb_port (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_port_args *args, -uintptr_t cq_dma_base, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_port *port; -int ret, cos_id, i; - -dlb2_log_create_ldb_port_args (hw, - domain_id, - cq_dma_base, - args, - vdev_req, - vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_ldb_port_args (hw, - domain_id, - cq_dma_base, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (args->cos_strict) { - cos_id = args->cos_id; - - port =DLB2_DOM_LIST_HEAD (domain->avail_ldb_ports[cos_id], -typeof (*port)); - }else { -int idx; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - idx = (args->cos_id + i) %DLB2_NUM_COS_DOMAINS ; - - port =DLB2_DOM_LIST_HEAD (domain->avail_ldb_ports[idx], -typeof (*port)); -if (port) -break ; - } - - cos_id = idx; - } - -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available ldb ports\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (port->configured) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: avail_ldb_ports contains configured ports.\n" , - __func__); -return -EFAULT ; - } - - ret =dlb2_configure_ldb_port (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); -if (ret <0 ) -return ret; - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list. -*/ -dlb2_list_del (&domain->avail_ldb_ports[cos_id], &port->domain_list); - -dlb2_list_add (&domain->used_ldb_ports[cos_id], &port->domain_list); - - resp->status =0 ; - resp->id = (vdev_req) ? port->id.virt_id : port->id.phys_id; - -return 0 ; -} - static void dlb2_log_create_dir_port_args(struct dlb2_hw *hw, u32 domain_id,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +471 -0
474 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 10/27 event/dlb2: add v2.5 create dir port
In reply to Timothy McDanielUpdate the low level HW functions responsible for creating directed ports. These functions create the producer port (PP), configure the consumer queue (CQ), configure queue depth, and validate the port creation arguments.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 426 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 414 +++++++++++++++++ 2 files changed, 414 insertions(+), 426 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -426
@@ -65,18 +65,6 @@ static inline void dlb2_flush_csr(struct dlb2_hw *hw)DLB2_CSR_RD (hw,DLB2_SYS_TOTAL_VAS ); } -static void dlb2_dir_port_cq_enable (struct dlb2_hw *hw, -struct dlb2_dir_pq_pair *port) -{ -union dlb2_lsp_cq_dir_dsbl reg; - - reg.field.disabled =0 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_DIR_DSBL (port->id.phys_id), reg.val); - -dlb2_flush_csr (hw); -} -static u32 dlb2_dir_queue_depth (struct dlb2_hw *hw,struct dlb2_dir_pq_pair *queue) {
@@ -1216,25 +1204,6 @@ int dlb2_set_group_sequence_numbers(struct dlb2_hw *hw,return 0 ; } -static void -dlb2_log_create_dir_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create directed port arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tCQ depth: %d\n" , - args->cq_depth); -DLB2_HW_DBG (hw,"\tCQ base address: 0x%lx\n" , - cq_dma_base); -} -static struct dlb2_dir_pq_pair * dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw, u32 id,
@@ -1256,401 +1225,6 @@ dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw,return NULL ; } -static int -dlb2_verify_create_dir_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -/* -* If the user claims the queue is already configured, validate -* the queue ID, its domain, and whether the queue is configured. -*/ -if (args->queue_id !=-1 ) { -struct dlb2_dir_pq_pair *queue; - - queue =dlb2_get_domain_used_dir_pq (hw, - args->queue_id, - vdev_req, - domain); - -if (queue ==NULL || queue->domain_id.phys_id != - domain->id.phys_id || - !queue->queue_configured) { - resp->status =DLB2_ST_INVALID_DIR_QUEUE_ID ; -return -EINVAL ; - } - } - -/* -* If the port's queue is not configured, validate that a free -* port-queue pair is available. -*/ -if (args->queue_id ==-1 && -dlb2_list_empty (&domain->avail_dir_pq_pairs)) { - resp->status =DLB2_ST_DIR_PORTS_UNAVAILABLE ; -return -EINVAL ; - } - -/* Check cache-line alignment */ -if ((cq_dma_base &0x3F ) !=0 ) { - resp->status =DLB2_ST_INVALID_CQ_VIRT_ADDR ; -return -EINVAL ; - } - -if (args->cq_depth !=1 && - args->cq_depth !=2 && - args->cq_depth !=4 && - args->cq_depth !=8 && - args->cq_depth !=16 && - args->cq_depth !=32 && - args->cq_depth !=64 && - args->cq_depth !=128 && - args->cq_depth !=256 && - args->cq_depth !=512 && - args->cq_depth !=1024 ) { - resp->status =DLB2_ST_INVALID_CQ_DEPTH ; -return -EINVAL ; - } - -return 0 ; -} - -static void dlb2_dir_port_configure_pp (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *port, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_dir_pp2vas r0 = { {0 } }; -union dlb2_sys_dir_pp_v r4 = { {0 } }; - - r0.field.vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_PP2VAS (port->id.phys_id), r0.val); - -if (vdev_req) { -union dlb2_sys_vf_dir_vpp2pp r1 = { {0 } }; -union dlb2_sys_dir_pp2vdev r2 = { {0 } }; -union dlb2_sys_vf_dir_vpp_v r3 = { {0 } }; -unsigned int offs; -u32 virt_id; - -/* -* DLB uses producer port address bits 17:12 to determine the -* producer port ID. In Scalable IOV mode, PP accesses come -* through the PF MMIO window for the physical producer port, -* so for translation purposes the virtual and physical port -* IDs are equal. -*/ -if (hw->virt_mode ==DLB2_VIRT_SRIOV ) - virt_id = port->id.virt_id; -else - virt_id = port->id.phys_id; - - r1.field.pp = port->id.phys_id; - - offs = vdev_id *DLB2_MAX_NUM_DIR_PORTS (hw->ver) + virt_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VPP2PP (offs), r1.val); - - r2.field.vdev = vdev_id; - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_PP2VDEV (port->id.phys_id), - r2.val); - - r3.field.vpp_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VPP_V (offs), r3.val); - } - - r4.field.pp_v =1 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_PP_V (port->id.phys_id), - r4.val); -} - -static int dlb2_dir_port_configure_cq (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *port, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_dir_cq_addr_l r0 = { {0 } }; -union dlb2_sys_dir_cq_addr_u r1 = { {0 } }; -union dlb2_sys_dir_cq2vf_pf_ro r2 = { {0 } }; -union dlb2_chp_dir_cq_tkn_depth_sel r3 = { {0 } }; -union dlb2_lsp_cq_dir_tkn_depth_sel_dsi r4 = { {0 } }; -union dlb2_sys_dir_cq_fmt r9 = { {0 } }; -union dlb2_sys_dir_cq_at r10 = { {0 } }; -union dlb2_sys_dir_cq_pasid r11 = { {0 } }; -union dlb2_chp_dir_cq2vas r12 = { {0 } }; - -/* The CQ address is 64B-aligned, and the DLB only wants bits [63:6] */ - r0.field.addr_l = cq_dma_base >>6 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_ADDR_L (port->id.phys_id), r0.val); - - r1.field.addr_u = cq_dma_base >>32 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_ADDR_U (port->id.phys_id), r1.val); - -/* -* 'ro' == relaxed ordering. This setting allows DLB2 to write -* cache lines out-of-order (but QEs within a cache line are always -* updated in-order). -*/ - r2.field.vf = vdev_id; - r2.field.is_pf = !vdev_req && (hw->virt_mode !=DLB2_VIRT_SIOV ); - r2.field.ro =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ2VF_PF_RO (port->id.phys_id), r2.val); - -if (args->cq_depth <=8 ) { - r3.field.token_depth_select =1 ; - }else if (args->cq_depth ==16 ) { - r3.field.token_depth_select =2 ; - }else if (args->cq_depth ==32 ) { - r3.field.token_depth_select =3 ; - }else if (args->cq_depth ==64 ) { - r3.field.token_depth_select =4 ; - }else if (args->cq_depth ==128 ) { - r3.field.token_depth_select =5 ; - }else if (args->cq_depth ==256 ) { - r3.field.token_depth_select =6 ; - }else if (args->cq_depth ==512 ) { - r3.field.token_depth_select =7 ; - }else if (args->cq_depth ==1024 ) { - r3.field.token_depth_select =8 ; - }else { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: invalid CQ depth\n" , - __func__, __LINE__); -return -EFAULT ; - } - -DLB2_CSR_WR (hw, -DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL (port->id.phys_id), - r3.val); - -/* -* To support CQs with depth less than 8, program the token count -* register with a non-zero initial value. Operations such as domain -* reset must take this initial value into account when quiescing the -* CQ. -*/ - port->init_tkn_cnt =0 ; - -if (args->cq_depth <8 ) { -union dlb2_lsp_cq_dir_tkn_cnt r13 = { {0 } }; - - port->init_tkn_cnt =8 - args->cq_depth; - - r13.field.count = port->init_tkn_cnt; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_DIR_TKN_CNT (port->id.phys_id), - r13.val); - }else { -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_DIR_TKN_CNT (port->id.phys_id), -DLB2_LSP_CQ_DIR_TKN_CNT_RST ); - } - - r4.field.token_depth_select = r3.field.token_depth_select; - r4.field.disable_wb_opt =0 ; - r4.field.ignore_depth =0 ; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_DIR_TKN_DEPTH_SEL_DSI (port->id.phys_id), - r4.val); - -/* Reset the CQ write pointer */ -DLB2_CSR_WR (hw, -DLB2_CHP_DIR_CQ_WPTR (port->id.phys_id), -DLB2_CHP_DIR_CQ_WPTR_RST ); - -/* Virtualize the PPID */ - r9.field.keep_pf_ppid =0 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_FMT (port->id.phys_id), r9.val); - -/* -* Address translation (AT) settings: 0: untranslated, 2: translated -* (see ATS spec regarding Address Type field for more details) -*/ - r10.field.cq_at =0 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_AT (port->id.phys_id), r10.val); - -if (vdev_req && hw->virt_mode ==DLB2_VIRT_SIOV ) { - r11.field.pasid = hw->pasid[vdev_id]; - r11.field.fmt2 =1 ; - } - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_CQ_PASID (port->id.phys_id), - r11.val); - - r12.field.cq2vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_CHP_DIR_CQ2VAS (port->id.phys_id), r12.val); - -return 0 ; -} - -static int dlb2_configure_dir_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *port, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -int ret; - - ret =dlb2_dir_port_configure_cq (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); - -if (ret <0 ) -return ret; - -dlb2_dir_port_configure_pp (hw, - domain, - port, - vdev_req, - vdev_id); - -dlb2_dir_port_cq_enable (hw, port); - - port->enabled = true; - - port->port_configured = true; - -return 0 ; -} - -/** -* dlb2_hw_create_dir_port() - Allocate and initialize a DLB directed port -* and queue. The port/queue pair have the same ID and name. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @cq_dma_base: Base DMA address for consumer queue memory -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_dir_port (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_port_args *args, -uintptr_t cq_dma_base, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_dir_pq_pair *port; -struct dlb2_hw_domain *domain; -int ret; - -dlb2_log_create_dir_port_args (hw, - domain_id, - cq_dma_base, - args, - vdev_req, - vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_dir_port_args (hw, - domain_id, - cq_dma_base, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (args->queue_id !=-1 ) - port =dlb2_get_domain_used_dir_pq (hw, - args->queue_id, - vdev_req, - domain); -else - port =DLB2_DOM_LIST_HEAD (domain->avail_dir_pq_pairs, -typeof (*port)); -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available dir ports\n" , - __func__, __LINE__); -return -EFAULT ; - } - - ret =dlb2_configure_dir_port (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); -if (ret <0 ) -return ret; - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list (if it's not already there). -*/ -if (args->queue_id ==-1 ) { -dlb2_list_del (&domain->avail_dir_pq_pairs, &port->domain_list); - -dlb2_list_add (&domain->used_dir_pq_pairs, &port->domain_list); - } - - resp->status =0 ; - resp->id = (vdev_req) ? port->id.virt_id : port->id.phys_id; - -return 0 ; -} - static void dlb2_configure_dir_queue(struct dlb2_hw *hw, struct dlb2_hw_domain *domain, struct dlb2_dir_pq_pair *queue,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +414 -0
417 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 11/27 event/dlb2: add v2.5 create dir queue
In reply to Timothy McDanielUpdate the low level HW functions responsible for creating directed queues. These functions configure the depth threshold, configure queue depth, and validate the queue creation arguments.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 213 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 201 +++++++++++++++++ 2 files changed, 201 insertions(+), 213 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -213
@@ -1225,219 +1225,6 @@ dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw,return NULL ; } -static void dlb2_configure_dir_queue (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *queue, -struct dlb2_create_dir_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_dir_vasqid_v r0 = { {0 } }; -union dlb2_sys_dir_qid_its r1 = { {0 } }; -union dlb2_lsp_qid_dir_depth_thrsh r2 = { {0 } }; -union dlb2_sys_dir_qid_v r5 = { {0 } }; - -unsigned int offs; - -/* QID write permissions are turned on when the domain is started */ - r0.field.vasqid_v =0 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_DIR_QUEUES (hw->ver) + - queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_VASQID_V (offs), r0.val); - -/* Don't timestamp QEs that pass through this queue */ - r1.field.qid_its =0 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_QID_ITS (queue->id.phys_id), - r1.val); - - r2.field.thresh = args->depth_threshold; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_DIR_DEPTH_THRSH (queue->id.phys_id), - r2.val); - -if (vdev_req) { -union dlb2_sys_vf_dir_vqid_v r3 = { {0 } }; -union dlb2_sys_vf_dir_vqid2qid r4 = { {0 } }; - - offs = vdev_id *DLB2_MAX_NUM_DIR_QUEUES (hw->ver) - + queue->id.virt_id; - - r3.field.vqid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VQID_V (offs), r3.val); - - r4.field.qid = queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VQID2QID (offs), r4.val); - } - - r5.field.qid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_QID_V (queue->id.phys_id), r5.val); - - queue->queue_configured = true; -} - -static void -dlb2_log_create_dir_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create directed queue arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , args->port_id); -} - -static int -dlb2_verify_create_dir_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -/* -* If the user claims the port is already configured, validate the port -* ID, its domain, and whether the port is configured. -*/ -if (args->port_id !=-1 ) { -struct dlb2_dir_pq_pair *port; - - port =dlb2_get_domain_used_dir_pq (hw, - args->port_id, - vdev_req, - domain); - -if (port ==NULL || port->domain_id.phys_id != - domain->id.phys_id || !port->port_configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - } - -/* -* If the queue's port is not configured, validate that a free -* port-queue pair is available. -*/ -if (args->port_id ==-1 && -dlb2_list_empty (&domain->avail_dir_pq_pairs)) { - resp->status =DLB2_ST_DIR_QUEUES_UNAVAILABLE ; -return -EINVAL ; - } - -return 0 ; -} - -/** -* dlb2_hw_create_dir_queue() - Allocate and initialize a DLB DIR queue. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_dir_queue (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_dir_pq_pair *queue; -struct dlb2_hw_domain *domain; -int ret; - -dlb2_log_create_dir_queue_args (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_dir_queue_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (args->port_id !=-1 ) - queue =dlb2_get_domain_used_dir_pq (hw, - args->port_id, - vdev_req, - domain); -else - queue =DLB2_DOM_LIST_HEAD (domain->avail_dir_pq_pairs, -typeof (*queue)); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available dir queues\n" , - __func__, __LINE__); -return -EFAULT ; - } - -dlb2_configure_dir_queue (hw, domain, queue, args, vdev_req, vdev_id); - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list (if it's not already there). -*/ -if (args->port_id ==-1 ) { -dlb2_list_del (&domain->avail_dir_pq_pairs, - &queue->domain_list); - -dlb2_list_add (&domain->used_dir_pq_pairs, - &queue->domain_list); - } - - resp->status =0 ; - - resp->id = (vdev_req) ? queue->id.virt_id : queue->id.phys_id; - -return 0 ; -} - static bool dlb2_port_find_slot_with_pending_map_queue(struct dlb2_ldb_port *port, struct dlb2_ldb_queue *queue,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +201 -0
204 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 12/27 event/dlb2: add v2.5 map qid
In reply to Timothy McDanielUpdate the low level HW functions responsible for mapping queues to ports. These functions also validate the map arguments and verify that the maximum number of queues linked to a load balanced port does not exceed the capabilities of the hardware.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 355 --------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 418 ++++++++++++++++++ 2 files changed, 418 insertions(+), 355 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -355
@@ -1245,68 +1245,6 @@ dlb2_port_find_slot_with_pending_map_queue(struct dlb2_ldb_port *port,return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); } -static void dlb2_ldb_port_change_qid_priority (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -int slot, -struct dlb2_map_qid_args *args) -{ -union dlb2_lsp_cq2priov r0; - -/* Read-modify-write the priority and valid bit register */ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2PRIOV (port->id.phys_id)); - - r0.field.v |=1 << slot; - r0.field.prio |= (args->priority &0x7 ) << slot *3 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (port->id.phys_id), r0.val); - -dlb2_flush_csr (hw); - - port->qid_map[slot].priority = args->priority; -} - -static int dlb2_verify_map_qid_slot_available (struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -struct dlb2_cmd_response *resp) -{ -enum dlb2_qid_map_state state; -int i; - -/* Unused slot available? */ -if (port->num_mappings <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) -return 0 ; - -/* -* If the queue is already mapped (from the application's perspective), -* this is simply a priority update. -*/ - state =DLB2_QUEUE_MAPPED ; -if (dlb2_port_find_slot_queue (port, state, queue, &i)) -return 0 ; - - state =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, state, queue, &i)) -return 0 ; - -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &i)) -return 0 ; - -/* -* If the slot contains an unmap in progress, it's considered -* available. -*/ - state =DLB2_QUEUE_UNMAP_IN_PROG ; -if (dlb2_port_find_slot (port, state, &i)) -return 0 ; - - state =DLB2_QUEUE_UNMAPPED ; -if (dlb2_port_find_slot (port, state, &i)) -return 0 ; - - resp->status =DLB2_ST_NO_QID_SLOTS_AVAILABLE ; -return -EINVAL ; -} -static struct dlb2_ldb_queue * dlb2_get_domain_ldb_queue(u32 id, bool vdev_req,
@@ -1355,299 +1293,6 @@ dlb2_get_domain_used_ldb_port(u32 id,return NULL ; } -static int dlb2_verify_map_qid_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_map_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_port *port; -struct dlb2_ldb_queue *queue; -int id; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); - -if (port ==NULL || !port->configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - -if (args->priority >=DLB2_QID_PRIORITIES ) { - resp->status =DLB2_ST_INVALID_PRIORITY ; -return -EINVAL ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); - -if (queue ==NULL || !queue->configured) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - -if (queue->domain_id.phys_id != domain->id.phys_id) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - -if (port->domain_id.phys_id != domain->id.phys_id) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - -return 0 ; -} - -static void dlb2_log_map_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_map_qid_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 map QID arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , - args->port_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , - args->qid); -DLB2_HW_DBG (hw,"\tPriority: %d\n" , - args->priority); -} - -int dlb2_hw_map_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_map_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -enum dlb2_qid_map_state st; -struct dlb2_ldb_port *port; -int ret, i, id; -u8 prio; - -dlb2_log_map_qid (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_map_qid_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - prio = args->priority; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: queue not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* If there are any outstanding detach operations for this port, -* attempt to complete them. This may be necessary to free up a QID -* slot for this requested mapping. -*/ -if (port->num_pending_removals) -dlb2_domain_finish_unmap_port (hw, domain, port); - - ret =dlb2_verify_map_qid_slot_available (port, queue, resp); -if (ret) -return ret; - -/* Hardware requires disabling the CQ before mapping QIDs. */ -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - -/* -* If this is only a priority change, don't perform the full QID->CQ -* mapping procedure -*/ - st =DLB2_QUEUE_MAPPED ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (prio != port->qid_map[i].priority) { -dlb2_ldb_port_change_qid_priority (hw, port, i, args); -DLB2_HW_DBG (hw,"DLB2 map: priority change\n" ); - } - - st =DLB2_QUEUE_MAPPED ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto map_qid_done; - } - - st =DLB2_QUEUE_UNMAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (prio != port->qid_map[i].priority) { -dlb2_ldb_port_change_qid_priority (hw, port, i, args); -DLB2_HW_DBG (hw,"DLB2 map: priority change\n" ); - } - - st =DLB2_QUEUE_MAPPED ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto map_qid_done; - } - -/* -* If this is a priority change on an in-progress mapping, don't -* perform the full QID->CQ mapping procedure. -*/ - st =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[i].priority = prio; - -DLB2_HW_DBG (hw,"DLB2 map: priority change only\n" ); - - goto map_qid_done; - } - -/* -* If this is a priority change on a pending mapping, update the -* pending priority -*/ -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[i].pending_priority = prio; - -DLB2_HW_DBG (hw,"DLB2 map: priority change only\n" ); - - goto map_qid_done; - } - -/* -* If all the CQ's slots are in use, then there's an unmap in progress -* (guaranteed by dlb2_verify_map_qid_slot_available()), so add this -* mapping to pending_map and return. When the removal is completed for -* the slot's current occupant, this mapping will be performed. -*/ -if (!dlb2_port_find_slot (port,DLB2_QUEUE_UNMAPPED , &i)) { -if (dlb2_port_find_slot (port,DLB2_QUEUE_UNMAP_IN_PROG , &i)) { -enum dlb2_qid_map_state st; - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[i].pending_qid = queue->id.phys_id; - port->qid_map[i].pending_priority = prio; - - st =DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ; - - ret =dlb2_port_slot_state_transition (hw, port, queue, - i, st); -if (ret) -return ret; - -DLB2_HW_DBG (hw,"DLB2 map: map pending removal\n" ); - - goto map_qid_done; - } - } - -/* -* If the domain has started, a special "dynamic" CQ->queue mapping -* procedure is required in order to safely update the CQ<->QID tables. -* The "static" procedure cannot be used when traffic is flowing, -* because the CQ<->QID tables cannot be updated atomically and the -* scheduler won't see the new mapping unless the queue's if_status -* changes, which isn't guaranteed. -*/ - ret =dlb2_ldb_port_map_qid (hw, domain, port, queue, prio); - -/* If ret is less than zero, it's due to an internal error */ -if (ret <0 ) -return ret; - -map_qid_done: -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - - resp->status =0 ; - -return 0 ; -} - static void dlb2_log_unmap_qid(struct dlb2_hw *hw, u32 domain_id, struct dlb2_unmap_qid_args *args,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +418 -0
421 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 13/27 event/dlb2: add v2.5 unmap queue
In reply to Timothy McDanielUpdate the low level HW functions responsible for removing the linkage between a queue and a load balanced port. Runtime checks are performed on the port and queue to make sure the state is appropriate for the unmap operation, and the unmap arguments are also validated.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 331 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 298 ++++++++++++++++ 2 files changed, 298 insertions(+), 331 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -331
@@ -1225,26 +1225,6 @@ dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw,return NULL ; } -static bool -dlb2_port_find_slot_with_pending_map_queue (struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -int *slot) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -struct dlb2_ldb_port_qid_map *map = &port->qid_map[i]; - -if (map->state ==DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP && - map->pending_qid == queue->id.phys_id) -break ; - } - - *slot = i; - -return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); -} -static struct dlb2_ldb_queue * dlb2_get_domain_ldb_queue(u32 id, bool vdev_req,
@@ -1265,317 +1245,6 @@ dlb2_get_domain_ldb_queue(u32 id,return NULL ; } -static struct dlb2_ldb_port * -dlb2_get_domain_used_ldb_port (u32 id, -bool vdev_req, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int i; -RTE_SET_USED (iter); - -if (id >=DLB2_MAX_NUM_LDB_PORTS ) -return NULL ; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) -if ((!vdev_req && port->id.phys_id == id) || - (vdev_req && port->id.virt_id == id)) -return port; - - DLB2_DOM_LIST_FOR(domain->avail_ldb_ports[i], port, iter) -if ((!vdev_req && port->id.phys_id == id) || - (vdev_req && port->id.virt_id == id)) -return port; - } - -return NULL ; -} - -static void dlb2_log_unmap_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_unmap_qid_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 unmap QID arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , - args->port_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , - args->qid); -if (args->qid <DLB2_MAX_NUM_LDB_QUEUES ) -DLB2_HW_DBG (hw,"\tQueue's num mappings: %d\n" , - hw->rsrcs.ldb_queues[args->qid].num_mappings); -} - -static int dlb2_verify_unmap_qid_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_unmap_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -enum dlb2_qid_map_state state; -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -struct dlb2_ldb_port *port; -int slot; -int id; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); - -if (port ==NULL || !port->configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - -if (port->domain_id.phys_id != domain->id.phys_id) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); - -if (queue ==NULL || !queue->configured) { -DLB2_HW_ERR (hw,"[%s()] Can't unmap unconfigured queue %d\n" , - __func__, args->qid); - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - -/* -* Verify that the port has the queue mapped. From the application's -* perspective a queue is mapped if it is actually mapped, the map is -* in progress, or the map is blocked pending an unmap. -*/ - state =DLB2_QUEUE_MAPPED ; -if (dlb2_port_find_slot_queue (port, state, queue, &slot)) -return 0 ; - - state =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, state, queue, &slot)) -return 0 ; - -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &slot)) -return 0 ; - - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; -} - -int dlb2_hw_unmap_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_unmap_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -enum dlb2_qid_map_state st; -struct dlb2_ldb_port *port; -bool unmap_complete; -int i, ret, id; - -dlb2_log_unmap_qid (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_unmap_qid_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: queue not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* If the queue hasn't been mapped yet, we need to update the slot's -* state and re-enable the queue's inflights. -*/ - st =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* Since the in-progress map was aborted, re-enable the QID's -* inflights. -*/ -if (queue->num_pending_additions ==0 ) -dlb2_ldb_queue_set_inflight_limit (hw, queue); - - st =DLB2_QUEUE_UNMAPPED ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto unmap_qid_done; - } - -/* -* If the queue mapping is on hold pending an unmap, we simply need to -* update the slot's state. -*/ -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - st =DLB2_QUEUE_UNMAP_IN_PROG ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto unmap_qid_done; - } - - st =DLB2_QUEUE_MAPPED ; -if (!dlb2_port_find_slot_queue (port, st, queue, &i)) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: no available CQ slots\n" , - __func__); -return -EFAULT ; - } - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* QID->CQ mapping removal is an asynchronous procedure. It requires -* stopping the DLB2 from scheduling this CQ, draining all inflights -* from the CQ, then unmapping the queue from the CQ. This function -* simply marks the port as needing the queue unmapped, and (if -* necessary) starts the unmapping worker thread. -*/ -dlb2_ldb_port_cq_disable (hw, port); - - st =DLB2_QUEUE_UNMAP_IN_PROG ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - -/* -* Attempt to finish the unmapping now, in case the port has no -* outstanding inflights. If that's not the case, this will fail and -* the unmapping will be completed at a later time. -*/ - unmap_complete =dlb2_domain_finish_unmap_port (hw, domain, port); - -/* -* If the unmapping couldn't complete immediately, launch the worker -* thread (if it isn't already launched) to finish it later. -*/ -if (!unmap_complete && !os_worker_active (hw)) -os_schedule_work (hw); - -unmap_qid_done: - resp->status =0 ; - -return 0 ; -} - -static void -dlb2_log_pending_port_unmaps_args (struct dlb2_hw *hw, -struct dlb2_pending_port_unmaps_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB unmaps in progress arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from VF %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , args->port_id); -} - -int dlb2_hw_pending_port_unmaps (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_pending_port_unmaps_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_port *port; - -dlb2_log_pending_port_unmaps_args (hw, args, vdev_req, vdev_id); - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - - port =dlb2_get_domain_used_ldb_port (args->port_id, vdev_req, domain); -if (port ==NULL || !port->configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - - resp->id = port->num_pending_removals; - -return 0 ; -} - static int dlb2_verify_start_domain_args(struct dlb2_hw *hw, u32 domain_id, struct dlb2_cmd_response *resp,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +298 -0
301 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 14/27 event/dlb2: add v2.5 start domain
In reply to Timothy McDanielUpdate the low level HW functions responsible for starting the scheduling domain. Once a domain is started, its resources can no longer be configured, except for QID remapping and port enable/disable. The start domain arguments are validated, and an error is returned if validation fails, or if the domain is not configured or has already been started.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 123 ----------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 123 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -123
@@ -1245,129 +1245,6 @@ dlb2_get_domain_ldb_queue(u32 id,return NULL ; } -static int dlb2_verify_start_domain_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -return 0 ; -} - -static void dlb2_log_start_domain (struct dlb2_hw *hw, -u32 domain_id, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 start domain arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -} - -/** -* dlb2_hw_start_domain() - Lock the domain configuration -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @arg: User-provided arguments (unused, here for ioctl callback template). -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int -dlb2_hw_start_domain (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_start_domain_args *arg, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_list_entry *iter; -struct dlb2_dir_pq_pair *dir_queue; -struct dlb2_ldb_queue *ldb_queue; -struct dlb2_hw_domain *domain; -int ret; -RTE_SET_USED (arg); -RTE_SET_USED (iter); - -dlb2_log_start_domain (hw, domain_id, vdev_req, vdev_id); - - ret =dlb2_verify_start_domain_args (hw, - domain_id, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* Enable load-balanced and directed queue write permissions for the -* queues this domain owns. Without this, the DLB2 will drop all -* incoming traffic to those queues. -*/ - DLB2_DOM_LIST_FOR(domain->used_ldb_queues, ldb_queue, iter) { -union dlb2_sys_ldb_vasqid_v r0 = { {0 } }; -unsigned int offs; - - r0.field.vasqid_v =1 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_LDB_QUEUES + - ldb_queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_VASQID_V (offs), r0.val); - } - - DLB2_DOM_LIST_FOR(domain->used_dir_pq_pairs, dir_queue, iter) { -union dlb2_sys_dir_vasqid_v r0 = { {0 } }; -unsigned int offs; - - r0.field.vasqid_v =1 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_DIR_PORTS (hw->ver) + - dir_queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_VASQID_V (offs), r0.val); - } - -dlb2_flush_csr (hw); - - domain->started = true; - - resp->status =0 ; - -return 0 ; -} - static void dlb2_log_get_dir_queue_depth(struct dlb2_hw *hw, u32 domain_id, u32 queue_id,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +130 -0
133 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 15/27 event/dlb2: add v2.5 credit scheme
In reply to Timothy McDanielDLB v2.5 uses a different credit scheme than was used in DLB v2.0 . Specifically, there is a single credit pool for both load balanced and directed traffic, instead of a separate pool for each as is found with DLB v2.0.
--- drivers/event/dlb2/dlb2.c | 311 ++++++++++++++++++++++++++------------ 1 file changed, 212 insertions(+), 99 deletions(-)
drivers/event/dlb2/dlb2.c +212 -99
@@ -436,8 +436,13 @@ dlb2_eventdev_info_get(struct rte_eventdev *dev,*/ evdev_dlb2_default_info.max_event_ports += dlb2->num_ldb_ports; evdev_dlb2_default_info.max_event_queues += dlb2->num_ldb_queues; - evdev_dlb2_default_info.max_num_events += dlb2->max_ldb_credits; - +if (dlb2->version ==DLB2_HW_V2_5 ) { + evdev_dlb2_default_info.max_num_events += + dlb2->max_credits; + }else { + evdev_dlb2_default_info.max_num_events += + dlb2->max_ldb_credits; + } evdev_dlb2_default_info.max_event_queues =RTE_MIN (evdev_dlb2_default_info.max_event_queues,RTE_EVENT_MAX_QUEUES_PER_DEV );
@@ -451,7 +456,8 @@ dlb2_eventdev_info_get(struct rte_eventdev *dev,static int dlb2_hw_create_sched_domain (struct dlb2_hw_dev *handle, -const struct dlb2_hw_rsrcs *resources_asked) +const struct dlb2_hw_rsrcs *resources_asked, +uint8_t device_version) {int ret =0 ;struct dlb2_create_sched_domain_args *cfg;
@@ -468,8 +474,10 @@ dlb2_hw_create_sched_domain(struct dlb2_hw_dev *handle,/* DIR ports and queues */ cfg->num_dir_ports = resources_asked->num_dir_ports; - - cfg->num_dir_credits = resources_asked->num_dir_credits; +if (device_version ==DLB2_HW_V2_5 ) + cfg->num_credits = resources_asked->num_credits; +else + cfg->num_dir_credits = resources_asked->num_dir_credits;/* LDB queues */
@@ -509,8 +517,8 @@ dlb2_hw_create_sched_domain(struct dlb2_hw_dev *handle,break ; } - cfg->num_ldb_credits = - resources_asked->num_ldb_credits; +if (device_version ==DLB2_HW_V2 ) + cfg->num_ldb_credits = resources_asked->num_ldb_credits; cfg->num_atomic_inflights = DLB2_NUM_ATOMIC_INFLIGHTS_PER_QUEUE *
@@ -519,14 +527,24 @@ dlb2_hw_create_sched_domain(struct dlb2_hw_dev *handle, cfg->num_hist_list_entries = resources_asked->num_ldb_ports *DLB2_NUM_HIST_LIST_ENTRIES_PER_LDB_PORT ; -DLB2_LOG_DBG ("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d\n" , - cfg->num_ldb_queues, - resources_asked->num_ldb_ports, - cfg->num_dir_ports, - cfg->num_atomic_inflights, - cfg->num_hist_list_entries, - cfg->num_ldb_credits, - cfg->num_dir_credits); +if (device_version ==DLB2_HW_V2_5 ) { +DLB2_LOG_DBG ("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d\n" , + cfg->num_ldb_queues, + resources_asked->num_ldb_ports, + cfg->num_dir_ports, + cfg->num_atomic_inflights, + cfg->num_hist_list_entries, + cfg->num_credits); + }else { +DLB2_LOG_DBG ("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d\n" , + cfg->num_ldb_queues, + resources_asked->num_ldb_ports, + cfg->num_dir_ports, + cfg->num_atomic_inflights, + cfg->num_hist_list_entries, + cfg->num_ldb_credits, + cfg->num_dir_credits); + }/* Configure the QM */
@@ -606,7 +624,6 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)*/ if (dlb2->configured) {dlb2_hw_reset_sched_domain (dev, true); - ret =dlb2_hw_query_resources (dlb2);if (ret) { DLB2_LOG_ERR("get resources err=%d, devid=%d\n",
@@ -665,20 +682,26 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)/* 1 dir queue per dir port */ rsrcs->num_ldb_queues = config->nb_event_queues - rsrcs->num_dir_ports; -/* Scale down nb_events_limit by 4 for directed credits, since there -* are 4x as many load-balanced credits. -*/ - rsrcs->num_ldb_credits =0 ; - rsrcs->num_dir_credits =0 ; +if (dlb2->version ==DLB2_HW_V2_5 ) { + rsrcs->num_credits =0 ; +if (rsrcs->num_ldb_queues || rsrcs->num_dir_ports) + rsrcs->num_credits = config->nb_events_limit; + }else { +/* Scale down nb_events_limit by 4 for directed credits, +* since there are 4x as many load-balanced credits. +*/ + rsrcs->num_ldb_credits =0 ; + rsrcs->num_dir_credits =0 ; -if (rsrcs->num_ldb_queues) - rsrcs->num_ldb_credits = config->nb_events_limit; -if (rsrcs->num_dir_ports) - rsrcs->num_dir_credits = config->nb_events_limit /4 ; -if (dlb2->num_dir_credits_override !=-1 ) - rsrcs->num_dir_credits = dlb2->num_dir_credits_override; +if (rsrcs->num_ldb_queues) + rsrcs->num_ldb_credits = config->nb_events_limit; +if (rsrcs->num_dir_ports) + rsrcs->num_dir_credits = config->nb_events_limit /4 ; +if (dlb2->num_dir_credits_override !=-1 ) + rsrcs->num_dir_credits = dlb2->num_dir_credits_override; + } -if (dlb2_hw_create_sched_domain (handle, rsrcs) <0 ) { +if (dlb2_hw_create_sched_domain (handle, rsrcs, dlb2->version) <0 ) {DLB2_LOG_ERR ("dlb2_hw_create_sched_domain failed\n" );return -ENODEV ; }
@@ -693,10 +716,15 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev) dlb2->num_ldb_ports = dlb2->num_ports - dlb2->num_dir_ports; dlb2->num_ldb_queues = dlb2->num_queues - dlb2->num_dir_ports; dlb2->num_dir_queues = dlb2->num_dir_ports; - dlb2->ldb_credit_pool = rsrcs->num_ldb_credits; - dlb2->max_ldb_credits = rsrcs->num_ldb_credits; - dlb2->dir_credit_pool = rsrcs->num_dir_credits; - dlb2->max_dir_credits = rsrcs->num_dir_credits; +if (dlb2->version ==DLB2_HW_V2_5 ) { + dlb2->credit_pool = rsrcs->num_credits; + dlb2->max_credits = rsrcs->num_credits; + }else { + dlb2->ldb_credit_pool = rsrcs->num_ldb_credits; + dlb2->max_ldb_credits = rsrcs->num_ldb_credits; + dlb2->dir_credit_pool = rsrcs->num_dir_credits; + dlb2->max_dir_credits = rsrcs->num_dir_credits; + } dlb2->configured = true;
@@ -1170,8 +1198,9 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,struct dlb2_port *qm_port =NULL ;char mz_name[RTE_MEMZONE_NAMESIZE ];uint32_t qm_port_id; -uint16_t ldb_credit_high_watermark; -uint16_t dir_credit_high_watermark; +uint16_t ldb_credit_high_watermark =0 ; +uint16_t dir_credit_high_watermark =0 ; +uint16_t credit_high_watermark =0 ;if (handle ==NULL )return -EINVAL ;
@@ -1206,15 +1235,18 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,/* User controls the LDB high watermark via enqueue depth. The DIR high * watermark is equal, unless the directed credit pool is too small. */ - ldb_credit_high_watermark = enqueue_depth; - -/* If there are no directed ports, the kernel driver will ignore this -* port's directed credit settings. Don't use enqueue_depth if it would -* require more directed credits than are available. -*/ - dir_credit_high_watermark = -RTE_MIN (enqueue_depth, - handle->cfg.num_dir_credits / dlb2->num_ports); +if (dlb2->version ==DLB2_HW_V2 ) { + ldb_credit_high_watermark = enqueue_depth; +/* If there are no directed ports, the kernel driver will +* ignore this port's directed credit settings. Don't use +* enqueue_depth if it would require more directed credits +* than are available. +*/ + dir_credit_high_watermark = +RTE_MIN (enqueue_depth, + handle->cfg.num_dir_credits / dlb2->num_ports); + }else + credit_high_watermark = enqueue_depth;/* Per QM values */
@@ -1249,8 +1281,12 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->id = qm_port_id; - qm_port->cached_ldb_credits =0 ; - qm_port->cached_dir_credits =0 ; +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_ldb_credits =0 ; + qm_port->cached_dir_credits =0 ; + }else + qm_port->cached_credits =0 ; +/* CQs with depth < 8 use an 8-entry queue, but withhold credits so * the effective depth is smaller. */
@@ -1298,17 +1334,26 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->state =PORT_STARTED ;/* enabled at create time */ qm_port->config_state =DLB2_CONFIGURED ; - qm_port->dir_credits = dir_credit_high_watermark; - qm_port->ldb_credits = ldb_credit_high_watermark; - qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; - qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; - -DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d\n" , - qm_port_id, - dequeue_depth, - qm_port->ldb_credits, - qm_port->dir_credits); +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->dir_credits = dir_credit_high_watermark; + qm_port->ldb_credits = ldb_credit_high_watermark; + qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; + qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; + +DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d\n" , + qm_port_id, + dequeue_depth, + qm_port->ldb_credits, + qm_port->dir_credits); + }else { + qm_port->credits = credit_high_watermark; + qm_port->credit_pool[DLB2_COMBINED_POOL ] = &dlb2->credit_pool; +DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, credits=%d\n" , + qm_port_id, + dequeue_depth, + qm_port->credits); + }rte_spinlock_unlock (&handle->resource_lock);return 0 ;
@@ -1356,8 +1401,9 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,struct dlb2_port *qm_port =NULL ;char mz_name[RTE_MEMZONE_NAMESIZE ];uint32_t qm_port_id; -uint16_t ldb_credit_high_watermark; -uint16_t dir_credit_high_watermark; +uint16_t ldb_credit_high_watermark =0 ; +uint16_t dir_credit_high_watermark =0 ; +uint16_t credit_high_watermark =0 ;if (dlb2 ==NULL || handle ==NULL )return -EINVAL ;
@@ -1386,14 +1432,16 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,/* User controls the LDB high watermark via enqueue depth. The DIR high * watermark is equal, unless the directed credit pool is too small. */ - ldb_credit_high_watermark = enqueue_depth; - -/* Don't use enqueue_depth if it would require more directed credits -* than are available. -*/ - dir_credit_high_watermark = -RTE_MIN (enqueue_depth, - handle->cfg.num_dir_credits / dlb2->num_ports); +if (dlb2->version ==DLB2_HW_V2 ) { + ldb_credit_high_watermark = enqueue_depth; +/* Don't use enqueue_depth if it would require more directed +* credits than are available. +*/ + dir_credit_high_watermark = +RTE_MIN (enqueue_depth, + handle->cfg.num_dir_credits / dlb2->num_ports); + }else + credit_high_watermark = enqueue_depth;/* Per QM values */
@@ -1430,8 +1478,12 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->id = qm_port_id; - qm_port->cached_ldb_credits =0 ; - qm_port->cached_dir_credits =0 ; +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_ldb_credits =0 ; + qm_port->cached_dir_credits =0 ; + }else + qm_port->cached_credits =0 ; +/* CQs with depth < 8 use an 8-entry queue, but withhold credits so * the effective depth is smaller. */
@@ -1467,17 +1519,26 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->state =PORT_STARTED ;/* enabled at create time */ qm_port->config_state =DLB2_CONFIGURED ; - qm_port->dir_credits = dir_credit_high_watermark; - qm_port->ldb_credits = ldb_credit_high_watermark; - qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; - qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; - -DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d,%d\n" , - qm_port_id, - dequeue_depth, - dir_credit_high_watermark, - ldb_credit_high_watermark); +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->dir_credits = dir_credit_high_watermark; + qm_port->ldb_credits = ldb_credit_high_watermark; + qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; + qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; + +DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d,%d\n" , + qm_port_id, + dequeue_depth, + dir_credit_high_watermark, + ldb_credit_high_watermark); + }else { + qm_port->credits = credit_high_watermark; + qm_port->credit_pool[DLB2_COMBINED_POOL ] = &dlb2->credit_pool; +DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d\n" , + qm_port_id, + dequeue_depth, + credit_high_watermark); + }rte_spinlock_unlock (&handle->resource_lock);return 0 ;
@@ -2297,6 +2358,24 @@ dlb2_check_enqueue_hw_dir_credits(struct dlb2_port *qm_port)return 0 ; } +static inline int +dlb2_check_enqueue_hw_credits (struct dlb2_port *qm_port) +{ +if (unlikely (qm_port->cached_credits ==0 )) { + qm_port->cached_credits = +dlb2_port_credits_get (qm_port, +DLB2_COMBINED_POOL ); +if (unlikely (qm_port->cached_credits ==0 )) { +DLB2_INC_STAT ( + qm_port->ev_port->stats.traffic.tx_nospc_hw_credits,1 ); +DLB2_LOG_DBG ("credits exhausted\n" ); +return 1 ;/* credits exhausted */ + } + } + +return 0 ; +} + static __rte_always_inline voiddlb2_pp_write (struct dlb2_enqueue_qe *qe4,struct process_local_port_data *port_data)
@@ -2565,12 +2644,19 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port,if (!qm_queue->is_directed) {/* Load balanced destination queue */ -if (dlb2_check_enqueue_hw_ldb_credits (qm_port)) { - rte_errno = -ENOSPC ; -return 1 ; +if (dlb2->version ==DLB2_HW_V2 ) { +if (dlb2_check_enqueue_hw_ldb_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_ldb_credits; + }else { +if (dlb2_check_enqueue_hw_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_credits; } - cached_credits = &qm_port->cached_ldb_credits; -switch (ev->sched_type) {case RTE_SCHED_TYPE_ORDERED :DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_ORDERED\n" );
@@ -2602,12 +2688,19 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port, }else {/* Directed destination queue */ -if (dlb2_check_enqueue_hw_dir_credits (qm_port)) { - rte_errno = -ENOSPC ; -return 1 ; +if (dlb2->version ==DLB2_HW_V2 ) { +if (dlb2_check_enqueue_hw_dir_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_dir_credits; + }else { +if (dlb2_check_enqueue_hw_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_credits; } - cached_credits = &qm_port->cached_dir_credits; -DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_DIRECTED\n" ); *sched_type =DLB2_SCHED_DIRECTED ;
@@ -2891,20 +2984,40 @@ dlb2_port_credits_inc(struct dlb2_port *qm_port, int num)/* increment port credits, and return to pool if exceeds threshold */ if (!qm_port->is_directed) { - qm_port->cached_ldb_credits += num; -if (qm_port->cached_ldb_credits >=2 * batch_size) { -__atomic_fetch_add ( - qm_port->credit_pool[DLB2_LDB_QUEUE ], - batch_size, __ATOMIC_SEQ_CST); - qm_port->cached_ldb_credits -= batch_size; +if (qm_port->dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_ldb_credits += num; +if (qm_port->cached_ldb_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_LDB_QUEUE ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_ldb_credits -= batch_size; + } + }else { + qm_port->cached_credits += num; +if (qm_port->cached_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_COMBINED_POOL ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_credits -= batch_size; + } } }else { - qm_port->cached_dir_credits += num; -if (qm_port->cached_dir_credits >=2 * batch_size) { -__atomic_fetch_add ( - qm_port->credit_pool[DLB2_DIR_QUEUE ], - batch_size, __ATOMIC_SEQ_CST); - qm_port->cached_dir_credits -= batch_size; +if (qm_port->dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_dir_credits += num; +if (qm_port->cached_dir_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_DIR_QUEUE ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_dir_credits -= batch_size; + } + }else { + qm_port->cached_credits += num; +if (qm_port->cached_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_COMBINED_POOL ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_credits -= batch_size; + } } } }
Signature · 1 line
2.23.0
PATCH v4 16/27 event/dlb2: add v2.5 queue depth functions
In reply to Timothy McDanielUpdate the low level hardware functions responsible for getting the queue depth. The command arguments are also validated.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 160 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 135 +++++++++++++++ 2 files changed, 135 insertions(+), 160 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -160
@@ -65,17 +65,6 @@ static inline void dlb2_flush_csr(struct dlb2_hw *hw)DLB2_CSR_RD (hw,DLB2_SYS_TOTAL_VAS ); } -static u32 dlb2_dir_queue_depth (struct dlb2_hw *hw, -struct dlb2_dir_pq_pair *queue) -{ -union dlb2_lsp_qid_dir_enqueue_cnt r0; - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_DIR_ENQUEUE_CNT (queue->id.phys_id)); - -return r0.field.count; -} -static void dlb2_ldb_port_cq_enable (struct dlb2_hw *hw,struct dlb2_ldb_port *port) {
@@ -108,24 +97,6 @@ static void dlb2_ldb_port_cq_disable(struct dlb2_hw *hw,dlb2_flush_csr (hw); } -static u32 dlb2_ldb_queue_depth (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue) -{ -union dlb2_lsp_qid_aqed_active_cnt r0; -union dlb2_lsp_qid_atm_active r1; -union dlb2_lsp_qid_ldb_enqueue_cnt r2; - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_AQED_ACTIVE_CNT (queue->id.phys_id)); - r1.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_ATM_ACTIVE (queue->id.phys_id)); - - r2.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_ENQUEUE_CNT (queue->id.phys_id)); - -return r0.field.count + r1.field.count + r2.field.count; -} -static struct dlb2_ldb_queue * dlb2_get_ldb_queue_from_id(struct dlb2_hw *hw, u32 id,
@@ -1204,134 +1175,3 @@ int dlb2_set_group_sequence_numbers(struct dlb2_hw *hw,return 0 ; } -static struct dlb2_dir_pq_pair * -dlb2_get_domain_used_dir_pq (struct dlb2_hw *hw, -u32 id, -bool vdev_req, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_dir_pq_pair *port; -RTE_SET_USED (iter); - -if (id >=DLB2_MAX_NUM_DIR_PORTS (hw->ver)) -return NULL ; - - DLB2_DOM_LIST_FOR(domain->used_dir_pq_pairs, port, iter) -if ((!vdev_req && port->id.phys_id == id) || - (vdev_req && port->id.virt_id == id)) -return port; - -return NULL ; -} - -static struct dlb2_ldb_queue * -dlb2_get_domain_ldb_queue (u32 id, -bool vdev_req, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_queue *queue; -RTE_SET_USED (iter); - -if (id >=DLB2_MAX_NUM_LDB_QUEUES ) -return NULL ; - - DLB2_DOM_LIST_FOR(domain->used_ldb_queues, queue, iter) -if ((!vdev_req && queue->id.phys_id == id) || - (vdev_req && queue->id.virt_id == id)) -return queue; - -return NULL ; -} - -static void dlb2_log_get_dir_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -u32 queue_id, -bool vdev_req, -unsigned int vf_id) -{ -DLB2_HW_DBG (hw,"DLB get directed queue depth:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from VF %d)\n" , vf_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , queue_id); -} - -int dlb2_hw_get_dir_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_get_dir_queue_depth_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_dir_pq_pair *queue; -struct dlb2_hw_domain *domain; -int id; - - id = domain_id; - -dlb2_log_get_dir_queue_depth (hw, domain_id, args->queue_id, - vdev_req, vdev_id); - - domain =dlb2_get_domain_from_id (hw, id, vdev_req, vdev_id); -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - - id = args->queue_id; - - queue =dlb2_get_domain_used_dir_pq (hw, id, vdev_req, domain); -if (queue ==NULL ) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - - resp->id =dlb2_dir_queue_depth (hw, queue); - -return 0 ; -} - -static void dlb2_log_get_ldb_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -u32 queue_id, -bool vdev_req, -unsigned int vf_id) -{ -DLB2_HW_DBG (hw,"DLB get load-balanced queue depth:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from VF %d)\n" , vf_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , queue_id); -} - -int dlb2_hw_get_ldb_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_get_ldb_queue_depth_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; - -dlb2_log_get_ldb_queue_depth (hw, domain_id, args->queue_id, - vdev_req, vdev_id); - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - - queue =dlb2_get_domain_ldb_queue (args->queue_id, vdev_req, domain); -if (queue ==NULL ) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - - resp->id =dlb2_ldb_queue_depth (hw, queue); - -return 0 ; -}
drivers/event/dlb2/pf/base/dlb2_resource_new.c +135 -0
138 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 17/27 event/dlb2: add v2.5 finish map/unmap
In reply to Timothy McDanielUpdate the low level HW functions responsible for finishing the queue map/unmap operation, which is an asynchronous operation.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 1054 ----------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 50 + 2 files changed, 50 insertions(+), 1054 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -1054
@@ -54,1060 +54,6 @@ void dlb2_hw_enable_sparse_ldb_cq_mode(struct dlb2_hw *hw)DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , r0.val); } -/* -* The PF driver cannot assume that a register write will affect subsequent HCW -* writes. To ensure a write completes, the driver must read back a CSR. This -* function only need be called for configuration that can occur after the -* domain has started; prior to starting, applications can't send HCWs. -*/ -static inline void dlb2_flush_csr (struct dlb2_hw *hw) -{ -DLB2_CSR_RD (hw,DLB2_SYS_TOTAL_VAS ); -} - -static void dlb2_ldb_port_cq_enable (struct dlb2_hw *hw, -struct dlb2_ldb_port *port) -{ -union dlb2_lsp_cq_ldb_dsbl reg; - -/* -* Don't re-enable the port if a removal is pending. The caller should -* mark this port as enabled (if it isn't already), and when the -* removal completes the port will be enabled. -*/ -if (port->num_pending_removals) -return ; - - reg.field.disabled =0 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_LDB_DSBL (port->id.phys_id), reg.val); - -dlb2_flush_csr (hw); -} - -static void dlb2_ldb_port_cq_disable (struct dlb2_hw *hw, -struct dlb2_ldb_port *port) -{ -union dlb2_lsp_cq_ldb_dsbl reg; - - reg.field.disabled =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_LDB_DSBL (port->id.phys_id), reg.val); - -dlb2_flush_csr (hw); -} - -static struct dlb2_ldb_queue * -dlb2_get_ldb_queue_from_id (struct dlb2_hw *hw, -u32 id, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_list_entry *iter1; -struct dlb2_list_entry *iter2; -struct dlb2_function_resources *rsrcs; -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -RTE_SET_USED (iter1); -RTE_SET_USED (iter2); - -if (id >=DLB2_MAX_NUM_LDB_QUEUES ) -return NULL ; - - rsrcs = (vdev_req) ? &hw->vdev[vdev_id] : &hw->pf; - -if (!vdev_req) -return &hw->rsrcs.ldb_queues[id]; - - DLB2_FUNC_LIST_FOR(rsrcs->used_domains, domain, iter1) { - DLB2_DOM_LIST_FOR(domain->used_ldb_queues, queue, iter2) -if (queue->id.virt_id == id) -return queue; - } - - DLB2_FUNC_LIST_FOR(rsrcs->avail_ldb_queues, queue, iter1) -if (queue->id.virt_id == id) -return queue; - -return NULL ; -} - -static struct dlb2_hw_domain *dlb2_get_domain_from_id (struct dlb2_hw *hw, -u32 id, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_list_entry *iteration; -struct dlb2_function_resources *rsrcs; -struct dlb2_hw_domain *domain; -RTE_SET_USED (iteration); - -if (id >=DLB2_MAX_NUM_DOMAINS ) -return NULL ; - -if (!vdev_req) -return &hw->domains[id]; - - rsrcs = &hw->vdev[vdev_id]; - - DLB2_FUNC_LIST_FOR(rsrcs->used_domains, domain, iteration) -if (domain->id.virt_id == id) -return domain; - -return NULL ; -} - -static int dlb2_port_slot_state_transition (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -int slot, -enum dlb2_qid_map_state new_state) -{ -enum dlb2_qid_map_state curr_state = port->qid_map[slot].state; -struct dlb2_hw_domain *domain; -int domain_id; - - domain_id = port->domain_id.phys_id; - - domain =dlb2_get_domain_from_id (hw, domain_id, false,0 ); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: unable to find domain %d\n" , - __func__, domain_id); -return -EINVAL ; - } - -switch (curr_state) { -case DLB2_QUEUE_UNMAPPED : -switch (new_state) { -case DLB2_QUEUE_MAPPED : - queue->num_mappings++; - port->num_mappings++; -break ; -case DLB2_QUEUE_MAP_IN_PROG : - queue->num_pending_additions++; - domain->num_pending_additions++; -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_MAPPED : -switch (new_state) { -case DLB2_QUEUE_UNMAPPED : - queue->num_mappings--; - port->num_mappings--; -break ; -case DLB2_QUEUE_UNMAP_IN_PROG : - port->num_pending_removals++; - domain->num_pending_removals++; -break ; -case DLB2_QUEUE_MAPPED : -/* Priority change, nothing to update */ -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_MAP_IN_PROG : -switch (new_state) { -case DLB2_QUEUE_UNMAPPED : - queue->num_pending_additions--; - domain->num_pending_additions--; -break ; -case DLB2_QUEUE_MAPPED : - queue->num_mappings++; - port->num_mappings++; - queue->num_pending_additions--; - domain->num_pending_additions--; -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_UNMAP_IN_PROG : -switch (new_state) { -case DLB2_QUEUE_UNMAPPED : - port->num_pending_removals--; - domain->num_pending_removals--; - queue->num_mappings--; - port->num_mappings--; -break ; -case DLB2_QUEUE_MAPPED : - port->num_pending_removals--; - domain->num_pending_removals--; -break ; -case DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP : -/* Nothing to update */ -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP : -switch (new_state) { -case DLB2_QUEUE_UNMAP_IN_PROG : -/* Nothing to update */ -break ; -case DLB2_QUEUE_UNMAPPED : -/* -* An UNMAP_IN_PROG_PENDING_MAP slot briefly -* becomes UNMAPPED before it transitions to -* MAP_IN_PROG. -*/ - queue->num_mappings--; - port->num_mappings--; - port->num_pending_removals--; - domain->num_pending_removals--; -break ; -default : - goto error; - } -break ; -default : - goto error; - } - - port->qid_map[slot].state = new_state; - -DLB2_HW_DBG (hw, -"[%s()] queue %d -> port %d state transition (%d -> %d)\n" , - __func__, queue->id.phys_id, port->id.phys_id, - curr_state, new_state); -return 0 ; - -error: -DLB2_HW_ERR (hw, -"[%s()] Internal error: invalid queue %d -> port %d state transition (%d -> %d)\n" , - __func__, queue->id.phys_id, port->id.phys_id, - curr_state, new_state); -return -EFAULT ; -} - -static bool dlb2_port_find_slot (struct dlb2_ldb_port *port, -enum dlb2_qid_map_state state, -int *slot) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -if (port->qid_map[i].state == state) -break ; - } - - *slot = i; - -return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); -} - -static bool dlb2_port_find_slot_queue (struct dlb2_ldb_port *port, -enum dlb2_qid_map_state state, -struct dlb2_ldb_queue *queue, -int *slot) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -if (port->qid_map[i].state == state && - port->qid_map[i].qid == queue->id.phys_id) -break ; - } - - *slot = i; - -return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); -} - -/* -* dlb2_ldb_queue_{enable, disable}_mapped_cqs() don't operate exactly as -* their function names imply, and should only be called by the dynamic CQ -* mapping code. -*/ -static void dlb2_ldb_queue_disable_mapped_cqs (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int slot, i; -RTE_SET_USED (iter); - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) { -enum dlb2_qid_map_state state =DLB2_QUEUE_MAPPED ; - -if (!dlb2_port_find_slot_queue (port, state, - queue, &slot)) -continue ; - -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - } - } -} - -static void dlb2_ldb_queue_enable_mapped_cqs (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int slot, i; -RTE_SET_USED (iter); - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) { -enum dlb2_qid_map_state state =DLB2_QUEUE_MAPPED ; - -if (!dlb2_port_find_slot_queue (port, state, - queue, &slot)) -continue ; - -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - } - } -} - -static void dlb2_ldb_port_clear_queue_if_status (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -int slot) -{ -union dlb2_lsp_ldb_sched_ctrl r0 = { {0 } }; - - r0.field.cq = port->id.phys_id; - r0.field.qidix = slot; - r0.field.value =0 ; - r0.field.inflight_ok_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r0.val); - -dlb2_flush_csr (hw); -} - -static void dlb2_ldb_port_set_queue_if_status (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -int slot) -{ -union dlb2_lsp_ldb_sched_ctrl r0 = { {0 } }; - - r0.field.cq = port->id.phys_id; - r0.field.qidix = slot; - r0.field.value =1 ; - r0.field.inflight_ok_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r0.val); - -dlb2_flush_csr (hw); -} - -static int dlb2_ldb_port_map_qid_static (struct dlb2_hw *hw, -struct dlb2_ldb_port *p, -struct dlb2_ldb_queue *q, -u8 priority) -{ -union dlb2_lsp_cq2priov r0; -union dlb2_lsp_cq2qid0 r1; -union dlb2_atm_qid2cqidix_00 r2; -union dlb2_lsp_qid2cqidix_00 r3; -union dlb2_lsp_qid2cqidix2_00 r4; -enum dlb2_qid_map_state state; -int i; - -/* Look for a pending or already mapped slot, else an unused slot */ -if (!dlb2_port_find_slot_queue (p,DLB2_QUEUE_MAP_IN_PROG , q, &i) && - !dlb2_port_find_slot_queue (p,DLB2_QUEUE_MAPPED , q, &i) && - !dlb2_port_find_slot (p,DLB2_QUEUE_UNMAPPED , &i)) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: CQ has no available QID mapping slots\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* Read-modify-write the priority and valid bit register */ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2PRIOV (p->id.phys_id)); - - r0.field.v |=1 << i; - r0.field.prio |= (priority &0x7 ) << i *3 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (p->id.phys_id), r0.val); - -/* Read-modify-write the QID map register */ -if (i <4 ) - r1.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2QID0 (p->id.phys_id)); -else - r1.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2QID1 (p->id.phys_id)); - -if (i ==0 || i ==4 ) - r1.field.qid_p0 = q->id.phys_id; -if (i ==1 || i ==5 ) - r1.field.qid_p1 = q->id.phys_id; -if (i ==2 || i ==6 ) - r1.field.qid_p2 = q->id.phys_id; -if (i ==3 || i ==7 ) - r1.field.qid_p3 = q->id.phys_id; - -if (i <4 ) -DLB2_CSR_WR (hw,DLB2_LSP_CQ2QID0 (p->id.phys_id), r1.val); -else -DLB2_CSR_WR (hw,DLB2_LSP_CQ2QID1 (p->id.phys_id), r1.val); - - r2.val =DLB2_CSR_RD (hw, -DLB2_ATM_QID2CQIDIX (q->id.phys_id, - p->id.phys_id /4 )); - - r3.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX (q->id.phys_id, - p->id.phys_id /4 )); - - r4.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX2 (q->id.phys_id, - p->id.phys_id /4 )); - -switch (p->id.phys_id %4 ) { -case 0 : - r2.field.cq_p0 |=1 << i; - r3.field.cq_p0 |=1 << i; - r4.field.cq_p0 |=1 << i; -break ; - -case 1 : - r2.field.cq_p1 |=1 << i; - r3.field.cq_p1 |=1 << i; - r4.field.cq_p1 |=1 << i; -break ; - -case 2 : - r2.field.cq_p2 |=1 << i; - r3.field.cq_p2 |=1 << i; - r4.field.cq_p2 |=1 << i; -break ; - -case 3 : - r2.field.cq_p3 |=1 << i; - r3.field.cq_p3 |=1 << i; - r4.field.cq_p3 |=1 << i; -break ; - } - -DLB2_CSR_WR (hw, -DLB2_ATM_QID2CQIDIX (q->id.phys_id, p->id.phys_id /4 ), - r2.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX (q->id.phys_id, p->id.phys_id /4 ), - r3.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX2 (q->id.phys_id, p->id.phys_id /4 ), - r4.val); - -dlb2_flush_csr (hw); - - p->qid_map[i].qid = q->id.phys_id; - p->qid_map[i].priority = priority; - - state =DLB2_QUEUE_MAPPED ; - -return dlb2_port_slot_state_transition (hw, p, q, i, state); -} - -static int dlb2_ldb_port_set_has_work_bits (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -int slot) -{ -union dlb2_lsp_qid_aqed_active_cnt r0; -union dlb2_lsp_qid_ldb_enqueue_cnt r1; -union dlb2_lsp_ldb_sched_ctrl r2 = { {0 } }; - -/* Set the atomic scheduling haswork bit */ - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_AQED_ACTIVE_CNT (queue->id.phys_id)); - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =1 ; - r2.field.rlist_haswork_v = r0.field.count >0 ; - -/* Set the non-atomic scheduling haswork bit */ -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - - r1.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_ENQUEUE_CNT (queue->id.phys_id)); - -memset (&r2,0 ,sizeof (r2)); - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =1 ; - r2.field.nalb_haswork_v = (r1.field.count >0 ); - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - -dlb2_flush_csr (hw); - -return 0 ; -} - -static void dlb2_ldb_port_clear_has_work_bits (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -u8 slot) -{ -union dlb2_lsp_ldb_sched_ctrl r2 = { {0 } }; - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =0 ; - r2.field.rlist_haswork_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - -memset (&r2,0 ,sizeof (r2)); - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =0 ; - r2.field.nalb_haswork_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - -dlb2_flush_csr (hw); -} - -static void dlb2_ldb_queue_set_inflight_limit (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue) -{ -union dlb2_lsp_qid_ldb_infl_lim r0 = { {0 } }; - - r0.field.limit = queue->num_qid_inflights; - -DLB2_CSR_WR (hw,DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id), r0.val); -} - -static void dlb2_ldb_queue_clear_inflight_limit (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue) -{ -DLB2_CSR_WR (hw, -DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id), -DLB2_LSP_QID_LDB_INFL_LIM_RST ); -} - -static int dlb2_ldb_port_finish_map_qid_dynamic (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue) -{ -struct dlb2_list_entry *iter; -union dlb2_lsp_qid_ldb_infl_cnt r0; -enum dlb2_qid_map_state state; -int slot, ret, i; -u8 prio; -RTE_SET_USED (iter); - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_INFL_CNT (queue->id.phys_id)); - -if (r0.field.count) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: non-zero QID inflight count\n" , - __func__); -return -EINVAL ; - } - -/* -* Static map the port and set its corresponding has_work bits. -*/ - state =DLB2_QUEUE_MAP_IN_PROG ; -if (!dlb2_port_find_slot_queue (port, state, queue, &slot)) -return -EINVAL ; - -if (slot >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - prio = port->qid_map[slot].priority; - -/* -* Update the CQ2QID, CQ2PRIOV, and QID2CQIDX registers, and -* the port's qid_map state. -*/ - ret =dlb2_ldb_port_map_qid_static (hw, port, queue, prio); -if (ret) -return ret; - - ret =dlb2_ldb_port_set_has_work_bits (hw, port, queue, slot); -if (ret) -return ret; - -/* -* Ensure IF_status(cq,qid) is 0 before enabling the port to -* prevent spurious schedules to cause the queue's inflight -* count to increase. -*/ -dlb2_ldb_port_clear_queue_if_status (hw, port, slot); - -/* Reset the queue's inflight status */ -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) { - state =DLB2_QUEUE_MAPPED ; -if (!dlb2_port_find_slot_queue (port, state, - queue, &slot)) -continue ; - -dlb2_ldb_port_set_queue_if_status (hw, port, slot); - } - } - -dlb2_ldb_queue_set_inflight_limit (hw, queue); - -/* Re-enable CQs mapped to this queue */ -dlb2_ldb_queue_enable_mapped_cqs (hw, domain, queue); - -/* If this queue has other mappings pending, clear its inflight limit */ -if (queue->num_pending_additions >0 ) -dlb2_ldb_queue_clear_inflight_limit (hw, queue); - -return 0 ; -} - -/** -* dlb2_ldb_port_map_qid_dynamic() - perform a "dynamic" QID->CQ mapping -* @hw: dlb2_hw handle for a particular device. -* @port: load-balanced port -* @queue: load-balanced queue -* @priority: queue servicing priority -* -* Returns 0 if the queue was mapped, 1 if the mapping is scheduled to occur -* at a later point, and <0 if an error occurred. -*/ -static int dlb2_ldb_port_map_qid_dynamic (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -u8 priority) -{ -union dlb2_lsp_qid_ldb_infl_cnt r0 = { {0 } }; -enum dlb2_qid_map_state state; -struct dlb2_hw_domain *domain; -int domain_id, slot, ret; - - domain_id = port->domain_id.phys_id; - - domain =dlb2_get_domain_from_id (hw, domain_id, false,0 ); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: unable to find domain %d\n" , - __func__, port->domain_id.phys_id); -return -EINVAL ; - } - -/* -* Set the QID inflight limit to 0 to prevent further scheduling of the -* queue. -*/ -DLB2_CSR_WR (hw,DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id),0 ); - -if (!dlb2_port_find_slot (port,DLB2_QUEUE_UNMAPPED , &slot)) { -DLB2_HW_ERR (hw, -"Internal error: No available unmapped slots\n" ); -return -EFAULT ; - } - -if (slot >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[slot].qid = queue->id.phys_id; - port->qid_map[slot].priority = priority; - - state =DLB2_QUEUE_MAP_IN_PROG ; - ret =dlb2_port_slot_state_transition (hw, port, queue, slot, state); -if (ret) -return ret; - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_INFL_CNT (queue->id.phys_id)); - -if (r0.field.count) { -/* -* The queue is owed completions so it's not safe to map it -* yet. Schedule a kernel thread to complete the mapping later, -* once software has completed all the queue's inflight events. -*/ -if (!os_worker_active (hw)) -os_schedule_work (hw); - -return 1 ; - } - -/* -* Disable the affected CQ, and the CQs already mapped to the QID, -* before reading the QID's inflight count a second time. There is an -* unlikely race in which the QID may schedule one more QE after we -* read an inflight count of 0, and disabling the CQs guarantees that -* the race will not occur after a re-read of the inflight count -* register. -*/ -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - -dlb2_ldb_queue_disable_mapped_cqs (hw, domain, queue); - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_INFL_CNT (queue->id.phys_id)); - -if (r0.field.count) { -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - -dlb2_ldb_queue_enable_mapped_cqs (hw, domain, queue); - -/* -* The queue is owed completions so it's not safe to map it -* yet. Schedule a kernel thread to complete the mapping later, -* once software has completed all the queue's inflight events. -*/ -if (!os_worker_active (hw)) -os_schedule_work (hw); - -return 1 ; - } - -return dlb2_ldb_port_finish_map_qid_dynamic (hw, domain, port, queue); -} - -static void dlb2_domain_finish_map_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -union dlb2_lsp_qid_ldb_infl_cnt r0; -struct dlb2_ldb_queue *queue; -int qid; - -if (port->qid_map[i].state !=DLB2_QUEUE_MAP_IN_PROG ) -continue ; - - qid = port->qid_map[i].qid; - - queue =dlb2_get_ldb_queue_from_id (hw, qid, false,0 ); - -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: unable to find queue %d\n" , - __func__, qid); -continue ; - } - - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_QID_LDB_INFL_CNT (qid)); - -if (r0.field.count) -continue ; - -/* -* Disable the affected CQ, and the CQs already mapped to the -* QID, before reading the QID's inflight count a second time. -* There is an unlikely race in which the QID may schedule one -* more QE after we read an inflight count of 0, and disabling -* the CQs guarantees that the race will not occur after a -* re-read of the inflight count register. -*/ -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - -dlb2_ldb_queue_disable_mapped_cqs (hw, domain, queue); - - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_QID_LDB_INFL_CNT (qid)); - -if (r0.field.count) { -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - -dlb2_ldb_queue_enable_mapped_cqs (hw, domain, queue); - -continue ; - } - -dlb2_ldb_port_finish_map_qid_dynamic (hw, domain, port, queue); - } -} - -static unsigned int -dlb2_domain_finish_map_qid_procedures (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int i; -RTE_SET_USED (iter); - -if (!domain->configured || domain->num_pending_additions ==0 ) -return 0 ; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) -dlb2_domain_finish_map_port (hw, domain, port); - } - -return domain->num_pending_additions; -} - -static int dlb2_ldb_port_unmap_qid (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue) -{ -enum dlb2_qid_map_state mapped, in_progress, pending_map, unmapped; -union dlb2_lsp_cq2priov r0; -union dlb2_atm_qid2cqidix_00 r1; -union dlb2_lsp_qid2cqidix_00 r2; -union dlb2_lsp_qid2cqidix2_00 r3; -u32 queue_id; -u32 port_id; -int i; - -/* Find the queue's slot */ - mapped =DLB2_QUEUE_MAPPED ; - in_progress =DLB2_QUEUE_UNMAP_IN_PROG ; - pending_map =DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ; - -if (!dlb2_port_find_slot_queue (port, mapped, queue, &i) && - !dlb2_port_find_slot_queue (port, in_progress, queue, &i) && - !dlb2_port_find_slot_queue (port, pending_map, queue, &i)) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: QID %d isn't mapped\n" , - __func__, __LINE__, queue->id.phys_id); -return -EFAULT ; - } - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port_id = port->id.phys_id; - queue_id = queue->id.phys_id; - -/* Read-modify-write the priority and valid bit register */ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2PRIOV (port_id)); - - r0.field.v &= ~(1 << i); - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (port_id), r0.val); - - r1.val =DLB2_CSR_RD (hw, -DLB2_ATM_QID2CQIDIX (queue_id, port_id /4 )); - - r2.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX (queue_id, port_id /4 )); - - r3.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX2 (queue_id, port_id /4 )); - -switch (port_id %4 ) { -case 0 : - r1.field.cq_p0 &= ~(1 << i); - r2.field.cq_p0 &= ~(1 << i); - r3.field.cq_p0 &= ~(1 << i); -break ; - -case 1 : - r1.field.cq_p1 &= ~(1 << i); - r2.field.cq_p1 &= ~(1 << i); - r3.field.cq_p1 &= ~(1 << i); -break ; - -case 2 : - r1.field.cq_p2 &= ~(1 << i); - r2.field.cq_p2 &= ~(1 << i); - r3.field.cq_p2 &= ~(1 << i); -break ; - -case 3 : - r1.field.cq_p3 &= ~(1 << i); - r2.field.cq_p3 &= ~(1 << i); - r3.field.cq_p3 &= ~(1 << i); -break ; - } - -DLB2_CSR_WR (hw, -DLB2_ATM_QID2CQIDIX (queue_id, port_id /4 ), - r1.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX (queue_id, port_id /4 ), - r2.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX2 (queue_id, port_id /4 ), - r3.val); - -dlb2_flush_csr (hw); - - unmapped =DLB2_QUEUE_UNMAPPED ; - -return dlb2_port_slot_state_transition (hw, port, queue, i, unmapped); -} - -static int dlb2_ldb_port_map_qid (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -u8 prio) -{ -if (domain->started) -return dlb2_ldb_port_map_qid_dynamic (hw, port, queue, prio); -else -return dlb2_ldb_port_map_qid_static (hw, port, queue, prio); -} - -static void -dlb2_domain_finish_unmap_port_slot (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -int slot) -{ -enum dlb2_qid_map_state state; -struct dlb2_ldb_queue *queue; - - queue = &hw->rsrcs.ldb_queues[port->qid_map[slot].qid]; - - state = port->qid_map[slot].state; - -/* Update the QID2CQIDX and CQ2QID vectors */ -dlb2_ldb_port_unmap_qid (hw, port, queue); - -/* -* Ensure the QID will not be serviced by this {CQ, slot} by clearing -* the has_work bits -*/ -dlb2_ldb_port_clear_has_work_bits (hw, port, slot); - -/* Reset the {CQ, slot} to its default state */ -dlb2_ldb_port_set_queue_if_status (hw, port, slot); - -/* Re-enable the CQ if it wasn't manually disabled by the user */ -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - -/* -* If there is a mapping that is pending this slot's removal, perform -* the mapping now. -*/ -if (state ==DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ) { -struct dlb2_ldb_port_qid_map *map; -struct dlb2_ldb_queue *map_queue; -u8 prio; - - map = &port->qid_map[slot]; - - map->qid = map->pending_qid; - map->priority = map->pending_priority; - - map_queue = &hw->rsrcs.ldb_queues[map->qid]; - prio = map->priority; - -dlb2_ldb_port_map_qid (hw, domain, port, map_queue, prio); - } -} - -static bool dlb2_domain_finish_unmap_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port) -{ -union dlb2_lsp_cq_ldb_infl_cnt r0; -int i; - -if (port->num_pending_removals ==0 ) -return false; - -/* -* The unmap requires all the CQ's outstanding inflights to be -* completed. -*/ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ_LDB_INFL_CNT (port->id.phys_id)); -if (r0.field.count >0 ) -return false; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -struct dlb2_ldb_port_qid_map *map; - - map = &port->qid_map[i]; - -if (map->state !=DLB2_QUEUE_UNMAP_IN_PROG && - map->state !=DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ) -continue ; - -dlb2_domain_finish_unmap_port_slot (hw, domain, port, i); - } - -return true; -} - -static unsigned int -dlb2_domain_finish_unmap_qid_procedures (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int i; -RTE_SET_USED (iter); - -if (!domain->configured || domain->num_pending_removals ==0 ) -return 0 ; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) -dlb2_domain_finish_unmap_port (hw, domain, port); - } - -return domain->num_pending_removals; -} - -unsigned int dlb2_finish_unmap_qid_procedures (struct dlb2_hw *hw) -{ -int i, num =0 ; - -/* Finish queue unmap jobs for any domain that needs it */ -for (i =0 ; i <DLB2_MAX_NUM_DOMAINS ; i++) { -struct dlb2_hw_domain *domain = &hw->domains[i]; - - num +=dlb2_domain_finish_unmap_qid_procedures (hw, domain); - } - -return num; -} - -unsigned int dlb2_finish_map_qid_procedures (struct dlb2_hw *hw) -{ -int i, num =0 ; - -/* Finish queue map jobs for any domain that needs it */ -for (i =0 ; i <DLB2_MAX_NUM_DOMAINS ; i++) { -struct dlb2_hw_domain *domain = &hw->domains[i]; - - num +=dlb2_domain_finish_map_qid_procedures (hw, domain); - } - -return num; -} -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) {if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS )
drivers/event/dlb2/pf/base/dlb2_resource_new.c +50 -0
53 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 18/27 event/dlb2: add v2.5 sparse cq mode
In reply to Timothy McDanielUpdate the low level HW functions responsible for configuring sparse CQ mode, where each cache line contains just one QE instead of 4.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 22 ----------- .../event/dlb2/pf/base/dlb2_resource_new.c | 39 +++++++++++++++++++ 2 files changed, 39 insertions(+), 22 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -22
@@ -32,28 +32,6 @@#define DLB2_FUNC_LIST_FOR_SAFE (head, ptr, ptr_tmp, it, it_tmp) \ DLB2_LIST_FOR_EACH_SAFE((head), ptr, ptr_tmp, func_list, it, it_tmp) -void dlb2_hw_enable_sparse_dir_cq_mode (struct dlb2_hw *hw) -{ -union dlb2_chp_cfg_chp_csr_ctrl r0; - - r0.val =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); - - r0.field.cfg_64bytes_qe_dir_cq_mode =1 ; - -DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , r0.val); -} - -void dlb2_hw_enable_sparse_ldb_cq_mode (struct dlb2_hw *hw) -{ -union dlb2_chp_cfg_chp_csr_ctrl r0; - - r0.val =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); - - r0.field.cfg_64bytes_qe_ldb_cq_mode =1 ; - -DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , r0.val); -} -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) {if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS )
drivers/event/dlb2/pf/base/dlb2_resource_new.c +39 -0
@@ -6089,3 +6089,42 @@ unsigned int dlb2_finish_map_qid_procedures(struct dlb2_hw *hw)return num; } + +/** +* dlb2_hw_enable_sparse_dir_cq_mode() - enable sparse mode for directed ports. +* @hw: dlb2_hw handle for a particular device. +* +* This function must be called prior to configuring scheduling domains. +*/ + +void dlb2_hw_enable_sparse_dir_cq_mode (struct dlb2_hw *hw) +{ +u32 ctrl; + + ctrl =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); + +DLB2_BIT_SET (ctrl, +DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_DIR_CQ_MODE ); + +DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , ctrl); +} + +/** +* dlb2_hw_enable_sparse_ldb_cq_mode() - enable sparse mode for load-balanced +* ports. +* @hw: dlb2_hw handle for a particular device. +* +* This function must be called prior to configuring scheduling domains. +*/ +void dlb2_hw_enable_sparse_ldb_cq_mode (struct dlb2_hw *hw) +{ +u32 ctrl; + + ctrl =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); + +DLB2_BIT_SET (ctrl, +DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_LDB_CQ_MODE ); + +DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , ctrl); +} +
Signature · 1 line
2.23.0
PATCH v4 19/27 event/dlb2: add v2.5 sequence number management
In reply to Timothy McDanielUpdate the low level HW functions that perform the sequence number management functions. These include getting a groups number of sequence numbers per queue, managing in-use slots, getting the current occupancy, and setting sequence numbers for a group.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 67 ----------- drivers/event/dlb2/pf/base/dlb2_resource.h | 4 +- .../event/dlb2/pf/base/dlb2_resource_new.c | 105 ++++++++++++++++++ 3 files changed, 107 insertions(+), 69 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -67
@@ -32,70 +32,3 @@#define DLB2_FUNC_LIST_FOR_SAFE (head, ptr, ptr_tmp, it, it_tmp) \ DLB2_LIST_FOR_EACH_SAFE((head), ptr, ptr_tmp, func_list, it, it_tmp) -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) -{ -if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) -return -EINVAL ; - -return hw->rsrcs.sn_groups[group_id].sequence_numbers_per_queue; -} - -int dlb2_get_group_sequence_number_occupancy (struct dlb2_hw *hw, -unsigned int group_id) -{ -if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) -return -EINVAL ; - -return dlb2_sn_group_used_slots (&hw->rsrcs.sn_groups[group_id]); -} - -static void dlb2_log_set_group_sequence_numbers (struct dlb2_hw *hw, -unsigned int group_id, -unsigned long val) -{ -DLB2_HW_DBG (hw,"DLB2 set group sequence numbers:\n" ); -DLB2_HW_DBG (hw,"\tGroup ID: %u\n" , group_id); -DLB2_HW_DBG (hw,"\tValue: %lu\n" , val); -} - -int dlb2_set_group_sequence_numbers (struct dlb2_hw *hw, -unsigned int group_id, -unsigned long val) -{ -u32 valid_allocations[] = {64 ,128 ,256 ,512 ,1024 }; -union dlb2_ro_pipe_grp_sn_mode r0 = { {0 } }; -struct dlb2_sn_group *group; -int mode; - -if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) -return -EINVAL ; - - group = &hw->rsrcs.sn_groups[group_id]; - -/* -* Once the first load-balanced queue using an SN group is configured, -* the group cannot be changed. -*/ -if (group->slot_use_bitmap !=0 ) -return -EPERM ; - -for (mode =0 ; mode <DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES ; mode++) -if (val == valid_allocations[mode]) -break ; - -if (mode ==DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES ) -return -EINVAL ; - - group->mode = mode; - group->sequence_numbers_per_queue = val; - - r0.field.sn_mode_0 = hw->rsrcs.sn_groups[0 ].mode; - r0.field.sn_mode_1 = hw->rsrcs.sn_groups[1 ].mode; - -DLB2_CSR_WR (hw,DLB2_RO_PIPE_GRP_SN_MODE , r0.val); - -dlb2_log_set_group_sequence_numbers (hw, group_id, val); - -return 0 ; -} -
drivers/event/dlb2/pf/base/dlb2_resource.h +2 -2
@@ -792,8 +792,8 @@ int dlb2_get_group_sequence_number_occupancy(struct dlb2_hw *hw,* ordered queue is configured. */ int dlb2_set_group_sequence_numbers (struct dlb2_hw *hw, -unsigned int group_id, -unsigned long val); +u32 group_id, +u32 val);/** * dlb2_reset_domain() - reset a scheduling domain
drivers/event/dlb2/pf/base/dlb2_resource_new.c +105 -0
108 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v4 20/27 event/dlb2: use new implementation of resource header
In reply to Timothy McDanielA temporary version of dlb_resource.h (dlb_resource_new.h) was used by the previous commits in this patch series. Merge the two files now that DLB v2.5 support has been fully added to dlb_resource.c.
--- drivers/event/dlb2/pf/base/dlb2_osdep.h | 2 - drivers/event/dlb2/pf/base/dlb2_resource.h | 36 +++++++++ .../event/dlb2/pf/base/dlb2_resource_new.c | 2 +- .../event/dlb2/pf/base/dlb2_resource_new.h | 73 ------------------- drivers/event/dlb2/pf/dlb2_main.c | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- 6 files changed, 39 insertions(+), 78 deletions(-) delete mode 100644 drivers/event/dlb2/pf/base/dlb2_resource_new.h
drivers/event/dlb2/pf/base/dlb2_osdep.h +0 -2
@@ -17,8 +17,6 @@#include <rte_spinlock.h> #include "../dlb2_main.h" -/* TEMPORARY inclusion of both headers for merge */ -#include "dlb2_resource_new.h" #include "dlb2_resource.h" #include "../../dlb2_log.h"
drivers/event/dlb2/pf/base/dlb2_resource.h +36 -0
@@ -8,6 +8,42 @@#include "dlb2_user.h" #include "dlb2_osdep_types.h" +/** +* dlb2_resource_init() - initialize the device +* @hw: pointer to struct dlb2_hw. +* @ver: device version. +* +* This function initializes the device's software state (pointed to by the hw +* argument) and programs global scheduling QoS registers. This function should +* be called during driver initialization. +* +* The dlb2_hw struct must be unique per DLB 2.0 device and persist until the +* device is reset. +* +* Return: +* Returns 0 upon success, <0 otherwise. +*/ +int dlb2_resource_init (struct dlb2_hw *hw,enum dlb2_hw_ver ver); + +/** +* dlb2_clr_pmcsr_disable() - power on bulk of DLB 2.0 logic +* @hw: dlb2_hw handle for a particular device. +* @ver: device version. +* +* Clearing the PMCSR must be done at initialization to make the device fully +* operational. +*/ +void dlb2_clr_pmcsr_disable (struct dlb2_hw *hw,enum dlb2_hw_ver ver); + +/** +* dlb2_resource_free() - free device state memory +* @hw: dlb2_hw handle for a particular device. +* +* This function frees software state pointed to by dlb2_hw. This function +* should be called when resetting the device or unloading the driver. +*/ +void dlb2_resource_free (struct dlb2_hw *hw); +/** * dlb2_resource_reset() - reset in-use resources to their initial state * @hw: dlb2_hw handle for a particular device.
drivers/event/dlb2/pf/base/dlb2_resource_new.c +1 -1
@@ -11,7 +11,7 @@#include "dlb2_osdep_bitmap.h" #include "dlb2_osdep_types.h" #include "dlb2_regs_new.h" -#include "dlb2_resource_new.h" /* TEMP FOR UPSTREAMPATCHES */ +#include "dlb2_resource.h" #include "../../dlb2_priv.h" #include "../../dlb2_inline_fns.h"
drivers/event/dlb2/pf/base/dlb2_resource_new.h deleted +0 -73
73 lines not on this page · raw message
drivers/event/dlb2/pf/dlb2_main.c +1 -1
@@ -17,7 +17,7 @@#include "base/dlb2_regs_new.h" #include "base/dlb2_hw_types_new.h" -#include "base/dlb2_resource_new.h" +#include "base/dlb2_resource.h" #include "base/dlb2_osdep.h" #include "dlb2_main.h" #include "../dlb2_user.h"
drivers/event/dlb2/pf/dlb2_pf.c +1 -1
@@ -40,7 +40,7 @@#include "dlb2_main.h" #include "base/dlb2_hw_types_new.h" #include "base/dlb2_osdep.h" -#include "base/dlb2_resource_new.h" +#include "base/dlb2_resource.h" static const char *event_dlb2_pf_name =RTE_STR (EVDEV_DLB2_NAME_PMD );
Signature · 1 line
2.23.0
PATCH v4 21/27 event/dlb2: use new implementation of resource file
In reply to Timothy McDanielThe file dlb_resource_new.c now contains all of the low level functions required to support both DLB v2.0 and DLB v2.5, and the original file (dlb_resource.c) was removed in the previous commit, so rename dlb_resource_new.c to dlb_resource.c, and update the meson build file so that the new file is built.
--- drivers/event/dlb2/meson.build | 1 - drivers/event/dlb2/pf/base/dlb2_resource.c | 6205 +++++++++++++++- .../event/dlb2/pf/base/dlb2_resource_new.c | 6235 ----------------- 3 files changed, 6203 insertions(+), 6238 deletions(-) delete mode 100644 drivers/event/dlb2/pf/base/dlb2_resource_new.c
drivers/event/dlb2/meson.build +0 -1
@@ -14,7 +14,6 @@ sources = files('dlb2.c', 'pf/dlb2_main.c', 'pf/dlb2_pf.c', 'pf/base/dlb2_resource.c', - 'pf/base/dlb2_resource_new.c', 'rte_pmd_dlb2.c', 'dlb2_selftest.c' )
drivers/event/dlb2/pf/base/dlb2_resource.c +6203 -2
2,993 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource_new.c deleted +0 -6235
6,235 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.23.0
Part of the diff is not shown here. View the raw message.
PATCH v4 22/27 event/dlb2: use new implementation of HW types header
In reply to Timothy McDanielAs support for DLB v2.5 was added, modifications were made to dlb_hw_types_new.h, but the old file needed to be preserved during the port in order to meet the requirement that individual patches in a series each compile successfully. Since the DLB v2.5 support is completely integrated, it is now safe to remove the old (original) file, as well as the DLB2_USE_NEW_HEADERS define that was used to control which version of the file was to be included in certain source files.
It is now safe to rename the new file, and use it unconditionally in all DLB source files.
--- drivers/event/dlb2/pf/base/dlb2_hw_types.h | 38 +- .../event/dlb2/pf/base/dlb2_hw_types_new.h | 357 ------------------ drivers/event/dlb2/pf/base/dlb2_resource.c | 4 +- drivers/event/dlb2/pf/dlb2_main.c | 4 +- drivers/event/dlb2/pf/dlb2_main.h | 4 - drivers/event/dlb2/pf/dlb2_pf.c | 4 +- 6 files changed, 33 insertions(+), 378 deletions(-) delete mode 100644 drivers/event/dlb2/pf/base/dlb2_hw_types_new.h
drivers/event/dlb2/pf/base/dlb2_hw_types.h +30 -8
@@ -2,14 +2,21 @@* Copyright(c) 2016-2020 Intel Corporation */ -#ifndef __DLB2_HW_TYPES_H -#define __DLB2_HW_TYPES_H +#ifndef __DLB2_HW_TYPES_NEW_H +#define __DLB2_HW_TYPES_NEW_H#include "../../dlb2_priv.h" #include "dlb2_user.h" #include "dlb2_osdep_list.h" #include "dlb2_osdep_types.h" +#include "dlb2_regs_new.h" + +#define DLB2_BITS_SET (x, val, mask) (x = ((x) & ~(mask)) \ + | (((val) << (mask##_LOC)) & (mask))) +#define DLB2_BITS_CLR (x, mask) (x &= ~(mask)) +#define DLB2_BIT_SET (x, mask) ((x) |= (mask)) +#define DLB2_BITS_GET (x, mask) (((x) & (mask)) >> (mask##_LOC))#define DLB2_MAX_NUM_VDEVS 16#define DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS 2
@@ -141,7 +148,7 @@ struct dlb2_dir_pq_pair { };enum dlb2_qid_map_state { -/* The slot doesn't contain a valid queue mapping */ +/* The slot does not contain a valid queue mapping */ DLB2_QUEUE_UNMAPPED ,/* The slot contains a valid queue mapping */ DLB2_QUEUE_MAPPED ,
@@ -174,6 +181,7 @@ struct dlb2_ldb_port {u32 hist_list_entry_base;u32 hist_list_entry_limit;u32 ref_cnt; +u8 cq_depth;u8 init_tkn_cnt;u8 num_pending_removals;u8 num_mappings;
@@ -245,8 +253,15 @@ struct dlb2_hw_domain {u32 avail_hist_list_entries;u32 hist_list_entry_base;u32 hist_list_entry_offset; -u32 num_ldb_credits; -u32 num_dir_credits; +union { +struct { +u32 num_ldb_credits; +u32 num_dir_credits; + }; +struct { +u32 num_credits; + }; + };u32 num_avail_aqed_entries;u32 num_used_aqed_entries;struct dlb2_resource_id id;
@@ -269,8 +284,15 @@ struct dlb2_function_resources {u32 num_avail_ldb_queues;u32 num_avail_ldb_ports[DLB2_NUM_COS_DOMAINS ];u32 num_avail_dir_pq_pairs; -u32 num_avail_qed_entries; -u32 num_avail_dqed_entries; +union { +struct { +u32 num_avail_qed_entries; +u32 num_avail_dqed_entries; + }; +struct { +u32 num_avail_entries; + }; + };u32 num_avail_aqed_entries;u8 locked;/* (VDEV only) */ };
@@ -332,4 +354,4 @@ struct dlb2_hw { unsigned int pasid[DLB2_MAX_NUM_VDEVS]; }; -#endif /* __DLB2_HW_TYPES_H */ +#endif /* __DLB2_HW_TYPES_NEW_H */
drivers/event/dlb2/pf/base/dlb2_hw_types_new.h deleted +0 -357
357 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource.c +1 -3
@@ -2,11 +2,9 @@* Copyright(c) 2016-2020 Intel Corporation */ -#define DLB2_USE_NEW_HEADERS /* TEMPORARY FOR MERGE */ -#include "dlb2_user.h" -#include "dlb2_hw_types_new.h" +#include "dlb2_hw_types.h" #include "dlb2_osdep.h" #include "dlb2_osdep_bitmap.h" #include "dlb2_osdep_types.h"
drivers/event/dlb2/pf/dlb2_main.c +1 -3
@@ -13,10 +13,8 @@#include <rte_malloc.h> #include <rte_errno.h> -#define DLB2_USE_NEW_HEADERS /* TEMPORARY FOR MERGE */ -#include "base/dlb2_regs_new.h" -#include "base/dlb2_hw_types_new.h" +#include "base/dlb2_hw_types.h" #include "base/dlb2_resource.h" #include "base/dlb2_osdep.h" #include "dlb2_main.h"
drivers/event/dlb2/pf/dlb2_main.h +0 -4
@@ -12,11 +12,7 @@#include <rte_bus_pci.h> #include <rte_eal_paging.h> -#ifdef DLB2_USE_NEW_HEADERS -#include "base/dlb2_hw_types_new.h" -#else #include "base/dlb2_hw_types.h" -#endif #include "../dlb2_user.h" #define DLB2_DEFAULT_UNREGISTER_TIMEOUT_S 5
drivers/event/dlb2/pf/dlb2_pf.c +1 -3
@@ -32,13 +32,11 @@#include <rte_memory.h> #include <rte_string_fns.h> -#define DLB2_USE_NEW_HEADERS /* TEMPORARY FOR MERGE */ -#include "../dlb2_priv.h" #include "../dlb2_iface.h" #include "../dlb2_inline_fns.h" #include "dlb2_main.h" -#include "base/dlb2_hw_types_new.h" +#include "base/dlb2_hw_types.h" #include "base/dlb2_osdep.h" #include "base/dlb2_resource.h"
Signature · 1 line
2.23.0
PATCH v4 23/27 event/dlb2: use new combined register map
In reply to Timothy McDanielAll references to the old register map have been removed, so it is safe to rename the new combined file that supports both DLB v2.0 and DLB v2.5. Also fixed all places where this file is included.
--- drivers/event/dlb2/pf/base/dlb2_hw_types.h | 2 +- drivers/event/dlb2/pf/base/dlb2_regs.h | 5955 +++++++++++++------- drivers/event/dlb2/pf/base/dlb2_regs_new.h | 4304 -------------- drivers/event/dlb2/pf/base/dlb2_resource.c | 2 +- drivers/event/dlb2/pf/dlb2_main.c | 2 +- 5 files changed, 3869 insertions(+), 6396 deletions(-) delete mode 100644 drivers/event/dlb2/pf/base/dlb2_regs_new.h
drivers/event/dlb2/pf/base/dlb2_hw_types.h +1 -1
@@ -10,7 +10,7 @@#include "dlb2_osdep_list.h" #include "dlb2_osdep_types.h" -#include "dlb2_regs_new.h" +#include "dlb2_regs.h" #define DLB2_BITS_SET (x, val, mask) (x = ((x) & ~(mask)) \ | (((val) << (mask##_LOC)) & (mask)))
drivers/event/dlb2/pf/base/dlb2_regs.h +3866 -2089
2,992 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_regs_new.h deleted +0 -4304
4,304 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource.c +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.23.0
Part of the diff is not shown here. View the raw message.
PATCH v4 24/27 event/dlb2: update xstats for v2.5
In reply to Timothy McDanielAdd DLB v2.5 specific information to xstats, such as metrics for the new credit scheme.
--- drivers/event/dlb2/dlb2_xstats.c | 41 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)
drivers/event/dlb2/dlb2_xstats.c +37 -4
@@ -9,6 +9,7 @@#include "dlb2_priv.h" #include "dlb2_inline_fns.h" +#include "pf/base/dlb2_regs.h" enum dlb2_xstats_type {/* common to device and port */
@@ -21,6 +22,7 @@ enum dlb2_xstats_type { zero_polls,/**< Call dequeue burst and return 0 */ tx_nospc_ldb_hw_credits,/**< Insufficient LDB h/w credits */ tx_nospc_dir_hw_credits,/**< Insufficient DIR h/w credits */ + tx_nospc_hw_credits,/**< Insufficient h/w credits */ tx_nospc_inflight_max,/**< Reach the new_event_threshold */ tx_nospc_new_event_limit,/**< Insufficient s/w credits */ tx_nospc_inflight_credits, /**< Port has too few s/w credits */
@@ -29,6 +31,7 @@ enum dlb2_xstats_type { inflight_events, ldb_pool_size, dir_pool_size, + pool_size,/* port specific */ tx_new,/**< Send an OP_NEW event */ tx_fwd, /**< Send an OP_FORWARD event */
@@ -129,6 +132,9 @@ dlb2_device_traffic_stat_get(struct dlb2_eventdev *dlb2,case tx_nospc_dir_hw_credits: val += port->stats.traffic.tx_nospc_dir_hw_credits;break ; +case tx_nospc_hw_credits: + val += port->stats.traffic.tx_nospc_hw_credits; +break ;case tx_nospc_inflight_max: val += port->stats.traffic.tx_nospc_inflight_max;break ;
@@ -159,6 +165,7 @@ get_dev_stat(struct dlb2_eventdev *dlb2, uint16_t obj_idx __rte_unused,case zero_polls:case tx_nospc_ldb_hw_credits:case tx_nospc_dir_hw_credits: +case tx_nospc_hw_credits:case tx_nospc_inflight_max:case tx_nospc_new_event_limit:case tx_nospc_inflight_credits:
@@ -171,6 +178,8 @@ get_dev_stat(struct dlb2_eventdev *dlb2, uint16_t obj_idx __rte_unused,return dlb2->num_ldb_credits;case dir_pool_size:return dlb2->num_dir_credits; +case pool_size: +return dlb2->num_credits;default :return -1 ; } }
@@ -203,6 +212,9 @@ get_port_stat(struct dlb2_eventdev *dlb2, uint16_t obj_idx,case tx_nospc_dir_hw_credits:return ev_port->stats.traffic.tx_nospc_dir_hw_credits; +case tx_nospc_hw_credits: +return ev_port->stats.traffic.tx_nospc_hw_credits; +case tx_nospc_inflight_max:return ev_port->stats.traffic.tx_nospc_inflight_max;
@@ -357,6 +369,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)"zero_polls" ,"tx_nospc_ldb_hw_credits" ,"tx_nospc_dir_hw_credits" , +"tx_nospc_hw_credits" ,"tx_nospc_inflight_max" ,"tx_nospc_new_event_limit" , "tx_nospc_inflight_credits",
@@ -364,6 +377,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)"inflight_events" ,"ldb_pool_size" ,"dir_pool_size" , + "pool_size", };static const enum dlb2_xstats_type dev_types[] = { rx_ok,
@@ -375,6 +389,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) zero_polls, tx_nospc_ldb_hw_credits, tx_nospc_dir_hw_credits, + tx_nospc_hw_credits, tx_nospc_inflight_max, tx_nospc_new_event_limit, tx_nospc_inflight_credits,
@@ -382,6 +397,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) inflight_events, ldb_pool_size, dir_pool_size, + pool_size, };/* Note: generated device stats are not allowed to be reset. */ static const uint8_t dev_reset_allowed[] = {
@@ -394,6 +410,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)0 ,/* zero_polls */ 0 ,/* tx_nospc_ldb_hw_credits */ 0 ,/* tx_nospc_dir_hw_credits */ +0 ,/* tx_nospc_hw_credits */ 0 ,/* tx_nospc_inflight_max */ 0 ,/* tx_nospc_new_event_limit */ 0, /* tx_nospc_inflight_credits */
@@ -401,6 +418,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)0 ,/* inflight_events */ 0 ,/* ldb_pool_size */ 0 ,/* dir_pool_size */ + 0, /* pool_size */ };static const char *const port_stats[] = { "is_configured",
@@ -415,6 +433,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)"zero_polls" ,"tx_nospc_ldb_hw_credits" ,"tx_nospc_dir_hw_credits" , +"tx_nospc_hw_credits" ,"tx_nospc_inflight_max" ,"tx_nospc_new_event_limit" , "tx_nospc_inflight_credits",
@@ -448,6 +467,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) zero_polls, tx_nospc_ldb_hw_credits, tx_nospc_dir_hw_credits, + tx_nospc_hw_credits, tx_nospc_inflight_max, tx_nospc_new_event_limit, tx_nospc_inflight_credits,
@@ -481,6 +501,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)1 ,/* zero_polls */ 1 ,/* tx_nospc_ldb_hw_credits */ 1 ,/* tx_nospc_dir_hw_credits */ +1 ,/* tx_nospc_hw_credits */ 1 ,/* tx_nospc_inflight_max */ 1 ,/* tx_nospc_new_event_limit */ 1, /* tx_nospc_inflight_credits */
@@ -935,8 +956,8 @@ dlb2_eventdev_xstats_reset(struct rte_eventdev *dev,break ;case RTE_EVENT_DEV_XSTATS_PORT :if (queue_port_id ==-1 ) { -for (i =0 ; i <DLB2_MAX_NUM_PORTS (dlb2->version); - i++) { +for (i =0 ; + i <DLB2_MAX_NUM_PORTS (dlb2->version); i++) {if (dlb2_xstats_reset_port (dlb2, i, ids, nb_ids))return -EINVAL ;
@@ -949,8 +970,8 @@ dlb2_eventdev_xstats_reset(struct rte_eventdev *dev,break ;case RTE_EVENT_DEV_XSTATS_QUEUE :if (queue_port_id ==-1 ) { -for (i =0 ; i <DLB2_MAX_NUM_QUEUES (dlb2->version); - i++) { +for (i =0 ; + i <DLB2_MAX_NUM_QUEUES (dlb2->version); i++) {if (dlb2_xstats_reset_queue (dlb2, i, ids, nb_ids))return -EINVAL ;
@@ -1048,6 +1069,9 @@ dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f)fprintf (f,"\tnum_dir_credits = %u\n" , dlb2->hw_rsrc_query_results.num_dir_credits); +fprintf (f,"\tnum_credits = %u\n" , + dlb2->hw_rsrc_query_results.num_credits); +/* Port level information */ for (i =0 ; i < dlb2->num_ports; i++) {
@@ -1102,6 +1126,12 @@ dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f)fprintf (f,"\tdir_credits = %u\n" , p->qm_port.dir_credits); +fprintf (f,"\tcached_credits = %u\n" , + p->qm_port.cached_credits); + +fprintf (f,"\tdir_credits = %u\n" , + p->qm_port.credits); + fprintf(f, "\tgenbit=%d, cq_idx=%d, cq_depth=%d\n", p->qm_port.gen_bit, p->qm_port.cq_idx,
@@ -1139,6 +1169,9 @@ dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f)fprintf (f,"\t\ttx_nospc_dir_hw_credits %" PRIu64"\n" , p->stats.traffic.tx_nospc_dir_hw_credits); +fprintf (f,"\t\ttx_nospc_hw_credits %" PRIu64"\n" , + p->stats.traffic.tx_nospc_hw_credits); +fprintf (f,"\t\ttx_nospc_inflight_max %" PRIu64"\n" , p->stats.traffic.tx_nospc_inflight_max);
Signature · 1 line
2.23.0
PATCH v4 25/27 doc/dlb2: update documentation for v2.5
In reply to Timothy McDanielUpdate the dlb documentation for v2.5. Notable differences include the new cobined credit scheme. Also cleaned up a couple of sections, and removed a duplicate section.
--- doc/guides/eventdevs/dlb2.rst | 75 +++++++++++++---------------------- 1 file changed, 27 insertions(+), 48 deletions(-)
doc/guides/eventdevs/dlb2.rst +27 -48
@@ -4,7 +4,8 @@ Driver for the Intel® Dynamic Load Balancer (DLB2) ================================================== -The DPDK dlb poll mode driver supports the Intel® Dynamic Load Balancer. +The DPDK dlb poll mode driver supports the Intel® Dynamic Load Balancer, +hardware versions 2.0 and 2.5. Prerequisites -------------
@@ -35,7 +36,7 @@ eventdev API and DLB2 misalign. Scheduling Domain Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -There are 32 scheduling domainis the DLB2. +DLB2 supports 32 scheduling domains. When one is configured, it allocates load-balanced and directed queues, ports, credits, and other hardware resources. Some resource allocations are user-controlled -- the number of queues, for example
@@ -67,42 +68,7 @@ If the ``RTE_EVENT_QUEUE_CFG_ALL_TYPES`` flag is not set, schedule_type dictates the queue's scheduling type. The ``nb_atomic_order_sequences`` queue configuration field sets the ordered -queue's reorder buffer size. DLB2 has 4 groups of ordered queues, where each -group is configured to contain either 1 queue with 1024 reorder entries, 2 -queues with 512 reorder entries, and so on down to 32 queues with 32 entries. - -When a load-balanced queue is created, the PMD will configure a new sequence -number group on-demand if num_sequence_numbers does not match a pre-existing -group with available reorder buffer entries. If all sequence number groups are -in use, no new group will be created and queue configuration will fail. (Note -that when the PMD is used with a virtual DLB2 device, it cannot change the -sequence number configuration.) - -The queue's ``nb_atomic_flows`` parameter is ignored by the DLB2 PMD, because -the DLB2 does not limit the number of flows a queue can track. In the DLB2, all -load-balanced queues can use the full 16-bit flow ID range. - -Load-Balanced Queues -~~~~~~~~~~~~~~~~~~~~ - -A load-balanced queue can support atomic and ordered scheduling, or atomic and -unordered scheduling, but not atomic and unordered and ordered scheduling. A -queue's scheduling types are controlled by the event queue configuration. - -If the user sets the ``RTE_EVENT_QUEUE_CFG_ALL_TYPES`` flag, the -``nb_atomic_order_sequences`` determines the supported scheduling types. -With non-zero ``nb_atomic_order_sequences``, the queue is configured for atomic -and ordered scheduling. In this case, ``RTE_SCHED_TYPE_PARALLEL`` scheduling is -supported by scheduling those events as ordered events. Note that when the -event is dequeued, its sched_type will be ``RTE_SCHED_TYPE_ORDERED``. Else if -``nb_atomic_order_sequences`` is zero, the queue is configured for atomic and -unordered scheduling. In this case, ``RTE_SCHED_TYPE_ORDERED`` is unsupported. - -If the ``RTE_EVENT_QUEUE_CFG_ALL_TYPES`` flag is not set, schedule_type -dictates the queue's scheduling type. - -The ``nb_atomic_order_sequences`` queue configuration field sets the ordered -queue's reorder buffer size. DLB2 has 4 groups of ordered queues, where each +queue's reorder buffer size. DLB2 has 2 groups of ordered queues, where each group is configured to contain either 1 queue with 1024 reorder entries, 2 queues with 512 reorder entries, and so on down to 32 queues with 32 entries.
@@ -157,6 +123,11 @@ type (atomic, ordered, or parallel) is not preserved, and an event's sched_type will be set to ``RTE_SCHED_TYPE_ATOMIC`` when it is dequeued from a directed port. +Finally, even though all 3 event types are supported on the same QID by +converting unordered events to ordered, such use should be discouraged as much +as possible, since mixing types on the same queue uses valuable reorder +resources, and orders events which do not require ordering. + Flow ID ~~~~~~~
@@ -169,13 +140,15 @@ Hardware Credits DLB2 uses a hardware credit scheme to prevent software from overflowing hardware event storage, with each unit of storage represented by a credit. A port spends a credit to enqueue an event, and hardware refills the ports with credits as the -events are scheduled to ports. Refills come from credit pools, and each port is -a member of a load-balanced credit pool and a directed credit pool. The -load-balanced credits are used to enqueue to load-balanced queues, and directed -credits are used for directed queues. +events are scheduled to ports. Refills come from credit pools. -A DLB2 eventdev contains one load-balanced and one directed credit pool. These -pools' sizes are controlled by the nb_events_limit field in struct +For DLB v2.5, there is a single credit pool used for both load balanced and +directed traffic. + +For DLB v2.0, each port is a member of both a load-balanced credit pool and a +directed credit pool. The load-balanced credits are used to enqueue to +load-balanced queues, and directed credits are used for directed queues. +These pools' sizes are controlled by the nb_events_limit field in struct rte_event_dev_config. The load-balanced pool is sized to contain nb_events_limit credits, and the directed pool is sized to contain nb_events_limit/4 credits. The directed pool size can be overridden with the
@@ -276,10 +249,16 @@ The DLB2 supports event priority and per-port queue service priority, as described in the eventdev header file. The DLB2 does not support 'global' event queue priority established at queue creation time. -DLB2 supports 8 event and queue service priority levels. For both priority -types, the PMD uses the upper three bits of the priority field to determine the -DLB2 priority, discarding the 5 least significant bits. The 5 least significant -event priority bits are not preserved when an event is enqueued. +DLB2 supports 4 event and queue service priority levels. For both priority types, +the PMD uses the upper three bits of the priority field to determine the DLB2 +priority, discarding the 5 least significant bits. But least significant bit out +of 3 priority bits is effectively ignored for binning into 4 priorities. The +discarded 5 least significant event priority bits are not preserved when an event +is enqueued. + +Note that event priority only works within the same event type. +When atomic and ordered or unordered events are enqueued to same QID, priority +across the types is always equal, and both types are served in a round robin manner. Reconfiguration ~~~~~~~~~~~~~~~
Signature · 1 line
2.23.0
PATCH v4 26/27 event/dlb: rename dlb2 driver
In reply to Timothy McDanielUpdated eventdev device name to be dlb_event instead of dlb2_event. The new name will be used for all versions of the DLB hardware. This change required corresponding changes to the directory name that contains the PMD, as well as the documentation files, build infrastructure, and PMD specific APIs.
Updated 20.11 release notes to reference dlb rst file, and not dlb2 rst file, since it was renamed to match the device name as part of this patch.
---
MAINTAINERS | 6 +-
app/test/test_eventdev.c | 6 +-
config/rte_config.h | 11 ++-
doc/api/doxy-api-index.md | 2 +-
doc/api/doxy-api.conf.in | 2 +-
doc/guides/eventdevs/{dlb2.rst => dlb.rst} | 88 +++++++++----------
doc/guides/eventdevs/index.rst | 2 +-
doc/guides/rel_notes/release_20_11.rst | 2 +-
doc/guides/rel_notes/release_21_05.rst | 5 ++
drivers/event/{dlb2 => dlb}/dlb2.c | 25 +++---
drivers/event/{dlb2 => dlb}/dlb2_iface.c | 0
drivers/event/{dlb2 => dlb}/dlb2_iface.h | 0
drivers/event/{dlb2 => dlb}/dlb2_inline_fns.h | 0
drivers/event/{dlb2 => dlb}/dlb2_log.h | 0
drivers/event/{dlb2 => dlb}/dlb2_priv.h | 7 +-
drivers/event/{dlb2 => dlb}/dlb2_selftest.c | 8 +-
drivers/event/{dlb2 => dlb}/dlb2_user.h | 0
drivers/event/{dlb2 => dlb}/dlb2_xstats.c | 0
drivers/event/{dlb2 => dlb}/meson.build | 4 +-
.../{dlb2 => dlb}/pf/base/dlb2_hw_types.h | 0
.../event/{dlb2 => dlb}/pf/base/dlb2_osdep.h | 0
.../{dlb2 => dlb}/pf/base/dlb2_osdep_bitmap.h | 0
.../{dlb2 => dlb}/pf/base/dlb2_osdep_list.h | 0
.../{dlb2 => dlb}/pf/base/dlb2_osdep_types.h | 0
.../event/{dlb2 => dlb}/pf/base/dlb2_regs.h | 0
.../{dlb2 => dlb}/pf/base/dlb2_resource.c | 0
.../{dlb2 => dlb}/pf/base/dlb2_resource.h | 0
drivers/event/{dlb2 => dlb}/pf/dlb2_main.c | 0
drivers/event/{dlb2 => dlb}/pf/dlb2_main.h | 0
drivers/event/{dlb2 => dlb}/pf/dlb2_pf.c | 0
.../rte_pmd_dlb2.c => dlb/rte_pmd_dlb.c} | 6 +-
.../rte_pmd_dlb2.h => dlb/rte_pmd_dlb.h} | 12 +--
drivers/event/{dlb2 => dlb}/version.map | 2 +-
drivers/event/meson.build | 2 +-
34 files changed, 95 insertions(+), 95 deletions(-)
rename doc/guides/eventdevs/{dlb2.rst => dlb.rst} (84%)
rename drivers/event/{dlb2 => dlb}/dlb2.c (99%)
rename drivers/event/{dlb2 => dlb}/dlb2_iface.c (100%)
rename drivers/event/{dlb2 => dlb}/dlb2_iface.h (100%)
rename drivers/event/{dlb2 => dlb}/dlb2_inline_fns.h (100%)
rename drivers/event/{dlb2 => dlb}/dlb2_log.h (100%)
rename drivers/event/{dlb2 => dlb}/dlb2_priv.h (99%)
rename drivers/event/{dlb2 => dlb}/dlb2_selftest.c (99%)
rename drivers/event/{dlb2 => dlb}/dlb2_user.h (100%)
rename drivers/event/{dlb2 => dlb}/dlb2_xstats.c (100%)
rename drivers/event/{dlb2 => dlb}/meson.build (89%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_hw_types.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_osdep.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_osdep_bitmap.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_osdep_list.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_osdep_types.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_regs.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_resource.c (100%)
rename drivers/event/{dlb2 => dlb}/pf/base/dlb2_resource.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/dlb2_main.c (100%)
rename drivers/event/{dlb2 => dlb}/pf/dlb2_main.h (100%)
rename drivers/event/{dlb2 => dlb}/pf/dlb2_pf.c (100%)
rename drivers/event/{dlb2/rte_pmd_dlb2.c => dlb/rte_pmd_dlb.c} (88%)
rename drivers/event/{dlb2/rte_pmd_dlb2.h => dlb/rte_pmd_dlb.h} (88%)
rename drivers/event/{dlb2 => dlb}/version.map (60%)MAINTAINERS +3 -3
@@ -1196,10 +1196,10 @@ Cavium OCTEON TX timvf M: Pavan Nikhilesh <[email protected]> F: drivers/event/octeontx/timvf_* -Intel DLB2 +Intel DLB M: Timothy McDaniel <[email protected]> -F: drivers/event/dlb2/ -F: doc/guides/eventdevs/dlb2.rst +F: drivers/event/dlb/ +F: doc/guides/eventdevs/dlb.rst Marvell OCTEON TX2 M: Pavan Nikhilesh <[email protected]>
app/test/test_eventdev.c +3 -3
@@ -1031,9 +1031,9 @@ test_eventdev_selftest_dpaa2(void) }static int -test_eventdev_selftest_dlb2 (void ) +test_eventdev_selftest_dlb (void ) { -return test_eventdev_selftest_impl ("dlb2_event" ,"" ); +return test_eventdev_selftest_impl ("dlb_event" ,"" ); }REGISTER_TEST_COMMAND (eventdev_common_autotest, test_eventdev_common);
@@ -1043,4 +1043,4 @@ REGISTER_TEST_COMMAND(eventdev_selftest_octeontx,REGISTER_TEST_COMMAND (eventdev_selftest_octeontx2, test_eventdev_selftest_octeontx2);REGISTER_TEST_COMMAND (eventdev_selftest_dpaa2, test_eventdev_selftest_dpaa2); -REGISTER_TEST_COMMAND (eventdev_selftest_dlb2, test_eventdev_selftest_dlb2); +REGISTER_TEST_COMMAND (eventdev_selftest_dlb, test_eventdev_selftest_dlb);
config/rte_config.h +5 -6
@@ -139,11 +139,10 @@/* QEDE PMD defines */ #define RTE_LIBRTE_QEDE_FW "" -/* DLB2 defines */ -#define RTE_LIBRTE_PMD_DLB2_POLL_INTERVAL 1000 -#define RTE_LIBRTE_PMD_DLB2_UMWAIT_CTL_STATE 0 -#undef RTE_LIBRTE_PMD_DLB2_QUELL_STATS -#define RTE_LIBRTE_PMD_DLB2_SW_CREDIT_QUANTA 32 -#define RTE_PMD_DLB2_DEFAULT_DEPTH_THRESH 256 +/* DLB defines */ +#define RTE_LIBRTE_PMD_DLB_POLL_INTERVAL 1000 +#undef RTE_LIBRTE_PMD_DLB_QUELL_STATS +#define RTE_LIBRTE_PMD_DLB_SW_CREDIT_QUANTA 32 +#define RTE_LIBRTE_PMD_DLB_DEFAULT_DEPTH_THRESH 256#endif /* _RTE_CONFIG_H_ */
doc/api/doxy-api-index.md +1 -1
@@ -55,7 +55,7 @@ The public API headers are grouped by topics: [dpaa2_cmdif] (@ref rte_pmd_dpaa2_cmdif.h), [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h), - [dlb2] (@ref rte_pmd_dlb2.h), + [dlb] (@ref rte_pmd_dlb.h), [ifpga] (@ref rte_pmd_ifpga.h) - **memory**:
doc/api/doxy-api.conf.in +1 -1
@@ -7,7 +7,7 @@ USE_MDFILE_AS_MAINPAGE = @TOPDIR@/doc/api/doxy-api-index.md INPUT = @TOPDIR@/doc/api/doxy-api-index.md \ @TOPDIR@/drivers/bus/vdev \ @TOPDIR@/drivers/crypto/scheduler \ - @TOPDIR@/drivers/event/dlb2 \ + @TOPDIR@/drivers/event/dlb \ @TOPDIR@/drivers/mempool/dpaa2 \ @TOPDIR@/drivers/net/ark \ @TOPDIR@/drivers/net/bnxt \
doc/guides/eventdevs/dlb.rst renamed from doc/guides/eventdevs/dlb2.rst +44 -44
249 lines not on this page · raw message
doc/guides/eventdevs/index.rst +1 -1
@@ -11,7 +11,7 @@ application through the eventdev API. :maxdepth: 2 :numbered: - dlb2 + dlb dpaa dpaa2 dsw
doc/guides/rel_notes/release_20_11.rst +1 -1
@@ -351,7 +351,7 @@ New Features * **Added a new driver for the Intel Dynamic Load Balancer v2.0 device.** Added the new ``dlb2`` eventdev driver for the Intel DLB V2.0 device. See the - :doc:`../eventdevs/dlb2` eventdev guide for more details on this new driver. + :doc:`../eventdevs/dlb` eventdev guide for more details on this new driver. * **Added Ice Lake (Gen4) support for Intel NTB.**
doc/guides/rel_notes/release_21_05.rst +5 -0
@@ -94,6 +94,11 @@ New Features * Added support for preferred busy polling. +* **Updated DLB driver.** + + * Added support for v2.5 hardware. + * Renamed DLB2 to DLB, which supports all HW versions v2.0 and v2.5. + * **Updated testpmd.** * Added a command line option to configure forced speed for Ethernet port.
drivers/event/dlb/dlb2.c renamed from drivers/event/dlb2/dlb2.c +10 -15
@@ -667,15 +667,8 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev) }/* Does this platform support umonitor/umwait? */ -if (rte_cpu_get_flag_enabled (RTE_CPUFLAG_WAITPKG )) { -if (RTE_LIBRTE_PMD_DLB2_UMWAIT_CTL_STATE !=0 && -RTE_LIBRTE_PMD_DLB2_UMWAIT_CTL_STATE !=1 ) { -DLB2_LOG_ERR ("invalid value (%d) for RTE_LIBRTE_PMD_DLB2_UMWAIT_CTL_STATE, must be 0 or 1.\n" , -RTE_LIBRTE_PMD_DLB2_UMWAIT_CTL_STATE ); -return -EINVAL ; - } +if (rte_cpu_get_flag_enabled (RTE_CPUFLAG_WAITPKG )) dlb2->umwait_allowed = true; - } rsrcs->num_dir_ports = config->nb_single_link_event_port_queues; rsrcs->num_ldb_ports = config->nb_event_ports - rsrcs->num_dir_ports;
@@ -930,8 +923,9 @@ dlb2_hw_create_ldb_queue(struct dlb2_eventdev *dlb2, }if (ev_queue->depth_threshold ==0 ) { - cfg.depth_threshold =RTE_PMD_DLB2_DEFAULT_DEPTH_THRESH ; - ev_queue->depth_threshold =RTE_PMD_DLB2_DEFAULT_DEPTH_THRESH ; + cfg.depth_threshold =RTE_LIBRTE_PMD_DLB_DEFAULT_DEPTH_THRESH ; + ev_queue->depth_threshold = +RTE_LIBRTE_PMD_DLB_DEFAULT_DEPTH_THRESH ; }else cfg.depth_threshold = ev_queue->depth_threshold;
@@ -1623,7 +1617,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev, RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL); ev_port->outstanding_releases =0 ; ev_port->inflight_credits =0 ; - ev_port->credit_update_quanta =RTE_LIBRTE_PMD_DLB2_SW_CREDIT_QUANTA ; + ev_port->credit_update_quanta =RTE_LIBRTE_PMD_DLB_SW_CREDIT_QUANTA ; ev_port->dlb2 = dlb2;/* reverse link */ /* Tear down pre-existing port->queue links */
@@ -1718,8 +1712,9 @@ dlb2_hw_create_dir_queue(struct dlb2_eventdev *dlb2, cfg.port_id = qm_port_id;if (ev_queue->depth_threshold ==0 ) { - cfg.depth_threshold =RTE_PMD_DLB2_DEFAULT_DEPTH_THRESH ; - ev_queue->depth_threshold =RTE_PMD_DLB2_DEFAULT_DEPTH_THRESH ; + cfg.depth_threshold =RTE_LIBRTE_PMD_DLB_DEFAULT_DEPTH_THRESH ; + ev_queue->depth_threshold = +RTE_LIBRTE_PMD_DLB_DEFAULT_DEPTH_THRESH ; }else cfg.depth_threshold = ev_queue->depth_threshold;
@@ -2747,7 +2742,7 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port,DLB2_INC_STAT (ev_port->stats.tx_op_cnt[ev->op],1 );DLB2_INC_STAT (ev_port->stats.traffic.tx_ok,1 ); -#ifndef RTE_LIBRTE_PMD_DLB2_QUELL_STATS +#ifndef RTE_LIBRTE_PMD_DLB_QUELL_STATS if (ev->op !=RTE_EVENT_OP_RELEASE ) {DLB2_INC_STAT (ev_port->stats.queue[ev->queue_id].enq_ok,1 );DLB2_INC_STAT (ev_port->stats.tx_sched_cnt[*sched_type],1 );
@@ -3070,7 +3065,7 @@ dlb2_dequeue_wait(struct dlb2_eventdev *dlb2,DLB2_INC_STAT (ev_port->stats.traffic.rx_umonitor_umwait,1 ); }else { -uint64_t poll_interval =RTE_LIBRTE_PMD_DLB2_POLL_INTERVAL ; +uint64_t poll_interval =RTE_LIBRTE_PMD_DLB_POLL_INTERVAL ;uint64_t curr_ticks =rte_get_timer_cycles ();uint64_t init_ticks = curr_ticks;
drivers/event/dlb/dlb2_iface.c renamed from drivers/event/dlb2/dlb2_iface.c +0 -0
drivers/event/dlb/dlb2_iface.h renamed from drivers/event/dlb2/dlb2_iface.h +0 -0
drivers/event/dlb/dlb2_inline_fns.h renamed from drivers/event/dlb2/dlb2_inline_fns.h +0 -0
drivers/event/dlb/dlb2_log.h renamed from drivers/event/dlb2/dlb2_log.h +0 -0
drivers/event/dlb/dlb2_priv.h renamed from drivers/event/dlb2/dlb2_priv.h +4 -3
@@ -12,7 +12,7 @@#include <rte_config.h> #include "dlb2_user.h" #include "dlb2_log.h" -#include "rte_pmd_dlb2.h" +#include "rte_pmd_dlb.h" #ifndef RTE_LIBRTE_PMD_DLB2_QUELL_STATS #define DLB2_INC_STAT (_stat, _incr_val) ((_stat) += _incr_val)
@@ -20,7 +20,8 @@#define DLB2_INC_STAT (_stat, _incr_val)#endif -#define EVDEV_DLB2_NAME_PMD dlb2_event +/* common name for all dlb devs (dlb v2.0, dlb v2.5 ...) */ +#define EVDEV_DLB2_NAME_PMD dlb_event/* command line arg strings */ #define NUMA_NODE_ARG "numa_node"
@@ -320,7 +321,7 @@ struct dlb2_port {bool gen_bit;uint16_t dir_credits;uint32_t dequeue_depth; -enum dlb2_token_pop_mode token_pop_mode; +enum dlb_token_pop_mode token_pop_mode;union dlb2_port_config cfg;uint32_t *credit_pool[DLB2_NUM_QUEUE_TYPES ];/* use __atomic builtins */ union {
drivers/event/dlb/dlb2_selftest.c renamed from drivers/event/dlb2/dlb2_selftest.c +4 -4
@@ -22,7 +22,7 @@#include <rte_pause.h> #include "dlb2_priv.h" -#include "rte_pmd_dlb2.h" +#include "rte_pmd_dlb.h" #define MAX_PORTS 32#define MAX_QIDS 32
@@ -1105,13 +1105,13 @@ test_deferred_sched(void)return -1 ; } - ret =rte_pmd_dlb2_set_token_pop_mode (evdev,0 ,DEFERRED_POP ); + ret =rte_pmd_dlb_set_token_pop_mode (evdev,0 ,DEFERRED_POP );if (ret <0 ) {printf ("%d: Error setting deferred scheduling\n" , __LINE__); goto err; } - ret =rte_pmd_dlb2_set_token_pop_mode (evdev,1 ,DEFERRED_POP ); + ret =rte_pmd_dlb_set_token_pop_mode (evdev,1 ,DEFERRED_POP );if (ret <0 ) {printf ("%d: Error setting deferred scheduling\n" , __LINE__); goto err;
@@ -1257,7 +1257,7 @@ test_delayed_pop(void)return -1 ; } - ret =rte_pmd_dlb2_set_token_pop_mode (evdev,0 ,DELAYED_POP ); + ret =rte_pmd_dlb_set_token_pop_mode (evdev,0 ,DELAYED_POP );if (ret <0 ) {printf ("%d: Error setting deferred scheduling\n" , __LINE__); goto err;
drivers/event/dlb/dlb2_user.h renamed from drivers/event/dlb2/dlb2_user.h +0 -0
drivers/event/dlb/dlb2_xstats.c renamed from drivers/event/dlb2/dlb2_xstats.c +0 -0
drivers/event/dlb/meson.build renamed from drivers/event/dlb2/meson.build +2 -2
@@ -14,10 +14,10 @@ sources = files('dlb2.c', 'pf/dlb2_main.c', 'pf/dlb2_pf.c', 'pf/base/dlb2_resource.c', - 'rte_pmd_dlb2.c', + 'rte_pmd_dlb.c', 'dlb2_selftest.c' ) -headers = files('rte_pmd_dlb2.h') +headers = files('rte_pmd_dlb.h') deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci']
drivers/event/dlb/pf/base/dlb2_hw_types.h renamed from drivers/event/dlb2/pf/base/dlb2_hw_types.h +0 -0
drivers/event/dlb/pf/base/dlb2_osdep.h renamed from drivers/event/dlb2/pf/base/dlb2_osdep.h +0 -0
drivers/event/dlb/pf/base/dlb2_osdep_bitmap.h renamed from drivers/event/dlb2/pf/base/dlb2_osdep_bitmap.h +0 -0
drivers/event/dlb/pf/base/dlb2_osdep_list.h renamed from drivers/event/dlb2/pf/base/dlb2_osdep_list.h +0 -0
drivers/event/dlb/pf/base/dlb2_osdep_types.h renamed from drivers/event/dlb2/pf/base/dlb2_osdep_types.h +0 -0
drivers/event/dlb/pf/base/dlb2_regs.h renamed from drivers/event/dlb2/pf/base/dlb2_regs.h +0 -0
drivers/event/dlb/pf/base/dlb2_resource.c renamed from drivers/event/dlb2/pf/base/dlb2_resource.c +0 -0
drivers/event/dlb/pf/base/dlb2_resource.h renamed from drivers/event/dlb2/pf/base/dlb2_resource.h +0 -0
drivers/event/dlb/pf/dlb2_main.c renamed from drivers/event/dlb2/pf/dlb2_main.c +0 -0
drivers/event/dlb/pf/dlb2_main.h renamed from drivers/event/dlb2/pf/dlb2_main.h +0 -0
drivers/event/dlb/pf/dlb2_pf.c renamed from drivers/event/dlb2/pf/dlb2_pf.c +0 -0
drivers/event/dlb/rte_pmd_dlb.c renamed from drivers/event/dlb2/rte_pmd_dlb2.c +3 -3
@@ -5,14 +5,14 @@#include <rte_eventdev.h> #include <eventdev_pmd.h> -#include "rte_pmd_dlb2.h" +#include "rte_pmd_dlb.h" #include "dlb2_priv.h" #include "dlb2_inline_fns.h" int -rte_pmd_dlb2_set_token_pop_mode (uint8_t dev_id, +rte_pmd_dlb_set_token_pop_mode (uint8_t dev_id,uint8_t port_id, -enum dlb2_token_pop_mode mode) +enum dlb_token_pop_mode mode) {struct dlb2_eventdev *dlb2;struct rte_eventdev *dev;
drivers/event/dlb/rte_pmd_dlb.h renamed from drivers/event/dlb2/rte_pmd_dlb2.h +6 -6
@@ -3,13 +3,13 @@*/ /*! -* @file rte_pmd_dlb2.h +* @file rte_pmd_dlb.h * * @brief DLB PMD-specific functions */ -#ifndef _RTE_PMD_DLB2_H_ -#define _RTE_PMD_DLB2_H_ +#ifndef _RTE_PMD_DLB_H_ +#define _RTE_PMD_DLB_H_ #ifdef __cplusplus extern "C" {
@@ -23,7 +23,7 @@ extern "C" {* * Selects the token pop mode for a DLB2 port. */ -enum dlb2_token_pop_mode { +enum dlb_token_pop_mode {/* Pop the CQ tokens immediately after dequeueing. */ AUTO_POP ,/* Pop CQ tokens after (dequeue_depth - 1) events are released.
@@ -61,9 +61,9 @@ enum dlb2_token_pop_mode {__rte_experimental int -rte_pmd_dlb2_set_token_pop_mode (uint8_t dev_id, +rte_pmd_dlb_set_token_pop_mode (uint8_t dev_id,uint8_t port_id, -enum dlb2_token_pop_mode mode); +enum dlb_token_pop_mode mode); #ifdef __cplusplus }
drivers/event/dlb/version.map renamed from drivers/event/dlb2/version.map +1 -1
@@ -5,5 +5,5 @@ DPDK_21 { EXPERIMENTAL { global: - rte_pmd_dlb2_set_token_pop_mode; + rte_pmd_dlb_set_token_pop_mode; };
drivers/event/meson.build +1 -1
@@ -5,7 +5,7 @@ if is_windows subdir_done() endif -drivers = ['dlb2', 'dpaa', 'dpaa2', 'octeontx2', 'opdl', 'skeleton', 'sw', +drivers = ['dlb', 'dpaa', 'dpaa2', 'octeontx2', 'opdl', 'skeleton', 'sw', 'dsw'] if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and dpdk_conf.has('RTE_ARCH_ARM64'))
Signature · 1 line
2.23.0
PATCH v4 27/27 event/dlb: move rte config defines to runtime devargs
In reply to Timothy McDanielThe new devarg names and their default values are listed below. The defaults have not changed, and none of these parameters are accessed in the fast path.
poll_interval=1000
sw_credit_quantai=32
default_depth_thresh=256
--- config/rte_config.h | 3 - drivers/event/dlb/dlb2.c | 109 +++++++++++++++++++++++++++++++-- drivers/event/dlb/dlb2_priv.h | 14 +++++ drivers/event/dlb/pf/dlb2_pf.c | 5 +- 4 files changed, 121 insertions(+), 10 deletions(-)
config/rte_config.h +0 -3
@@ -140,9 +140,6 @@#define RTE_LIBRTE_QEDE_FW ""/* DLB defines */ -#define RTE_LIBRTE_PMD_DLB_POLL_INTERVAL 1000#undef RTE_LIBRTE_PMD_DLB_QUELL_STATS -#define RTE_LIBRTE_PMD_DLB_SW_CREDIT_QUANTA 32 -#define RTE_LIBRTE_PMD_DLB_DEFAULT_DEPTH_THRESH 256#endif /* _RTE_CONFIG_H_ */
drivers/event/dlb/dlb2.c +103 -6
159 lines not on this page · raw message
drivers/event/dlb/dlb2_priv.h +14 -0
@@ -23,6 +23,11 @@/* common name for all dlb devs (dlb v2.0, dlb v2.5 ...) */ #define EVDEV_DLB2_NAME_PMD dlb_event +/* Default values for command line devargs */ +#define DLB2_POLL_INTERVAL_DEFAULT 1000 +#define DLB2_SW_CREDIT_QUANTA_DEFAULT 32 +#define DLB2_DEPTH_THRESH_DEFAULT 256 +/* command line arg strings */ #define NUMA_NODE_ARG "numa_node"#define DLB2_MAX_NUM_EVENTS "max_num_events"
@@ -31,6 +36,9 @@#define DLB2_DEFER_SCHED_ARG "defer_sched"#define DLB2_QID_DEPTH_THRESH_ARG "qid_depth_thresh"#define DLB2_COS_ARG "cos" +#define DLB2_POLL_INTERVAL_ARG "poll_interval" +#define DLB2_SW_CREDIT_QUANTA_ARG "sw_credit_quanta" +#define DLB2_DEPTH_THRESH_ARG "default_depth_thresh"/* Begin HW related defines and structs */
@@ -571,6 +579,9 @@ struct dlb2_eventdev {bool global_dequeue_wait;/* Not using per dequeue wait if true */ bool defer_sched;enum dlb2_cq_poll_modes poll_mode; +int poll_interval; +int sw_credit_quanta; +int default_depth_thresh;uint8_t revision;uint8_t version;bool configured;
@@ -604,6 +615,9 @@ struct dlb2_devargs {int defer_sched;struct dlb2_qid_depth_thresholds qid_depth_thresholds;enum dlb2_cos cos_id; +int poll_interval; +int sw_credit_quanta; +int default_depth_thresh; };/* End Eventdev related defines and structs */
drivers/event/dlb/pf/dlb2_pf.c +4 -1
@@ -615,7 +615,10 @@ dlb2_eventdev_pci_init(struct rte_eventdev *eventdev) .max_num_events = DLB2_MAX_NUM_LDB_CREDITS, .num_dir_credits_override = -1, .qid_depth_thresholds = { {0} }, - .cos_id = DLB2_COS_DEFAULT + .cos_id = DLB2_COS_DEFAULT, + .poll_interval = DLB2_POLL_INTERVAL_DEFAULT, + .sw_credit_quanta = DLB2_SW_CREDIT_QUANTA_DEFAULT, + .default_depth_thresh = DLB2_DEPTH_THRESH_DEFAULT };struct dlb2_eventdev *dlb2;
Signature · 1 line
2.23.0
v5 cover Add DLB v2.5
In reply to Timothy McDanielFrom: Timothy McDaniel <[email protected]>
This patch series adds support for DLB v2.5 to the current DLB V2.0 PMD. The resulting PMD supports both hardware versions.
The main differences between the DLB v2.5 and v2.0 hardware are:
- Number of queues/ports
- DLB v2.5 uses a combined credit pool, whereas DLB v2.0 splits credits into 2 pools, a directed credit pool and a load balanced credit pool.
- Different register maps, with different bit names and offsets
In order to support both hardware versions with the same PMD, and avoid code duplication, the file dlb2_resource.c required a complete rewrite. This required some creative staging of the changes in order to keep the individual patches relatively small, while also meeting the requirement that all individual patches in the set compile cleanly.
To accomplish this, a few temporary files are used:
dlb2_hw_types_new.hdlb2_resources_new.hdlb2_resources_new.c
As dlb2_resources_new.c is populated with the new combined v2.0/v2.5 low level logic, the corresponding old code is removed from dlb2_resource.c, thus allowing both the original and new code to continue to compile and link cleanly. Once all of the code has been migrated to the new model, the old versions of the files are removed, and the new versions are renamed, effectively replacing the old original files.
As you review the code, you can ignore the code deletions from dlb2_resource.c, as that file continues to shrink as the new corresponding logic is added to dlb2_resource_new.c.
Changes since V4:
1) restore original PMD name (dlb2)
2) resore original PMD source location (drivers/event/dlb2)
3) restore documentation, such that it references dlb2_event, instead of dlb_event
Changes since V3:
1) Moved minor cleanup to its own patch. This included
a) remove FPGA references
b) eliminate duplicate macros/defines in hw_types
c) don't include dlb2_mbox.h
d) delete unused defines.macros (SMON, INT, ...)
2) Changed DLB V2.x and V2.x to simply v2.x, where v is lower case
3) Updated 20.11 release notes to remove reference to dlb2 doc, since it is now named dlb.rst
4) Updated commit message/header text, as requested
Changes since V2:
1) fix commit headers
2) fix commit message repeated words
3) remove FPGA reference
4) split out new v2.5 register definitions into separate patch
5) fixed documentation to use DLB and dlb_event exclusively, instead of the old names such as dlb1_event, dlb2_event, DLB2, ... Final doc updates are done in patch that performs device rename from DLB2 tosimply DLB
6) use component event/dlb at commit which changes device name and all subsequent commits
7) Move all DLB constants out of config/rte_config.h except QUELL_STATS, which is used in the fastpath. Exposed these as devarg command line parameters
8) Removed "TEMPORARY" comment leftover in dlb2_osdep.h
9) squashed 20-21 and 22-23 since they were logically the same as 19-20, which was requested to be squashed
10) delete old dlb2.rst - dlb.rst has been updated for v2.0 and v2.1
Changes since V1:
1) Simplified subject text for all patches
2) correct typos/spelling
3) remove FPGA references
4) remove stale sysconf() references
5) fixed patches that had compilation issues
6) updated release notes
7) renamed dlb device from dlb2_event to dlb_event
8) moved dlb2 directory to dlb,to match name change
9) fixed other cases where "dlb2" was being used externally
Timothy McDaniel (26):
event/dlb2: minor code cleanup
event/dlb2: add v2.5 probe
event/dlb2: add v2.5 HW register definitions event/dlb2: add v2.5 HW init
event/dlb2: add v2.5 get resources event/dlb2: add v2.5 create sched domain event/dlb2: add v2.5 domain reset
event/dlb2: add v2.5 create ldb queue event/dlb2: add v2.5 create ldb port event/dlb2: add v2.5 create dir port event/dlb2: add v2.5 create dir queue event/dlb2: add v2.5 map qid
event/dlb2: add v2.5 unmap queue
event/dlb2: add v2.5 start domain
event/dlb2: add v2.5 credit scheme event/dlb2: add v2.5 queue depth functions event/dlb2: add v2.5 finish map/unmap event/dlb2: add v2.5 sparse cq mode event/dlb2: add v2.5 sequence number management event/dlb2: use new implementation of resource header event/dlb2: use new implementation of resource file event/dlb2: use new implementation of HW types header event/dlb2: use new combined register map event/dlb2: update xstats for v2.5 event/dlb2: move rte config defines to runtime devargs doc/dlb2: update documentation for v2.5
config/rte_config.h | 4 - doc/guides/eventdevs/dlb2.rst | 153 +- drivers/event/dlb2/dlb2.c | 550 +- drivers/event/dlb2/dlb2_priv.h | 170 +- drivers/event/dlb2/dlb2_user.h | 27 +- drivers/event/dlb2/dlb2_xstats.c | 70 +- drivers/event/dlb2/pf/base/dlb2_hw_types.h | 106 +- drivers/event/dlb2/pf/base/dlb2_mbox.h | 596 -- drivers/event/dlb2/pf/base/dlb2_osdep.h | 2 + drivers/event/dlb2/pf/base/dlb2_regs.h | 5955 +++++++++++++------- drivers/event/dlb2/pf/base/dlb2_resource.c | 3278 ++++++----- drivers/event/dlb2/pf/base/dlb2_resource.h | 28 +- drivers/event/dlb2/pf/dlb2_main.c | 37 +- drivers/event/dlb2/pf/dlb2_pf.c | 67 +- 14 files changed, 6445 insertions(+), 4598 deletions(-) delete mode 100644 drivers/event/dlb2/pf/base/dlb2_mbox.h
Signature · 1 line
2.23.0
PATCH v5 1/26 event/dlb2: minor code cleanup
From: Timothy McDaniel <[email protected]>
1) Remove references to FPGA.
2) Do not include dlb2_mbox.h, it is not needed.
3) Remove duplicate macros/defines that were present in both dlb2_priv.h and dlb2_hw_types.h. Update dlb2_resource.c to include dlb2_priv.h so that it picks up the macros/defines that have now been consolidated.
--- drivers/event/dlb2/pf/base/dlb2_hw_types.h | 46 +- drivers/event/dlb2/pf/base/dlb2_mbox.h | 596 --------------------- drivers/event/dlb2/pf/base/dlb2_resource.c | 1 - 3 files changed, 2 insertions(+), 641 deletions(-) delete mode 100644 drivers/event/dlb2/pf/base/dlb2_mbox.h
drivers/event/dlb2/pf/base/dlb2_hw_types.h +2 -44
@@ -5,55 +5,25 @@#ifndef __DLB2_HW_TYPES_H#define __DLB2_HW_TYPES_H +#include "../../dlb2_priv.h" #include "dlb2_user.h" #include "dlb2_osdep_list.h" #include "dlb2_osdep_types.h" #define DLB2_MAX_NUM_VDEVS 16 -#define DLB2_MAX_NUM_DOMAINS 32 -#define DLB2_MAX_NUM_LDB_QUEUES 32/* LDB == load-balanced */ -#define DLB2_MAX_NUM_DIR_QUEUES 64/* DIR == directed */ -#define DLB2_MAX_NUM_LDB_PORTS 64 -#define DLB2_MAX_NUM_DIR_PORTS 64 -#define DLB2_MAX_NUM_LDB_CREDITS (8 * 1024) -#define DLB2_MAX_NUM_DIR_CREDITS (2 * 1024) -#define DLB2_MAX_NUM_HIST_LIST_ENTRIES 2048#define DLB2_MAX_NUM_AQED_ENTRIES 2048 -#define DLB2_MAX_NUM_QIDS_PER_LDB_CQ 8#define DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS 2#define DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES 5 -#define DLB2_QID_PRIORITIES 8 +#define DLB2_NUM_ARB_WEIGHTS 8#define DLB2_MAX_WEIGHT 255#define DLB2_NUM_COS_DOMAINS 4#define DLB2_MAX_CQ_COMP_CHECK_LOOPS 409600#define DLB2_MAX_QID_EMPTY_CHECK_LOOPS (32 * 64 * 1024 * (800 / 30)) -#ifdef FPGA -#define DLB2_HZ 2000000 -#else -#define DLB2_HZ 800000000 -#endif -#define PCI_DEVICE_ID_INTEL_DLB2_PF 0x2710#define PCI_DEVICE_ID_INTEL_DLB2_VF 0x2711 -/* Interrupt related macros */ -#define DLB2_PF_NUM_NON_CQ_INTERRUPT_VECTORS 1 -#define DLB2_PF_NUM_CQ_INTERRUPT_VECTORS 64 -#define DLB2_PF_TOTAL_NUM_INTERRUPT_VECTORS \ - (DLB2_PF_NUM_NON_CQ_INTERRUPT_VECTORS + \ - DLB2_PF_NUM_CQ_INTERRUPT_VECTORS) -#define DLB2_PF_NUM_COMPRESSED_MODE_VECTORS \ - (DLB2_PF_NUM_NON_CQ_INTERRUPT_VECTORS + 1) -#define DLB2_PF_NUM_PACKED_MODE_VECTORS \ - DLB2_PF_TOTAL_NUM_INTERRUPT_VECTORS -#define DLB2_PF_COMPRESSED_MODE_CQ_VECTOR_ID \ - DLB2_PF_NUM_NON_CQ_INTERRUPT_VECTORS - -/* DLB non-CQ interrupts (alarm, mailbox, WDT) */ -#define DLB2_INT_NON_CQ 0 -#define DLB2_ALARM_HW_SOURCE_SYS 0#define DLB2_ALARM_HW_SOURCE_DLB 1
@@ -65,18 +35,6 @@#define DLB2_ALARM_HW_CHP_AID_ILLEGAL_ENQ 1#define DLB2_ALARM_HW_CHP_AID_EXCESS_TOKEN_POPS 2 -#define DLB2_VF_NUM_NON_CQ_INTERRUPT_VECTORS 1 -#define DLB2_VF_NUM_CQ_INTERRUPT_VECTORS 31 -#define DLB2_VF_BASE_CQ_VECTOR_ID 0 -#define DLB2_VF_LAST_CQ_VECTOR_ID 30 -#define DLB2_VF_MBOX_VECTOR_ID 31 -#define DLB2_VF_TOTAL_NUM_INTERRUPT_VECTORS \ - (DLB2_VF_NUM_NON_CQ_INTERRUPT_VECTORS + \ - DLB2_VF_NUM_CQ_INTERRUPT_VECTORS) - -#define DLB2_VDEV_MAX_NUM_INTERRUPT_VECTORS (DLB2_MAX_NUM_LDB_PORTS + \ - DLB2_MAX_NUM_DIR_PORTS + 1) -/* * Hardware-defined base addresses. Those prefixed 'DLB2_DRV' are only used by * the PF driver.
drivers/event/dlb2/pf/base/dlb2_mbox.h deleted +0 -596
596 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -1
@@ -5,7 +5,6 @@#include "dlb2_user.h" #include "dlb2_hw_types.h" -#include "dlb2_mbox.h" #include "dlb2_osdep.h" #include "dlb2_osdep_bitmap.h" #include "dlb2_osdep_types.h"
Signature · 1 line
2.23.0
PATCH v5 2/26 event/dlb2: add v2.5 probe
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
This commit adds dlb v2.5 probe support, and updates parameter parsing.
The dlb v2.5 device differs from dlb v2, in that the number of resources (ports, queues, ...) is different, so macros have been added to take the device version into account.
--- drivers/event/dlb2/dlb2.c | 99 +++++++++++--- drivers/event/dlb2/dlb2_priv.h | 151 +++++++++++++++------ drivers/event/dlb2/dlb2_xstats.c | 37 ++--- drivers/event/dlb2/pf/base/dlb2_hw_types.h | 28 ++-- drivers/event/dlb2/pf/base/dlb2_resource.c | 47 ++++--- drivers/event/dlb2/pf/dlb2_pf.c | 62 ++++++++- 6 files changed, 319 insertions(+), 105 deletions(-)
drivers/event/dlb2/dlb2.c +79 -20
@@ -59,7 +59,8 @@ static struct rte_event_dev_info evdev_dlb2_default_info = { .max_event_port_enqueue_depth = DLB2_MAX_ENQUEUE_DEPTH, .max_event_port_links = DLB2_MAX_NUM_QIDS_PER_LDB_CQ, .max_num_events = DLB2_MAX_NUM_LDB_CREDITS, - .max_single_link_event_port_queue_pairs = DLB2_MAX_NUM_DIR_PORTS, + .max_single_link_event_port_queue_pairs = + DLB2_MAX_NUM_DIR_PORTS(DLB2_HW_V2), .event_dev_cap = (RTE_EVENT_DEV_CAP_QUEUE_QOS | RTE_EVENT_DEV_CAP_EVENT_QOS | RTE_EVENT_DEV_CAP_BURST_MODE |
@@ -69,7 +70,7 @@ static struct rte_event_dev_info evdev_dlb2_default_info = { };struct process_local_port_data -dlb2_port[DLB2_MAX_NUM_PORTS ][DLB2_NUM_PORT_TYPES ]; +dlb2_port[DLB2_MAX_NUM_PORTS_ALL ][DLB2_NUM_PORT_TYPES ];static void dlb2_free_qe_mem (struct dlb2_port *qm_port)
@@ -97,7 +98,7 @@ dlb2_init_queue_depth_thresholds(struct dlb2_eventdev *dlb2, {int q; -for (q =0 ; q <DLB2_MAX_NUM_QUEUES ; q++) { +for (q =0 ; q <DLB2_MAX_NUM_QUEUES (dlb2->version); q++) {if (qid_depth_thresholds[q] !=0 ) dlb2->ev_queues[q].depth_threshold = qid_depth_thresholds[q];
@@ -247,9 +248,9 @@ set_num_dir_credits(const char *key __rte_unused,return ret;if (*num_dir_credits <0 || - *num_dir_credits >DLB2_MAX_NUM_DIR_CREDITS ) { + *num_dir_credits >DLB2_MAX_NUM_DIR_CREDITS (DLB2_HW_V2 )) {DLB2_LOG_ERR ("dlb2: num_dir_credits must be between 0 and %d\n" , -DLB2_MAX_NUM_DIR_CREDITS ); +DLB2_MAX_NUM_DIR_CREDITS (DLB2_HW_V2 ));return -EINVAL ; }
@@ -306,7 +307,6 @@ set_cos(const char *key __rte_unused,return 0 ; } - static int set_qid_depth_thresh(const char *key __rte_unused, const char *value,
@@ -327,7 +327,7 @@ set_qid_depth_thresh(const char *key __rte_unused,*/ if (sscanf (value,"all:%d" , &thresh) ==1 ) { first =0 ; - last =DLB2_MAX_NUM_QUEUES -1 ; + last =DLB2_MAX_NUM_QUEUES (DLB2_HW_V2 ) -1 ; }else if (sscanf (value,"%d-%d:%d" , &first, &last, &thresh) ==3 ) {/* we have everything we need */ }else if (sscanf (value,"%d:%d" , &first, &thresh) ==2 ) {
@@ -337,7 +337,56 @@ set_qid_depth_thresh(const char *key __rte_unused,return -EINVAL ; } -if (first > last || first <0 || last >=DLB2_MAX_NUM_QUEUES ) { +if (first > last || first <0 || + last >=DLB2_MAX_NUM_QUEUES (DLB2_HW_V2 )) { +DLB2_LOG_ERR ("Error parsing qid depth devarg, invalid qid value\n" ); +return -EINVAL ; + } + +if (thresh <0 || thresh >DLB2_MAX_QUEUE_DEPTH_THRESHOLD ) { +DLB2_LOG_ERR ("Error parsing qid depth devarg, threshold > %d\n" , +DLB2_MAX_QUEUE_DEPTH_THRESHOLD ); +return -EINVAL ; + } + +for (i = first; i <= last; i++) + qid_thresh->val[i] = thresh;/* indexed by qid */ + +return 0 ; +} + +static int +set_qid_depth_thresh_v2_5(const char *key __rte_unused, +const char *value, +void *opaque) +{ +struct dlb2_qid_depth_thresholds *qid_thresh = opaque; +int first, last, thresh, i; + +if (value ==NULL || opaque ==NULL ) { +DLB2_LOG_ERR ("NULL pointer\n" ); +return -EINVAL ; + } + +/* command line override may take one of the following 3 forms: +* qid_depth_thresh=all:<threshold_value> ... all queues +* qid_depth_thresh=qidA-qidB:<threshold_value> ... a range of queues +* qid_depth_thresh=qid:<threshold_value> ... just one queue +*/ +if (sscanf (value,"all:%d" , &thresh) ==1 ) { + first =0 ; + last =DLB2_MAX_NUM_QUEUES (DLB2_HW_V2_5 ) -1 ; + }else if (sscanf (value,"%d-%d:%d" , &first, &last, &thresh) ==3 ) { +/* we have everything we need */ + }else if (sscanf (value,"%d:%d" , &first, &thresh) ==2 ) { + last = first; + }else { +DLB2_LOG_ERR ("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val\n" ); +return -EINVAL ; + } + +if (first > last || first <0 || + last >=DLB2_MAX_NUM_QUEUES (DLB2_HW_V2_5 )) {DLB2_LOG_ERR ("Error parsing qid depth devarg, invalid qid value\n" );return -EINVAL ; }
@@ -521,7 +570,7 @@ dlb2_hw_reset_sched_domain(const struct rte_eventdev *dev, bool reconfig)for (i =0 ; i < dlb2->num_queues; i++) dlb2->ev_queues[i].qm_queue.config_state = config_state; -for (i =0 ; i <DLB2_MAX_NUM_QUEUES ; i++) +for (i =0 ; i <DLB2_MAX_NUM_QUEUES (DLB2_HW_V2_5 ); i++) dlb2->ev_queues[i].setup_done = false; dlb2->num_ports =0 ;
@@ -1453,7 +1502,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev, dlb2 =dlb2_pmd_priv (dev); -if (ev_port_id >=DLB2_MAX_NUM_PORTS ) +if (ev_port_id >=DLB2_MAX_NUM_PORTS (dlb2->version))return -EINVAL ; if (port_conf->dequeue_depth >
@@ -3895,7 +3944,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev, }/* Initialize each port's token pop mode */ -for (i =0 ; i <DLB2_MAX_NUM_PORTS ; i++) +for (i =0 ; i <DLB2_MAX_NUM_PORTS (dlb2->version); i++) dlb2->ev_ports[i].qm_port.token_pop_mode =AUTO_POP ;rte_spinlock_init (&dlb2->qm_instance.resource_lock);
@@ -3945,7 +3994,8 @@ dlb2_secondary_eventdev_probe(struct rte_eventdev *dev,int dlb2_parse_params (const char *params,const char *name, -struct dlb2_devargs *dlb2_args) +struct dlb2_devargs *dlb2_args, +uint8_t version) {int ret =0 ;static const char *const args[] = {NUMA_NODE_ARG ,
@@ -3984,17 +4034,18 @@ dlb2_parse_params(const char *params,return ret; } - ret =rte_kvargs_process (kvlist, +if (version ==DLB2_HW_V2 ) { + ret =rte_kvargs_process (kvlist,DLB2_NUM_DIR_CREDITS , set_num_dir_credits, &dlb2_args->num_dir_credits_override); -if (ret !=0 ) { -DLB2_LOG_ERR ("%s: Error parsing num_dir_credits parameter" , - name); -rte_kvargs_free (kvlist); -return ret; +if (ret !=0 ) { +DLB2_LOG_ERR ("%s: Error parsing num_dir_credits parameter" , + name); +rte_kvargs_free (kvlist); +return ret; + } } - ret =rte_kvargs_process (kvlist,DEV_ID_ARG , set_dev_id, &dlb2_args->dev_id);
@@ -4005,11 +4056,19 @@ dlb2_parse_params(const char *params,return ret; } - ret =rte_kvargs_process ( +if (version ==DLB2_HW_V2 ) { + ret =rte_kvargs_process ( kvlist,DLB2_QID_DEPTH_THRESH_ARG , set_qid_depth_thresh, &dlb2_args->qid_depth_thresholds); + }else { + ret =rte_kvargs_process ( + kvlist, +DLB2_QID_DEPTH_THRESH_ARG , + set_qid_depth_thresh_v2_5, + &dlb2_args->qid_depth_thresholds); + }if (ret !=0 ) {DLB2_LOG_ERR ("%s: Error parsing qid_depth_thresh parameter" , name);
drivers/event/dlb2/dlb2_priv.h +113 -38
249 lines not on this page · raw message
drivers/event/dlb2/dlb2_xstats.c +19 -18
@@ -95,7 +95,7 @@ dlb2_device_traffic_stat_get(struct dlb2_eventdev *dlb2,int i;uint64_t val =0 ; -for (i =0 ; i <DLB2_MAX_NUM_PORTS ; i++) { +for (i =0 ; i <DLB2_MAX_NUM_PORTS (dlb2->version); i++) {struct dlb2_eventdev_port *port = &dlb2->ev_ports[i];if (!port->setup_done)
@@ -269,7 +269,7 @@ dlb2_get_threshold_stat(struct dlb2_eventdev *dlb2, int qid, int stat)int port =0 ;uint64_t tally =0 ; -for (port =0 ; port <DLB2_MAX_NUM_PORTS ; port++) +for (port =0 ; port <DLB2_MAX_NUM_PORTS (dlb2->version); port++) tally += dlb2->ev_ports[port].stats.queue[qid].qid_depth[stat];return tally;
@@ -281,7 +281,7 @@ dlb2_get_enq_ok_stat(struct dlb2_eventdev *dlb2, int qid)int port =0 ;uint64_t enq_ok_tally =0 ; -for (port =0 ; port <DLB2_MAX_NUM_PORTS ; port++) +for (port =0 ; port <DLB2_MAX_NUM_PORTS (dlb2->version); port++) enq_ok_tally += dlb2->ev_ports[port].stats.queue[qid].enq_ok;return enq_ok_tally;
@@ -561,8 +561,8 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)/* other vars */ const unsigned int count =RTE_DIM (dev_stats) + -DLB2_MAX_NUM_PORTS *RTE_DIM (port_stats) + -DLB2_MAX_NUM_QUEUES *RTE_DIM (qid_stats); +DLB2_MAX_NUM_PORTS (dlb2->version) *RTE_DIM (port_stats) + +DLB2_MAX_NUM_QUEUES (dlb2->version) *RTE_DIM (qid_stats);unsigned int i, port, qid, stat_id =0 ; dlb2->xstats = rte_zmalloc_socket(NULL,
@@ -583,7 +583,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) } dlb2->xstats_count_mode_dev = stat_id; -for (port =0 ; port <DLB2_MAX_NUM_PORTS ; port++) { +for (port =0 ; port <DLB2_MAX_NUM_PORTS (dlb2->version); port++) { dlb2->xstats_offset_for_port[port] = stat_id;uint32_t count_offset = stat_id;
@@ -605,7 +605,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) dlb2->xstats_count_mode_port = stat_id - dlb2->xstats_count_mode_dev; -for (qid =0 ; qid <DLB2_MAX_NUM_QUEUES ; qid++) { +for (qid =0 ; qid <DLB2_MAX_NUM_QUEUES (dlb2->version); qid++) {uint32_t count_offset = stat_id; dlb2->xstats_offset_for_qid[qid] = stat_id;
@@ -658,16 +658,15 @@ dlb2_eventdev_xstats_get_names(const struct rte_eventdev *dev, xstats_mode_count = dlb2->xstats_count_mode_dev;break ;case RTE_EVENT_DEV_XSTATS_PORT : -if (queue_port_id >=DLB2_MAX_NUM_PORTS ) +if (queue_port_id >=DLB2_MAX_NUM_PORTS (dlb2->version))break ; xstats_mode_count = dlb2->xstats_count_per_port[queue_port_id]; start_offset = dlb2->xstats_offset_for_port[queue_port_id];break ;case RTE_EVENT_DEV_XSTATS_QUEUE : -#if (DLB2_MAX_NUM_QUEUES <=255 )/* max 8 bit value */ -if (queue_port_id >=DLB2_MAX_NUM_QUEUES ) +if (queue_port_id >=DLB2_MAX_NUM_QUEUES (dlb2->version) && + (DLB2_MAX_NUM_QUEUES (dlb2->version) <=255 ))break ; -#endif xstats_mode_count = dlb2->xstats_count_per_qid[queue_port_id]; start_offset = dlb2->xstats_offset_for_qid[queue_port_id];break ;
@@ -709,13 +708,13 @@ dlb2_xstats_update(struct dlb2_eventdev *dlb2, xstats_mode_count = dlb2->xstats_count_mode_dev;break ;case RTE_EVENT_DEV_XSTATS_PORT : -if (queue_port_id >=DLB2_MAX_NUM_PORTS ) +if (queue_port_id >=DLB2_MAX_NUM_PORTS (dlb2->version)) goto invalid_value; xstats_mode_count = dlb2->xstats_count_per_port[queue_port_id];break ;case RTE_EVENT_DEV_XSTATS_QUEUE : -#if (DLB2_MAX_NUM_QUEUES <=255 )/* max 8 bit value */ -if (queue_port_id >=DLB2_MAX_NUM_QUEUES ) +#if (DLB2_MAX_NUM_QUEUES (DLB2_HW_V2_5 ) <=255 )/* max 8 bit value */ +if (queue_port_id >=DLB2_MAX_NUM_QUEUES (dlb2->version)) goto invalid_value;#endif xstats_mode_count = dlb2->xstats_count_per_qid[queue_port_id];
@@ -936,12 +935,13 @@ dlb2_eventdev_xstats_reset(struct rte_eventdev *dev,break ;case RTE_EVENT_DEV_XSTATS_PORT :if (queue_port_id ==-1 ) { -for (i =0 ; i <DLB2_MAX_NUM_PORTS ; i++) { +for (i =0 ; i <DLB2_MAX_NUM_PORTS (dlb2->version); + i++) {if (dlb2_xstats_reset_port (dlb2, i, ids, nb_ids))return -EINVAL ; } - }else if (queue_port_id <DLB2_MAX_NUM_PORTS ) { + }else if (queue_port_id <DLB2_MAX_NUM_PORTS (dlb2->version)) {if (dlb2_xstats_reset_port (dlb2, queue_port_id, ids, nb_ids))return -EINVAL ;
@@ -949,12 +949,13 @@ dlb2_eventdev_xstats_reset(struct rte_eventdev *dev,break ;case RTE_EVENT_DEV_XSTATS_QUEUE :if (queue_port_id ==-1 ) { -for (i =0 ; i <DLB2_MAX_NUM_QUEUES ; i++) { +for (i =0 ; i <DLB2_MAX_NUM_QUEUES (dlb2->version); + i++) {if (dlb2_xstats_reset_queue (dlb2, i, ids, nb_ids))return -EINVAL ; } - }else if (queue_port_id <DLB2_MAX_NUM_QUEUES ) { + }else if (queue_port_id <DLB2_MAX_NUM_QUEUES (dlb2->version)) {if (dlb2_xstats_reset_queue (dlb2, queue_port_id, ids, nb_ids))return -EINVAL ;
drivers/event/dlb2/pf/base/dlb2_hw_types.h +19 -9
@@ -12,18 +12,25 @@#include "dlb2_osdep_types.h" #define DLB2_MAX_NUM_VDEVS 16 -#define DLB2_MAX_NUM_AQED_ENTRIES 2048#define DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS 2 -#define DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES 5 -#define DLB2_NUM_ARB_WEIGHTS 8 +#define DLB2_MAX_NUM_AQED_ENTRIES 2048#define DLB2_MAX_WEIGHT 255#define DLB2_NUM_COS_DOMAINS 4 +#define DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS 2 +#define DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES 5#define DLB2_MAX_CQ_COMP_CHECK_LOOPS 409600#define DLB2_MAX_QID_EMPTY_CHECK_LOOPS (32 * 64 * 1024 * (800 / 30)) + +#define DLB2_FUNC_BAR 0 +#define DLB2_CSR_BAR 2 +#define PCI_DEVICE_ID_INTEL_DLB2_PF 0x2710#define PCI_DEVICE_ID_INTEL_DLB2_VF 0x2711 +#define PCI_DEVICE_ID_INTEL_DLB2_5_PF 0x2714 +#define PCI_DEVICE_ID_INTEL_DLB2_5_VF 0x2715 +#define DLB2_ALARM_HW_SOURCE_SYS 0#define DLB2_ALARM_HW_SOURCE_DLB 1
@@ -55,7 +62,8 @@#define DLB2_DIR_PP_BASE 0x2000000#define DLB2_DIR_PP_STRIDE 0x1000#define DLB2_DIR_PP_BOUND (DLB2_DIR_PP_BASE + \ - DLB2_DIR_PP_STRIDE * DLB2_MAX_NUM_DIR_PORTS) + DLB2_DIR_PP_STRIDE * \ + DLB2_MAX_NUM_DIR_PORTS_V2_5)#define DLB2_DIR_PP_OFFS (id) (DLB2_DIR_PP_BASE + (id) * DLB2_PP_SIZE)struct dlb2_resource_id {
@@ -183,7 +191,7 @@ struct dlb2_sn_group {static inline bool dlb2_sn_group_full (struct dlb2_sn_group *group) { -u32 mask[] = { +const u32 mask[] = {0x0000ffff ,/* 64 SNs per queue */ 0x000000ff ,/* 128 SNs per queue */ 0x0000000f ,/* 256 SNs per queue */
@@ -195,7 +203,7 @@ static inline bool dlb2_sn_group_full(struct dlb2_sn_group *group)static inline int dlb2_sn_group_alloc_slot (struct dlb2_sn_group *group) { -u32 bound[6 ] = {16 ,8 ,4 ,2 ,1 }; +const u32 bound[] = {16 ,8 ,4 ,2 ,1 };u32 i;for (i =0 ; i < bound[group->mode]; i++) {
@@ -285,7 +293,7 @@ struct dlb2_function_resources {struct dlb2_hw_resources {struct dlb2_ldb_queue ldb_queues[DLB2_MAX_NUM_LDB_QUEUES ];struct dlb2_ldb_port ldb_ports[DLB2_MAX_NUM_LDB_PORTS ]; -struct dlb2_dir_pq_pair dir_pq_pairs[DLB2_MAX_NUM_DIR_PORTS ]; +struct dlb2_dir_pq_pair dir_pq_pairs[DLB2_MAX_NUM_DIR_PORTS_V2_5 ];struct dlb2_sn_group sn_groups[DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ]; };
@@ -302,11 +310,13 @@ struct dlb2_sw_mbox { };struct dlb2_hw { +uint8_t ver; +/* BAR 0 address */ -void *csr_kva; +void *csr_kva;unsigned long csr_phys_addr;/* BAR 2 address */ -void *func_kva; +void *func_kva;unsigned long func_phys_addr;/* Resource tracking */
drivers/event/dlb2/pf/base/dlb2_resource.c +29 -18
155 lines not on this page · raw message
drivers/event/dlb2/pf/dlb2_pf.c +60 -2
103 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 3/26 event/dlb2: add v2.5 HW register definitions
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Add auto-generated register definitions, updated to support both DLB v2.0 and v2.5 devices.
--- drivers/event/dlb2/pf/base/dlb2_regs_new.h | 4304 ++++++++++++++++++++ 1 file changed, 4304 insertions(+) create mode 100644 drivers/event/dlb2/pf/base/dlb2_regs_new.h
drivers/event/dlb2/pf/base/dlb2_regs_new.h new file +4304 -0
@@ -0,0 +1,4304 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2016-2020 Intel Corporation +*/ + +#ifndef __DLB2_REGS_NEW_H +#define __DLB2_REGS_NEW_H + +#include "dlb2_osdep_types.h" + +#define DLB2_PF_VF2PF_MAILBOX_BYTES 256 +#define DLB2_PF_VF2PF_MAILBOX (vf_id, x) \ + (0x1000 + 0x4 * (x) + (vf_id) * 0x10000) +#define DLB2_PF_VF2PF_MAILBOX_RST 0x0 + +#define DLB2_PF_VF2PF_MAILBOX_MSG 0xFFFFFFFF +#define DLB2_PF_VF2PF_MAILBOX_MSG_LOC 0 + +#define DLB2_PF_VF2PF_MAILBOX_ISR (vf_id) \ + (0x1f00 + (vf_id) * 0x10000) +#define DLB2_PF_VF2PF_MAILBOX_ISR_RST 0x0 + +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF0_ISR 0x00000001 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF1_ISR 0x00000002 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF2_ISR 0x00000004 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF3_ISR 0x00000008 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF4_ISR 0x00000010 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF5_ISR 0x00000020 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF6_ISR 0x00000040 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF7_ISR 0x00000080 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF8_ISR 0x00000100 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF9_ISR 0x00000200 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF10_ISR 0x00000400 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF11_ISR 0x00000800 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF12_ISR 0x00001000 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF13_ISR 0x00002000 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF14_ISR 0x00004000 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF15_ISR 0x00008000 +#define DLB2_PF_VF2PF_MAILBOX_ISR_RSVD0 0xFFFF0000 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF0_ISR_LOC 0 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF1_ISR_LOC 1 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF2_ISR_LOC 2 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF3_ISR_LOC 3 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF4_ISR_LOC 4 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF5_ISR_LOC 5 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF6_ISR_LOC 6 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF7_ISR_LOC 7 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF8_ISR_LOC 8 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF9_ISR_LOC 9 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF10_ISR_LOC 10 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF11_ISR_LOC 11 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF12_ISR_LOC 12 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF13_ISR_LOC 13 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF14_ISR_LOC 14 +#define DLB2_PF_VF2PF_MAILBOX_ISR_VF15_ISR_LOC 15 +#define DLB2_PF_VF2PF_MAILBOX_ISR_RSVD0_LOC 16 + +#define DLB2_PF_VF2PF_FLR_ISR (vf_id) \ + (0x1f04 + (vf_id) * 0x10000) +#define DLB2_PF_VF2PF_FLR_ISR_RST 0x0 + +#define DLB2_PF_VF2PF_FLR_ISR_VF0_ISR 0x00000001 +#define DLB2_PF_VF2PF_FLR_ISR_VF1_ISR 0x00000002 +#define DLB2_PF_VF2PF_FLR_ISR_VF2_ISR 0x00000004 +#define DLB2_PF_VF2PF_FLR_ISR_VF3_ISR 0x00000008 +#define DLB2_PF_VF2PF_FLR_ISR_VF4_ISR 0x00000010 +#define DLB2_PF_VF2PF_FLR_ISR_VF5_ISR 0x00000020 +#define DLB2_PF_VF2PF_FLR_ISR_VF6_ISR 0x00000040 +#define DLB2_PF_VF2PF_FLR_ISR_VF7_ISR 0x00000080 +#define DLB2_PF_VF2PF_FLR_ISR_VF8_ISR 0x00000100 +#define DLB2_PF_VF2PF_FLR_ISR_VF9_ISR 0x00000200 +#define DLB2_PF_VF2PF_FLR_ISR_VF10_ISR 0x00000400 +#define DLB2_PF_VF2PF_FLR_ISR_VF11_ISR 0x00000800 +#define DLB2_PF_VF2PF_FLR_ISR_VF12_ISR 0x00001000 +#define DLB2_PF_VF2PF_FLR_ISR_VF13_ISR 0x00002000 +#define DLB2_PF_VF2PF_FLR_ISR_VF14_ISR 0x00004000 +#define DLB2_PF_VF2PF_FLR_ISR_VF15_ISR 0x00008000 +#define DLB2_PF_VF2PF_FLR_ISR_RSVD0 0xFFFF0000 +#define DLB2_PF_VF2PF_FLR_ISR_VF0_ISR_LOC 0 +#define DLB2_PF_VF2PF_FLR_ISR_VF1_ISR_LOC 1 +#define DLB2_PF_VF2PF_FLR_ISR_VF2_ISR_LOC 2 +#define DLB2_PF_VF2PF_FLR_ISR_VF3_ISR_LOC 3 +#define DLB2_PF_VF2PF_FLR_ISR_VF4_ISR_LOC 4 +#define DLB2_PF_VF2PF_FLR_ISR_VF5_ISR_LOC 5 +#define DLB2_PF_VF2PF_FLR_ISR_VF6_ISR_LOC 6 +#define DLB2_PF_VF2PF_FLR_ISR_VF7_ISR_LOC 7 +#define DLB2_PF_VF2PF_FLR_ISR_VF8_ISR_LOC 8 +#define DLB2_PF_VF2PF_FLR_ISR_VF9_ISR_LOC 9 +#define DLB2_PF_VF2PF_FLR_ISR_VF10_ISR_LOC 10 +#define DLB2_PF_VF2PF_FLR_ISR_VF11_ISR_LOC 11 +#define DLB2_PF_VF2PF_FLR_ISR_VF12_ISR_LOC 12 +#define DLB2_PF_VF2PF_FLR_ISR_VF13_ISR_LOC 13 +#define DLB2_PF_VF2PF_FLR_ISR_VF14_ISR_LOC 14 +#define DLB2_PF_VF2PF_FLR_ISR_VF15_ISR_LOC 15 +#define DLB2_PF_VF2PF_FLR_ISR_RSVD0_LOC 16 + +#define DLB2_PF_VF2PF_ISR_PEND (vf_id) \ + (0x1f10 + (vf_id) * 0x10000) +#define DLB2_PF_VF2PF_ISR_PEND_RST 0x0 + +#define DLB2_PF_VF2PF_ISR_PEND_ISR_PEND 0x00000001 +#define DLB2_PF_VF2PF_ISR_PEND_RSVD0 0xFFFFFFFE +#define DLB2_PF_VF2PF_ISR_PEND_ISR_PEND_LOC 0 +#define DLB2_PF_VF2PF_ISR_PEND_RSVD0_LOC 1 + +#define DLB2_PF_PF2VF_MAILBOX_BYTES 64 +#define DLB2_PF_PF2VF_MAILBOX (vf_id, x) \ + (0x2000 + 0x4 * (x) + (vf_id) * 0x10000) +#define DLB2_PF_PF2VF_MAILBOX_RST 0x0 + +#define DLB2_PF_PF2VF_MAILBOX_MSG 0xFFFFFFFF +#define DLB2_PF_PF2VF_MAILBOX_MSG_LOC 0 + +#define DLB2_PF_PF2VF_MAILBOX_ISR (vf_id) \ + (0x2f00 + (vf_id) * 0x10000) +#define DLB2_PF_PF2VF_MAILBOX_ISR_RST 0x0 + +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF0_ISR 0x00000001 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF1_ISR 0x00000002 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF2_ISR 0x00000004 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF3_ISR 0x00000008 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF4_ISR 0x00000010 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF5_ISR 0x00000020 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF6_ISR 0x00000040 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF7_ISR 0x00000080 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF8_ISR 0x00000100 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF9_ISR 0x00000200 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF10_ISR 0x00000400 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF11_ISR 0x00000800 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF12_ISR 0x00001000 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF13_ISR 0x00002000 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF14_ISR 0x00004000 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF15_ISR 0x00008000 +#define DLB2_PF_PF2VF_MAILBOX_ISR_RSVD0 0xFFFF0000 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF0_ISR_LOC 0 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF1_ISR_LOC 1 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF2_ISR_LOC 2 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF3_ISR_LOC 3 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF4_ISR_LOC 4 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF5_ISR_LOC 5 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF6_ISR_LOC 6 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF7_ISR_LOC 7 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF8_ISR_LOC 8 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF9_ISR_LOC 9 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF10_ISR_LOC 10 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF11_ISR_LOC 11 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF12_ISR_LOC 12 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF13_ISR_LOC 13 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF14_ISR_LOC 14 +#define DLB2_PF_PF2VF_MAILBOX_ISR_VF15_ISR_LOC 15 +#define DLB2_PF_PF2VF_MAILBOX_ISR_RSVD0_LOC 16 + +#define DLB2_PF_VF_RESET_IN_PROGRESS (vf_id) \ + (0x3000 + (vf_id) * 0x10000) +#define DLB2_PF_VF_RESET_IN_PROGRESS_RST 0xffff + +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF0_RESET_IN_PROGRESS 0x00000001 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF1_RESET_IN_PROGRESS 0x00000002 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF2_RESET_IN_PROGRESS 0x00000004 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF3_RESET_IN_PROGRESS 0x00000008 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF4_RESET_IN_PROGRESS 0x00000010 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF5_RESET_IN_PROGRESS 0x00000020 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF6_RESET_IN_PROGRESS 0x00000040 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF7_RESET_IN_PROGRESS 0x00000080 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF8_RESET_IN_PROGRESS 0x00000100 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF9_RESET_IN_PROGRESS 0x00000200 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF10_RESET_IN_PROGRESS 0x00000400 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF11_RESET_IN_PROGRESS 0x00000800 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF12_RESET_IN_PROGRESS 0x00001000 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF13_RESET_IN_PROGRESS 0x00002000 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF14_RESET_IN_PROGRESS 0x00004000 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF15_RESET_IN_PROGRESS 0x00008000 +#define DLB2_PF_VF_RESET_IN_PROGRESS_RSVD0 0xFFFF0000 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF0_RESET_IN_PROGRESS_LOC 0 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF1_RESET_IN_PROGRESS_LOC 1 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF2_RESET_IN_PROGRESS_LOC 2 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF3_RESET_IN_PROGRESS_LOC 3 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF4_RESET_IN_PROGRESS_LOC 4 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF5_RESET_IN_PROGRESS_LOC 5 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF6_RESET_IN_PROGRESS_LOC 6 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF7_RESET_IN_PROGRESS_LOC 7 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF8_RESET_IN_PROGRESS_LOC 8 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF9_RESET_IN_PROGRESS_LOC 9 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF10_RESET_IN_PROGRESS_LOC 10 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF11_RESET_IN_PROGRESS_LOC 11 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF12_RESET_IN_PROGRESS_LOC 12 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF13_RESET_IN_PROGRESS_LOC 13 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF14_RESET_IN_PROGRESS_LOC 14 +#define DLB2_PF_VF_RESET_IN_PROGRESS_VF15_RESET_IN_PROGRESS_LOC 15 +#define DLB2_PF_VF_RESET_IN_PROGRESS_RSVD0_LOC 16 + +#define DLB2_MSIX_VECTOR_CTRL (x) \ + (0x100000c + (x) * 0x10) +#define DLB2_MSIX_VECTOR_CTRL_RST 0x1 + +#define DLB2_MSIX_VECTOR_CTRL_VEC_MASK 0x00000001 +#define DLB2_MSIX_VECTOR_CTRL_RSVD0 0xFFFFFFFE +#define DLB2_MSIX_VECTOR_CTRL_VEC_MASK_LOC 0 +#define DLB2_MSIX_VECTOR_CTRL_RSVD0_LOC 1 + +#define DLB2_IOSF_FUNC_VF_BAR_DSBL (x) \ + (0x20 + (x) * 0x4) +#define DLB2_IOSF_FUNC_VF_BAR_DSBL_RST 0x0 + +#define DLB2_IOSF_FUNC_VF_BAR_DSBL_FUNC_VF_BAR_DIS 0x00000001 +#define DLB2_IOSF_FUNC_VF_BAR_DSBL_RSVD0 0xFFFFFFFE +#define DLB2_IOSF_FUNC_VF_BAR_DSBL_FUNC_VF_BAR_DIS_LOC 0 +#define DLB2_IOSF_FUNC_VF_BAR_DSBL_RSVD0_LOC 1 + +#define DLB2_V2SYS_TOTAL_VAS 0x1000011c +#define DLB2_V2_5SYS_TOTAL_VAS 0x10000114 +#define DLB2_SYS_TOTAL_VAS (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2SYS_TOTAL_VAS : \ + DLB2_V2_5SYS_TOTAL_VAS) +#define DLB2_SYS_TOTAL_VAS_RST 0x20 + +#define DLB2_SYS_TOTAL_VAS_TOTAL_VAS 0xFFFFFFFF +#define DLB2_SYS_TOTAL_VAS_TOTAL_VAS_LOC 0 + +#define DLB2_SYS_TOTAL_DIR_CRDS 0x10000108 +#define DLB2_SYS_TOTAL_DIR_CRDS_RST 0x1000 + +#define DLB2_SYS_TOTAL_DIR_CRDS_TOTAL_DIR_CREDITS 0xFFFFFFFF +#define DLB2_SYS_TOTAL_DIR_CRDS_TOTAL_DIR_CREDITS_LOC 0 + +#define DLB2_SYS_TOTAL_LDB_CRDS 0x10000104 +#define DLB2_SYS_TOTAL_LDB_CRDS_RST 0x2000 + +#define DLB2_SYS_TOTAL_LDB_CRDS_TOTAL_LDB_CREDITS 0xFFFFFFFF +#define DLB2_SYS_TOTAL_LDB_CRDS_TOTAL_LDB_CREDITS_LOC 0 + +#define DLB2_SYS_ALARM_PF_SYND2 0x10000508 +#define DLB2_SYS_ALARM_PF_SYND2_RST 0x0 + +#define DLB2_SYS_ALARM_PF_SYND2_LOCK_ID 0x0000FFFF +#define DLB2_SYS_ALARM_PF_SYND2_MEAS 0x00010000 +#define DLB2_SYS_ALARM_PF_SYND2_DEBUG 0x00FE0000 +#define DLB2_SYS_ALARM_PF_SYND2_CQ_POP 0x01000000 +#define DLB2_SYS_ALARM_PF_SYND2_QE_UHL 0x02000000 +#define DLB2_SYS_ALARM_PF_SYND2_QE_ORSP 0x04000000 +#define DLB2_SYS_ALARM_PF_SYND2_QE_VALID 0x08000000 +#define DLB2_SYS_ALARM_PF_SYND2_CQ_INT_REARM 0x10000000 +#define DLB2_SYS_ALARM_PF_SYND2_DSI_ERROR 0x20000000 +#define DLB2_SYS_ALARM_PF_SYND2_RSVD0 0xC0000000 +#define DLB2_SYS_ALARM_PF_SYND2_LOCK_ID_LOC 0 +#define DLB2_SYS_ALARM_PF_SYND2_MEAS_LOC 16 +#define DLB2_SYS_ALARM_PF_SYND2_DEBUG_LOC 17 +#define DLB2_SYS_ALARM_PF_SYND2_CQ_POP_LOC 24 +#define DLB2_SYS_ALARM_PF_SYND2_QE_UHL_LOC 25 +#define DLB2_SYS_ALARM_PF_SYND2_QE_ORSP_LOC 26 +#define DLB2_SYS_ALARM_PF_SYND2_QE_VALID_LOC 27 +#define DLB2_SYS_ALARM_PF_SYND2_CQ_INT_REARM_LOC 28 +#define DLB2_SYS_ALARM_PF_SYND2_DSI_ERROR_LOC 29 +#define DLB2_SYS_ALARM_PF_SYND2_RSVD0_LOC 30 + +#define DLB2_SYS_ALARM_PF_SYND1 0x10000504 +#define DLB2_SYS_ALARM_PF_SYND1_RST 0x0 + +#define DLB2_SYS_ALARM_PF_SYND1_DSI 0x0000FFFF +#define DLB2_SYS_ALARM_PF_SYND1_QID 0x00FF0000 +#define DLB2_SYS_ALARM_PF_SYND1_QTYPE 0x03000000 +#define DLB2_SYS_ALARM_PF_SYND1_QPRI 0x1C000000 +#define DLB2_SYS_ALARM_PF_SYND1_MSG_TYPE 0xE0000000 +#define DLB2_SYS_ALARM_PF_SYND1_DSI_LOC 0 +#define DLB2_SYS_ALARM_PF_SYND1_QID_LOC 16 +#define DLB2_SYS_ALARM_PF_SYND1_QTYPE_LOC 24 +#define DLB2_SYS_ALARM_PF_SYND1_QPRI_LOC 26 +#define DLB2_SYS_ALARM_PF_SYND1_MSG_TYPE_LOC 29 + +#define DLB2_SYS_ALARM_PF_SYND0 0x10000500 +#define DLB2_SYS_ALARM_PF_SYND0_RST 0x0 + +#define DLB2_SYS_ALARM_PF_SYND0_SYNDROME 0x000000FF +#define DLB2_SYS_ALARM_PF_SYND0_RTYPE 0x00000300 +#define DLB2_SYS_ALARM_PF_SYND0_RSVD0 0x00001C00 +#define DLB2_SYS_ALARM_PF_SYND0_IS_LDB 0x00002000 +#define DLB2_SYS_ALARM_PF_SYND0_CLS 0x0000C000 +#define DLB2_SYS_ALARM_PF_SYND0_AID 0x003F0000 +#define DLB2_SYS_ALARM_PF_SYND0_UNIT 0x03C00000 +#define DLB2_SYS_ALARM_PF_SYND0_SOURCE 0x3C000000 +#define DLB2_SYS_ALARM_PF_SYND0_MORE 0x40000000 +#define DLB2_SYS_ALARM_PF_SYND0_VALID 0x80000000 +#define DLB2_SYS_ALARM_PF_SYND0_SYNDROME_LOC 0 +#define DLB2_SYS_ALARM_PF_SYND0_RTYPE_LOC 8 +#define DLB2_SYS_ALARM_PF_SYND0_RSVD0_LOC 10 +#define DLB2_SYS_ALARM_PF_SYND0_IS_LDB_LOC 13 +#define DLB2_SYS_ALARM_PF_SYND0_CLS_LOC 14 +#define DLB2_SYS_ALARM_PF_SYND0_AID_LOC 16 +#define DLB2_SYS_ALARM_PF_SYND0_UNIT_LOC 22 +#define DLB2_SYS_ALARM_PF_SYND0_SOURCE_LOC 26 +#define DLB2_SYS_ALARM_PF_SYND0_MORE_LOC 30 +#define DLB2_SYS_ALARM_PF_SYND0_VALID_LOC 31 + +#define DLB2_SYS_VF_LDB_VPP_V (x) \ + (0x10000f00 + (x) * 0x1000) +#define DLB2_SYS_VF_LDB_VPP_V_RST 0x0 + +#define DLB2_SYS_VF_LDB_VPP_V_VPP_V 0x00000001 +#define DLB2_SYS_VF_LDB_VPP_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_VF_LDB_VPP_V_VPP_V_LOC 0 +#define DLB2_SYS_VF_LDB_VPP_V_RSVD0_LOC 1 + +#define DLB2_SYS_VF_LDB_VPP2PP (x) \ + (0x10000f04 + (x) * 0x1000) +#define DLB2_SYS_VF_LDB_VPP2PP_RST 0x0 + +#define DLB2_SYS_VF_LDB_VPP2PP_PP 0x0000003F +#define DLB2_SYS_VF_LDB_VPP2PP_RSVD0 0xFFFFFFC0 +#define DLB2_SYS_VF_LDB_VPP2PP_PP_LOC 0 +#define DLB2_SYS_VF_LDB_VPP2PP_RSVD0_LOC 6 + +#define DLB2_SYS_VF_DIR_VPP_V (x) \ + (0x10000f08 + (x) * 0x1000) +#define DLB2_SYS_VF_DIR_VPP_V_RST 0x0 + +#define DLB2_SYS_VF_DIR_VPP_V_VPP_V 0x00000001 +#define DLB2_SYS_VF_DIR_VPP_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_VF_DIR_VPP_V_VPP_V_LOC 0 +#define DLB2_SYS_VF_DIR_VPP_V_RSVD0_LOC 1 + +#define DLB2_SYS_VF_DIR_VPP2PP (x) \ + (0x10000f0c + (x) * 0x1000) +#define DLB2_SYS_VF_DIR_VPP2PP_RST 0x0 + +#define DLB2_SYS_VF_DIR_VPP2PP_PP 0x0000003F +#define DLB2_SYS_VF_DIR_VPP2PP_RSVD0 0xFFFFFFC0 +#define DLB2_SYS_VF_DIR_VPP2PP_PP_LOC 0 +#define DLB2_SYS_VF_DIR_VPP2PP_RSVD0_LOC 6 + +#define DLB2_SYS_VF_LDB_VQID_V (x) \ + (0x10000f10 + (x) * 0x1000) +#define DLB2_SYS_VF_LDB_VQID_V_RST 0x0 + +#define DLB2_SYS_VF_LDB_VQID_V_VQID_V 0x00000001 +#define DLB2_SYS_VF_LDB_VQID_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_VF_LDB_VQID_V_VQID_V_LOC 0 +#define DLB2_SYS_VF_LDB_VQID_V_RSVD0_LOC 1 + +#define DLB2_SYS_VF_LDB_VQID2QID (x) \ + (0x10000f14 + (x) * 0x1000) +#define DLB2_SYS_VF_LDB_VQID2QID_RST 0x0 + +#define DLB2_SYS_VF_LDB_VQID2QID_QID 0x0000001F +#define DLB2_SYS_VF_LDB_VQID2QID_RSVD0 0xFFFFFFE0 +#define DLB2_SYS_VF_LDB_VQID2QID_QID_LOC 0 +#define DLB2_SYS_VF_LDB_VQID2QID_RSVD0_LOC 5 + +#define DLB2_SYS_LDB_QID2VQID (x) \ + (0x10000f18 + (x) * 0x1000) +#define DLB2_SYS_LDB_QID2VQID_RST 0x0 + +#define DLB2_SYS_LDB_QID2VQID_VQID 0x0000001F +#define DLB2_SYS_LDB_QID2VQID_RSVD0 0xFFFFFFE0 +#define DLB2_SYS_LDB_QID2VQID_VQID_LOC 0 +#define DLB2_SYS_LDB_QID2VQID_RSVD0_LOC 5 + +#define DLB2_SYS_VF_DIR_VQID_V (x) \ + (0x10000f1c + (x) * 0x1000) +#define DLB2_SYS_VF_DIR_VQID_V_RST 0x0 + +#define DLB2_SYS_VF_DIR_VQID_V_VQID_V 0x00000001 +#define DLB2_SYS_VF_DIR_VQID_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_VF_DIR_VQID_V_VQID_V_LOC 0 +#define DLB2_SYS_VF_DIR_VQID_V_RSVD0_LOC 1 + +#define DLB2_SYS_VF_DIR_VQID2QID (x) \ + (0x10000f20 + (x) * 0x1000) +#define DLB2_SYS_VF_DIR_VQID2QID_RST 0x0 + +#define DLB2_SYS_VF_DIR_VQID2QID_QID 0x0000003F +#define DLB2_SYS_VF_DIR_VQID2QID_RSVD0 0xFFFFFFC0 +#define DLB2_SYS_VF_DIR_VQID2QID_QID_LOC 0 +#define DLB2_SYS_VF_DIR_VQID2QID_RSVD0_LOC 6 + +#define DLB2_SYS_LDB_VASQID_V (x) \ + (0x10000f24 + (x) * 0x1000) +#define DLB2_SYS_LDB_VASQID_V_RST 0x0 + +#define DLB2_SYS_LDB_VASQID_V_VASQID_V 0x00000001 +#define DLB2_SYS_LDB_VASQID_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_LDB_VASQID_V_VASQID_V_LOC 0 +#define DLB2_SYS_LDB_VASQID_V_RSVD0_LOC 1 + +#define DLB2_SYS_DIR_VASQID_V (x) \ + (0x10000f28 + (x) * 0x1000) +#define DLB2_SYS_DIR_VASQID_V_RST 0x0 + +#define DLB2_SYS_DIR_VASQID_V_VASQID_V 0x00000001 +#define DLB2_SYS_DIR_VASQID_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_DIR_VASQID_V_VASQID_V_LOC 0 +#define DLB2_SYS_DIR_VASQID_V_RSVD0_LOC 1 + +#define DLB2_SYS_ALARM_VF_SYND2 (x) \ + (0x10000f48 + (x) * 0x1000) +#define DLB2_SYS_ALARM_VF_SYND2_RST 0x0 + +#define DLB2_SYS_ALARM_VF_SYND2_LOCK_ID 0x0000FFFF +#define DLB2_SYS_ALARM_VF_SYND2_DEBUG 0x00FF0000 +#define DLB2_SYS_ALARM_VF_SYND2_CQ_POP 0x01000000 +#define DLB2_SYS_ALARM_VF_SYND2_QE_UHL 0x02000000 +#define DLB2_SYS_ALARM_VF_SYND2_QE_ORSP 0x04000000 +#define DLB2_SYS_ALARM_VF_SYND2_QE_VALID 0x08000000 +#define DLB2_SYS_ALARM_VF_SYND2_ISZ 0x10000000 +#define DLB2_SYS_ALARM_VF_SYND2_DSI_ERROR 0x20000000 +#define DLB2_SYS_ALARM_VF_SYND2_DLBRSVD 0xC0000000 +#define DLB2_SYS_ALARM_VF_SYND2_LOCK_ID_LOC 0 +#define DLB2_SYS_ALARM_VF_SYND2_DEBUG_LOC 16 +#define DLB2_SYS_ALARM_VF_SYND2_CQ_POP_LOC 24 +#define DLB2_SYS_ALARM_VF_SYND2_QE_UHL_LOC 25 +#define DLB2_SYS_ALARM_VF_SYND2_QE_ORSP_LOC 26 +#define DLB2_SYS_ALARM_VF_SYND2_QE_VALID_LOC 27 +#define DLB2_SYS_ALARM_VF_SYND2_ISZ_LOC 28 +#define DLB2_SYS_ALARM_VF_SYND2_DSI_ERROR_LOC 29 +#define DLB2_SYS_ALARM_VF_SYND2_DLBRSVD_LOC 30 + +#define DLB2_SYS_ALARM_VF_SYND1 (x) \ + (0x10000f44 + (x) * 0x1000) +#define DLB2_SYS_ALARM_VF_SYND1_RST 0x0 + +#define DLB2_SYS_ALARM_VF_SYND1_DSI 0x0000FFFF +#define DLB2_SYS_ALARM_VF_SYND1_QID 0x00FF0000 +#define DLB2_SYS_ALARM_VF_SYND1_QTYPE 0x03000000 +#define DLB2_SYS_ALARM_VF_SYND1_QPRI 0x1C000000 +#define DLB2_SYS_ALARM_VF_SYND1_MSG_TYPE 0xE0000000 +#define DLB2_SYS_ALARM_VF_SYND1_DSI_LOC 0 +#define DLB2_SYS_ALARM_VF_SYND1_QID_LOC 16 +#define DLB2_SYS_ALARM_VF_SYND1_QTYPE_LOC 24 +#define DLB2_SYS_ALARM_VF_SYND1_QPRI_LOC 26 +#define DLB2_SYS_ALARM_VF_SYND1_MSG_TYPE_LOC 29 + +#define DLB2_SYS_ALARM_VF_SYND0 (x) \ + (0x10000f40 + (x) * 0x1000) +#define DLB2_SYS_ALARM_VF_SYND0_RST 0x0 + +#define DLB2_SYS_ALARM_VF_SYND0_SYNDROME 0x000000FF +#define DLB2_SYS_ALARM_VF_SYND0_RTYPE 0x00000300 +#define DLB2_SYS_ALARM_VF_SYND0_VF_SYND0_PARITY 0x00000400 +#define DLB2_SYS_ALARM_VF_SYND0_VF_SYND1_PARITY 0x00000800 +#define DLB2_SYS_ALARM_VF_SYND0_VF_SYND2_PARITY 0x00001000 +#define DLB2_SYS_ALARM_VF_SYND0_IS_LDB 0x00002000 +#define DLB2_SYS_ALARM_VF_SYND0_CLS 0x0000C000 +#define DLB2_SYS_ALARM_VF_SYND0_AID 0x003F0000 +#define DLB2_SYS_ALARM_VF_SYND0_UNIT 0x03C00000 +#define DLB2_SYS_ALARM_VF_SYND0_SOURCE 0x3C000000 +#define DLB2_SYS_ALARM_VF_SYND0_MORE 0x40000000 +#define DLB2_SYS_ALARM_VF_SYND0_VALID 0x80000000 +#define DLB2_SYS_ALARM_VF_SYND0_SYNDROME_LOC 0 +#define DLB2_SYS_ALARM_VF_SYND0_RTYPE_LOC 8 +#define DLB2_SYS_ALARM_VF_SYND0_VF_SYND0_PARITY_LOC 10 +#define DLB2_SYS_ALARM_VF_SYND0_VF_SYND1_PARITY_LOC 11 +#define DLB2_SYS_ALARM_VF_SYND0_VF_SYND2_PARITY_LOC 12 +#define DLB2_SYS_ALARM_VF_SYND0_IS_LDB_LOC 13 +#define DLB2_SYS_ALARM_VF_SYND0_CLS_LOC 14 +#define DLB2_SYS_ALARM_VF_SYND0_AID_LOC 16 +#define DLB2_SYS_ALARM_VF_SYND0_UNIT_LOC 22 +#define DLB2_SYS_ALARM_VF_SYND0_SOURCE_LOC 26 +#define DLB2_SYS_ALARM_VF_SYND0_MORE_LOC 30 +#define DLB2_SYS_ALARM_VF_SYND0_VALID_LOC 31 + +#define DLB2_SYS_LDB_QID_CFG_V (x) \ + (0x10000f58 + (x) * 0x1000) +#define DLB2_SYS_LDB_QID_CFG_V_RST 0x0 + +#define DLB2_SYS_LDB_QID_CFG_V_SN_CFG_V 0x00000001 +#define DLB2_SYS_LDB_QID_CFG_V_FID_CFG_V 0x00000002 +#define DLB2_SYS_LDB_QID_CFG_V_RSVD0 0xFFFFFFFC +#define DLB2_SYS_LDB_QID_CFG_V_SN_CFG_V_LOC 0 +#define DLB2_SYS_LDB_QID_CFG_V_FID_CFG_V_LOC 1 +#define DLB2_SYS_LDB_QID_CFG_V_RSVD0_LOC 2 + +#define DLB2_SYS_LDB_QID_ITS (x) \ + (0x10000f54 + (x) * 0x1000) +#define DLB2_SYS_LDB_QID_ITS_RST 0x0 + +#define DLB2_SYS_LDB_QID_ITS_QID_ITS 0x00000001 +#define DLB2_SYS_LDB_QID_ITS_RSVD0 0xFFFFFFFE +#define DLB2_SYS_LDB_QID_ITS_QID_ITS_LOC 0 +#define DLB2_SYS_LDB_QID_ITS_RSVD0_LOC 1 + +#define DLB2_SYS_LDB_QID_V (x) \ + (0x10000f50 + (x) * 0x1000) +#define DLB2_SYS_LDB_QID_V_RST 0x0 + +#define DLB2_SYS_LDB_QID_V_QID_V 0x00000001 +#define DLB2_SYS_LDB_QID_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_LDB_QID_V_QID_V_LOC 0 +#define DLB2_SYS_LDB_QID_V_RSVD0_LOC 1 + +#define DLB2_SYS_DIR_QID_ITS (x) \ + (0x10000f64 + (x) * 0x1000) +#define DLB2_SYS_DIR_QID_ITS_RST 0x0 + +#define DLB2_SYS_DIR_QID_ITS_QID_ITS 0x00000001 +#define DLB2_SYS_DIR_QID_ITS_RSVD0 0xFFFFFFFE +#define DLB2_SYS_DIR_QID_ITS_QID_ITS_LOC 0 +#define DLB2_SYS_DIR_QID_ITS_RSVD0_LOC 1 + +#define DLB2_SYS_DIR_QID_V (x) \ + (0x10000f60 + (x) * 0x1000) +#define DLB2_SYS_DIR_QID_V_RST 0x0 + +#define DLB2_SYS_DIR_QID_V_QID_V 0x00000001 +#define DLB2_SYS_DIR_QID_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_DIR_QID_V_QID_V_LOC 0 +#define DLB2_SYS_DIR_QID_V_RSVD0_LOC 1 + +#define DLB2_SYS_LDB_CQ_AI_DATA (x) \ + (0x10000fa8 + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ_AI_DATA_RST 0x0 + +#define DLB2_SYS_LDB_CQ_AI_DATA_CQ_AI_DATA 0xFFFFFFFF +#define DLB2_SYS_LDB_CQ_AI_DATA_CQ_AI_DATA_LOC 0 + +#define DLB2_SYS_LDB_CQ_AI_ADDR (x) \ + (0x10000fa4 + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ_AI_ADDR_RST 0x0 + +#define DLB2_SYS_LDB_CQ_AI_ADDR_RSVD1 0x00000003 +#define DLB2_SYS_LDB_CQ_AI_ADDR_CQ_AI_ADDR 0x000FFFFC +#define DLB2_SYS_LDB_CQ_AI_ADDR_RSVD0 0xFFF00000 +#define DLB2_SYS_LDB_CQ_AI_ADDR_RSVD1_LOC 0 +#define DLB2_SYS_LDB_CQ_AI_ADDR_CQ_AI_ADDR_LOC 2 +#define DLB2_SYS_LDB_CQ_AI_ADDR_RSVD0_LOC 20 + +#define DLB2_V2SYS_LDB_CQ_PASID (x) \ + (0x10000fa0 + (x) * 0x1000) +#define DLB2_V2_5SYS_LDB_CQ_PASID (x) \ + (0x10000f9c + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ_PASID (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2SYS_LDB_CQ_PASID(x) : \ + DLB2_V2_5SYS_LDB_CQ_PASID(x)) +#define DLB2_SYS_LDB_CQ_PASID_RST 0x0 + +#define DLB2_SYS_LDB_CQ_PASID_PASID 0x000FFFFF +#define DLB2_SYS_LDB_CQ_PASID_EXE_REQ 0x00100000 +#define DLB2_SYS_LDB_CQ_PASID_PRIV_REQ 0x00200000 +#define DLB2_SYS_LDB_CQ_PASID_FMT2 0x00400000 +#define DLB2_SYS_LDB_CQ_PASID_RSVD0 0xFF800000 +#define DLB2_SYS_LDB_CQ_PASID_PASID_LOC 0 +#define DLB2_SYS_LDB_CQ_PASID_EXE_REQ_LOC 20 +#define DLB2_SYS_LDB_CQ_PASID_PRIV_REQ_LOC 21 +#define DLB2_SYS_LDB_CQ_PASID_FMT2_LOC 22 +#define DLB2_SYS_LDB_CQ_PASID_RSVD0_LOC 23 + +#define DLB2_SYS_LDB_CQ_AT (x) \ + (0x10000f9c + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ_AT_RST 0x0 + +#define DLB2_SYS_LDB_CQ_AT_CQ_AT 0x00000003 +#define DLB2_SYS_LDB_CQ_AT_RSVD0 0xFFFFFFFC +#define DLB2_SYS_LDB_CQ_AT_CQ_AT_LOC 0 +#define DLB2_SYS_LDB_CQ_AT_RSVD0_LOC 2 + +#define DLB2_SYS_LDB_CQ_ISR (x) \ + (0x10000f98 + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ_ISR_RST 0x0 +/* CQ Interrupt Modes */ +#define DLB2_CQ_ISR_MODE_DIS 0 +#define DLB2_CQ_ISR_MODE_MSI 1 +#define DLB2_CQ_ISR_MODE_MSIX 2 +#define DLB2_CQ_ISR_MODE_ADI 3 + +#define DLB2_SYS_LDB_CQ_ISR_VECTOR 0x0000003F +#define DLB2_SYS_LDB_CQ_ISR_VF 0x000003C0 +#define DLB2_SYS_LDB_CQ_ISR_EN_CODE 0x00000C00 +#define DLB2_SYS_LDB_CQ_ISR_RSVD0 0xFFFFF000 +#define DLB2_SYS_LDB_CQ_ISR_VECTOR_LOC 0 +#define DLB2_SYS_LDB_CQ_ISR_VF_LOC 6 +#define DLB2_SYS_LDB_CQ_ISR_EN_CODE_LOC 10 +#define DLB2_SYS_LDB_CQ_ISR_RSVD0_LOC 12 + +#define DLB2_SYS_LDB_CQ2VF_PF_RO (x) \ + (0x10000f94 + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ2VF_PF_RO_RST 0x0 + +#define DLB2_SYS_LDB_CQ2VF_PF_RO_VF 0x0000000F +#define DLB2_SYS_LDB_CQ2VF_PF_RO_IS_PF 0x00000010 +#define DLB2_SYS_LDB_CQ2VF_PF_RO_RO 0x00000020 +#define DLB2_SYS_LDB_CQ2VF_PF_RO_RSVD0 0xFFFFFFC0 +#define DLB2_SYS_LDB_CQ2VF_PF_RO_VF_LOC 0 +#define DLB2_SYS_LDB_CQ2VF_PF_RO_IS_PF_LOC 4 +#define DLB2_SYS_LDB_CQ2VF_PF_RO_RO_LOC 5 +#define DLB2_SYS_LDB_CQ2VF_PF_RO_RSVD0_LOC 6 + +#define DLB2_SYS_LDB_PP_V (x) \ + (0x10000f90 + (x) * 0x1000) +#define DLB2_SYS_LDB_PP_V_RST 0x0 + +#define DLB2_SYS_LDB_PP_V_PP_V 0x00000001 +#define DLB2_SYS_LDB_PP_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_LDB_PP_V_PP_V_LOC 0 +#define DLB2_SYS_LDB_PP_V_RSVD0_LOC 1 + +#define DLB2_SYS_LDB_PP2VDEV (x) \ + (0x10000f8c + (x) * 0x1000) +#define DLB2_SYS_LDB_PP2VDEV_RST 0x0 + +#define DLB2_SYS_LDB_PP2VDEV_VDEV 0x0000000F +#define DLB2_SYS_LDB_PP2VDEV_RSVD0 0xFFFFFFF0 +#define DLB2_SYS_LDB_PP2VDEV_VDEV_LOC 0 +#define DLB2_SYS_LDB_PP2VDEV_RSVD0_LOC 4 + +#define DLB2_SYS_LDB_PP2VAS (x) \ + (0x10000f88 + (x) * 0x1000) +#define DLB2_SYS_LDB_PP2VAS_RST 0x0 + +#define DLB2_SYS_LDB_PP2VAS_VAS 0x0000001F +#define DLB2_SYS_LDB_PP2VAS_RSVD0 0xFFFFFFE0 +#define DLB2_SYS_LDB_PP2VAS_VAS_LOC 0 +#define DLB2_SYS_LDB_PP2VAS_RSVD0_LOC 5 + +#define DLB2_SYS_LDB_CQ_ADDR_U (x) \ + (0x10000f84 + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ_ADDR_U_RST 0x0 + +#define DLB2_SYS_LDB_CQ_ADDR_U_ADDR_U 0xFFFFFFFF +#define DLB2_SYS_LDB_CQ_ADDR_U_ADDR_U_LOC 0 + +#define DLB2_SYS_LDB_CQ_ADDR_L (x) \ + (0x10000f80 + (x) * 0x1000) +#define DLB2_SYS_LDB_CQ_ADDR_L_RST 0x0 + +#define DLB2_SYS_LDB_CQ_ADDR_L_RSVD0 0x0000003F +#define DLB2_SYS_LDB_CQ_ADDR_L_ADDR_L 0xFFFFFFC0 +#define DLB2_SYS_LDB_CQ_ADDR_L_RSVD0_LOC 0 +#define DLB2_SYS_LDB_CQ_ADDR_L_ADDR_L_LOC 6 + +#define DLB2_SYS_DIR_CQ_FMT (x) \ + (0x10000fec + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_FMT_RST 0x0 + +#define DLB2_SYS_DIR_CQ_FMT_KEEP_PF_PPID 0x00000001 +#define DLB2_SYS_DIR_CQ_FMT_RSVD0 0xFFFFFFFE +#define DLB2_SYS_DIR_CQ_FMT_KEEP_PF_PPID_LOC 0 +#define DLB2_SYS_DIR_CQ_FMT_RSVD0_LOC 1 + +#define DLB2_SYS_DIR_CQ_AI_DATA (x) \ + (0x10000fe8 + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_AI_DATA_RST 0x0 + +#define DLB2_SYS_DIR_CQ_AI_DATA_CQ_AI_DATA 0xFFFFFFFF +#define DLB2_SYS_DIR_CQ_AI_DATA_CQ_AI_DATA_LOC 0 + +#define DLB2_SYS_DIR_CQ_AI_ADDR (x) \ + (0x10000fe4 + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_AI_ADDR_RST 0x0 + +#define DLB2_SYS_DIR_CQ_AI_ADDR_RSVD1 0x00000003 +#define DLB2_SYS_DIR_CQ_AI_ADDR_CQ_AI_ADDR 0x000FFFFC +#define DLB2_SYS_DIR_CQ_AI_ADDR_RSVD0 0xFFF00000 +#define DLB2_SYS_DIR_CQ_AI_ADDR_RSVD1_LOC 0 +#define DLB2_SYS_DIR_CQ_AI_ADDR_CQ_AI_ADDR_LOC 2 +#define DLB2_SYS_DIR_CQ_AI_ADDR_RSVD0_LOC 20 + +#define DLB2_V2SYS_DIR_CQ_PASID (x) \ + (0x10000fe0 + (x) * 0x1000) +#define DLB2_V2_5SYS_DIR_CQ_PASID (x) \ + (0x10000fdc + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_PASID (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2SYS_DIR_CQ_PASID(x) : \ + DLB2_V2_5SYS_DIR_CQ_PASID(x)) +#define DLB2_SYS_DIR_CQ_PASID_RST 0x0 + +#define DLB2_SYS_DIR_CQ_PASID_PASID 0x000FFFFF +#define DLB2_SYS_DIR_CQ_PASID_EXE_REQ 0x00100000 +#define DLB2_SYS_DIR_CQ_PASID_PRIV_REQ 0x00200000 +#define DLB2_SYS_DIR_CQ_PASID_FMT2 0x00400000 +#define DLB2_SYS_DIR_CQ_PASID_RSVD0 0xFF800000 +#define DLB2_SYS_DIR_CQ_PASID_PASID_LOC 0 +#define DLB2_SYS_DIR_CQ_PASID_EXE_REQ_LOC 20 +#define DLB2_SYS_DIR_CQ_PASID_PRIV_REQ_LOC 21 +#define DLB2_SYS_DIR_CQ_PASID_FMT2_LOC 22 +#define DLB2_SYS_DIR_CQ_PASID_RSVD0_LOC 23 + +#define DLB2_SYS_DIR_CQ_AT (x) \ + (0x10000fdc + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_AT_RST 0x0 + +#define DLB2_SYS_DIR_CQ_AT_CQ_AT 0x00000003 +#define DLB2_SYS_DIR_CQ_AT_RSVD0 0xFFFFFFFC +#define DLB2_SYS_DIR_CQ_AT_CQ_AT_LOC 0 +#define DLB2_SYS_DIR_CQ_AT_RSVD0_LOC 2 + +#define DLB2_SYS_DIR_CQ_ISR (x) \ + (0x10000fd8 + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_ISR_RST 0x0 + +#define DLB2_SYS_DIR_CQ_ISR_VECTOR 0x0000003F +#define DLB2_SYS_DIR_CQ_ISR_VF 0x000003C0 +#define DLB2_SYS_DIR_CQ_ISR_EN_CODE 0x00000C00 +#define DLB2_SYS_DIR_CQ_ISR_RSVD0 0xFFFFF000 +#define DLB2_SYS_DIR_CQ_ISR_VECTOR_LOC 0 +#define DLB2_SYS_DIR_CQ_ISR_VF_LOC 6 +#define DLB2_SYS_DIR_CQ_ISR_EN_CODE_LOC 10 +#define DLB2_SYS_DIR_CQ_ISR_RSVD0_LOC 12 + +#define DLB2_SYS_DIR_CQ2VF_PF_RO (x) \ + (0x10000fd4 + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ2VF_PF_RO_RST 0x0 + +#define DLB2_SYS_DIR_CQ2VF_PF_RO_VF 0x0000000F +#define DLB2_SYS_DIR_CQ2VF_PF_RO_IS_PF 0x00000010 +#define DLB2_SYS_DIR_CQ2VF_PF_RO_RO 0x00000020 +#define DLB2_SYS_DIR_CQ2VF_PF_RO_RSVD0 0xFFFFFFC0 +#define DLB2_SYS_DIR_CQ2VF_PF_RO_VF_LOC 0 +#define DLB2_SYS_DIR_CQ2VF_PF_RO_IS_PF_LOC 4 +#define DLB2_SYS_DIR_CQ2VF_PF_RO_RO_LOC 5 +#define DLB2_SYS_DIR_CQ2VF_PF_RO_RSVD0_LOC 6 + +#define DLB2_SYS_DIR_PP_V (x) \ + (0x10000fd0 + (x) * 0x1000) +#define DLB2_SYS_DIR_PP_V_RST 0x0 + +#define DLB2_SYS_DIR_PP_V_PP_V 0x00000001 +#define DLB2_SYS_DIR_PP_V_RSVD0 0xFFFFFFFE +#define DLB2_SYS_DIR_PP_V_PP_V_LOC 0 +#define DLB2_SYS_DIR_PP_V_RSVD0_LOC 1 + +#define DLB2_SYS_DIR_PP2VDEV (x) \ + (0x10000fcc + (x) * 0x1000) +#define DLB2_SYS_DIR_PP2VDEV_RST 0x0 + +#define DLB2_SYS_DIR_PP2VDEV_VDEV 0x0000000F +#define DLB2_SYS_DIR_PP2VDEV_RSVD0 0xFFFFFFF0 +#define DLB2_SYS_DIR_PP2VDEV_VDEV_LOC 0 +#define DLB2_SYS_DIR_PP2VDEV_RSVD0_LOC 4 + +#define DLB2_SYS_DIR_PP2VAS (x) \ + (0x10000fc8 + (x) * 0x1000) +#define DLB2_SYS_DIR_PP2VAS_RST 0x0 + +#define DLB2_SYS_DIR_PP2VAS_VAS 0x0000001F +#define DLB2_SYS_DIR_PP2VAS_RSVD0 0xFFFFFFE0 +#define DLB2_SYS_DIR_PP2VAS_VAS_LOC 0 +#define DLB2_SYS_DIR_PP2VAS_RSVD0_LOC 5 + +#define DLB2_SYS_DIR_CQ_ADDR_U (x) \ + (0x10000fc4 + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_ADDR_U_RST 0x0 + +#define DLB2_SYS_DIR_CQ_ADDR_U_ADDR_U 0xFFFFFFFF +#define DLB2_SYS_DIR_CQ_ADDR_U_ADDR_U_LOC 0 + +#define DLB2_SYS_DIR_CQ_ADDR_L (x) \ + (0x10000fc0 + (x) * 0x1000) +#define DLB2_SYS_DIR_CQ_ADDR_L_RST 0x0 + +#define DLB2_SYS_DIR_CQ_ADDR_L_RSVD0 0x0000003F +#define DLB2_SYS_DIR_CQ_ADDR_L_ADDR_L 0xFFFFFFC0 +#define DLB2_SYS_DIR_CQ_ADDR_L_RSVD0_LOC 0 +#define DLB2_SYS_DIR_CQ_ADDR_L_ADDR_L_LOC 6 + +#define DLB2_SYS_PM_SMON_COMP_MASK1 0x10003024 +#define DLB2_SYS_PM_SMON_COMP_MASK1_RST 0xffffffff + +#define DLB2_SYS_PM_SMON_COMP_MASK1_COMP_MASK1 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_COMP_MASK1_COMP_MASK1_LOC 0 + +#define DLB2_SYS_PM_SMON_COMP_MASK0 0x10003020 +#define DLB2_SYS_PM_SMON_COMP_MASK0_RST 0xffffffff + +#define DLB2_SYS_PM_SMON_COMP_MASK0_COMP_MASK0 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_COMP_MASK0_COMP_MASK0_LOC 0 + +#define DLB2_SYS_PM_SMON_MAX_TMR 0x1000301c +#define DLB2_SYS_PM_SMON_MAX_TMR_RST 0x0 + +#define DLB2_SYS_PM_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_SYS_PM_SMON_TMR 0x10003018 +#define DLB2_SYS_PM_SMON_TMR_RST 0x0 + +#define DLB2_SYS_PM_SMON_TMR_TIMER_VAL 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_TMR_TIMER_VAL_LOC 0 + +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR1 0x10003014 +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR0 0x10003010 +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_SYS_PM_SMON_COMPARE1 0x1000300c +#define DLB2_SYS_PM_SMON_COMPARE1_RST 0x0 + +#define DLB2_SYS_PM_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_SYS_PM_SMON_COMPARE0 0x10003008 +#define DLB2_SYS_PM_SMON_COMPARE0_RST 0x0 + +#define DLB2_SYS_PM_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_SYS_PM_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_SYS_PM_SMON_CFG1 0x10003004 +#define DLB2_SYS_PM_SMON_CFG1_RST 0x0 + +#define DLB2_SYS_PM_SMON_CFG1_MODE0 0x000000FF +#define DLB2_SYS_PM_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_SYS_PM_SMON_CFG1_RSVD 0xFFFF0000 +#define DLB2_SYS_PM_SMON_CFG1_MODE0_LOC 0 +#define DLB2_SYS_PM_SMON_CFG1_MODE1_LOC 8 +#define DLB2_SYS_PM_SMON_CFG1_RSVD_LOC 16 + +#define DLB2_SYS_PM_SMON_CFG0 0x10003000 +#define DLB2_SYS_PM_SMON_CFG0_RST 0x40000000 + +#define DLB2_SYS_PM_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_SYS_PM_SMON_CFG0_RSVD2 0x0000000E +#define DLB2_SYS_PM_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_SYS_PM_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_SYS_PM_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_SYS_PM_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_SYS_PM_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_SYS_PM_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_SYS_PM_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_SYS_PM_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_SYS_PM_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_SYS_PM_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_SYS_PM_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_SYS_PM_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_SYS_PM_SMON_CFG0_RSVD1 0x00800000 +#define DLB2_SYS_PM_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_SYS_PM_SMON_CFG0_RSVD0 0x20000000 +#define DLB2_SYS_PM_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_SYS_PM_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_SYS_PM_SMON_CFG0_RSVD2_LOC 1 +#define DLB2_SYS_PM_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_SYS_PM_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_SYS_PM_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_SYS_PM_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_SYS_PM_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_SYS_PM_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_SYS_PM_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_SYS_PM_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_SYS_PM_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_SYS_PM_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_SYS_PM_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_SYS_PM_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_SYS_PM_SMON_CFG0_RSVD1_LOC 23 +#define DLB2_SYS_PM_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_SYS_PM_SMON_CFG0_RSVD0_LOC 29 +#define DLB2_SYS_PM_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_SYS_SMON_COMP_MASK1 (x) \ + (0x18002024 + (x) * 0x40) +#define DLB2_SYS_SMON_COMP_MASK1_RST 0xffffffff + +#define DLB2_SYS_SMON_COMP_MASK1_COMP_MASK1 0xFFFFFFFF +#define DLB2_SYS_SMON_COMP_MASK1_COMP_MASK1_LOC 0 + +#define DLB2_SYS_SMON_COMP_MASK0 (x) \ + (0x18002020 + (x) * 0x40) +#define DLB2_SYS_SMON_COMP_MASK0_RST 0xffffffff + +#define DLB2_SYS_SMON_COMP_MASK0_COMP_MASK0 0xFFFFFFFF +#define DLB2_SYS_SMON_COMP_MASK0_COMP_MASK0_LOC 0 + +#define DLB2_SYS_SMON_MAX_TMR (x) \ + (0x1800201c + (x) * 0x40) +#define DLB2_SYS_SMON_MAX_TMR_RST 0x0 + +#define DLB2_SYS_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_SYS_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_SYS_SMON_TMR (x) \ + (0x18002018 + (x) * 0x40) +#define DLB2_SYS_SMON_TMR_RST 0x0 + +#define DLB2_SYS_SMON_TMR_TIMER_VAL 0xFFFFFFFF +#define DLB2_SYS_SMON_TMR_TIMER_VAL_LOC 0 + +#define DLB2_SYS_SMON_ACTIVITYCNTR1 (x) \ + (0x18002014 + (x) * 0x40) +#define DLB2_SYS_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_SYS_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_SYS_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_SYS_SMON_ACTIVITYCNTR0 (x) \ + (0x18002010 + (x) * 0x40) +#define DLB2_SYS_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_SYS_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_SYS_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_SYS_SMON_COMPARE1 (x) \ + (0x1800200c + (x) * 0x40) +#define DLB2_SYS_SMON_COMPARE1_RST 0x0 + +#define DLB2_SYS_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_SYS_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_SYS_SMON_COMPARE0 (x) \ + (0x18002008 + (x) * 0x40) +#define DLB2_SYS_SMON_COMPARE0_RST 0x0 + +#define DLB2_SYS_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_SYS_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_SYS_SMON_CFG1 (x) \ + (0x18002004 + (x) * 0x40) +#define DLB2_SYS_SMON_CFG1_RST 0x0 + +#define DLB2_SYS_SMON_CFG1_MODE0 0x000000FF +#define DLB2_SYS_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_SYS_SMON_CFG1_RSVD 0xFFFF0000 +#define DLB2_SYS_SMON_CFG1_MODE0_LOC 0 +#define DLB2_SYS_SMON_CFG1_MODE1_LOC 8 +#define DLB2_SYS_SMON_CFG1_RSVD_LOC 16 + +#define DLB2_SYS_SMON_CFG0 (x) \ + (0x18002000 + (x) * 0x40) +#define DLB2_SYS_SMON_CFG0_RST 0x40000000 + +#define DLB2_SYS_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_SYS_SMON_CFG0_RSVD2 0x0000000E +#define DLB2_SYS_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_SYS_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_SYS_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_SYS_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_SYS_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_SYS_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_SYS_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_SYS_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_SYS_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_SYS_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_SYS_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_SYS_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_SYS_SMON_CFG0_RSVD1 0x00800000 +#define DLB2_SYS_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_SYS_SMON_CFG0_RSVD0 0x20000000 +#define DLB2_SYS_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_SYS_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_SYS_SMON_CFG0_RSVD2_LOC 1 +#define DLB2_SYS_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_SYS_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_SYS_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_SYS_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_SYS_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_SYS_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_SYS_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_SYS_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_SYS_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_SYS_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_SYS_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_SYS_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_SYS_SMON_CFG0_RSVD1_LOC 23 +#define DLB2_SYS_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_SYS_SMON_CFG0_RSVD0_LOC 29 +#define DLB2_SYS_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_SYS_INGRESS_ALARM_ENBL 0x10000300 +#define DLB2_SYS_INGRESS_ALARM_ENBL_RST 0x0 + +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_HCW 0x00000001 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_PP 0x00000002 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_PASID 0x00000004 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_QID 0x00000008 +#define DLB2_SYS_INGRESS_ALARM_ENBL_DISABLED_QID 0x00000010 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_LDB_QID_CFG 0x00000020 +#define DLB2_SYS_INGRESS_ALARM_ENBL_RSVD0 0xFFFFFFC0 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_HCW_LOC 0 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_PP_LOC 1 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_PASID_LOC 2 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_QID_LOC 3 +#define DLB2_SYS_INGRESS_ALARM_ENBL_DISABLED_QID_LOC 4 +#define DLB2_SYS_INGRESS_ALARM_ENBL_ILLEGAL_LDB_QID_CFG_LOC 5 +#define DLB2_SYS_INGRESS_ALARM_ENBL_RSVD0_LOC 6 + +#define DLB2_SYS_MSIX_ACK 0x10000400 +#define DLB2_SYS_MSIX_ACK_RST 0x0 + +#define DLB2_SYS_MSIX_ACK_MSIX_0_ACK 0x00000001 +#define DLB2_SYS_MSIX_ACK_MSIX_1_ACK 0x00000002 +#define DLB2_SYS_MSIX_ACK_RSVD0 0xFFFFFFFC +#define DLB2_SYS_MSIX_ACK_MSIX_0_ACK_LOC 0 +#define DLB2_SYS_MSIX_ACK_MSIX_1_ACK_LOC 1 +#define DLB2_SYS_MSIX_ACK_RSVD0_LOC 2 + +#define DLB2_SYS_MSIX_PASSTHRU 0x10000404 +#define DLB2_SYS_MSIX_PASSTHRU_RST 0x0 + +#define DLB2_SYS_MSIX_PASSTHRU_MSIX_0_PASSTHRU 0x00000001 +#define DLB2_SYS_MSIX_PASSTHRU_MSIX_1_PASSTHRU 0x00000002 +#define DLB2_SYS_MSIX_PASSTHRU_RSVD0 0xFFFFFFFC +#define DLB2_SYS_MSIX_PASSTHRU_MSIX_0_PASSTHRU_LOC 0 +#define DLB2_SYS_MSIX_PASSTHRU_MSIX_1_PASSTHRU_LOC 1 +#define DLB2_SYS_MSIX_PASSTHRU_RSVD0_LOC 2 + +#define DLB2_SYS_MSIX_MODE 0x10000408 +#define DLB2_SYS_MSIX_MODE_RST 0x0 +/* MSI-X Modes */ +#define DLB2_MSIX_MODE_PACKED 0 +#define DLB2_MSIX_MODE_COMPRESSED 1 + +#define DLB2_SYS_MSIX_MODE_MODE_V2 0x00000001 +#define DLB2_SYS_MSIX_MODE_POLL_MODE_V2 0x00000002 +#define DLB2_SYS_MSIX_MODE_POLL_MASK_V2 0x00000004 +#define DLB2_SYS_MSIX_MODE_POLL_LOCK_V2 0x00000008 +#define DLB2_SYS_MSIX_MODE_RSVD0_V2 0xFFFFFFF0 +#define DLB2_SYS_MSIX_MODE_MODE_V2_LOC 0 +#define DLB2_SYS_MSIX_MODE_POLL_MODE_V2_LOC 1 +#define DLB2_SYS_MSIX_MODE_POLL_MASK_V2_LOC 2 +#define DLB2_SYS_MSIX_MODE_POLL_LOCK_V2_LOC 3 +#define DLB2_SYS_MSIX_MODE_RSVD0_V2_LOC 4 + +#define DLB2_SYS_MSIX_MODE_MODE_V2_5 0x00000001 +#define DLB2_SYS_MSIX_MODE_IMS_POLLING_V2_5 0x00000002 +#define DLB2_SYS_MSIX_MODE_RSVD0_V2_5 0xFFFFFFFC +#define DLB2_SYS_MSIX_MODE_MODE_V2_5_LOC 0 +#define DLB2_SYS_MSIX_MODE_IMS_POLLING_V2_5_LOC 1 +#define DLB2_SYS_MSIX_MODE_RSVD0_V2_5_LOC 2 + +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS 0x10000440 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_RST 0x0 + +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_0_OCC_INT 0x00000001 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_1_OCC_INT 0x00000002 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_2_OCC_INT 0x00000004 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_3_OCC_INT 0x00000008 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_4_OCC_INT 0x00000010 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_5_OCC_INT 0x00000020 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_6_OCC_INT 0x00000040 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_7_OCC_INT 0x00000080 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_8_OCC_INT 0x00000100 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_9_OCC_INT 0x00000200 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_10_OCC_INT 0x00000400 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_11_OCC_INT 0x00000800 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_12_OCC_INT 0x00001000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_13_OCC_INT 0x00002000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_14_OCC_INT 0x00004000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_15_OCC_INT 0x00008000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_16_OCC_INT 0x00010000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_17_OCC_INT 0x00020000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_18_OCC_INT 0x00040000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_19_OCC_INT 0x00080000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_20_OCC_INT 0x00100000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_21_OCC_INT 0x00200000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_22_OCC_INT 0x00400000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_23_OCC_INT 0x00800000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_24_OCC_INT 0x01000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_25_OCC_INT 0x02000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_26_OCC_INT 0x04000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_27_OCC_INT 0x08000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_28_OCC_INT 0x10000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_29_OCC_INT 0x20000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_30_OCC_INT 0x40000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_31_OCC_INT 0x80000000 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_0_OCC_INT_LOC 0 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_1_OCC_INT_LOC 1 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_2_OCC_INT_LOC 2 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_3_OCC_INT_LOC 3 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_4_OCC_INT_LOC 4 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_5_OCC_INT_LOC 5 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_6_OCC_INT_LOC 6 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_7_OCC_INT_LOC 7 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_8_OCC_INT_LOC 8 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_9_OCC_INT_LOC 9 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_10_OCC_INT_LOC 10 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_11_OCC_INT_LOC 11 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_12_OCC_INT_LOC 12 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_13_OCC_INT_LOC 13 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_14_OCC_INT_LOC 14 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_15_OCC_INT_LOC 15 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_16_OCC_INT_LOC 16 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_17_OCC_INT_LOC 17 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_18_OCC_INT_LOC 18 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_19_OCC_INT_LOC 19 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_20_OCC_INT_LOC 20 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_21_OCC_INT_LOC 21 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_22_OCC_INT_LOC 22 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_23_OCC_INT_LOC 23 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_24_OCC_INT_LOC 24 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_25_OCC_INT_LOC 25 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_26_OCC_INT_LOC 26 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_27_OCC_INT_LOC 27 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_28_OCC_INT_LOC 28 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_29_OCC_INT_LOC 29 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_30_OCC_INT_LOC 30 +#define DLB2_SYS_DIR_CQ_31_0_OCC_INT_STS_CQ_31_OCC_INT_LOC 31 + +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS 0x10000444 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_RST 0x0 + +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_32_OCC_INT 0x00000001 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_33_OCC_INT 0x00000002 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_34_OCC_INT 0x00000004 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_35_OCC_INT 0x00000008 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_36_OCC_INT 0x00000010 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_37_OCC_INT 0x00000020 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_38_OCC_INT 0x00000040 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_39_OCC_INT 0x00000080 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_40_OCC_INT 0x00000100 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_41_OCC_INT 0x00000200 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_42_OCC_INT 0x00000400 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_43_OCC_INT 0x00000800 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_44_OCC_INT 0x00001000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_45_OCC_INT 0x00002000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_46_OCC_INT 0x00004000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_47_OCC_INT 0x00008000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_48_OCC_INT 0x00010000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_49_OCC_INT 0x00020000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_50_OCC_INT 0x00040000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_51_OCC_INT 0x00080000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_52_OCC_INT 0x00100000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_53_OCC_INT 0x00200000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_54_OCC_INT 0x00400000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_55_OCC_INT 0x00800000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_56_OCC_INT 0x01000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_57_OCC_INT 0x02000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_58_OCC_INT 0x04000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_59_OCC_INT 0x08000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_60_OCC_INT 0x10000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_61_OCC_INT 0x20000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_62_OCC_INT 0x40000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_63_OCC_INT 0x80000000 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_32_OCC_INT_LOC 0 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_33_OCC_INT_LOC 1 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_34_OCC_INT_LOC 2 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_35_OCC_INT_LOC 3 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_36_OCC_INT_LOC 4 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_37_OCC_INT_LOC 5 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_38_OCC_INT_LOC 6 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_39_OCC_INT_LOC 7 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_40_OCC_INT_LOC 8 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_41_OCC_INT_LOC 9 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_42_OCC_INT_LOC 10 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_43_OCC_INT_LOC 11 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_44_OCC_INT_LOC 12 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_45_OCC_INT_LOC 13 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_46_OCC_INT_LOC 14 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_47_OCC_INT_LOC 15 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_48_OCC_INT_LOC 16 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_49_OCC_INT_LOC 17 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_50_OCC_INT_LOC 18 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_51_OCC_INT_LOC 19 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_52_OCC_INT_LOC 20 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_53_OCC_INT_LOC 21 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_54_OCC_INT_LOC 22 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_55_OCC_INT_LOC 23 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_56_OCC_INT_LOC 24 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_57_OCC_INT_LOC 25 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_58_OCC_INT_LOC 26 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_59_OCC_INT_LOC 27 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_60_OCC_INT_LOC 28 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_61_OCC_INT_LOC 29 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_62_OCC_INT_LOC 30 +#define DLB2_SYS_DIR_CQ_63_32_OCC_INT_STS_CQ_63_OCC_INT_LOC 31 + +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS 0x10000460 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_RST 0x0 + +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_0_OCC_INT 0x00000001 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_1_OCC_INT 0x00000002 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_2_OCC_INT 0x00000004 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_3_OCC_INT 0x00000008 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_4_OCC_INT 0x00000010 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_5_OCC_INT 0x00000020 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_6_OCC_INT 0x00000040 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_7_OCC_INT 0x00000080 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_8_OCC_INT 0x00000100 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_9_OCC_INT 0x00000200 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_10_OCC_INT 0x00000400 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_11_OCC_INT 0x00000800 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_12_OCC_INT 0x00001000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_13_OCC_INT 0x00002000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_14_OCC_INT 0x00004000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_15_OCC_INT 0x00008000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_16_OCC_INT 0x00010000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_17_OCC_INT 0x00020000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_18_OCC_INT 0x00040000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_19_OCC_INT 0x00080000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_20_OCC_INT 0x00100000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_21_OCC_INT 0x00200000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_22_OCC_INT 0x00400000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_23_OCC_INT 0x00800000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_24_OCC_INT 0x01000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_25_OCC_INT 0x02000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_26_OCC_INT 0x04000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_27_OCC_INT 0x08000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_28_OCC_INT 0x10000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_29_OCC_INT 0x20000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_30_OCC_INT 0x40000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_31_OCC_INT 0x80000000 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_0_OCC_INT_LOC 0 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_1_OCC_INT_LOC 1 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_2_OCC_INT_LOC 2 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_3_OCC_INT_LOC 3 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_4_OCC_INT_LOC 4 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_5_OCC_INT_LOC 5 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_6_OCC_INT_LOC 6 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_7_OCC_INT_LOC 7 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_8_OCC_INT_LOC 8 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_9_OCC_INT_LOC 9 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_10_OCC_INT_LOC 10 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_11_OCC_INT_LOC 11 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_12_OCC_INT_LOC 12 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_13_OCC_INT_LOC 13 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_14_OCC_INT_LOC 14 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_15_OCC_INT_LOC 15 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_16_OCC_INT_LOC 16 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_17_OCC_INT_LOC 17 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_18_OCC_INT_LOC 18 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_19_OCC_INT_LOC 19 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_20_OCC_INT_LOC 20 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_21_OCC_INT_LOC 21 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_22_OCC_INT_LOC 22 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_23_OCC_INT_LOC 23 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_24_OCC_INT_LOC 24 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_25_OCC_INT_LOC 25 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_26_OCC_INT_LOC 26 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_27_OCC_INT_LOC 27 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_28_OCC_INT_LOC 28 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_29_OCC_INT_LOC 29 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_30_OCC_INT_LOC 30 +#define DLB2_SYS_LDB_CQ_31_0_OCC_INT_STS_CQ_31_OCC_INT_LOC 31 + +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS 0x10000464 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_RST 0x0 + +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_32_OCC_INT 0x00000001 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_33_OCC_INT 0x00000002 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_34_OCC_INT 0x00000004 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_35_OCC_INT 0x00000008 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_36_OCC_INT 0x00000010 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_37_OCC_INT 0x00000020 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_38_OCC_INT 0x00000040 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_39_OCC_INT 0x00000080 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_40_OCC_INT 0x00000100 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_41_OCC_INT 0x00000200 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_42_OCC_INT 0x00000400 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_43_OCC_INT 0x00000800 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_44_OCC_INT 0x00001000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_45_OCC_INT 0x00002000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_46_OCC_INT 0x00004000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_47_OCC_INT 0x00008000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_48_OCC_INT 0x00010000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_49_OCC_INT 0x00020000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_50_OCC_INT 0x00040000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_51_OCC_INT 0x00080000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_52_OCC_INT 0x00100000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_53_OCC_INT 0x00200000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_54_OCC_INT 0x00400000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_55_OCC_INT 0x00800000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_56_OCC_INT 0x01000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_57_OCC_INT 0x02000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_58_OCC_INT 0x04000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_59_OCC_INT 0x08000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_60_OCC_INT 0x10000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_61_OCC_INT 0x20000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_62_OCC_INT 0x40000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_63_OCC_INT 0x80000000 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_32_OCC_INT_LOC 0 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_33_OCC_INT_LOC 1 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_34_OCC_INT_LOC 2 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_35_OCC_INT_LOC 3 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_36_OCC_INT_LOC 4 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_37_OCC_INT_LOC 5 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_38_OCC_INT_LOC 6 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_39_OCC_INT_LOC 7 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_40_OCC_INT_LOC 8 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_41_OCC_INT_LOC 9 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_42_OCC_INT_LOC 10 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_43_OCC_INT_LOC 11 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_44_OCC_INT_LOC 12 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_45_OCC_INT_LOC 13 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_46_OCC_INT_LOC 14 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_47_OCC_INT_LOC 15 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_48_OCC_INT_LOC 16 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_49_OCC_INT_LOC 17 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_50_OCC_INT_LOC 18 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_51_OCC_INT_LOC 19 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_52_OCC_INT_LOC 20 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_53_OCC_INT_LOC 21 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_54_OCC_INT_LOC 22 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_55_OCC_INT_LOC 23 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_56_OCC_INT_LOC 24 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_57_OCC_INT_LOC 25 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_58_OCC_INT_LOC 26 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_59_OCC_INT_LOC 27 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_60_OCC_INT_LOC 28 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_61_OCC_INT_LOC 29 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_62_OCC_INT_LOC 30 +#define DLB2_SYS_LDB_CQ_63_32_OCC_INT_STS_CQ_63_OCC_INT_LOC 31 + +#define DLB2_SYS_DIR_CQ_OPT_CLR 0x100004c0 +#define DLB2_SYS_DIR_CQ_OPT_CLR_RST 0x0 + +#define DLB2_SYS_DIR_CQ_OPT_CLR_CQ 0x0000003F +#define DLB2_SYS_DIR_CQ_OPT_CLR_RSVD0 0xFFFFFFC0 +#define DLB2_SYS_DIR_CQ_OPT_CLR_CQ_LOC 0 +#define DLB2_SYS_DIR_CQ_OPT_CLR_RSVD0_LOC 6 + +#define DLB2_SYS_ALARM_HW_SYND 0x1000050c +#define DLB2_SYS_ALARM_HW_SYND_RST 0x0 + +#define DLB2_SYS_ALARM_HW_SYND_SYNDROME 0x000000FF +#define DLB2_SYS_ALARM_HW_SYND_RTYPE 0x00000300 +#define DLB2_SYS_ALARM_HW_SYND_ALARM 0x00000400 +#define DLB2_SYS_ALARM_HW_SYND_CWD 0x00000800 +#define DLB2_SYS_ALARM_HW_SYND_VF_PF_MB 0x00001000 +#define DLB2_SYS_ALARM_HW_SYND_RSVD0 0x00002000 +#define DLB2_SYS_ALARM_HW_SYND_CLS 0x0000C000 +#define DLB2_SYS_ALARM_HW_SYND_AID 0x003F0000 +#define DLB2_SYS_ALARM_HW_SYND_UNIT 0x03C00000 +#define DLB2_SYS_ALARM_HW_SYND_SOURCE 0x3C000000 +#define DLB2_SYS_ALARM_HW_SYND_MORE 0x40000000 +#define DLB2_SYS_ALARM_HW_SYND_VALID 0x80000000 +#define DLB2_SYS_ALARM_HW_SYND_SYNDROME_LOC 0 +#define DLB2_SYS_ALARM_HW_SYND_RTYPE_LOC 8 +#define DLB2_SYS_ALARM_HW_SYND_ALARM_LOC 10 +#define DLB2_SYS_ALARM_HW_SYND_CWD_LOC 11 +#define DLB2_SYS_ALARM_HW_SYND_VF_PF_MB_LOC 12 +#define DLB2_SYS_ALARM_HW_SYND_RSVD0_LOC 13 +#define DLB2_SYS_ALARM_HW_SYND_CLS_LOC 14 +#define DLB2_SYS_ALARM_HW_SYND_AID_LOC 16 +#define DLB2_SYS_ALARM_HW_SYND_UNIT_LOC 22 +#define DLB2_SYS_ALARM_HW_SYND_SOURCE_LOC 26 +#define DLB2_SYS_ALARM_HW_SYND_MORE_LOC 30 +#define DLB2_SYS_ALARM_HW_SYND_VALID_LOC 31 + +#define DLB2_AQED_QID_FID_LIM (x) \ + (0x20000000 + (x) * 0x1000) +#define DLB2_AQED_QID_FID_LIM_RST 0x7ff + +#define DLB2_AQED_QID_FID_LIM_QID_FID_LIMIT 0x00001FFF +#define DLB2_AQED_QID_FID_LIM_RSVD0 0xFFFFE000 +#define DLB2_AQED_QID_FID_LIM_QID_FID_LIMIT_LOC 0 +#define DLB2_AQED_QID_FID_LIM_RSVD0_LOC 13 + +#define DLB2_AQED_QID_HID_WIDTH (x) \ + (0x20080000 + (x) * 0x1000) +#define DLB2_AQED_QID_HID_WIDTH_RST 0x0 + +#define DLB2_AQED_QID_HID_WIDTH_COMPRESS_CODE 0x00000007 +#define DLB2_AQED_QID_HID_WIDTH_RSVD0 0xFFFFFFF8 +#define DLB2_AQED_QID_HID_WIDTH_COMPRESS_CODE_LOC 0 +#define DLB2_AQED_QID_HID_WIDTH_RSVD0_LOC 3 + +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0 0x24000004 +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_RST 0xfefcfaf8 + +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI0 0x000000FF +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI1 0x0000FF00 +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI2 0x00FF0000 +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI3 0xFF000000 +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI0_LOC 0 +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI1_LOC 8 +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI2_LOC 16 +#define DLB2_AQED_CFG_ARB_WEIGHTS_TQPRI_ATM_0_PRI3_LOC 24 + +#define DLB2_AQED_SMON_ACTIVITYCNTR0 0x2c00004c +#define DLB2_AQED_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_AQED_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_AQED_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_AQED_SMON_ACTIVITYCNTR1 0x2c000050 +#define DLB2_AQED_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_AQED_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_AQED_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_AQED_SMON_COMPARE0 0x2c000054 +#define DLB2_AQED_SMON_COMPARE0_RST 0x0 + +#define DLB2_AQED_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_AQED_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_AQED_SMON_COMPARE1 0x2c000058 +#define DLB2_AQED_SMON_COMPARE1_RST 0x0 + +#define DLB2_AQED_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_AQED_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_AQED_SMON_CFG0 0x2c00005c +#define DLB2_AQED_SMON_CFG0_RST 0x40000000 + +#define DLB2_AQED_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_AQED_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_AQED_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_AQED_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_AQED_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_AQED_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_AQED_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_AQED_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_AQED_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_AQED_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_AQED_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_AQED_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_AQED_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_AQED_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_AQED_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_AQED_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_AQED_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_AQED_SMON_CFG0_RSVZ2 0x20000000 +#define DLB2_AQED_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_AQED_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_AQED_SMON_CFG0_SMON_0TRIGGER_ENABLE_LOC 1 +#define DLB2_AQED_SMON_CFG0_RSVZ0_LOC 2 +#define DLB2_AQED_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_AQED_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_AQED_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_AQED_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_AQED_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_AQED_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_AQED_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_AQED_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_AQED_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_AQED_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_AQED_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_AQED_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_AQED_SMON_CFG0_RSVZ1_LOC 23 +#define DLB2_AQED_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_AQED_SMON_CFG0_RSVZ2_LOC 29 +#define DLB2_AQED_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_AQED_SMON_CFG1 0x2c000060 +#define DLB2_AQED_SMON_CFG1_RST 0x0 + +#define DLB2_AQED_SMON_CFG1_MODE0 0x000000FF +#define DLB2_AQED_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_AQED_SMON_CFG1_RSVZ0 0xFFFF0000 +#define DLB2_AQED_SMON_CFG1_MODE0_LOC 0 +#define DLB2_AQED_SMON_CFG1_MODE1_LOC 8 +#define DLB2_AQED_SMON_CFG1_RSVZ0_LOC 16 + +#define DLB2_AQED_SMON_MAX_TMR 0x2c000064 +#define DLB2_AQED_SMON_MAX_TMR_RST 0x0 + +#define DLB2_AQED_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_AQED_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_AQED_SMON_TMR 0x2c000068 +#define DLB2_AQED_SMON_TMR_RST 0x0 + +#define DLB2_AQED_SMON_TMR_TIMER 0xFFFFFFFF +#define DLB2_AQED_SMON_TMR_TIMER_LOC 0 + +#define DLB2_ATM_QID2CQIDIX_00 (x) \ + (0x30080000 + (x) * 0x1000) +#define DLB2_ATM_QID2CQIDIX_00_RST 0x0 +#define DLB2_ATM_QID2CQIDIX (x, y) \ + (DLB2_ATM_QID2CQIDIX_00(x) + 0x80000 * (y)) +#define DLB2_ATM_QID2CQIDIX_NUM 16 + +#define DLB2_ATM_QID2CQIDIX_00_CQ_P0 0x000000FF +#define DLB2_ATM_QID2CQIDIX_00_CQ_P1 0x0000FF00 +#define DLB2_ATM_QID2CQIDIX_00_CQ_P2 0x00FF0000 +#define DLB2_ATM_QID2CQIDIX_00_CQ_P3 0xFF000000 +#define DLB2_ATM_QID2CQIDIX_00_CQ_P0_LOC 0 +#define DLB2_ATM_QID2CQIDIX_00_CQ_P1_LOC 8 +#define DLB2_ATM_QID2CQIDIX_00_CQ_P2_LOC 16 +#define DLB2_ATM_QID2CQIDIX_00_CQ_P3_LOC 24 + +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN 0x34000004 +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_RST 0xfffefdfc + +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN0 0x000000FF +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN1 0x0000FF00 +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN2 0x00FF0000 +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN3 0xFF000000 +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN0_LOC 0 +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN1_LOC 8 +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN2_LOC 16 +#define DLB2_ATM_CFG_ARB_WEIGHTS_RDY_BIN_BIN3_LOC 24 + +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN 0x34000008 +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_RST 0xfffefdfc + +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN0 0x000000FF +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN1 0x0000FF00 +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN2 0x00FF0000 +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN3 0xFF000000 +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN0_LOC 0 +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN1_LOC 8 +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN2_LOC 16 +#define DLB2_ATM_CFG_ARB_WEIGHTS_SCHED_BIN_BIN3_LOC 24 + +#define DLB2_ATM_SMON_ACTIVITYCNTR0 0x3c000050 +#define DLB2_ATM_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_ATM_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_ATM_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_ATM_SMON_ACTIVITYCNTR1 0x3c000054 +#define DLB2_ATM_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_ATM_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_ATM_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_ATM_SMON_COMPARE0 0x3c000058 +#define DLB2_ATM_SMON_COMPARE0_RST 0x0 + +#define DLB2_ATM_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_ATM_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_ATM_SMON_COMPARE1 0x3c00005c +#define DLB2_ATM_SMON_COMPARE1_RST 0x0 + +#define DLB2_ATM_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_ATM_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_ATM_SMON_CFG0 0x3c000060 +#define DLB2_ATM_SMON_CFG0_RST 0x40000000 + +#define DLB2_ATM_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_ATM_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_ATM_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_ATM_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_ATM_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_ATM_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_ATM_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_ATM_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_ATM_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_ATM_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_ATM_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_ATM_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_ATM_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_ATM_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_ATM_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_ATM_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_ATM_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_ATM_SMON_CFG0_RSVZ2 0x20000000 +#define DLB2_ATM_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_ATM_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_ATM_SMON_CFG0_SMON_0TRIGGER_ENABLE_LOC 1 +#define DLB2_ATM_SMON_CFG0_RSVZ0_LOC 2 +#define DLB2_ATM_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_ATM_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_ATM_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_ATM_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_ATM_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_ATM_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_ATM_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_ATM_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_ATM_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_ATM_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_ATM_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_ATM_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_ATM_SMON_CFG0_RSVZ1_LOC 23 +#define DLB2_ATM_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_ATM_SMON_CFG0_RSVZ2_LOC 29 +#define DLB2_ATM_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_ATM_SMON_CFG1 0x3c000064 +#define DLB2_ATM_SMON_CFG1_RST 0x0 + +#define DLB2_ATM_SMON_CFG1_MODE0 0x000000FF +#define DLB2_ATM_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_ATM_SMON_CFG1_RSVZ0 0xFFFF0000 +#define DLB2_ATM_SMON_CFG1_MODE0_LOC 0 +#define DLB2_ATM_SMON_CFG1_MODE1_LOC 8 +#define DLB2_ATM_SMON_CFG1_RSVZ0_LOC 16 + +#define DLB2_ATM_SMON_MAX_TMR 0x3c000068 +#define DLB2_ATM_SMON_MAX_TMR_RST 0x0 + +#define DLB2_ATM_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_ATM_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_ATM_SMON_TMR 0x3c00006c +#define DLB2_ATM_SMON_TMR_RST 0x0 + +#define DLB2_ATM_SMON_TMR_TIMER 0xFFFFFFFF +#define DLB2_ATM_SMON_TMR_TIMER_LOC 0 + +#define DLB2_CHP_CFG_DIR_VAS_CRD (x) \ + (0x40000000 + (x) * 0x1000) +#define DLB2_CHP_CFG_DIR_VAS_CRD_RST 0x0 + +#define DLB2_CHP_CFG_DIR_VAS_CRD_COUNT 0x00003FFF +#define DLB2_CHP_CFG_DIR_VAS_CRD_RSVD0 0xFFFFC000 +#define DLB2_CHP_CFG_DIR_VAS_CRD_COUNT_LOC 0 +#define DLB2_CHP_CFG_DIR_VAS_CRD_RSVD0_LOC 14 + +#define DLB2_CHP_CFG_LDB_VAS_CRD (x) \ + (0x40080000 + (x) * 0x1000) +#define DLB2_CHP_CFG_LDB_VAS_CRD_RST 0x0 + +#define DLB2_CHP_CFG_LDB_VAS_CRD_COUNT 0x00007FFF +#define DLB2_CHP_CFG_LDB_VAS_CRD_RSVD0 0xFFFF8000 +#define DLB2_CHP_CFG_LDB_VAS_CRD_COUNT_LOC 0 +#define DLB2_CHP_CFG_LDB_VAS_CRD_RSVD0_LOC 15 + +#define DLB2_V2CHP_ORD_QID_SN (x) \ + (0x40100000 + (x) * 0x1000) +#define DLB2_V2_5CHP_ORD_QID_SN (x) \ + (0x40080000 + (x) * 0x1000) +#define DLB2_CHP_ORD_QID_SN (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_ORD_QID_SN(x) : \ + DLB2_V2_5CHP_ORD_QID_SN(x)) +#define DLB2_CHP_ORD_QID_SN_RST 0x0 + +#define DLB2_CHP_ORD_QID_SN_SN 0x000003FF +#define DLB2_CHP_ORD_QID_SN_RSVD0 0xFFFFFC00 +#define DLB2_CHP_ORD_QID_SN_SN_LOC 0 +#define DLB2_CHP_ORD_QID_SN_RSVD0_LOC 10 + +#define DLB2_V2CHP_ORD_QID_SN_MAP (x) \ + (0x40180000 + (x) * 0x1000) +#define DLB2_V2_5CHP_ORD_QID_SN_MAP (x) \ + (0x40100000 + (x) * 0x1000) +#define DLB2_CHP_ORD_QID_SN_MAP (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_ORD_QID_SN_MAP(x) : \ + DLB2_V2_5CHP_ORD_QID_SN_MAP(x)) +#define DLB2_CHP_ORD_QID_SN_MAP_RST 0x0 + +#define DLB2_CHP_ORD_QID_SN_MAP_MODE 0x00000007 +#define DLB2_CHP_ORD_QID_SN_MAP_SLOT 0x00000078 +#define DLB2_CHP_ORD_QID_SN_MAP_RSVZ0 0x00000080 +#define DLB2_CHP_ORD_QID_SN_MAP_GRP 0x00000100 +#define DLB2_CHP_ORD_QID_SN_MAP_RSVZ1 0x00000200 +#define DLB2_CHP_ORD_QID_SN_MAP_RSVD0 0xFFFFFC00 +#define DLB2_CHP_ORD_QID_SN_MAP_MODE_LOC 0 +#define DLB2_CHP_ORD_QID_SN_MAP_SLOT_LOC 3 +#define DLB2_CHP_ORD_QID_SN_MAP_RSVZ0_LOC 7 +#define DLB2_CHP_ORD_QID_SN_MAP_GRP_LOC 8 +#define DLB2_CHP_ORD_QID_SN_MAP_RSVZ1_LOC 9 +#define DLB2_CHP_ORD_QID_SN_MAP_RSVD0_LOC 10 + +#define DLB2_V2CHP_SN_CHK_ENBL (x) \ + (0x40200000 + (x) * 0x1000) +#define DLB2_V2_5CHP_SN_CHK_ENBL (x) \ + (0x40180000 + (x) * 0x1000) +#define DLB2_CHP_SN_CHK_ENBL (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_SN_CHK_ENBL(x) : \ + DLB2_V2_5CHP_SN_CHK_ENBL(x)) +#define DLB2_CHP_SN_CHK_ENBL_RST 0x0 + +#define DLB2_CHP_SN_CHK_ENBL_EN 0x00000001 +#define DLB2_CHP_SN_CHK_ENBL_RSVD0 0xFFFFFFFE +#define DLB2_CHP_SN_CHK_ENBL_EN_LOC 0 +#define DLB2_CHP_SN_CHK_ENBL_RSVD0_LOC 1 + +#define DLB2_V2CHP_DIR_CQ_DEPTH (x) \ + (0x40280000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ_DEPTH (x) \ + (0x40300000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ_DEPTH (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_DEPTH(x) : \ + DLB2_V2_5CHP_DIR_CQ_DEPTH(x)) +#define DLB2_CHP_DIR_CQ_DEPTH_RST 0x0 + +#define DLB2_CHP_DIR_CQ_DEPTH_DEPTH 0x00001FFF +#define DLB2_CHP_DIR_CQ_DEPTH_RSVD0 0xFFFFE000 +#define DLB2_CHP_DIR_CQ_DEPTH_DEPTH_LOC 0 +#define DLB2_CHP_DIR_CQ_DEPTH_RSVD0_LOC 13 + +#define DLB2_V2CHP_DIR_CQ_INT_DEPTH_THRSH (x) \ + (0x40300000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ_INT_DEPTH_THRSH (x) \ + (0x40380000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ_INT_DEPTH_THRSH (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_INT_DEPTH_THRSH(x) : \ + DLB2_V2_5CHP_DIR_CQ_INT_DEPTH_THRSH(x)) +#define DLB2_CHP_DIR_CQ_INT_DEPTH_THRSH_RST 0x0 + +#define DLB2_CHP_DIR_CQ_INT_DEPTH_THRSH_DEPTH_THRESHOLD 0x00001FFF +#define DLB2_CHP_DIR_CQ_INT_DEPTH_THRSH_RSVD0 0xFFFFE000 +#define DLB2_CHP_DIR_CQ_INT_DEPTH_THRSH_DEPTH_THRESHOLD_LOC 0 +#define DLB2_CHP_DIR_CQ_INT_DEPTH_THRSH_RSVD0_LOC 13 + +#define DLB2_V2CHP_DIR_CQ_INT_ENB (x) \ + (0x40380000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ_INT_ENB (x) \ + (0x40400000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ_INT_ENB (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_INT_ENB(x) : \ + DLB2_V2_5CHP_DIR_CQ_INT_ENB(x)) +#define DLB2_CHP_DIR_CQ_INT_ENB_RST 0x0 + +#define DLB2_CHP_DIR_CQ_INT_ENB_EN_TIM 0x00000001 +#define DLB2_CHP_DIR_CQ_INT_ENB_EN_DEPTH 0x00000002 +#define DLB2_CHP_DIR_CQ_INT_ENB_RSVD0 0xFFFFFFFC +#define DLB2_CHP_DIR_CQ_INT_ENB_EN_TIM_LOC 0 +#define DLB2_CHP_DIR_CQ_INT_ENB_EN_DEPTH_LOC 1 +#define DLB2_CHP_DIR_CQ_INT_ENB_RSVD0_LOC 2 + +#define DLB2_V2CHP_DIR_CQ_TMR_THRSH (x) \ + (0x40480000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ_TMR_THRSH (x) \ + (0x40500000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ_TMR_THRSH (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_TMR_THRSH(x) : \ + DLB2_V2_5CHP_DIR_CQ_TMR_THRSH(x)) +#define DLB2_CHP_DIR_CQ_TMR_THRSH_RST 0x1 + +#define DLB2_CHP_DIR_CQ_TMR_THRSH_THRSH_0 0x00000001 +#define DLB2_CHP_DIR_CQ_TMR_THRSH_THRSH_13_1 0x00003FFE +#define DLB2_CHP_DIR_CQ_TMR_THRSH_RSVD0 0xFFFFC000 +#define DLB2_CHP_DIR_CQ_TMR_THRSH_THRSH_0_LOC 0 +#define DLB2_CHP_DIR_CQ_TMR_THRSH_THRSH_13_1_LOC 1 +#define DLB2_CHP_DIR_CQ_TMR_THRSH_RSVD0_LOC 14 + +#define DLB2_V2CHP_DIR_CQ_TKN_DEPTH_SEL (x) \ + (0x40500000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ_TKN_DEPTH_SEL (x) \ + (0x40580000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_TKN_DEPTH_SEL(x) : \ + DLB2_V2_5CHP_DIR_CQ_TKN_DEPTH_SEL(x)) +#define DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL_RST 0x0 + +#define DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL_TOKEN_DEPTH_SELECT 0x0000000F +#define DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL_RSVD0 0xFFFFFFF0 +#define DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL_TOKEN_DEPTH_SELECT_LOC 0 +#define DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL_RSVD0_LOC 4 + +#define DLB2_V2CHP_DIR_CQ_WD_ENB (x) \ + (0x40580000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ_WD_ENB (x) \ + (0x40600000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ_WD_ENB (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_WD_ENB(x) : \ + DLB2_V2_5CHP_DIR_CQ_WD_ENB(x)) +#define DLB2_CHP_DIR_CQ_WD_ENB_RST 0x0 + +#define DLB2_CHP_DIR_CQ_WD_ENB_WD_ENABLE 0x00000001 +#define DLB2_CHP_DIR_CQ_WD_ENB_RSVD0 0xFFFFFFFE +#define DLB2_CHP_DIR_CQ_WD_ENB_WD_ENABLE_LOC 0 +#define DLB2_CHP_DIR_CQ_WD_ENB_RSVD0_LOC 1 + +#define DLB2_V2CHP_DIR_CQ_WPTR (x) \ + (0x40600000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ_WPTR (x) \ + (0x40680000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ_WPTR (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_WPTR(x) : \ + DLB2_V2_5CHP_DIR_CQ_WPTR(x)) +#define DLB2_CHP_DIR_CQ_WPTR_RST 0x0 + +#define DLB2_CHP_DIR_CQ_WPTR_WRITE_POINTER 0x00001FFF +#define DLB2_CHP_DIR_CQ_WPTR_RSVD0 0xFFFFE000 +#define DLB2_CHP_DIR_CQ_WPTR_WRITE_POINTER_LOC 0 +#define DLB2_CHP_DIR_CQ_WPTR_RSVD0_LOC 13 + +#define DLB2_V2CHP_DIR_CQ2VAS (x) \ + (0x40680000 + (x) * 0x1000) +#define DLB2_V2_5CHP_DIR_CQ2VAS (x) \ + (0x40700000 + (x) * 0x1000) +#define DLB2_CHP_DIR_CQ2VAS (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ2VAS(x) : \ + DLB2_V2_5CHP_DIR_CQ2VAS(x)) +#define DLB2_CHP_DIR_CQ2VAS_RST 0x0 + +#define DLB2_CHP_DIR_CQ2VAS_CQ2VAS 0x0000001F +#define DLB2_CHP_DIR_CQ2VAS_RSVD0 0xFFFFFFE0 +#define DLB2_CHP_DIR_CQ2VAS_CQ2VAS_LOC 0 +#define DLB2_CHP_DIR_CQ2VAS_RSVD0_LOC 5 + +#define DLB2_V2CHP_HIST_LIST_BASE (x) \ + (0x40700000 + (x) * 0x1000) +#define DLB2_V2_5CHP_HIST_LIST_BASE (x) \ + (0x40780000 + (x) * 0x1000) +#define DLB2_CHP_HIST_LIST_BASE (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_HIST_LIST_BASE(x) : \ + DLB2_V2_5CHP_HIST_LIST_BASE(x)) +#define DLB2_CHP_HIST_LIST_BASE_RST 0x0 + +#define DLB2_CHP_HIST_LIST_BASE_BASE 0x00001FFF +#define DLB2_CHP_HIST_LIST_BASE_RSVD0 0xFFFFE000 +#define DLB2_CHP_HIST_LIST_BASE_BASE_LOC 0 +#define DLB2_CHP_HIST_LIST_BASE_RSVD0_LOC 13 + +#define DLB2_V2CHP_HIST_LIST_LIM (x) \ + (0x40780000 + (x) * 0x1000) +#define DLB2_V2_5CHP_HIST_LIST_LIM (x) \ + (0x40800000 + (x) * 0x1000) +#define DLB2_CHP_HIST_LIST_LIM (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_HIST_LIST_LIM(x) : \ + DLB2_V2_5CHP_HIST_LIST_LIM(x)) +#define DLB2_CHP_HIST_LIST_LIM_RST 0x0 + +#define DLB2_CHP_HIST_LIST_LIM_LIMIT 0x00001FFF +#define DLB2_CHP_HIST_LIST_LIM_RSVD0 0xFFFFE000 +#define DLB2_CHP_HIST_LIST_LIM_LIMIT_LOC 0 +#define DLB2_CHP_HIST_LIST_LIM_RSVD0_LOC 13 + +#define DLB2_V2CHP_HIST_LIST_POP_PTR (x) \ + (0x40800000 + (x) * 0x1000) +#define DLB2_V2_5CHP_HIST_LIST_POP_PTR (x) \ + (0x40880000 + (x) * 0x1000) +#define DLB2_CHP_HIST_LIST_POP_PTR (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_HIST_LIST_POP_PTR(x) : \ + DLB2_V2_5CHP_HIST_LIST_POP_PTR(x)) +#define DLB2_CHP_HIST_LIST_POP_PTR_RST 0x0 + +#define DLB2_CHP_HIST_LIST_POP_PTR_POP_PTR 0x00001FFF +#define DLB2_CHP_HIST_LIST_POP_PTR_GENERATION 0x00002000 +#define DLB2_CHP_HIST_LIST_POP_PTR_RSVD0 0xFFFFC000 +#define DLB2_CHP_HIST_LIST_POP_PTR_POP_PTR_LOC 0 +#define DLB2_CHP_HIST_LIST_POP_PTR_GENERATION_LOC 13 +#define DLB2_CHP_HIST_LIST_POP_PTR_RSVD0_LOC 14 + +#define DLB2_V2CHP_HIST_LIST_PUSH_PTR (x) \ + (0x40880000 + (x) * 0x1000) +#define DLB2_V2_5CHP_HIST_LIST_PUSH_PTR (x) \ + (0x40900000 + (x) * 0x1000) +#define DLB2_CHP_HIST_LIST_PUSH_PTR (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_HIST_LIST_PUSH_PTR(x) : \ + DLB2_V2_5CHP_HIST_LIST_PUSH_PTR(x)) +#define DLB2_CHP_HIST_LIST_PUSH_PTR_RST 0x0 + +#define DLB2_CHP_HIST_LIST_PUSH_PTR_PUSH_PTR 0x00001FFF +#define DLB2_CHP_HIST_LIST_PUSH_PTR_GENERATION 0x00002000 +#define DLB2_CHP_HIST_LIST_PUSH_PTR_RSVD0 0xFFFFC000 +#define DLB2_CHP_HIST_LIST_PUSH_PTR_PUSH_PTR_LOC 0 +#define DLB2_CHP_HIST_LIST_PUSH_PTR_GENERATION_LOC 13 +#define DLB2_CHP_HIST_LIST_PUSH_PTR_RSVD0_LOC 14 + +#define DLB2_V2CHP_LDB_CQ_DEPTH (x) \ + (0x40900000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ_DEPTH (x) \ + (0x40a80000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ_DEPTH (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_DEPTH(x) : \ + DLB2_V2_5CHP_LDB_CQ_DEPTH(x)) +#define DLB2_CHP_LDB_CQ_DEPTH_RST 0x0 + +#define DLB2_CHP_LDB_CQ_DEPTH_DEPTH 0x000007FF +#define DLB2_CHP_LDB_CQ_DEPTH_RSVD0 0xFFFFF800 +#define DLB2_CHP_LDB_CQ_DEPTH_DEPTH_LOC 0 +#define DLB2_CHP_LDB_CQ_DEPTH_RSVD0_LOC 11 + +#define DLB2_V2CHP_LDB_CQ_INT_DEPTH_THRSH (x) \ + (0x40980000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ_INT_DEPTH_THRSH (x) \ + (0x40b00000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ_INT_DEPTH_THRSH (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_INT_DEPTH_THRSH(x) : \ + DLB2_V2_5CHP_LDB_CQ_INT_DEPTH_THRSH(x)) +#define DLB2_CHP_LDB_CQ_INT_DEPTH_THRSH_RST 0x0 + +#define DLB2_CHP_LDB_CQ_INT_DEPTH_THRSH_DEPTH_THRESHOLD 0x000007FF +#define DLB2_CHP_LDB_CQ_INT_DEPTH_THRSH_RSVD0 0xFFFFF800 +#define DLB2_CHP_LDB_CQ_INT_DEPTH_THRSH_DEPTH_THRESHOLD_LOC 0 +#define DLB2_CHP_LDB_CQ_INT_DEPTH_THRSH_RSVD0_LOC 11 + +#define DLB2_V2CHP_LDB_CQ_INT_ENB (x) \ + (0x40a00000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ_INT_ENB (x) \ + (0x40b80000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ_INT_ENB (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_INT_ENB(x) : \ + DLB2_V2_5CHP_LDB_CQ_INT_ENB(x)) +#define DLB2_CHP_LDB_CQ_INT_ENB_RST 0x0 + +#define DLB2_CHP_LDB_CQ_INT_ENB_EN_TIM 0x00000001 +#define DLB2_CHP_LDB_CQ_INT_ENB_EN_DEPTH 0x00000002 +#define DLB2_CHP_LDB_CQ_INT_ENB_RSVD0 0xFFFFFFFC +#define DLB2_CHP_LDB_CQ_INT_ENB_EN_TIM_LOC 0 +#define DLB2_CHP_LDB_CQ_INT_ENB_EN_DEPTH_LOC 1 +#define DLB2_CHP_LDB_CQ_INT_ENB_RSVD0_LOC 2 + +#define DLB2_V2CHP_LDB_CQ_TMR_THRSH (x) \ + (0x40b00000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ_TMR_THRSH (x) \ + (0x40c80000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ_TMR_THRSH (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_TMR_THRSH(x) : \ + DLB2_V2_5CHP_LDB_CQ_TMR_THRSH(x)) +#define DLB2_CHP_LDB_CQ_TMR_THRSH_RST 0x1 + +#define DLB2_CHP_LDB_CQ_TMR_THRSH_THRSH_0 0x00000001 +#define DLB2_CHP_LDB_CQ_TMR_THRSH_THRSH_13_1 0x00003FFE +#define DLB2_CHP_LDB_CQ_TMR_THRSH_RSVD0 0xFFFFC000 +#define DLB2_CHP_LDB_CQ_TMR_THRSH_THRSH_0_LOC 0 +#define DLB2_CHP_LDB_CQ_TMR_THRSH_THRSH_13_1_LOC 1 +#define DLB2_CHP_LDB_CQ_TMR_THRSH_RSVD0_LOC 14 + +#define DLB2_V2CHP_LDB_CQ_TKN_DEPTH_SEL (x) \ + (0x40b80000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ_TKN_DEPTH_SEL (x) \ + (0x40d00000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_TKN_DEPTH_SEL(x) : \ + DLB2_V2_5CHP_LDB_CQ_TKN_DEPTH_SEL(x)) +#define DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL_RST 0x0 + +#define DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL_TOKEN_DEPTH_SELECT 0x0000000F +#define DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL_RSVD0 0xFFFFFFF0 +#define DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL_TOKEN_DEPTH_SELECT_LOC 0 +#define DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL_RSVD0_LOC 4 + +#define DLB2_V2CHP_LDB_CQ_WD_ENB (x) \ + (0x40c00000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ_WD_ENB (x) \ + (0x40d80000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ_WD_ENB (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_WD_ENB(x) : \ + DLB2_V2_5CHP_LDB_CQ_WD_ENB(x)) +#define DLB2_CHP_LDB_CQ_WD_ENB_RST 0x0 + +#define DLB2_CHP_LDB_CQ_WD_ENB_WD_ENABLE 0x00000001 +#define DLB2_CHP_LDB_CQ_WD_ENB_RSVD0 0xFFFFFFFE +#define DLB2_CHP_LDB_CQ_WD_ENB_WD_ENABLE_LOC 0 +#define DLB2_CHP_LDB_CQ_WD_ENB_RSVD0_LOC 1 + +#define DLB2_V2CHP_LDB_CQ_WPTR (x) \ + (0x40c80000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ_WPTR (x) \ + (0x40e00000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ_WPTR (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_WPTR(x) : \ + DLB2_V2_5CHP_LDB_CQ_WPTR(x)) +#define DLB2_CHP_LDB_CQ_WPTR_RST 0x0 + +#define DLB2_CHP_LDB_CQ_WPTR_WRITE_POINTER 0x000007FF +#define DLB2_CHP_LDB_CQ_WPTR_RSVD0 0xFFFFF800 +#define DLB2_CHP_LDB_CQ_WPTR_WRITE_POINTER_LOC 0 +#define DLB2_CHP_LDB_CQ_WPTR_RSVD0_LOC 11 + +#define DLB2_V2CHP_LDB_CQ2VAS (x) \ + (0x40d00000 + (x) * 0x1000) +#define DLB2_V2_5CHP_LDB_CQ2VAS (x) \ + (0x40e80000 + (x) * 0x1000) +#define DLB2_CHP_LDB_CQ2VAS (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ2VAS(x) : \ + DLB2_V2_5CHP_LDB_CQ2VAS(x)) +#define DLB2_CHP_LDB_CQ2VAS_RST 0x0 + +#define DLB2_CHP_LDB_CQ2VAS_CQ2VAS 0x0000001F +#define DLB2_CHP_LDB_CQ2VAS_RSVD0 0xFFFFFFE0 +#define DLB2_CHP_LDB_CQ2VAS_CQ2VAS_LOC 0 +#define DLB2_CHP_LDB_CQ2VAS_RSVD0_LOC 5 + +#define DLB2_CHP_CFG_CHP_CSR_CTRL 0x44000008 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_RST 0x180002 + +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_COR_ALARM_DIS 0x00000001 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_COR_SYND_DIS 0x00000002 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_UNCR_ALARM_DIS 0x00000004 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_UNC_SYND_DIS 0x00000008 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF0_ALARM_DIS 0x00000010 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF0_SYND_DIS 0x00000020 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF1_ALARM_DIS 0x00000040 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF1_SYND_DIS 0x00000080 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF2_ALARM_DIS 0x00000100 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF2_SYND_DIS 0x00000200 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF3_ALARM_DIS 0x00000400 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF3_SYND_DIS 0x00000800 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF4_ALARM_DIS 0x00001000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF4_SYND_DIS 0x00002000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF5_ALARM_DIS 0x00004000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF5_SYND_DIS 0x00008000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_DLB_COR_ALARM_ENABLE 0x00010000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_LDB_CQ_MODE 0x00020000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_DIR_CQ_MODE 0x00040000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_WRITE_LDB 0x00080000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_WRITE_DIR 0x00100000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_FIRST_WRITE_LDB 0x00200000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_FIRST_WRITE_DIR 0x00400000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_RSVZ0 0xFF800000 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_COR_ALARM_DIS_LOC 0 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_COR_SYND_DIS_LOC 1 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_UNCR_ALARM_DIS_LOC 2 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_UNC_SYND_DIS_LOC 3 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF0_ALARM_DIS_LOC 4 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF0_SYND_DIS_LOC 5 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF1_ALARM_DIS_LOC 6 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF1_SYND_DIS_LOC 7 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF2_ALARM_DIS_LOC 8 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF2_SYND_DIS_LOC 9 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF3_ALARM_DIS_LOC 10 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF3_SYND_DIS_LOC 11 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF4_ALARM_DIS_LOC 12 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF4_SYND_DIS_LOC 13 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF5_ALARM_DIS_LOC 14 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_INT_INF5_SYND_DIS_LOC 15 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_DLB_COR_ALARM_ENABLE_LOC 16 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_LDB_CQ_MODE_LOC 17 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_DIR_CQ_MODE_LOC 18 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_WRITE_LDB_LOC 19 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_WRITE_DIR_LOC 20 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_FIRST_WRITE_LDB_LOC 21 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_PAD_FIRST_WRITE_DIR_LOC 22 +#define DLB2_CHP_CFG_CHP_CSR_CTRL_RSVZ0_LOC 23 + +#define DLB2_V2CHP_DIR_CQ_INTR_ARMED0 0x4400005c +#define DLB2_V2_5CHP_DIR_CQ_INTR_ARMED0 0x4400004c +#define DLB2_CHP_DIR_CQ_INTR_ARMED0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_INTR_ARMED0 : \ + DLB2_V2_5CHP_DIR_CQ_INTR_ARMED0) +#define DLB2_CHP_DIR_CQ_INTR_ARMED0_RST 0x0 + +#define DLB2_CHP_DIR_CQ_INTR_ARMED0_ARMED 0xFFFFFFFF +#define DLB2_CHP_DIR_CQ_INTR_ARMED0_ARMED_LOC 0 + +#define DLB2_V2CHP_DIR_CQ_INTR_ARMED1 0x44000060 +#define DLB2_V2_5CHP_DIR_CQ_INTR_ARMED1 0x44000050 +#define DLB2_CHP_DIR_CQ_INTR_ARMED1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_DIR_CQ_INTR_ARMED1 : \ + DLB2_V2_5CHP_DIR_CQ_INTR_ARMED1) +#define DLB2_CHP_DIR_CQ_INTR_ARMED1_RST 0x0 + +#define DLB2_CHP_DIR_CQ_INTR_ARMED1_ARMED 0xFFFFFFFF +#define DLB2_CHP_DIR_CQ_INTR_ARMED1_ARMED_LOC 0 + +#define DLB2_V2CHP_CFG_DIR_CQ_TIMER_CTL 0x44000084 +#define DLB2_V2_5CHP_CFG_DIR_CQ_TIMER_CTL 0x44000088 +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_DIR_CQ_TIMER_CTL : \ + DLB2_V2_5CHP_CFG_DIR_CQ_TIMER_CTL) +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL_RST 0x0 + +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL_SAMPLE_INTERVAL 0x000000FF +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL_ENB 0x00000100 +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL_RSVZ0 0xFFFFFE00 +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL_SAMPLE_INTERVAL_LOC 0 +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL_ENB_LOC 8 +#define DLB2_CHP_CFG_DIR_CQ_TIMER_CTL_RSVZ0_LOC 9 + +#define DLB2_V2CHP_CFG_DIR_WDTO_0 0x44000088 +#define DLB2_V2_5CHP_CFG_DIR_WDTO_0 0x4400008c +#define DLB2_CHP_CFG_DIR_WDTO_0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_DIR_WDTO_0 : \ + DLB2_V2_5CHP_CFG_DIR_WDTO_0) +#define DLB2_CHP_CFG_DIR_WDTO_0_RST 0x0 + +#define DLB2_CHP_CFG_DIR_WDTO_0_WDTO 0xFFFFFFFF +#define DLB2_CHP_CFG_DIR_WDTO_0_WDTO_LOC 0 + +#define DLB2_V2CHP_CFG_DIR_WDTO_1 0x4400008c +#define DLB2_V2_5CHP_CFG_DIR_WDTO_1 0x44000090 +#define DLB2_CHP_CFG_DIR_WDTO_1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_DIR_WDTO_1 : \ + DLB2_V2_5CHP_CFG_DIR_WDTO_1) +#define DLB2_CHP_CFG_DIR_WDTO_1_RST 0x0 + +#define DLB2_CHP_CFG_DIR_WDTO_1_WDTO 0xFFFFFFFF +#define DLB2_CHP_CFG_DIR_WDTO_1_WDTO_LOC 0 + +#define DLB2_V2CHP_CFG_DIR_WD_DISABLE0 0x44000098 +#define DLB2_V2_5CHP_CFG_DIR_WD_DISABLE0 0x440000a4 +#define DLB2_CHP_CFG_DIR_WD_DISABLE0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_DIR_WD_DISABLE0 : \ + DLB2_V2_5CHP_CFG_DIR_WD_DISABLE0) +#define DLB2_CHP_CFG_DIR_WD_DISABLE0_RST 0xffffffff + +#define DLB2_CHP_CFG_DIR_WD_DISABLE0_WD_DISABLE 0xFFFFFFFF +#define DLB2_CHP_CFG_DIR_WD_DISABLE0_WD_DISABLE_LOC 0 + +#define DLB2_V2CHP_CFG_DIR_WD_DISABLE1 0x4400009c +#define DLB2_V2_5CHP_CFG_DIR_WD_DISABLE1 0x440000a8 +#define DLB2_CHP_CFG_DIR_WD_DISABLE1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_DIR_WD_DISABLE1 : \ + DLB2_V2_5CHP_CFG_DIR_WD_DISABLE1) +#define DLB2_CHP_CFG_DIR_WD_DISABLE1_RST 0xffffffff + +#define DLB2_CHP_CFG_DIR_WD_DISABLE1_WD_DISABLE 0xFFFFFFFF +#define DLB2_CHP_CFG_DIR_WD_DISABLE1_WD_DISABLE_LOC 0 + +#define DLB2_V2CHP_CFG_DIR_WD_ENB_INTERVAL 0x440000a0 +#define DLB2_V2_5CHP_CFG_DIR_WD_ENB_INTERVAL 0x440000b0 +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_DIR_WD_ENB_INTERVAL : \ + DLB2_V2_5CHP_CFG_DIR_WD_ENB_INTERVAL) +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL_RST 0x0 + +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL_SAMPLE_INTERVAL 0x0FFFFFFF +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL_ENB 0x10000000 +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL_RSVZ0 0xE0000000 +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL_SAMPLE_INTERVAL_LOC 0 +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL_ENB_LOC 28 +#define DLB2_CHP_CFG_DIR_WD_ENB_INTERVAL_RSVZ0_LOC 29 + +#define DLB2_V2CHP_CFG_DIR_WD_THRESHOLD 0x440000ac +#define DLB2_V2_5CHP_CFG_DIR_WD_THRESHOLD 0x440000c0 +#define DLB2_CHP_CFG_DIR_WD_THRESHOLD (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_DIR_WD_THRESHOLD : \ + DLB2_V2_5CHP_CFG_DIR_WD_THRESHOLD) +#define DLB2_CHP_CFG_DIR_WD_THRESHOLD_RST 0x0 + +#define DLB2_CHP_CFG_DIR_WD_THRESHOLD_WD_THRESHOLD 0x000000FF +#define DLB2_CHP_CFG_DIR_WD_THRESHOLD_RSVZ0 0xFFFFFF00 +#define DLB2_CHP_CFG_DIR_WD_THRESHOLD_WD_THRESHOLD_LOC 0 +#define DLB2_CHP_CFG_DIR_WD_THRESHOLD_RSVZ0_LOC 8 + +#define DLB2_V2CHP_LDB_CQ_INTR_ARMED0 0x440000b0 +#define DLB2_V2_5CHP_LDB_CQ_INTR_ARMED0 0x440000c4 +#define DLB2_CHP_LDB_CQ_INTR_ARMED0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_INTR_ARMED0 : \ + DLB2_V2_5CHP_LDB_CQ_INTR_ARMED0) +#define DLB2_CHP_LDB_CQ_INTR_ARMED0_RST 0x0 + +#define DLB2_CHP_LDB_CQ_INTR_ARMED0_ARMED 0xFFFFFFFF +#define DLB2_CHP_LDB_CQ_INTR_ARMED0_ARMED_LOC 0 + +#define DLB2_V2CHP_LDB_CQ_INTR_ARMED1 0x440000b4 +#define DLB2_V2_5CHP_LDB_CQ_INTR_ARMED1 0x440000c8 +#define DLB2_CHP_LDB_CQ_INTR_ARMED1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_LDB_CQ_INTR_ARMED1 : \ + DLB2_V2_5CHP_LDB_CQ_INTR_ARMED1) +#define DLB2_CHP_LDB_CQ_INTR_ARMED1_RST 0x0 + +#define DLB2_CHP_LDB_CQ_INTR_ARMED1_ARMED 0xFFFFFFFF +#define DLB2_CHP_LDB_CQ_INTR_ARMED1_ARMED_LOC 0 + +#define DLB2_V2CHP_CFG_LDB_CQ_TIMER_CTL 0x440000d8 +#define DLB2_V2_5CHP_CFG_LDB_CQ_TIMER_CTL 0x440000ec +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_LDB_CQ_TIMER_CTL : \ + DLB2_V2_5CHP_CFG_LDB_CQ_TIMER_CTL) +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL_RST 0x0 + +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL_SAMPLE_INTERVAL 0x000000FF +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL_ENB 0x00000100 +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL_RSVZ0 0xFFFFFE00 +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL_SAMPLE_INTERVAL_LOC 0 +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL_ENB_LOC 8 +#define DLB2_CHP_CFG_LDB_CQ_TIMER_CTL_RSVZ0_LOC 9 + +#define DLB2_V2CHP_CFG_LDB_WDTO_0 0x440000dc +#define DLB2_V2_5CHP_CFG_LDB_WDTO_0 0x440000f0 +#define DLB2_CHP_CFG_LDB_WDTO_0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_LDB_WDTO_0 : \ + DLB2_V2_5CHP_CFG_LDB_WDTO_0) +#define DLB2_CHP_CFG_LDB_WDTO_0_RST 0x0 + +#define DLB2_CHP_CFG_LDB_WDTO_0_WDTO 0xFFFFFFFF +#define DLB2_CHP_CFG_LDB_WDTO_0_WDTO_LOC 0 + +#define DLB2_V2CHP_CFG_LDB_WDTO_1 0x440000e0 +#define DLB2_V2_5CHP_CFG_LDB_WDTO_1 0x440000f4 +#define DLB2_CHP_CFG_LDB_WDTO_1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_LDB_WDTO_1 : \ + DLB2_V2_5CHP_CFG_LDB_WDTO_1) +#define DLB2_CHP_CFG_LDB_WDTO_1_RST 0x0 + +#define DLB2_CHP_CFG_LDB_WDTO_1_WDTO 0xFFFFFFFF +#define DLB2_CHP_CFG_LDB_WDTO_1_WDTO_LOC 0 + +#define DLB2_V2CHP_CFG_LDB_WD_DISABLE0 0x440000ec +#define DLB2_V2_5CHP_CFG_LDB_WD_DISABLE0 0x44000100 +#define DLB2_CHP_CFG_LDB_WD_DISABLE0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_LDB_WD_DISABLE0 : \ + DLB2_V2_5CHP_CFG_LDB_WD_DISABLE0) +#define DLB2_CHP_CFG_LDB_WD_DISABLE0_RST 0xffffffff + +#define DLB2_CHP_CFG_LDB_WD_DISABLE0_WD_DISABLE 0xFFFFFFFF +#define DLB2_CHP_CFG_LDB_WD_DISABLE0_WD_DISABLE_LOC 0 + +#define DLB2_V2CHP_CFG_LDB_WD_DISABLE1 0x440000f0 +#define DLB2_V2_5CHP_CFG_LDB_WD_DISABLE1 0x44000104 +#define DLB2_CHP_CFG_LDB_WD_DISABLE1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_LDB_WD_DISABLE1 : \ + DLB2_V2_5CHP_CFG_LDB_WD_DISABLE1) +#define DLB2_CHP_CFG_LDB_WD_DISABLE1_RST 0xffffffff + +#define DLB2_CHP_CFG_LDB_WD_DISABLE1_WD_DISABLE 0xFFFFFFFF +#define DLB2_CHP_CFG_LDB_WD_DISABLE1_WD_DISABLE_LOC 0 + +#define DLB2_V2CHP_CFG_LDB_WD_ENB_INTERVAL 0x440000f4 +#define DLB2_V2_5CHP_CFG_LDB_WD_ENB_INTERVAL 0x44000108 +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_LDB_WD_ENB_INTERVAL : \ + DLB2_V2_5CHP_CFG_LDB_WD_ENB_INTERVAL) +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL_RST 0x0 + +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL_SAMPLE_INTERVAL 0x0FFFFFFF +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL_ENB 0x10000000 +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL_RSVZ0 0xE0000000 +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL_SAMPLE_INTERVAL_LOC 0 +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL_ENB_LOC 28 +#define DLB2_CHP_CFG_LDB_WD_ENB_INTERVAL_RSVZ0_LOC 29 + +#define DLB2_V2CHP_CFG_LDB_WD_THRESHOLD 0x44000100 +#define DLB2_V2_5CHP_CFG_LDB_WD_THRESHOLD 0x44000114 +#define DLB2_CHP_CFG_LDB_WD_THRESHOLD (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2CHP_CFG_LDB_WD_THRESHOLD : \ + DLB2_V2_5CHP_CFG_LDB_WD_THRESHOLD) +#define DLB2_CHP_CFG_LDB_WD_THRESHOLD_RST 0x0 + +#define DLB2_CHP_CFG_LDB_WD_THRESHOLD_WD_THRESHOLD 0x000000FF +#define DLB2_CHP_CFG_LDB_WD_THRESHOLD_RSVZ0 0xFFFFFF00 +#define DLB2_CHP_CFG_LDB_WD_THRESHOLD_WD_THRESHOLD_LOC 0 +#define DLB2_CHP_CFG_LDB_WD_THRESHOLD_RSVZ0_LOC 8 + +#define DLB2_CHP_SMON_COMPARE0 0x4c000000 +#define DLB2_CHP_SMON_COMPARE0_RST 0x0 + +#define DLB2_CHP_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_CHP_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_CHP_SMON_COMPARE1 0x4c000004 +#define DLB2_CHP_SMON_COMPARE1_RST 0x0 + +#define DLB2_CHP_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_CHP_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_CHP_SMON_CFG0 0x4c000008 +#define DLB2_CHP_SMON_CFG0_RST 0x40000000 + +#define DLB2_CHP_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_CHP_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_CHP_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_CHP_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_CHP_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_CHP_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_CHP_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_CHP_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_CHP_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_CHP_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_CHP_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_CHP_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_CHP_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_CHP_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_CHP_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_CHP_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_CHP_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_CHP_SMON_CFG0_RSVZ2 0x20000000 +#define DLB2_CHP_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_CHP_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_CHP_SMON_CFG0_SMON_0TRIGGER_ENABLE_LOC 1 +#define DLB2_CHP_SMON_CFG0_RSVZ0_LOC 2 +#define DLB2_CHP_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_CHP_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_CHP_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_CHP_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_CHP_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_CHP_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_CHP_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_CHP_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_CHP_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_CHP_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_CHP_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_CHP_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_CHP_SMON_CFG0_RSVZ1_LOC 23 +#define DLB2_CHP_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_CHP_SMON_CFG0_RSVZ2_LOC 29 +#define DLB2_CHP_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_CHP_SMON_CFG1 0x4c00000c +#define DLB2_CHP_SMON_CFG1_RST 0x0 + +#define DLB2_CHP_SMON_CFG1_MODE0 0x000000FF +#define DLB2_CHP_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_CHP_SMON_CFG1_RSVZ0 0xFFFF0000 +#define DLB2_CHP_SMON_CFG1_MODE0_LOC 0 +#define DLB2_CHP_SMON_CFG1_MODE1_LOC 8 +#define DLB2_CHP_SMON_CFG1_RSVZ0_LOC 16 + +#define DLB2_CHP_SMON_ACTIVITYCNTR0 0x4c000010 +#define DLB2_CHP_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_CHP_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_CHP_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_CHP_SMON_ACTIVITYCNTR1 0x4c000014 +#define DLB2_CHP_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_CHP_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_CHP_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_CHP_SMON_MAX_TMR 0x4c000018 +#define DLB2_CHP_SMON_MAX_TMR_RST 0x0 + +#define DLB2_CHP_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_CHP_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_CHP_SMON_TMR 0x4c00001c +#define DLB2_CHP_SMON_TMR_RST 0x0 + +#define DLB2_CHP_SMON_TMR_TIMER 0xFFFFFFFF +#define DLB2_CHP_SMON_TMR_TIMER_LOC 0 + +#define DLB2_CHP_CTRL_DIAG_02 0x4c000028 +#define DLB2_CHP_CTRL_DIAG_02_RST 0x1555 + +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_EMPTY_V2 0x00000001 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_AFULL_V2 0x00000002 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_EMPTY_V2 0x04 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_AFULL_V2 0x08 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_EMPTY_V2 0x0010 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_AFULL_V2 0x0020 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_EMPTY_V2 0x0040 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_AFULL_V2 0x0080 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_EMPTY_V2 0x0100 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_AFULL_V2 0x0200 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_EMPTY_V2 0x0400 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_AFULL_V2 0x0800 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_EMPTY_V2 0x1000 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_AFULL_V2 0x2000 +#define DLB2_CHP_CTRL_DIAG_02_RSVD0_V2 0xFFFFC000 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_EMPTY_V2_LOC 0 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_AFULL_V2_LOC 1 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_EMPTY_V2_LOC 2 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_AFULL_V2_LOC 3 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_EMPTY_V2_LOC 4 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_AFULL_V2_LOC 5 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_EMPTY_V2_LOC 6 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_AFULL_V2_LOC 7 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_EMPTY_V2_LOC 8 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_AFULL_V2_LOC 9 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_EMPTY_V2_LOC 10 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_AFULL_V2_LOC 11 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_EMPTY_V2_LOC 12 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_AFULL_V2_LOC 13 +#define DLB2_CHP_CTRL_DIAG_02_RSVD0_V2_LOC 14 + +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_EMPTY_V2_5 0x00000001 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_AFULL_V2_5 0x00000002 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_EMPTY_V2_5 4 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_AFULL_V2_5 8 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_EMPTY_V2_5 0x10 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_AFULL_V2_5 0x20 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_EMPTY_V2_5 0x0040 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_AFULL_V2_5 0x0080 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_EMPTY_V2_5 0x00000100 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_AFULL_V2_5 0x00000200 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_EMPTY_V2_5 0x0400 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_AFULL_V2_5 0x0800 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_EMPTY_V2_5 0x1000 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_AFULL_V2_5 0x2000 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOKEN_QB_STATUS_SIZE_V2_5 0x0001C000 +#define DLB2_CHP_CTRL_DIAG_02_FREELIST_SIZE_V2_5 0xFFFE0000 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_EMPTY_V2_5_LOC 0 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_CREDIT_STATUS_AFULL_V2_5_LOC 1 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_EMPTY_V2_5_LOC 2 +#define DLB2_CHP_CTRL_DIAG_02_CHP_OUT_HCW_PIPE_CREDIT_STATUS_AFULL_V2_5_LOC 3 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_EMPTY_V2_5_LOC 4 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_AP_CMP_PIPE_CREDIT_STATUS_AFULL_V2_5_LOC 5 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_EMPTY_V2_5_LOC 6 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOK_PIPE_CREDIT_STATUS_AFULL_V2_5_LOC 7 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_EMPTY_V2_5_LOC 8 +#define DLB2_CHP_CTRL_DIAG_02_CHP_ROP_PIPE_CREDIT_STATUS_AFULL_V2_5_LOC 9 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_EMPTY_V2_5_LOC 10 +#define DLB2_CHP_CTRL_DIAG_02_QED_TO_CQ_PIPE_CREDIT_STATUS_AFULL_V2_5_LOC 11 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_EMPTY_V2_5_LOC 12 +#define DLB2_CHP_CTRL_DIAG_02_EGRESS_LSP_TOKEN_CREDIT_STATUS_AFULL_V2_5_LOC 13 +#define DLB2_CHP_CTRL_DIAG_02_CHP_LSP_TOKEN_QB_STATUS_SIZE_V2_5_LOC 14 +#define DLB2_CHP_CTRL_DIAG_02_FREELIST_SIZE_V2_5_LOC 17 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0 0x54000000 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_RST 0xfefcfaf8 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI0 0x000000FF +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI1 0x0000FF00 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI2 0x00FF0000 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI3 0xFF000000 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI0_LOC 0 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI1_LOC 8 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI2_LOC 16 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_0_PRI3_LOC 24 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_1 0x54000004 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_1_RST 0x0 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_1_RSVZ0 0xFFFFFFFF +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_DIR_1_RSVZ0_LOC 0 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0 0x54000008 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_RST 0xfefcfaf8 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI0 0x000000FF +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI1 0x0000FF00 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI2 0x00FF0000 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI3 0xFF000000 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI0_LOC 0 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI1_LOC 8 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI2_LOC 16 +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI3_LOC 24 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1 0x5400000c +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1_RST 0x0 + +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1_RSVZ0 0xFFFFFFFF +#define DLB2_DP_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1_RSVZ0_LOC 0 + +#define DLB2_DP_DIR_CSR_CTRL 0x54000010 +#define DLB2_DP_DIR_CSR_CTRL_RST 0x0 + +#define DLB2_DP_DIR_CSR_CTRL_INT_COR_ALARM_DIS 0x00000001 +#define DLB2_DP_DIR_CSR_CTRL_INT_COR_SYND_DIS 0x00000002 +#define DLB2_DP_DIR_CSR_CTRL_INT_UNCR_ALARM_DIS 0x00000004 +#define DLB2_DP_DIR_CSR_CTRL_INT_UNC_SYND_DIS 0x00000008 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF0_ALARM_DIS 0x00000010 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF0_SYND_DIS 0x00000020 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF1_ALARM_DIS 0x00000040 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF1_SYND_DIS 0x00000080 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF2_ALARM_DIS 0x00000100 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF2_SYND_DIS 0x00000200 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF3_ALARM_DIS 0x00000400 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF3_SYND_DIS 0x00000800 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF4_ALARM_DIS 0x00001000 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF4_SYND_DIS 0x00002000 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF5_ALARM_DIS 0x00004000 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF5_SYND_DIS 0x00008000 +#define DLB2_DP_DIR_CSR_CTRL_RSVZ0 0xFFFF0000 +#define DLB2_DP_DIR_CSR_CTRL_INT_COR_ALARM_DIS_LOC 0 +#define DLB2_DP_DIR_CSR_CTRL_INT_COR_SYND_DIS_LOC 1 +#define DLB2_DP_DIR_CSR_CTRL_INT_UNCR_ALARM_DIS_LOC 2 +#define DLB2_DP_DIR_CSR_CTRL_INT_UNC_SYND_DIS_LOC 3 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF0_ALARM_DIS_LOC 4 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF0_SYND_DIS_LOC 5 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF1_ALARM_DIS_LOC 6 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF1_SYND_DIS_LOC 7 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF2_ALARM_DIS_LOC 8 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF2_SYND_DIS_LOC 9 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF3_ALARM_DIS_LOC 10 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF3_SYND_DIS_LOC 11 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF4_ALARM_DIS_LOC 12 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF4_SYND_DIS_LOC 13 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF5_ALARM_DIS_LOC 14 +#define DLB2_DP_DIR_CSR_CTRL_INT_INF5_SYND_DIS_LOC 15 +#define DLB2_DP_DIR_CSR_CTRL_RSVZ0_LOC 16 + +#define DLB2_DP_SMON_ACTIVITYCNTR0 0x5c000058 +#define DLB2_DP_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_DP_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_DP_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_DP_SMON_ACTIVITYCNTR1 0x5c00005c +#define DLB2_DP_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_DP_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_DP_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_DP_SMON_COMPARE0 0x5c000060 +#define DLB2_DP_SMON_COMPARE0_RST 0x0 + +#define DLB2_DP_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_DP_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_DP_SMON_COMPARE1 0x5c000064 +#define DLB2_DP_SMON_COMPARE1_RST 0x0 + +#define DLB2_DP_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_DP_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_DP_SMON_CFG0 0x5c000068 +#define DLB2_DP_SMON_CFG0_RST 0x40000000 + +#define DLB2_DP_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_DP_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_DP_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_DP_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_DP_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_DP_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_DP_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_DP_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_DP_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_DP_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_DP_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_DP_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_DP_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_DP_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_DP_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_DP_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_DP_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_DP_SMON_CFG0_RSVZ2 0x20000000 +#define DLB2_DP_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_DP_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_DP_SMON_CFG0_SMON_0TRIGGER_ENABLE_LOC 1 +#define DLB2_DP_SMON_CFG0_RSVZ0_LOC 2 +#define DLB2_DP_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_DP_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_DP_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_DP_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_DP_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_DP_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_DP_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_DP_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_DP_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_DP_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_DP_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_DP_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_DP_SMON_CFG0_RSVZ1_LOC 23 +#define DLB2_DP_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_DP_SMON_CFG0_RSVZ2_LOC 29 +#define DLB2_DP_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_DP_SMON_CFG1 0x5c00006c +#define DLB2_DP_SMON_CFG1_RST 0x0 + +#define DLB2_DP_SMON_CFG1_MODE0 0x000000FF +#define DLB2_DP_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_DP_SMON_CFG1_RSVZ0 0xFFFF0000 +#define DLB2_DP_SMON_CFG1_MODE0_LOC 0 +#define DLB2_DP_SMON_CFG1_MODE1_LOC 8 +#define DLB2_DP_SMON_CFG1_RSVZ0_LOC 16 + +#define DLB2_DP_SMON_MAX_TMR 0x5c000070 +#define DLB2_DP_SMON_MAX_TMR_RST 0x0 + +#define DLB2_DP_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_DP_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_DP_SMON_TMR 0x5c000074 +#define DLB2_DP_SMON_TMR_RST 0x0 + +#define DLB2_DP_SMON_TMR_TIMER 0xFFFFFFFF +#define DLB2_DP_SMON_TMR_TIMER_LOC 0 + +#define DLB2_DQED_SMON_ACTIVITYCNTR0 0x6c000024 +#define DLB2_DQED_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_DQED_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_DQED_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_DQED_SMON_ACTIVITYCNTR1 0x6c000028 +#define DLB2_DQED_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_DQED_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_DQED_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_DQED_SMON_COMPARE0 0x6c00002c +#define DLB2_DQED_SMON_COMPARE0_RST 0x0 + +#define DLB2_DQED_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_DQED_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_DQED_SMON_COMPARE1 0x6c000030 +#define DLB2_DQED_SMON_COMPARE1_RST 0x0 + +#define DLB2_DQED_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_DQED_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_DQED_SMON_CFG0 0x6c000034 +#define DLB2_DQED_SMON_CFG0_RST 0x40000000 + +#define DLB2_DQED_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_DQED_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_DQED_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_DQED_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_DQED_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_DQED_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_DQED_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_DQED_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_DQED_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_DQED_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_DQED_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_DQED_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_DQED_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_DQED_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_DQED_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_DQED_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_DQED_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_DQED_SMON_CFG0_RSVZ2 0x20000000 +#define DLB2_DQED_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_DQED_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_DQED_SMON_CFG0_SMON_0TRIGGER_ENABLE_LOC 1 +#define DLB2_DQED_SMON_CFG0_RSVZ0_LOC 2 +#define DLB2_DQED_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_DQED_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_DQED_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_DQED_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_DQED_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_DQED_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_DQED_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_DQED_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_DQED_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_DQED_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_DQED_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_DQED_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_DQED_SMON_CFG0_RSVZ1_LOC 23 +#define DLB2_DQED_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_DQED_SMON_CFG0_RSVZ2_LOC 29 +#define DLB2_DQED_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_DQED_SMON_CFG1 0x6c000038 +#define DLB2_DQED_SMON_CFG1_RST 0x0 + +#define DLB2_DQED_SMON_CFG1_MODE0 0x000000FF +#define DLB2_DQED_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_DQED_SMON_CFG1_RSVZ0 0xFFFF0000 +#define DLB2_DQED_SMON_CFG1_MODE0_LOC 0 +#define DLB2_DQED_SMON_CFG1_MODE1_LOC 8 +#define DLB2_DQED_SMON_CFG1_RSVZ0_LOC 16 + +#define DLB2_DQED_SMON_MAX_TMR 0x6c00003c +#define DLB2_DQED_SMON_MAX_TMR_RST 0x0 + +#define DLB2_DQED_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_DQED_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_DQED_SMON_TMR 0x6c000040 +#define DLB2_DQED_SMON_TMR_RST 0x0 + +#define DLB2_DQED_SMON_TMR_TIMER 0xFFFFFFFF +#define DLB2_DQED_SMON_TMR_TIMER_LOC 0 + +#define DLB2_QED_SMON_ACTIVITYCNTR0 0x7c000024 +#define DLB2_QED_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_QED_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_QED_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_QED_SMON_ACTIVITYCNTR1 0x7c000028 +#define DLB2_QED_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_QED_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_QED_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_QED_SMON_COMPARE0 0x7c00002c +#define DLB2_QED_SMON_COMPARE0_RST 0x0 + +#define DLB2_QED_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_QED_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_QED_SMON_COMPARE1 0x7c000030 +#define DLB2_QED_SMON_COMPARE1_RST 0x0 + +#define DLB2_QED_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_QED_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_QED_SMON_CFG0 0x7c000034 +#define DLB2_QED_SMON_CFG0_RST 0x40000000 + +#define DLB2_QED_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_QED_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_QED_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_QED_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_QED_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_QED_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_QED_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_QED_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_QED_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_QED_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_QED_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_QED_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_QED_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_QED_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_QED_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_QED_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_QED_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_QED_SMON_CFG0_RSVZ2 0x20000000 +#define DLB2_QED_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_QED_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_QED_SMON_CFG0_SMON_0TRIGGER_ENABLE_LOC 1 +#define DLB2_QED_SMON_CFG0_RSVZ0_LOC 2 +#define DLB2_QED_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_QED_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_QED_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_QED_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_QED_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_QED_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_QED_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_QED_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_QED_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_QED_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_QED_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_QED_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_QED_SMON_CFG0_RSVZ1_LOC 23 +#define DLB2_QED_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_QED_SMON_CFG0_RSVZ2_LOC 29 +#define DLB2_QED_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_QED_SMON_CFG1 0x7c000038 +#define DLB2_QED_SMON_CFG1_RST 0x0 + +#define DLB2_QED_SMON_CFG1_MODE0 0x000000FF +#define DLB2_QED_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_QED_SMON_CFG1_RSVZ0 0xFFFF0000 +#define DLB2_QED_SMON_CFG1_MODE0_LOC 0 +#define DLB2_QED_SMON_CFG1_MODE1_LOC 8 +#define DLB2_QED_SMON_CFG1_RSVZ0_LOC 16 + +#define DLB2_QED_SMON_MAX_TMR 0x7c00003c +#define DLB2_QED_SMON_MAX_TMR_RST 0x0 + +#define DLB2_QED_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_QED_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_QED_SMON_TMR 0x7c000040 +#define DLB2_QED_SMON_TMR_RST 0x0 + +#define DLB2_QED_SMON_TMR_TIMER 0xFFFFFFFF +#define DLB2_QED_SMON_TMR_TIMER_LOC 0 + +#define DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0 0x84000000 +#define DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0 0x74000000 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0 : \ + DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0) +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_RST 0xfefcfaf8 + +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI0 0x000000FF +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI1 0x0000FF00 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI2 0x00FF0000 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI3 0xFF000000 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI0_LOC 0 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI1_LOC 8 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI2_LOC 16 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_0_PRI3_LOC 24 + +#define DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1 0x84000004 +#define DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1 0x74000004 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1 : \ + DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1) +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1_RST 0x0 + +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1_RSVZ0 0xFFFFFFFF +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_ATQ_1_RSVZ0_LOC 0 + +#define DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0 0x84000008 +#define DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0 0x74000008 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0 : \ + DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0) +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_RST 0xfefcfaf8 + +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI0 0x000000FF +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI1 0x0000FF00 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI2 0x00FF0000 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI3 0xFF000000 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI0_LOC 0 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI1_LOC 8 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI2_LOC 16 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_0_PRI3_LOC 24 + +#define DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1 0x8400000c +#define DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1 0x7400000c +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1 : \ + DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1) +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1_RST 0x0 + +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1_RSVZ0 0xFFFFFFFF +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_NALB_1_RSVZ0_LOC 0 + +#define DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0 0x84000010 +#define DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0 0x74000010 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0 : \ + DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0) +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_RST 0xfefcfaf8 + +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI0 0x000000FF +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI1 0x0000FF00 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI2 0x00FF0000 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI3 0xFF000000 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI0_LOC 0 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI1_LOC 8 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI2_LOC 16 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_0_PRI3_LOC 24 + +#define DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1 0x84000014 +#define DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1 0x74000014 +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1 : \ + DLB2_V2_5NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1) +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1_RST 0x0 + +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1_RSVZ0 0xFFFFFFFF +#define DLB2_NALB_CFG_ARB_WEIGHTS_TQPRI_REPLAY_1_RSVZ0_LOC 0 + +#define DLB2_NALB_SMON_ACTIVITYCNTR0 0x8c000064 +#define DLB2_NALB_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_NALB_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_NALB_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_NALB_SMON_ACTIVITYCNTR1 0x8c000068 +#define DLB2_NALB_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_NALB_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_NALB_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_NALB_SMON_COMPARE0 0x8c00006c +#define DLB2_NALB_SMON_COMPARE0_RST 0x0 + +#define DLB2_NALB_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_NALB_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_NALB_SMON_COMPARE1 0x8c000070 +#define DLB2_NALB_SMON_COMPARE1_RST 0x0 + +#define DLB2_NALB_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_NALB_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_NALB_SMON_CFG0 0x8c000074 +#define DLB2_NALB_SMON_CFG0_RST 0x40000000 + +#define DLB2_NALB_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_NALB_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_NALB_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_NALB_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_NALB_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_NALB_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_NALB_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_NALB_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_NALB_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_NALB_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_NALB_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_NALB_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_NALB_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_NALB_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_NALB_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_NALB_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_NALB_SMON_CFG0_TIMER_PRESCALE 0x1F000000 +#define DLB2_NALB_SMON_CFG0_RSVZ2 0x20000000 +#define DLB2_NALB_SMON_CFG0_VERSION 0xC0000000 +#define DLB2_NALB_SMON_CFG0_SMON_ENABLE_LOC 0 +#define DLB2_NALB_SMON_CFG0_SMON_0TRIGGER_ENABLE_LOC 1 +#define DLB2_NALB_SMON_CFG0_RSVZ0_LOC 2 +#define DLB2_NALB_SMON_CFG0_SMON0_FUNCTION_LOC 4 +#define DLB2_NALB_SMON_CFG0_SMON0_FUNCTION_COMPARE_LOC 7 +#define DLB2_NALB_SMON_CFG0_SMON1_FUNCTION_LOC 8 +#define DLB2_NALB_SMON_CFG0_SMON1_FUNCTION_COMPARE_LOC 11 +#define DLB2_NALB_SMON_CFG0_SMON_MODE_LOC 12 +#define DLB2_NALB_SMON_CFG0_STOPCOUNTEROVFL_LOC 16 +#define DLB2_NALB_SMON_CFG0_INTCOUNTEROVFL_LOC 17 +#define DLB2_NALB_SMON_CFG0_STATCOUNTER0OVFL_LOC 18 +#define DLB2_NALB_SMON_CFG0_STATCOUNTER1OVFL_LOC 19 +#define DLB2_NALB_SMON_CFG0_STOPTIMEROVFL_LOC 20 +#define DLB2_NALB_SMON_CFG0_INTTIMEROVFL_LOC 21 +#define DLB2_NALB_SMON_CFG0_STATTIMEROVFL_LOC 22 +#define DLB2_NALB_SMON_CFG0_RSVZ1_LOC 23 +#define DLB2_NALB_SMON_CFG0_TIMER_PRESCALE_LOC 24 +#define DLB2_NALB_SMON_CFG0_RSVZ2_LOC 29 +#define DLB2_NALB_SMON_CFG0_VERSION_LOC 30 + +#define DLB2_NALB_SMON_CFG1 0x8c000078 +#define DLB2_NALB_SMON_CFG1_RST 0x0 + +#define DLB2_NALB_SMON_CFG1_MODE0 0x000000FF +#define DLB2_NALB_SMON_CFG1_MODE1 0x0000FF00 +#define DLB2_NALB_SMON_CFG1_RSVZ0 0xFFFF0000 +#define DLB2_NALB_SMON_CFG1_MODE0_LOC 0 +#define DLB2_NALB_SMON_CFG1_MODE1_LOC 8 +#define DLB2_NALB_SMON_CFG1_RSVZ0_LOC 16 + +#define DLB2_NALB_SMON_MAX_TMR 0x8c00007c +#define DLB2_NALB_SMON_MAX_TMR_RST 0x0 + +#define DLB2_NALB_SMON_MAX_TMR_MAXVALUE 0xFFFFFFFF +#define DLB2_NALB_SMON_MAX_TMR_MAXVALUE_LOC 0 + +#define DLB2_NALB_SMON_TMR 0x8c000080 +#define DLB2_NALB_SMON_TMR_RST 0x0 + +#define DLB2_NALB_SMON_TMR_TIMER 0xFFFFFFFF +#define DLB2_NALB_SMON_TMR_TIMER_LOC 0 + +#define DLB2_V2RO_GRP_0_SLT_SHFT (x) \ + (0x96000000 + (x) * 0x4) +#define DLB2_V2_5RO_GRP_0_SLT_SHFT (x) \ + (0x86000000 + (x) * 0x4) +#define DLB2_RO_GRP_0_SLT_SHFT (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2RO_GRP_0_SLT_SHFT(x) : \ + DLB2_V2_5RO_GRP_0_SLT_SHFT(x)) +#define DLB2_RO_GRP_0_SLT_SHFT_RST 0x0 + +#define DLB2_RO_GRP_0_SLT_SHFT_CHANGE 0x000003FF +#define DLB2_RO_GRP_0_SLT_SHFT_RSVD0 0xFFFFFC00 +#define DLB2_RO_GRP_0_SLT_SHFT_CHANGE_LOC 0 +#define DLB2_RO_GRP_0_SLT_SHFT_RSVD0_LOC 10 + +#define DLB2_V2RO_GRP_1_SLT_SHFT (x) \ + (0x96010000 + (x) * 0x4) +#define DLB2_V2_5RO_GRP_1_SLT_SHFT (x) \ + (0x86010000 + (x) * 0x4) +#define DLB2_RO_GRP_1_SLT_SHFT (ver, x) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2RO_GRP_1_SLT_SHFT(x) : \ + DLB2_V2_5RO_GRP_1_SLT_SHFT(x)) +#define DLB2_RO_GRP_1_SLT_SHFT_RST 0x0 + +#define DLB2_RO_GRP_1_SLT_SHFT_CHANGE 0x000003FF +#define DLB2_RO_GRP_1_SLT_SHFT_RSVD0 0xFFFFFC00 +#define DLB2_RO_GRP_1_SLT_SHFT_CHANGE_LOC 0 +#define DLB2_RO_GRP_1_SLT_SHFT_RSVD0_LOC 10 + +#define DLB2_V2RO_GRP_SN_MODE 0x94000000 +#define DLB2_V2_5RO_GRP_SN_MODE 0x84000000 +#define DLB2_RO_GRP_SN_MODE (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2RO_GRP_SN_MODE : \ + DLB2_V2_5RO_GRP_SN_MODE) +#define DLB2_RO_GRP_SN_MODE_RST 0x0 + +#define DLB2_RO_GRP_SN_MODE_SN_MODE_0 0x00000007 +#define DLB2_RO_GRP_SN_MODE_RSZV0 0x000000F8 +#define DLB2_RO_GRP_SN_MODE_SN_MODE_1 0x00000700 +#define DLB2_RO_GRP_SN_MODE_RSZV1 0xFFFFF800 +#define DLB2_RO_GRP_SN_MODE_SN_MODE_0_LOC 0 +#define DLB2_RO_GRP_SN_MODE_RSZV0_LOC 3 +#define DLB2_RO_GRP_SN_MODE_SN_MODE_1_LOC 8 +#define DLB2_RO_GRP_SN_MODE_RSZV1_LOC 11 + +#define DLB2_V2RO_CFG_CTRL_GENERAL_0 0x9c000000 +#define DLB2_V2_5RO_CFG_CTRL_GENERAL_0 0x8c000000 +#define DLB2_RO_CFG_CTRL_GENERAL_0 (ver) \ + (ver == DLB2_HW_V2 ? \ + DLB2_V2RO_CFG_CTRL_GENERAL_0 : \ + DLB2_V2_5RO_CFG_CTRL_GENERAL_0) +#define DLB2_RO_CFG_CTRL_GENERAL_0_RST 0x0 + +#define DLB2_RO_CFG_CTRL_GENERAL_0_UNIT_SINGLE_STEP_MODE 0x00000001 +#define DLB2_RO_CFG_CTRL_GENERAL_0_RR_EN 0x00000002 +#define DLB2_RO_CFG_CTRL_GENERAL_0_RSZV0 0xFFFFFFFC +#define DLB2_RO_CFG_CTRL_GENERAL_0_UNIT_SINGLE_STEP_MODE_LOC 0 +#define DLB2_RO_CFG_CTRL_GENERAL_0_RR_EN_LOC 1 +#define DLB2_RO_CFG_CTRL_GENERAL_0_RSZV0_LOC 2 + +#define DLB2_RO_SMON_ACTIVITYCNTR0 0x9c000030 +#define DLB2_RO_SMON_ACTIVITYCNTR0_RST 0x0 + +#define DLB2_RO_SMON_ACTIVITYCNTR0_COUNTER0 0xFFFFFFFF +#define DLB2_RO_SMON_ACTIVITYCNTR0_COUNTER0_LOC 0 + +#define DLB2_RO_SMON_ACTIVITYCNTR1 0x9c000034 +#define DLB2_RO_SMON_ACTIVITYCNTR1_RST 0x0 + +#define DLB2_RO_SMON_ACTIVITYCNTR1_COUNTER1 0xFFFFFFFF +#define DLB2_RO_SMON_ACTIVITYCNTR1_COUNTER1_LOC 0 + +#define DLB2_RO_SMON_COMPARE0 0x9c000038 +#define DLB2_RO_SMON_COMPARE0_RST 0x0 + +#define DLB2_RO_SMON_COMPARE0_COMPARE0 0xFFFFFFFF +#define DLB2_RO_SMON_COMPARE0_COMPARE0_LOC 0 + +#define DLB2_RO_SMON_COMPARE1 0x9c00003c +#define DLB2_RO_SMON_COMPARE1_RST 0x0 + +#define DLB2_RO_SMON_COMPARE1_COMPARE1 0xFFFFFFFF +#define DLB2_RO_SMON_COMPARE1_COMPARE1_LOC 0 + +#define DLB2_RO_SMON_CFG0 0x9c000040 +#define DLB2_RO_SMON_CFG0_RST 0x40000000 + +#define DLB2_RO_SMON_CFG0_SMON_ENABLE 0x00000001 +#define DLB2_RO_SMON_CFG0_SMON_0TRIGGER_ENABLE 0x00000002 +#define DLB2_RO_SMON_CFG0_RSVZ0 0x0000000C +#define DLB2_RO_SMON_CFG0_SMON0_FUNCTION 0x00000070 +#define DLB2_RO_SMON_CFG0_SMON0_FUNCTION_COMPARE 0x00000080 +#define DLB2_RO_SMON_CFG0_SMON1_FUNCTION 0x00000700 +#define DLB2_RO_SMON_CFG0_SMON1_FUNCTION_COMPARE 0x00000800 +#define DLB2_RO_SMON_CFG0_SMON_MODE 0x0000F000 +#define DLB2_RO_SMON_CFG0_STOPCOUNTEROVFL 0x00010000 +#define DLB2_RO_SMON_CFG0_INTCOUNTEROVFL 0x00020000 +#define DLB2_RO_SMON_CFG0_STATCOUNTER0OVFL 0x00040000 +#define DLB2_RO_SMON_CFG0_STATCOUNTER1OVFL 0x00080000 +#define DLB2_RO_SMON_CFG0_STOPTIMEROVFL 0x00100000 +#define DLB2_RO_SMON_CFG0_INTTIMEROVFL 0x00200000 +#define DLB2_RO_SMON_CFG0_STATTIMEROVFL 0x00400000 +#define DLB2_RO_SMON_CFG0_RSVZ1 0x00800000 +#define DLB2_RO_SMON_CFG0_TIMER_PRESCALE 0x1F000000
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.23.0
Part of the diff is not shown here. View the raw message.
PATCH v5 4/26 event/dlb2: add v2.5 HW init
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
This commit adds support for DLB v2.5 probe-time hardware init, and sets up a framework for incorporating the remaining changes required to support DLB v2.5.
DLB v2.0 and DLB v2.5 are similar in many respects, but their register offsets and definitions are different. As a result of these, differences, the low level hardware functions must take the device version into consideration. This requires that the hardware version be passed to many of the low level functions, so that the PMD can take the appropriate action based on the device version.
To ease the transition and keep the individual patches small, three temporary files are added in this commit. These files have "new" in their names. The files with "new" contain changes specific to a consolidated PMD that supports both DLB v2.0 and DLB 2.5. Their sister files of the same name (minus "new") contain the old DLB v2.0 specific code. The intent is to remove code from the original files as that code is ported to the combined DLB 2.0/2.5 PMD model and added to the "new" files in a series of commits. At end of the patch series, the old files will be empty and the "new" files will have the logic needed to implement a single PMD that supports both DLB v2.0 and DLB v2.5. At that time, the original DLB v2.0 specific files will be deleted, and the "new" files will be renamed and replace them.
--- drivers/event/dlb2/dlb2_priv.h | 5 + drivers/event/dlb2/meson.build | 1 + .../event/dlb2/pf/base/dlb2_hw_types_new.h | 356 ++++++++++++++++++ drivers/event/dlb2/pf/base/dlb2_osdep.h | 4 + drivers/event/dlb2/pf/base/dlb2_resource.c | 180 +-------- drivers/event/dlb2/pf/base/dlb2_resource.h | 36 -- .../event/dlb2/pf/base/dlb2_resource_new.c | 259 +++++++++++++ .../event/dlb2/pf/base/dlb2_resource_new.h | 73 ++++ drivers/event/dlb2/pf/dlb2_main.c | 41 +- drivers/event/dlb2/pf/dlb2_main.h | 4 + drivers/event/dlb2/pf/dlb2_pf.c | 6 +- 11 files changed, 735 insertions(+), 230 deletions(-) create mode 100644 drivers/event/dlb2/pf/base/dlb2_hw_types_new.h create mode 100644 drivers/event/dlb2/pf/base/dlb2_resource_new.c create mode 100644 drivers/event/dlb2/pf/base/dlb2_resource_new.h
drivers/event/dlb2/dlb2_priv.h +5 -0
@@ -114,6 +114,11 @@#define EV_TO_DLB2_PRIO (x) ((x) >> 5)#define DLB2_TO_EV_PRIO (x) ((x) << 5) +enum dlb2_hw_ver { +DLB2_HW_VER_2 , +DLB2_HW_VER_2_5 , +}; +enum dlb2_hw_port_types {DLB2_LDB_PORT ,DLB2_DIR_PORT ,
drivers/event/dlb2/meson.build +1 -0
@@ -15,6 +15,7 @@ sources = files( 'pf/dlb2_main.c', 'pf/dlb2_pf.c', 'pf/base/dlb2_resource.c', + 'pf/base/dlb2_resource_new.c', 'rte_pmd_dlb2.c', 'dlb2_selftest.c', )
drivers/event/dlb2/pf/base/dlb2_hw_types_new.h new file +356 -0
356 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_osdep.h +4 -0
@@ -16,7 +16,11 @@#include <rte_log.h> #include <rte_spinlock.h> #include "../dlb2_main.h" + +/* TEMPORARY inclusion of both headers for merge */ +#include "dlb2_resource_new.h" #include "dlb2_resource.h" +#include "../../dlb2_log.h" #include "../../dlb2_user.h"
drivers/event/dlb2/pf/base/dlb2_resource.c +1 -179
198 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource.h +0 -36
@@ -6,35 +6,8 @@#define __DLB2_RESOURCE_H#include "dlb2_user.h" - -#include "dlb2_hw_types.h" #include "dlb2_osdep_types.h" -/** -* dlb2_resource_init() - initialize the device -* @hw: pointer to struct dlb2_hw. -* -* This function initializes the device's software state (pointed to by the hw -* argument) and programs global scheduling QoS registers. This function should -* be called during driver initialization. -* -* The dlb2_hw struct must be unique per DLB 2.0 device and persist until the -* device is reset. -* -* Return: -* Returns 0 upon success, <0 otherwise. -*/ -int dlb2_resource_init (struct dlb2_hw *hw); - -/** -* dlb2_resource_free() - free device state memory -* @hw: dlb2_hw handle for a particular device. -* -* This function frees software state pointed to by dlb2_hw. This function -* should be called when resetting the device or unloading the driver. -*/ -void dlb2_resource_free (struct dlb2_hw *hw); -/** * dlb2_resource_reset() - reset in-use resources to their initial state * @hw: dlb2_hw handle for a particular device.
@@ -1485,15 +1458,6 @@ int dlb2_notify_vf(struct dlb2_hw *hw,*/ int dlb2_vdev_in_use (struct dlb2_hw *hw,unsigned int id); -/** -* dlb2_clr_pmcsr_disable() - power on bulk of DLB 2.0 logic -* @hw: dlb2_hw handle for a particular device. -* -* Clearing the PMCSR must be done at initialization to make the device fully -* operational. -*/ -void dlb2_clr_pmcsr_disable (struct dlb2_hw *hw); -/** * dlb2_hw_get_ldb_queue_depth() - returns the depth of a load-balanced queue * @hw: dlb2_hw handle for a particular device.
drivers/event/dlb2/pf/base/dlb2_resource_new.c new file +259 -0
259 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource_new.h new file +73 -0
73 lines not on this page · raw message
drivers/event/dlb2/pf/dlb2_main.c +28 -13
88 lines not on this page · raw message
drivers/event/dlb2/pf/dlb2_main.h +4 -0
@@ -12,7 +12,11 @@#include <rte_bus_pci.h> #include <rte_eal_paging.h> +#ifdef DLB2_USE_NEW_HEADERS +#include "base/dlb2_hw_types_new.h" +#else #include "base/dlb2_hw_types.h" +#endif #include "../dlb2_user.h" #define DLB2_DEFAULT_UNREGISTER_TIMEOUT_S 5
drivers/event/dlb2/pf/dlb2_pf.c +4 -2
@@ -32,13 +32,15 @@#include <rte_memory.h> #include <rte_string_fns.h> +#define DLB2_USE_NEW_HEADERS /* TEMPORARY FOR MERGE */ +#include "../dlb2_priv.h" #include "../dlb2_iface.h" #include "../dlb2_inline_fns.h" #include "dlb2_main.h" -#include "base/dlb2_hw_types.h" +#include "base/dlb2_hw_types_new.h" #include "base/dlb2_osdep.h" -#include "base/dlb2_resource.h" +#include "base/dlb2_resource_new.h" static const char *event_dlb2_pf_name =RTE_STR (EVDEV_DLB2_NAME_PMD );
Signature · 1 line
2.23.0
PATCH v5 5/26 event/dlb2: add v2.5 get resources
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
DLB v2.5 uses a new credit scheme, where directed and load balanced credits are unified, instead of having separate directed and load balanced credit pools.
--- drivers/event/dlb2/dlb2.c | 20 ++++-- drivers/event/dlb2/dlb2_user.h | 14 +++- drivers/event/dlb2/pf/base/dlb2_resource.c | 48 -------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 66 +++++++++++++++++++ 4 files changed, 92 insertions(+), 56 deletions(-)
drivers/event/dlb2/dlb2.c +14 -6
@@ -132,17 +132,25 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2) evdev_dlb2_default_info.max_event_ports = dlb2->hw_rsrc_query_results.num_ldb_ports; - evdev_dlb2_default_info.max_num_events = - dlb2->hw_rsrc_query_results.num_ldb_credits; - +if (dlb2->version ==DLB2_HW_V2_5 ) { + evdev_dlb2_default_info.max_num_events = + dlb2->hw_rsrc_query_results.num_credits; + }else { + evdev_dlb2_default_info.max_num_events = + dlb2->hw_rsrc_query_results.num_ldb_credits; + }/* Save off values used when creating the scheduling domain. */ handle->info.num_sched_domains = dlb2->hw_rsrc_query_results.num_sched_domains; - handle->info.hw_rsrc_max.nb_events_limit = - dlb2->hw_rsrc_query_results.num_ldb_credits; - +if (dlb2->version ==DLB2_HW_V2_5 ) { + handle->info.hw_rsrc_max.nb_events_limit = + dlb2->hw_rsrc_query_results.num_credits; + }else { + handle->info.hw_rsrc_max.nb_events_limit = + dlb2->hw_rsrc_query_results.num_ldb_credits; + } handle->info.hw_rsrc_max.num_queues = dlb2->hw_rsrc_query_results.num_ldb_queues + dlb2->hw_rsrc_query_results.num_dir_ports;
drivers/event/dlb2/dlb2_user.h +12 -2
@@ -195,9 +195,12 @@ struct dlb2_create_sched_domain_args {* contiguous range of history list entries. * - num_ldb_credits: Amount of available load-balanced QE storage. * - num_dir_credits: Amount of available directed QE storage. +* - response.status: Detailed error code. In certain cases, such as if the +* ioctl request arg is invalid, the driver won't set status. */ struct dlb2_get_num_resources_args {/* Output parameters */ +struct dlb2_cmd_response response;__u32 num_sched_domains;__u32 num_ldb_queues;__u32 num_ldb_ports;
@@ -206,8 +209,15 @@ struct dlb2_get_num_resources_args {__u32 num_atomic_inflights;__u32 num_hist_list_entries;__u32 max_contiguous_hist_list_entries; -__u32 num_ldb_credits; -__u32 num_dir_credits; +union { +struct { +__u32 num_ldb_credits; +__u32 num_dir_credits; + }; +struct { +__u32 num_credits; + }; + }; };/*
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -48
54 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource_new.c +66 -0
69 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 6/26 event/dlb2: add v2.5 create sched domain
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update domain creation logic to account for DLB v2.5 credit scheme, new register map, and new register access macros.
--- drivers/event/dlb2/dlb2_user.h | 13 +- drivers/event/dlb2/pf/base/dlb2_resource.c | 645 ---------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 696 ++++++++++++++++++ 3 files changed, 707 insertions(+), 647 deletions(-)
drivers/event/dlb2/dlb2_user.h +11 -2
@@ -18,6 +18,7 @@ enum dlb2_error {DLB2_ST_LDB_QUEUES_UNAVAILABLE ,DLB2_ST_LDB_CREDITS_UNAVAILABLE ,DLB2_ST_DIR_CREDITS_UNAVAILABLE , +DLB2_ST_CREDITS_UNAVAILABLE ,DLB2_ST_SEQUENCE_NUMBERS_UNAVAILABLE ,DLB2_ST_INVALID_DOMAIN_ID , DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION,
@@ -57,6 +58,7 @@ static const char dlb2_error_strings[][128] = {"DLB2_ST_LDB_QUEUES_UNAVAILABLE" ,"DLB2_ST_LDB_CREDITS_UNAVAILABLE" ,"DLB2_ST_DIR_CREDITS_UNAVAILABLE" , +"DLB2_ST_CREDITS_UNAVAILABLE" ,"DLB2_ST_SEQUENCE_NUMBERS_UNAVAILABLE" ,"DLB2_ST_INVALID_DOMAIN_ID" , "DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION",
@@ -170,8 +172,15 @@ struct dlb2_create_sched_domain_args {__u32 num_dir_ports;__u32 num_atomic_inflights;__u32 num_hist_list_entries; -__u32 num_ldb_credits; -__u32 num_dir_credits; +union { +struct { +__u32 num_ldb_credits; +__u32 num_dir_credits; + }; +struct { +__u32 num_credits; + }; + };__u8 cos_strict;__u8 padding1[3 ]; };
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -645
657 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource_new.c +696 -0
699 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 7/26 event/dlb2: add v2.5 domain reset
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Reset hardware registers, consumer queues, ports, interrupts and software. Queues must also be drained as part of the reset process.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- .../event/dlb2/pf/base/dlb2_hw_types_new.h | 1 + drivers/event/dlb2/pf/base/dlb2_resource.c | 1494 ---------- .../event/dlb2/pf/base/dlb2_resource_new.c | 2562 +++++++++++++++++ 3 files changed, 2563 insertions(+), 1494 deletions(-)
drivers/event/dlb2/pf/base/dlb2_hw_types_new.h +1 -0
@@ -181,6 +181,7 @@ struct dlb2_ldb_port {u32 hist_list_entry_base;u32 hist_list_entry_limit;u32 ref_cnt; +u8 cq_depth;u8 init_tkn_cnt;u8 num_pending_removals;u8 num_mappings;
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -1494
1,530 lines not on this page · raw message
drivers/event/dlb2/pf/base/dlb2_resource_new.c +2562 -0
1,463 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.23.0
Part of the diff is not shown here. View the raw message.
PATCH v5 8/26 event/dlb2: add v2.5 create ldb queue
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Updated low level hardware functions related to configuring load balanced queues. These functions create the queues, as well as attach related resources required by load balanced queues, such as sequence numbers.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 397 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 391 +++++++++++++++++ 2 files changed, 391 insertions(+), 397 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -397
@@ -1149,403 +1149,6 @@ unsigned int dlb2_finish_map_qid_procedures(struct dlb2_hw *hw)return num; } - -static void dlb2_configure_ldb_queue (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue, -struct dlb2_create_ldb_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_vf_ldb_vqid_v r0 = { {0 } }; -union dlb2_sys_vf_ldb_vqid2qid r1 = { {0 } }; -union dlb2_sys_ldb_qid2vqid r2 = { {0 } }; -union dlb2_sys_ldb_vasqid_v r3 = { {0 } }; -union dlb2_lsp_qid_ldb_infl_lim r4 = { {0 } }; -union dlb2_lsp_qid_aqed_active_lim r5 = { {0 } }; -union dlb2_aqed_pipe_qid_hid_width r6 = { {0 } }; -union dlb2_sys_ldb_qid_its r7 = { {0 } }; -union dlb2_lsp_qid_atm_depth_thrsh r8 = { {0 } }; -union dlb2_lsp_qid_naldb_depth_thrsh r9 = { {0 } }; -union dlb2_aqed_pipe_qid_fid_lim r10 = { {0 } }; -union dlb2_chp_ord_qid_sn_map r11 = { {0 } }; -union dlb2_sys_ldb_qid_cfg_v r12 = { {0 } }; -union dlb2_sys_ldb_qid_v r13 = { {0 } }; - -struct dlb2_sn_group *sn_group; -unsigned int offs; - -/* QID write permissions are turned on when the domain is started */ - r3.field.vasqid_v =0 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_LDB_QUEUES + - queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_VASQID_V (offs), r3.val); - -/* -* Unordered QIDs get 4K inflights, ordered get as many as the number -* of sequence numbers. -*/ - r4.field.limit = args->num_qid_inflights; - -DLB2_CSR_WR (hw,DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id), r4.val); - - r5.field.limit = queue->aqed_limit; - -if (r5.field.limit >DLB2_MAX_NUM_AQED_ENTRIES ) - r5.field.limit =DLB2_MAX_NUM_AQED_ENTRIES ; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_AQED_ACTIVE_LIM (queue->id.phys_id), - r5.val); - -switch (args->lock_id_comp_level) { -case 64 : - r6.field.compress_code =1 ; -break ; -case 128 : - r6.field.compress_code =2 ; -break ; -case 256 : - r6.field.compress_code =3 ; -break ; -case 512 : - r6.field.compress_code =4 ; -break ; -case 1024 : - r6.field.compress_code =5 ; -break ; -case 2048 : - r6.field.compress_code =6 ; -break ; -case 4096 : - r6.field.compress_code =7 ; -break ; -case 0 : -case 65536 : - r6.field.compress_code =0 ; - } - -DLB2_CSR_WR (hw, -DLB2_AQED_PIPE_QID_HID_WIDTH (queue->id.phys_id), - r6.val); - -/* Don't timestamp QEs that pass through this queue */ - r7.field.qid_its =0 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_QID_ITS (queue->id.phys_id), - r7.val); - - r8.field.thresh = args->depth_threshold; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_ATM_DEPTH_THRSH (queue->id.phys_id), - r8.val); - - r9.field.thresh = args->depth_threshold; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_NALDB_DEPTH_THRSH (queue->id.phys_id), - r9.val); - -/* -* This register limits the number of inflight flows a queue can have -* at one time. It has an upper bound of 2048, but can be -* over-subscribed. 512 is chosen so that a single queue doesn't use -* the entire atomic storage, but can use a substantial portion if -* needed. -*/ - r10.field.qid_fid_limit =512 ; - -DLB2_CSR_WR (hw, -DLB2_AQED_PIPE_QID_FID_LIM (queue->id.phys_id), - r10.val); - -/* Configure SNs */ - sn_group = &hw->rsrcs.sn_groups[queue->sn_group]; - r11.field.mode = sn_group->mode; - r11.field.slot = queue->sn_slot; - r11.field.grp = sn_group->id; - -DLB2_CSR_WR (hw,DLB2_CHP_ORD_QID_SN_MAP (queue->id.phys_id), r11.val); - - r12.field.sn_cfg_v = (args->num_sequence_numbers !=0 ); - r12.field.fid_cfg_v = (args->num_atomic_inflights !=0 ); - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_QID_CFG_V (queue->id.phys_id), r12.val); - -if (vdev_req) { - offs = vdev_id *DLB2_MAX_NUM_LDB_QUEUES + queue->id.virt_id; - - r0.field.vqid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VQID_V (offs), r0.val); - - r1.field.qid = queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VQID2QID (offs), r1.val); - - r2.field.vqid = queue->id.virt_id; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_QID2VQID (queue->id.phys_id), - r2.val); - } - - r13.field.qid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_QID_V (queue->id.phys_id), r13.val); -} - -static int -dlb2_ldb_queue_attach_to_sn_group (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue, -struct dlb2_create_ldb_queue_args *args) -{ -int slot =-1 ; -int i; - - queue->sn_cfg_valid = false; - -if (args->num_sequence_numbers ==0 ) -return 0 ; - -for (i =0 ; i <DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ; i++) { -struct dlb2_sn_group *group = &hw->rsrcs.sn_groups[i]; - -if (group->sequence_numbers_per_queue == - args->num_sequence_numbers && - !dlb2_sn_group_full (group)) { - slot =dlb2_sn_group_alloc_slot (group); -if (slot >=0 ) -break ; - } - } - -if (slot ==-1 ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no sequence number slots available\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue->sn_cfg_valid = true; - queue->sn_group = i; - queue->sn_slot = slot; -return 0 ; -} - -static int -dlb2_ldb_queue_attach_resources (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue, -struct dlb2_create_ldb_queue_args *args) -{ -int ret; - - ret =dlb2_ldb_queue_attach_to_sn_group (hw, queue, args); -if (ret) -return ret; - -/* Attach QID inflights */ - queue->num_qid_inflights = args->num_qid_inflights; - -/* Attach atomic inflights */ - queue->aqed_limit = args->num_atomic_inflights; - - domain->num_avail_aqed_entries -= args->num_atomic_inflights; - domain->num_used_aqed_entries += args->num_atomic_inflights; - -return 0 ; -} - -static int -dlb2_verify_create_ldb_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -int i; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -if (dlb2_list_empty (&domain->avail_ldb_queues)) { - resp->status =DLB2_ST_LDB_QUEUES_UNAVAILABLE ; -return -EINVAL ; - } - -if (args->num_sequence_numbers) { -for (i =0 ; i <DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ; i++) { -struct dlb2_sn_group *group = &hw->rsrcs.sn_groups[i]; - -if (group->sequence_numbers_per_queue == - args->num_sequence_numbers && - !dlb2_sn_group_full (group)) -break ; - } - -if (i ==DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) { - resp->status =DLB2_ST_SEQUENCE_NUMBERS_UNAVAILABLE ; -return -EINVAL ; - } - } - -if (args->num_qid_inflights >4096 ) { - resp->status =DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION ; -return -EINVAL ; - } - -/* Inflights must be <= number of sequence numbers if ordered */ -if (args->num_sequence_numbers !=0 && - args->num_qid_inflights > args->num_sequence_numbers) { - resp->status =DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION ; -return -EINVAL ; - } - -if (domain->num_avail_aqed_entries < args->num_atomic_inflights) { - resp->status =DLB2_ST_ATOMIC_INFLIGHTS_UNAVAILABLE ; -return -EINVAL ; - } - -if (args->num_atomic_inflights && - args->lock_id_comp_level !=0 && - args->lock_id_comp_level !=64 && - args->lock_id_comp_level !=128 && - args->lock_id_comp_level !=256 && - args->lock_id_comp_level !=512 && - args->lock_id_comp_level !=1024 && - args->lock_id_comp_level !=2048 && - args->lock_id_comp_level !=4096 && - args->lock_id_comp_level !=65536 ) { - resp->status =DLB2_ST_INVALID_LOCK_ID_COMP_LEVEL ; -return -EINVAL ; - } - -return 0 ; -} - -static void -dlb2_log_create_ldb_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create load-balanced queue arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tNumber of sequence numbers: %d\n" , - args->num_sequence_numbers); -DLB2_HW_DBG (hw,"\tNumber of QID inflights: %d\n" , - args->num_qid_inflights); -DLB2_HW_DBG (hw,"\tNumber of ATM inflights: %d\n" , - args->num_atomic_inflights); -} - -/** -* dlb2_hw_create_ldb_queue() - Allocate and initialize a DLB LDB queue. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_ldb_queue (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -int ret; - -dlb2_log_create_ldb_queue_args (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_ldb_queue_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue =DLB2_DOM_LIST_HEAD (domain->avail_ldb_queues,typeof (*queue)); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available ldb queues\n" , - __func__, __LINE__); -return -EFAULT ; - } - - ret =dlb2_ldb_queue_attach_resources (hw, domain, queue, args); -if (ret <0 ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: failed to attach the ldb queue resources\n" , - __func__, __LINE__); -return ret; - } - -dlb2_configure_ldb_queue (hw, domain, queue, args, vdev_req, vdev_id); - - queue->num_mappings =0 ; - - queue->configured = true; - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list. -*/ -dlb2_list_del (&domain->avail_ldb_queues, &queue->domain_list); - -dlb2_list_add (&domain->used_ldb_queues, &queue->domain_list); - - resp->status =0 ; - resp->id = (vdev_req) ? queue->id.virt_id : queue->id.phys_id; - -return 0 ; -} -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) {if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS )
drivers/event/dlb2/pf/base/dlb2_resource_new.c +391 -0
394 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 9/26 event/dlb2: add v2.5 create ldb port
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for creating load balanced ports. These functions create the producer port (PP), configure the consumer queue (CQ), and validate the port creation arguments.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 490 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 471 +++++++++++++++++ 2 files changed, 471 insertions(+), 490 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -490
@@ -1216,496 +1216,6 @@ int dlb2_set_group_sequence_numbers(struct dlb2_hw *hw,return 0 ; } -static void dlb2_ldb_port_configure_pp (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_ldb_pp2vas r0 = { {0 } }; -union dlb2_sys_ldb_pp_v r4 = { {0 } }; - - r0.field.vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_PP2VAS (port->id.phys_id), r0.val); - -if (vdev_req) { -union dlb2_sys_vf_ldb_vpp2pp r1 = { {0 } }; -union dlb2_sys_ldb_pp2vdev r2 = { {0 } }; -union dlb2_sys_vf_ldb_vpp_v r3 = { {0 } }; -unsigned int offs; -u32 virt_id; - -/* -* DLB uses producer port address bits 17:12 to determine the -* producer port ID. In Scalable IOV mode, PP accesses come -* through the PF MMIO window for the physical producer port, -* so for translation purposes the virtual and physical port -* IDs are equal. -*/ -if (hw->virt_mode ==DLB2_VIRT_SRIOV ) - virt_id = port->id.virt_id; -else - virt_id = port->id.phys_id; - - r1.field.pp = port->id.phys_id; - - offs = vdev_id *DLB2_MAX_NUM_LDB_PORTS + virt_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VPP2PP (offs), r1.val); - - r2.field.vdev = vdev_id; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_PP2VDEV (port->id.phys_id), - r2.val); - - r3.field.vpp_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_LDB_VPP_V (offs), r3.val); - } - - r4.field.pp_v =1 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_PP_V (port->id.phys_id), - r4.val); -} - -static int dlb2_ldb_port_configure_cq (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_ldb_cq_addr_l r0 = { {0 } }; -union dlb2_sys_ldb_cq_addr_u r1 = { {0 } }; -union dlb2_sys_ldb_cq2vf_pf_ro r2 = { {0 } }; -union dlb2_chp_ldb_cq_tkn_depth_sel r3 = { {0 } }; -union dlb2_lsp_cq_ldb_tkn_depth_sel r4 = { {0 } }; -union dlb2_chp_hist_list_lim r5 = { {0 } }; -union dlb2_chp_hist_list_base r6 = { {0 } }; -union dlb2_lsp_cq_ldb_infl_lim r7 = { {0 } }; -union dlb2_chp_hist_list_push_ptr r8 = { {0 } }; -union dlb2_chp_hist_list_pop_ptr r9 = { {0 } }; -union dlb2_sys_ldb_cq_at r10 = { {0 } }; -union dlb2_sys_ldb_cq_pasid r11 = { {0 } }; -union dlb2_chp_ldb_cq2vas r12 = { {0 } }; -union dlb2_lsp_cq2priov r13 = { {0 } }; - -/* The CQ address is 64B-aligned, and the DLB only wants bits [63:6] */ - r0.field.addr_l = cq_dma_base >>6 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ_ADDR_L (port->id.phys_id), r0.val); - - r1.field.addr_u = cq_dma_base >>32 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ_ADDR_U (port->id.phys_id), r1.val); - -/* -* 'ro' == relaxed ordering. This setting allows DLB2 to write -* cache lines out-of-order (but QEs within a cache line are always -* updated in-order). -*/ - r2.field.vf = vdev_id; - r2.field.is_pf = !vdev_req && (hw->virt_mode !=DLB2_VIRT_SIOV ); - r2.field.ro =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ2VF_PF_RO (port->id.phys_id), r2.val); - -if (args->cq_depth <=8 ) { - r3.field.token_depth_select =1 ; - }else if (args->cq_depth ==16 ) { - r3.field.token_depth_select =2 ; - }else if (args->cq_depth ==32 ) { - r3.field.token_depth_select =3 ; - }else if (args->cq_depth ==64 ) { - r3.field.token_depth_select =4 ; - }else if (args->cq_depth ==128 ) { - r3.field.token_depth_select =5 ; - }else if (args->cq_depth ==256 ) { - r3.field.token_depth_select =6 ; - }else if (args->cq_depth ==512 ) { - r3.field.token_depth_select =7 ; - }else if (args->cq_depth ==1024 ) { - r3.field.token_depth_select =8 ; - }else { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: invalid CQ depth\n" , - __func__, __LINE__); -return -EFAULT ; - } - -DLB2_CSR_WR (hw, -DLB2_CHP_LDB_CQ_TKN_DEPTH_SEL (port->id.phys_id), - r3.val); - -/* -* To support CQs with depth less than 8, program the token count -* register with a non-zero initial value. Operations such as domain -* reset must take this initial value into account when quiescing the -* CQ. -*/ - port->init_tkn_cnt =0 ; - -if (args->cq_depth <8 ) { -union dlb2_lsp_cq_ldb_tkn_cnt r14 = { {0 } }; - - port->init_tkn_cnt =8 - args->cq_depth; - - r14.field.token_count = port->init_tkn_cnt; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_LDB_TKN_CNT (port->id.phys_id), - r14.val); - }else { -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_LDB_TKN_CNT (port->id.phys_id), -DLB2_LSP_CQ_LDB_TKN_CNT_RST ); - } - - r4.field.token_depth_select = r3.field.token_depth_select; - r4.field.ignore_depth =0 ; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_LDB_TKN_DEPTH_SEL (port->id.phys_id), - r4.val); - -/* Reset the CQ write pointer */ -DLB2_CSR_WR (hw, -DLB2_CHP_LDB_CQ_WPTR (port->id.phys_id), -DLB2_CHP_LDB_CQ_WPTR_RST ); - - r5.field.limit = port->hist_list_entry_limit -1 ; - -DLB2_CSR_WR (hw,DLB2_CHP_HIST_LIST_LIM (port->id.phys_id), r5.val); - - r6.field.base = port->hist_list_entry_base; - -DLB2_CSR_WR (hw,DLB2_CHP_HIST_LIST_BASE (port->id.phys_id), r6.val); - -/* -* The inflight limit sets a cap on the number of QEs for which this CQ -* can owe completions at one time. -*/ - r7.field.limit = args->cq_history_list_size; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_LDB_INFL_LIM (port->id.phys_id), r7.val); - - r8.field.push_ptr = r6.field.base; - r8.field.generation =0 ; - -DLB2_CSR_WR (hw, -DLB2_CHP_HIST_LIST_PUSH_PTR (port->id.phys_id), - r8.val); - - r9.field.pop_ptr = r6.field.base; - r9.field.generation =0 ; - -DLB2_CSR_WR (hw,DLB2_CHP_HIST_LIST_POP_PTR (port->id.phys_id), r9.val); - -/* -* Address translation (AT) settings: 0: untranslated, 2: translated -* (see ATS spec regarding Address Type field for more details) -*/ - r10.field.cq_at =0 ; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_CQ_AT (port->id.phys_id), r10.val); - -if (vdev_req && hw->virt_mode ==DLB2_VIRT_SIOV ) { - r11.field.pasid = hw->pasid[vdev_id]; - r11.field.fmt2 =1 ; - } - -DLB2_CSR_WR (hw, -DLB2_SYS_LDB_CQ_PASID (port->id.phys_id), - r11.val); - - r12.field.cq2vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_CHP_LDB_CQ2VAS (port->id.phys_id), r12.val); - -/* Disable the port's QID mappings */ - r13.field.v =0 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (port->id.phys_id), r13.val); - -return 0 ; -} - -static int dlb2_configure_ldb_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -int ret, i; - - port->hist_list_entry_base = domain->hist_list_entry_base + - domain->hist_list_entry_offset; - port->hist_list_entry_limit = port->hist_list_entry_base + - args->cq_history_list_size; - - domain->hist_list_entry_offset += args->cq_history_list_size; - domain->avail_hist_list_entries -= args->cq_history_list_size; - - ret =dlb2_ldb_port_configure_cq (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); -if (ret <0 ) -return ret; - -dlb2_ldb_port_configure_pp (hw, - domain, - port, - vdev_req, - vdev_id); - -dlb2_ldb_port_cq_enable (hw, port); - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) - port->qid_map[i].state =DLB2_QUEUE_UNMAPPED ; - port->num_mappings =0 ; - - port->enabled = true; - - port->configured = true; - -return 0 ; -} - -static void -dlb2_log_create_ldb_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create load-balanced port arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tCQ depth: %d\n" , - args->cq_depth); -DLB2_HW_DBG (hw,"\tCQ hist list size: %d\n" , - args->cq_history_list_size); -DLB2_HW_DBG (hw,"\tCQ base address: 0x%lx\n" , - cq_dma_base); -DLB2_HW_DBG (hw,"\tCoS ID: %u\n" , args->cos_id); -DLB2_HW_DBG (hw,"\tStrict CoS allocation: %u\n" , - args->cos_strict); -} - -static int -dlb2_verify_create_ldb_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_ldb_port_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -int i; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -if (args->cos_id >=DLB2_NUM_COS_DOMAINS ) { - resp->status =DLB2_ST_INVALID_COS_ID ; -return -EINVAL ; - } - -if (args->cos_strict) { -if (dlb2_list_empty (&domain->avail_ldb_ports[args->cos_id])) { - resp->status =DLB2_ST_LDB_PORTS_UNAVAILABLE ; -return -EINVAL ; - } - }else { -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { -if (!dlb2_list_empty (&domain->avail_ldb_ports[i])) -break ; - } - -if (i ==DLB2_NUM_COS_DOMAINS ) { - resp->status =DLB2_ST_LDB_PORTS_UNAVAILABLE ; -return -EINVAL ; - } - } - -/* Check cache-line alignment */ -if ((cq_dma_base &0x3F ) !=0 ) { - resp->status =DLB2_ST_INVALID_CQ_VIRT_ADDR ; -return -EINVAL ; - } - -if (args->cq_depth !=1 && - args->cq_depth !=2 && - args->cq_depth !=4 && - args->cq_depth !=8 && - args->cq_depth !=16 && - args->cq_depth !=32 && - args->cq_depth !=64 && - args->cq_depth !=128 && - args->cq_depth !=256 && - args->cq_depth !=512 && - args->cq_depth !=1024 ) { - resp->status =DLB2_ST_INVALID_CQ_DEPTH ; -return -EINVAL ; - } - -/* The history list size must be >= 1 */ -if (!args->cq_history_list_size) { - resp->status =DLB2_ST_INVALID_HIST_LIST_DEPTH ; -return -EINVAL ; - } - -if (args->cq_history_list_size > domain->avail_hist_list_entries) { - resp->status =DLB2_ST_HIST_LIST_ENTRIES_UNAVAILABLE ; -return -EINVAL ; - } - -return 0 ; -} - - -/** -* dlb2_hw_create_ldb_port() - Allocate and initialize a load-balanced port and -* its resources. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @cq_dma_base: Base DMA address for consumer queue memory -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_ldb_port (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_ldb_port_args *args, -uintptr_t cq_dma_base, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_port *port; -int ret, cos_id, i; - -dlb2_log_create_ldb_port_args (hw, - domain_id, - cq_dma_base, - args, - vdev_req, - vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_ldb_port_args (hw, - domain_id, - cq_dma_base, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (args->cos_strict) { - cos_id = args->cos_id; - - port =DLB2_DOM_LIST_HEAD (domain->avail_ldb_ports[cos_id], -typeof (*port)); - }else { -int idx; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - idx = (args->cos_id + i) %DLB2_NUM_COS_DOMAINS ; - - port =DLB2_DOM_LIST_HEAD (domain->avail_ldb_ports[idx], -typeof (*port)); -if (port) -break ; - } - - cos_id = idx; - } - -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available ldb ports\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (port->configured) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: avail_ldb_ports contains configured ports.\n" , - __func__); -return -EFAULT ; - } - - ret =dlb2_configure_ldb_port (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); -if (ret <0 ) -return ret; - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list. -*/ -dlb2_list_del (&domain->avail_ldb_ports[cos_id], &port->domain_list); - -dlb2_list_add (&domain->used_ldb_ports[cos_id], &port->domain_list); - - resp->status =0 ; - resp->id = (vdev_req) ? port->id.virt_id : port->id.phys_id; - -return 0 ; -} - static void dlb2_log_create_dir_port_args(struct dlb2_hw *hw, u32 domain_id,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +471 -0
474 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 10/26 event/dlb2: add v2.5 create dir port
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for creating directed ports. These functions create the producer port (PP), configure the consumer queue (CQ), configure queue depth, and validate the port creation arguments.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 426 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 414 +++++++++++++++++ 2 files changed, 414 insertions(+), 426 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -426
@@ -65,18 +65,6 @@ static inline void dlb2_flush_csr(struct dlb2_hw *hw)DLB2_CSR_RD (hw,DLB2_SYS_TOTAL_VAS ); } -static void dlb2_dir_port_cq_enable (struct dlb2_hw *hw, -struct dlb2_dir_pq_pair *port) -{ -union dlb2_lsp_cq_dir_dsbl reg; - - reg.field.disabled =0 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_DIR_DSBL (port->id.phys_id), reg.val); - -dlb2_flush_csr (hw); -} -static u32 dlb2_dir_queue_depth (struct dlb2_hw *hw,struct dlb2_dir_pq_pair *queue) {
@@ -1216,25 +1204,6 @@ int dlb2_set_group_sequence_numbers(struct dlb2_hw *hw,return 0 ; } -static void -dlb2_log_create_dir_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create directed port arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tCQ depth: %d\n" , - args->cq_depth); -DLB2_HW_DBG (hw,"\tCQ base address: 0x%lx\n" , - cq_dma_base); -} -static struct dlb2_dir_pq_pair * dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw, u32 id,
@@ -1256,401 +1225,6 @@ dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw,return NULL ; } -static int -dlb2_verify_create_dir_port_args (struct dlb2_hw *hw, -u32 domain_id, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -/* -* If the user claims the queue is already configured, validate -* the queue ID, its domain, and whether the queue is configured. -*/ -if (args->queue_id !=-1 ) { -struct dlb2_dir_pq_pair *queue; - - queue =dlb2_get_domain_used_dir_pq (hw, - args->queue_id, - vdev_req, - domain); - -if (queue ==NULL || queue->domain_id.phys_id != - domain->id.phys_id || - !queue->queue_configured) { - resp->status =DLB2_ST_INVALID_DIR_QUEUE_ID ; -return -EINVAL ; - } - } - -/* -* If the port's queue is not configured, validate that a free -* port-queue pair is available. -*/ -if (args->queue_id ==-1 && -dlb2_list_empty (&domain->avail_dir_pq_pairs)) { - resp->status =DLB2_ST_DIR_PORTS_UNAVAILABLE ; -return -EINVAL ; - } - -/* Check cache-line alignment */ -if ((cq_dma_base &0x3F ) !=0 ) { - resp->status =DLB2_ST_INVALID_CQ_VIRT_ADDR ; -return -EINVAL ; - } - -if (args->cq_depth !=1 && - args->cq_depth !=2 && - args->cq_depth !=4 && - args->cq_depth !=8 && - args->cq_depth !=16 && - args->cq_depth !=32 && - args->cq_depth !=64 && - args->cq_depth !=128 && - args->cq_depth !=256 && - args->cq_depth !=512 && - args->cq_depth !=1024 ) { - resp->status =DLB2_ST_INVALID_CQ_DEPTH ; -return -EINVAL ; - } - -return 0 ; -} - -static void dlb2_dir_port_configure_pp (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *port, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_dir_pp2vas r0 = { {0 } }; -union dlb2_sys_dir_pp_v r4 = { {0 } }; - - r0.field.vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_PP2VAS (port->id.phys_id), r0.val); - -if (vdev_req) { -union dlb2_sys_vf_dir_vpp2pp r1 = { {0 } }; -union dlb2_sys_dir_pp2vdev r2 = { {0 } }; -union dlb2_sys_vf_dir_vpp_v r3 = { {0 } }; -unsigned int offs; -u32 virt_id; - -/* -* DLB uses producer port address bits 17:12 to determine the -* producer port ID. In Scalable IOV mode, PP accesses come -* through the PF MMIO window for the physical producer port, -* so for translation purposes the virtual and physical port -* IDs are equal. -*/ -if (hw->virt_mode ==DLB2_VIRT_SRIOV ) - virt_id = port->id.virt_id; -else - virt_id = port->id.phys_id; - - r1.field.pp = port->id.phys_id; - - offs = vdev_id *DLB2_MAX_NUM_DIR_PORTS (hw->ver) + virt_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VPP2PP (offs), r1.val); - - r2.field.vdev = vdev_id; - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_PP2VDEV (port->id.phys_id), - r2.val); - - r3.field.vpp_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VPP_V (offs), r3.val); - } - - r4.field.pp_v =1 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_PP_V (port->id.phys_id), - r4.val); -} - -static int dlb2_dir_port_configure_cq (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *port, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_dir_cq_addr_l r0 = { {0 } }; -union dlb2_sys_dir_cq_addr_u r1 = { {0 } }; -union dlb2_sys_dir_cq2vf_pf_ro r2 = { {0 } }; -union dlb2_chp_dir_cq_tkn_depth_sel r3 = { {0 } }; -union dlb2_lsp_cq_dir_tkn_depth_sel_dsi r4 = { {0 } }; -union dlb2_sys_dir_cq_fmt r9 = { {0 } }; -union dlb2_sys_dir_cq_at r10 = { {0 } }; -union dlb2_sys_dir_cq_pasid r11 = { {0 } }; -union dlb2_chp_dir_cq2vas r12 = { {0 } }; - -/* The CQ address is 64B-aligned, and the DLB only wants bits [63:6] */ - r0.field.addr_l = cq_dma_base >>6 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_ADDR_L (port->id.phys_id), r0.val); - - r1.field.addr_u = cq_dma_base >>32 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_ADDR_U (port->id.phys_id), r1.val); - -/* -* 'ro' == relaxed ordering. This setting allows DLB2 to write -* cache lines out-of-order (but QEs within a cache line are always -* updated in-order). -*/ - r2.field.vf = vdev_id; - r2.field.is_pf = !vdev_req && (hw->virt_mode !=DLB2_VIRT_SIOV ); - r2.field.ro =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ2VF_PF_RO (port->id.phys_id), r2.val); - -if (args->cq_depth <=8 ) { - r3.field.token_depth_select =1 ; - }else if (args->cq_depth ==16 ) { - r3.field.token_depth_select =2 ; - }else if (args->cq_depth ==32 ) { - r3.field.token_depth_select =3 ; - }else if (args->cq_depth ==64 ) { - r3.field.token_depth_select =4 ; - }else if (args->cq_depth ==128 ) { - r3.field.token_depth_select =5 ; - }else if (args->cq_depth ==256 ) { - r3.field.token_depth_select =6 ; - }else if (args->cq_depth ==512 ) { - r3.field.token_depth_select =7 ; - }else if (args->cq_depth ==1024 ) { - r3.field.token_depth_select =8 ; - }else { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: invalid CQ depth\n" , - __func__, __LINE__); -return -EFAULT ; - } - -DLB2_CSR_WR (hw, -DLB2_CHP_DIR_CQ_TKN_DEPTH_SEL (port->id.phys_id), - r3.val); - -/* -* To support CQs with depth less than 8, program the token count -* register with a non-zero initial value. Operations such as domain -* reset must take this initial value into account when quiescing the -* CQ. -*/ - port->init_tkn_cnt =0 ; - -if (args->cq_depth <8 ) { -union dlb2_lsp_cq_dir_tkn_cnt r13 = { {0 } }; - - port->init_tkn_cnt =8 - args->cq_depth; - - r13.field.count = port->init_tkn_cnt; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_DIR_TKN_CNT (port->id.phys_id), - r13.val); - }else { -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_DIR_TKN_CNT (port->id.phys_id), -DLB2_LSP_CQ_DIR_TKN_CNT_RST ); - } - - r4.field.token_depth_select = r3.field.token_depth_select; - r4.field.disable_wb_opt =0 ; - r4.field.ignore_depth =0 ; - -DLB2_CSR_WR (hw, -DLB2_LSP_CQ_DIR_TKN_DEPTH_SEL_DSI (port->id.phys_id), - r4.val); - -/* Reset the CQ write pointer */ -DLB2_CSR_WR (hw, -DLB2_CHP_DIR_CQ_WPTR (port->id.phys_id), -DLB2_CHP_DIR_CQ_WPTR_RST ); - -/* Virtualize the PPID */ - r9.field.keep_pf_ppid =0 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_FMT (port->id.phys_id), r9.val); - -/* -* Address translation (AT) settings: 0: untranslated, 2: translated -* (see ATS spec regarding Address Type field for more details) -*/ - r10.field.cq_at =0 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_CQ_AT (port->id.phys_id), r10.val); - -if (vdev_req && hw->virt_mode ==DLB2_VIRT_SIOV ) { - r11.field.pasid = hw->pasid[vdev_id]; - r11.field.fmt2 =1 ; - } - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_CQ_PASID (port->id.phys_id), - r11.val); - - r12.field.cq2vas = domain->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_CHP_DIR_CQ2VAS (port->id.phys_id), r12.val); - -return 0 ; -} - -static int dlb2_configure_dir_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *port, -uintptr_t cq_dma_base, -struct dlb2_create_dir_port_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -int ret; - - ret =dlb2_dir_port_configure_cq (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); - -if (ret <0 ) -return ret; - -dlb2_dir_port_configure_pp (hw, - domain, - port, - vdev_req, - vdev_id); - -dlb2_dir_port_cq_enable (hw, port); - - port->enabled = true; - - port->port_configured = true; - -return 0 ; -} - -/** -* dlb2_hw_create_dir_port() - Allocate and initialize a DLB directed port -* and queue. The port/queue pair have the same ID and name. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @cq_dma_base: Base DMA address for consumer queue memory -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_dir_port (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_port_args *args, -uintptr_t cq_dma_base, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_dir_pq_pair *port; -struct dlb2_hw_domain *domain; -int ret; - -dlb2_log_create_dir_port_args (hw, - domain_id, - cq_dma_base, - args, - vdev_req, - vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_dir_port_args (hw, - domain_id, - cq_dma_base, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (args->queue_id !=-1 ) - port =dlb2_get_domain_used_dir_pq (hw, - args->queue_id, - vdev_req, - domain); -else - port =DLB2_DOM_LIST_HEAD (domain->avail_dir_pq_pairs, -typeof (*port)); -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available dir ports\n" , - __func__, __LINE__); -return -EFAULT ; - } - - ret =dlb2_configure_dir_port (hw, - domain, - port, - cq_dma_base, - args, - vdev_req, - vdev_id); -if (ret <0 ) -return ret; - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list (if it's not already there). -*/ -if (args->queue_id ==-1 ) { -dlb2_list_del (&domain->avail_dir_pq_pairs, &port->domain_list); - -dlb2_list_add (&domain->used_dir_pq_pairs, &port->domain_list); - } - - resp->status =0 ; - resp->id = (vdev_req) ? port->id.virt_id : port->id.phys_id; - -return 0 ; -} - static void dlb2_configure_dir_queue(struct dlb2_hw *hw, struct dlb2_hw_domain *domain, struct dlb2_dir_pq_pair *queue,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +414 -0
417 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 11/26 event/dlb2: add v2.5 create dir queue
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for creating directed queues. These functions configure the depth threshold, configure queue depth, and validate the queue creation arguments.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 213 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 201 +++++++++++++++++ 2 files changed, 201 insertions(+), 213 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -213
@@ -1225,219 +1225,6 @@ dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw,return NULL ; } -static void dlb2_configure_dir_queue (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_dir_pq_pair *queue, -struct dlb2_create_dir_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -union dlb2_sys_dir_vasqid_v r0 = { {0 } }; -union dlb2_sys_dir_qid_its r1 = { {0 } }; -union dlb2_lsp_qid_dir_depth_thrsh r2 = { {0 } }; -union dlb2_sys_dir_qid_v r5 = { {0 } }; - -unsigned int offs; - -/* QID write permissions are turned on when the domain is started */ - r0.field.vasqid_v =0 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_DIR_QUEUES (hw->ver) + - queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_VASQID_V (offs), r0.val); - -/* Don't timestamp QEs that pass through this queue */ - r1.field.qid_its =0 ; - -DLB2_CSR_WR (hw, -DLB2_SYS_DIR_QID_ITS (queue->id.phys_id), - r1.val); - - r2.field.thresh = args->depth_threshold; - -DLB2_CSR_WR (hw, -DLB2_LSP_QID_DIR_DEPTH_THRSH (queue->id.phys_id), - r2.val); - -if (vdev_req) { -union dlb2_sys_vf_dir_vqid_v r3 = { {0 } }; -union dlb2_sys_vf_dir_vqid2qid r4 = { {0 } }; - - offs = vdev_id *DLB2_MAX_NUM_DIR_QUEUES (hw->ver) - + queue->id.virt_id; - - r3.field.vqid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VQID_V (offs), r3.val); - - r4.field.qid = queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_VF_DIR_VQID2QID (offs), r4.val); - } - - r5.field.qid_v =1 ; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_QID_V (queue->id.phys_id), r5.val); - - queue->queue_configured = true; -} - -static void -dlb2_log_create_dir_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_queue_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 create directed queue arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , args->port_id); -} - -static int -dlb2_verify_create_dir_queue_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -/* -* If the user claims the port is already configured, validate the port -* ID, its domain, and whether the port is configured. -*/ -if (args->port_id !=-1 ) { -struct dlb2_dir_pq_pair *port; - - port =dlb2_get_domain_used_dir_pq (hw, - args->port_id, - vdev_req, - domain); - -if (port ==NULL || port->domain_id.phys_id != - domain->id.phys_id || !port->port_configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - } - -/* -* If the queue's port is not configured, validate that a free -* port-queue pair is available. -*/ -if (args->port_id ==-1 && -dlb2_list_empty (&domain->avail_dir_pq_pairs)) { - resp->status =DLB2_ST_DIR_QUEUES_UNAVAILABLE ; -return -EINVAL ; - } - -return 0 ; -} - -/** -* dlb2_hw_create_dir_queue() - Allocate and initialize a DLB DIR queue. -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @args: User-provided arguments. -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int dlb2_hw_create_dir_queue (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_create_dir_queue_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_dir_pq_pair *queue; -struct dlb2_hw_domain *domain; -int ret; - -dlb2_log_create_dir_queue_args (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_create_dir_queue_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (args->port_id !=-1 ) - queue =dlb2_get_domain_used_dir_pq (hw, - args->port_id, - vdev_req, - domain); -else - queue =DLB2_DOM_LIST_HEAD (domain->avail_dir_pq_pairs, -typeof (*queue)); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: no available dir queues\n" , - __func__, __LINE__); -return -EFAULT ; - } - -dlb2_configure_dir_queue (hw, domain, queue, args, vdev_req, vdev_id); - -/* -* Configuration succeeded, so move the resource from the 'avail' to -* the 'used' list (if it's not already there). -*/ -if (args->port_id ==-1 ) { -dlb2_list_del (&domain->avail_dir_pq_pairs, - &queue->domain_list); - -dlb2_list_add (&domain->used_dir_pq_pairs, - &queue->domain_list); - } - - resp->status =0 ; - - resp->id = (vdev_req) ? queue->id.virt_id : queue->id.phys_id; - -return 0 ; -} - static bool dlb2_port_find_slot_with_pending_map_queue(struct dlb2_ldb_port *port, struct dlb2_ldb_queue *queue,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +201 -0
204 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 12/26 event/dlb2: add v2.5 map qid
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for mapping queues to ports. These functions also validate the map arguments and verify that the maximum number of queues linked to a load balanced port does not exceed the capabilities of the hardware.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware version, v2.0 or v2.5.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 355 --------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 418 ++++++++++++++++++ 2 files changed, 418 insertions(+), 355 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -355
@@ -1245,68 +1245,6 @@ dlb2_port_find_slot_with_pending_map_queue(struct dlb2_ldb_port *port,return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); } -static void dlb2_ldb_port_change_qid_priority (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -int slot, -struct dlb2_map_qid_args *args) -{ -union dlb2_lsp_cq2priov r0; - -/* Read-modify-write the priority and valid bit register */ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2PRIOV (port->id.phys_id)); - - r0.field.v |=1 << slot; - r0.field.prio |= (args->priority &0x7 ) << slot *3 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (port->id.phys_id), r0.val); - -dlb2_flush_csr (hw); - - port->qid_map[slot].priority = args->priority; -} - -static int dlb2_verify_map_qid_slot_available (struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -struct dlb2_cmd_response *resp) -{ -enum dlb2_qid_map_state state; -int i; - -/* Unused slot available? */ -if (port->num_mappings <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) -return 0 ; - -/* -* If the queue is already mapped (from the application's perspective), -* this is simply a priority update. -*/ - state =DLB2_QUEUE_MAPPED ; -if (dlb2_port_find_slot_queue (port, state, queue, &i)) -return 0 ; - - state =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, state, queue, &i)) -return 0 ; - -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &i)) -return 0 ; - -/* -* If the slot contains an unmap in progress, it's considered -* available. -*/ - state =DLB2_QUEUE_UNMAP_IN_PROG ; -if (dlb2_port_find_slot (port, state, &i)) -return 0 ; - - state =DLB2_QUEUE_UNMAPPED ; -if (dlb2_port_find_slot (port, state, &i)) -return 0 ; - - resp->status =DLB2_ST_NO_QID_SLOTS_AVAILABLE ; -return -EINVAL ; -} -static struct dlb2_ldb_queue * dlb2_get_domain_ldb_queue(u32 id, bool vdev_req,
@@ -1355,299 +1293,6 @@ dlb2_get_domain_used_ldb_port(u32 id,return NULL ; } -static int dlb2_verify_map_qid_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_map_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_port *port; -struct dlb2_ldb_queue *queue; -int id; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); - -if (port ==NULL || !port->configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - -if (args->priority >=DLB2_QID_PRIORITIES ) { - resp->status =DLB2_ST_INVALID_PRIORITY ; -return -EINVAL ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); - -if (queue ==NULL || !queue->configured) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - -if (queue->domain_id.phys_id != domain->id.phys_id) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - -if (port->domain_id.phys_id != domain->id.phys_id) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - -return 0 ; -} - -static void dlb2_log_map_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_map_qid_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 map QID arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , - args->port_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , - args->qid); -DLB2_HW_DBG (hw,"\tPriority: %d\n" , - args->priority); -} - -int dlb2_hw_map_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_map_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -enum dlb2_qid_map_state st; -struct dlb2_ldb_port *port; -int ret, i, id; -u8 prio; - -dlb2_log_map_qid (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_map_qid_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - prio = args->priority; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: queue not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* If there are any outstanding detach operations for this port, -* attempt to complete them. This may be necessary to free up a QID -* slot for this requested mapping. -*/ -if (port->num_pending_removals) -dlb2_domain_finish_unmap_port (hw, domain, port); - - ret =dlb2_verify_map_qid_slot_available (port, queue, resp); -if (ret) -return ret; - -/* Hardware requires disabling the CQ before mapping QIDs. */ -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - -/* -* If this is only a priority change, don't perform the full QID->CQ -* mapping procedure -*/ - st =DLB2_QUEUE_MAPPED ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (prio != port->qid_map[i].priority) { -dlb2_ldb_port_change_qid_priority (hw, port, i, args); -DLB2_HW_DBG (hw,"DLB2 map: priority change\n" ); - } - - st =DLB2_QUEUE_MAPPED ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto map_qid_done; - } - - st =DLB2_QUEUE_UNMAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (prio != port->qid_map[i].priority) { -dlb2_ldb_port_change_qid_priority (hw, port, i, args); -DLB2_HW_DBG (hw,"DLB2 map: priority change\n" ); - } - - st =DLB2_QUEUE_MAPPED ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto map_qid_done; - } - -/* -* If this is a priority change on an in-progress mapping, don't -* perform the full QID->CQ mapping procedure. -*/ - st =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[i].priority = prio; - -DLB2_HW_DBG (hw,"DLB2 map: priority change only\n" ); - - goto map_qid_done; - } - -/* -* If this is a priority change on a pending mapping, update the -* pending priority -*/ -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[i].pending_priority = prio; - -DLB2_HW_DBG (hw,"DLB2 map: priority change only\n" ); - - goto map_qid_done; - } - -/* -* If all the CQ's slots are in use, then there's an unmap in progress -* (guaranteed by dlb2_verify_map_qid_slot_available()), so add this -* mapping to pending_map and return. When the removal is completed for -* the slot's current occupant, this mapping will be performed. -*/ -if (!dlb2_port_find_slot (port,DLB2_QUEUE_UNMAPPED , &i)) { -if (dlb2_port_find_slot (port,DLB2_QUEUE_UNMAP_IN_PROG , &i)) { -enum dlb2_qid_map_state st; - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[i].pending_qid = queue->id.phys_id; - port->qid_map[i].pending_priority = prio; - - st =DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ; - - ret =dlb2_port_slot_state_transition (hw, port, queue, - i, st); -if (ret) -return ret; - -DLB2_HW_DBG (hw,"DLB2 map: map pending removal\n" ); - - goto map_qid_done; - } - } - -/* -* If the domain has started, a special "dynamic" CQ->queue mapping -* procedure is required in order to safely update the CQ<->QID tables. -* The "static" procedure cannot be used when traffic is flowing, -* because the CQ<->QID tables cannot be updated atomically and the -* scheduler won't see the new mapping unless the queue's if_status -* changes, which isn't guaranteed. -*/ - ret =dlb2_ldb_port_map_qid (hw, domain, port, queue, prio); - -/* If ret is less than zero, it's due to an internal error */ -if (ret <0 ) -return ret; - -map_qid_done: -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - - resp->status =0 ; - -return 0 ; -} - static void dlb2_log_unmap_qid(struct dlb2_hw *hw, u32 domain_id, struct dlb2_unmap_qid_args *args,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +418 -0
421 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 13/26 event/dlb2: add v2.5 unmap queue
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for removing the linkage between a queue and a load balanced port. Runtime checks are performed on the port and queue to make sure the state is appropriate for the unmap operation, and the unmap arguments are also validated.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 331 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 298 ++++++++++++++++ 2 files changed, 298 insertions(+), 331 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -331
@@ -1225,26 +1225,6 @@ dlb2_get_domain_used_dir_pq(struct dlb2_hw *hw,return NULL ; } -static bool -dlb2_port_find_slot_with_pending_map_queue (struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -int *slot) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -struct dlb2_ldb_port_qid_map *map = &port->qid_map[i]; - -if (map->state ==DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP && - map->pending_qid == queue->id.phys_id) -break ; - } - - *slot = i; - -return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); -} -static struct dlb2_ldb_queue * dlb2_get_domain_ldb_queue(u32 id, bool vdev_req,
@@ -1265,317 +1245,6 @@ dlb2_get_domain_ldb_queue(u32 id,return NULL ; } -static struct dlb2_ldb_port * -dlb2_get_domain_used_ldb_port (u32 id, -bool vdev_req, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int i; -RTE_SET_USED (iter); - -if (id >=DLB2_MAX_NUM_LDB_PORTS ) -return NULL ; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) -if ((!vdev_req && port->id.phys_id == id) || - (vdev_req && port->id.virt_id == id)) -return port; - - DLB2_DOM_LIST_FOR(domain->avail_ldb_ports[i], port, iter) -if ((!vdev_req && port->id.phys_id == id) || - (vdev_req && port->id.virt_id == id)) -return port; - } - -return NULL ; -} - -static void dlb2_log_unmap_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_unmap_qid_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 unmap QID arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , - domain_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , - args->port_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , - args->qid); -if (args->qid <DLB2_MAX_NUM_LDB_QUEUES ) -DLB2_HW_DBG (hw,"\tQueue's num mappings: %d\n" , - hw->rsrcs.ldb_queues[args->qid].num_mappings); -} - -static int dlb2_verify_unmap_qid_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_unmap_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -enum dlb2_qid_map_state state; -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -struct dlb2_ldb_port *port; -int slot; -int id; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); - -if (port ==NULL || !port->configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - -if (port->domain_id.phys_id != domain->id.phys_id) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); - -if (queue ==NULL || !queue->configured) { -DLB2_HW_ERR (hw,"[%s()] Can't unmap unconfigured queue %d\n" , - __func__, args->qid); - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - -/* -* Verify that the port has the queue mapped. From the application's -* perspective a queue is mapped if it is actually mapped, the map is -* in progress, or the map is blocked pending an unmap. -*/ - state =DLB2_QUEUE_MAPPED ; -if (dlb2_port_find_slot_queue (port, state, queue, &slot)) -return 0 ; - - state =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, state, queue, &slot)) -return 0 ; - -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &slot)) -return 0 ; - - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; -} - -int dlb2_hw_unmap_qid (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_unmap_qid_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -enum dlb2_qid_map_state st; -struct dlb2_ldb_port *port; -bool unmap_complete; -int i, ret, id; - -dlb2_log_unmap_qid (hw, domain_id, args, vdev_req, vdev_id); - -/* -* Verify that hardware resources are available before attempting to -* satisfy the request. This simplifies the error unwinding code. -*/ - ret =dlb2_verify_unmap_qid_args (hw, - domain_id, - args, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - id = args->port_id; - - port =dlb2_get_domain_used_ldb_port (id, vdev_req, domain); -if (port ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - - queue =dlb2_get_domain_ldb_queue (args->qid, vdev_req, domain); -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: queue not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* If the queue hasn't been mapped yet, we need to update the slot's -* state and re-enable the queue's inflights. -*/ - st =DLB2_QUEUE_MAP_IN_PROG ; -if (dlb2_port_find_slot_queue (port, st, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* Since the in-progress map was aborted, re-enable the QID's -* inflights. -*/ -if (queue->num_pending_additions ==0 ) -dlb2_ldb_queue_set_inflight_limit (hw, queue); - - st =DLB2_QUEUE_UNMAPPED ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto unmap_qid_done; - } - -/* -* If the queue mapping is on hold pending an unmap, we simply need to -* update the slot's state. -*/ -if (dlb2_port_find_slot_with_pending_map_queue (port, queue, &i)) { -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - st =DLB2_QUEUE_UNMAP_IN_PROG ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - - goto unmap_qid_done; - } - - st =DLB2_QUEUE_MAPPED ; -if (!dlb2_port_find_slot_queue (port, st, queue, &i)) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: no available CQ slots\n" , - __func__); -return -EFAULT ; - } - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* QID->CQ mapping removal is an asynchronous procedure. It requires -* stopping the DLB2 from scheduling this CQ, draining all inflights -* from the CQ, then unmapping the queue from the CQ. This function -* simply marks the port as needing the queue unmapped, and (if -* necessary) starts the unmapping worker thread. -*/ -dlb2_ldb_port_cq_disable (hw, port); - - st =DLB2_QUEUE_UNMAP_IN_PROG ; - ret =dlb2_port_slot_state_transition (hw, port, queue, i, st); -if (ret) -return ret; - -/* -* Attempt to finish the unmapping now, in case the port has no -* outstanding inflights. If that's not the case, this will fail and -* the unmapping will be completed at a later time. -*/ - unmap_complete =dlb2_domain_finish_unmap_port (hw, domain, port); - -/* -* If the unmapping couldn't complete immediately, launch the worker -* thread (if it isn't already launched) to finish it later. -*/ -if (!unmap_complete && !os_worker_active (hw)) -os_schedule_work (hw); - -unmap_qid_done: - resp->status =0 ; - -return 0 ; -} - -static void -dlb2_log_pending_port_unmaps_args (struct dlb2_hw *hw, -struct dlb2_pending_port_unmaps_args *args, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB unmaps in progress arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from VF %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tPort ID: %d\n" , args->port_id); -} - -int dlb2_hw_pending_port_unmaps (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_pending_port_unmaps_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_port *port; - -dlb2_log_pending_port_unmaps_args (hw, args, vdev_req, vdev_id); - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - - port =dlb2_get_domain_used_ldb_port (args->port_id, vdev_req, domain); -if (port ==NULL || !port->configured) { - resp->status =DLB2_ST_INVALID_PORT_ID ; -return -EINVAL ; - } - - resp->id = port->num_pending_removals; - -return 0 ; -} - static int dlb2_verify_start_domain_args(struct dlb2_hw *hw, u32 domain_id, struct dlb2_cmd_response *resp,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +298 -0
301 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 14/26 event/dlb2: add v2.5 start domain
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for starting the scheduling domain. Once a domain is started, its resources can no longer be configured, except for QID remapping and port enable/disable. The start domain arguments are validated, and an error is returned if validation fails, or if the domain is not configured or has already been started.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 123 ----------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 123 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -123
@@ -1245,129 +1245,6 @@ dlb2_get_domain_ldb_queue(u32 id,return NULL ; } -static int dlb2_verify_start_domain_args (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); - -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - -if (!domain->configured) { - resp->status =DLB2_ST_DOMAIN_NOT_CONFIGURED ; -return -EINVAL ; - } - -if (domain->started) { - resp->status =DLB2_ST_DOMAIN_STARTED ; -return -EINVAL ; - } - -return 0 ; -} - -static void dlb2_log_start_domain (struct dlb2_hw *hw, -u32 domain_id, -bool vdev_req, -unsigned int vdev_id) -{ -DLB2_HW_DBG (hw,"DLB2 start domain arguments:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from vdev %d)\n" , vdev_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -} - -/** -* dlb2_hw_start_domain() - Lock the domain configuration -* @hw: Contains the current state of the DLB2 hardware. -* @domain_id: Domain ID -* @arg: User-provided arguments (unused, here for ioctl callback template). -* @resp: Response to user. -* @vdev_req: Request came from a virtual device. -* @vdev_id: If vdev_req is true, this contains the virtual device's ID. -* -* Return: returns < 0 on error, 0 otherwise. If the driver is unable to -* satisfy a request, resp->status will be set accordingly. -*/ -int -dlb2_hw_start_domain (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_start_domain_args *arg, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_list_entry *iter; -struct dlb2_dir_pq_pair *dir_queue; -struct dlb2_ldb_queue *ldb_queue; -struct dlb2_hw_domain *domain; -int ret; -RTE_SET_USED (arg); -RTE_SET_USED (iter); - -dlb2_log_start_domain (hw, domain_id, vdev_req, vdev_id); - - ret =dlb2_verify_start_domain_args (hw, - domain_id, - resp, - vdev_req, - vdev_id); -if (ret) -return ret; - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: domain not found\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* -* Enable load-balanced and directed queue write permissions for the -* queues this domain owns. Without this, the DLB2 will drop all -* incoming traffic to those queues. -*/ - DLB2_DOM_LIST_FOR(domain->used_ldb_queues, ldb_queue, iter) { -union dlb2_sys_ldb_vasqid_v r0 = { {0 } }; -unsigned int offs; - - r0.field.vasqid_v =1 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_LDB_QUEUES + - ldb_queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_LDB_VASQID_V (offs), r0.val); - } - - DLB2_DOM_LIST_FOR(domain->used_dir_pq_pairs, dir_queue, iter) { -union dlb2_sys_dir_vasqid_v r0 = { {0 } }; -unsigned int offs; - - r0.field.vasqid_v =1 ; - - offs = domain->id.phys_id *DLB2_MAX_NUM_DIR_PORTS (hw->ver) + - dir_queue->id.phys_id; - -DLB2_CSR_WR (hw,DLB2_SYS_DIR_VASQID_V (offs), r0.val); - } - -dlb2_flush_csr (hw); - - domain->started = true; - - resp->status =0 ; - -return 0 ; -} - static void dlb2_log_get_dir_queue_depth(struct dlb2_hw *hw, u32 domain_id, u32 queue_id,
drivers/event/dlb2/pf/base/dlb2_resource_new.c +130 -0
133 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 15/26 event/dlb2: add v2.5 credit scheme
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
DLB v2.5 uses a different credit scheme than was used in DLB v2.0 . Specifically, there is a single credit pool for both load balanced and directed traffic, instead of a separate pool for each as is found with DLB v2.0.
--- drivers/event/dlb2/dlb2.c | 311 ++++++++++++++++++++++++++------------ 1 file changed, 212 insertions(+), 99 deletions(-)
drivers/event/dlb2/dlb2.c +212 -99
@@ -436,8 +436,13 @@ dlb2_eventdev_info_get(struct rte_eventdev *dev,*/ evdev_dlb2_default_info.max_event_ports += dlb2->num_ldb_ports; evdev_dlb2_default_info.max_event_queues += dlb2->num_ldb_queues; - evdev_dlb2_default_info.max_num_events += dlb2->max_ldb_credits; - +if (dlb2->version ==DLB2_HW_V2_5 ) { + evdev_dlb2_default_info.max_num_events += + dlb2->max_credits; + }else { + evdev_dlb2_default_info.max_num_events += + dlb2->max_ldb_credits; + } evdev_dlb2_default_info.max_event_queues =RTE_MIN (evdev_dlb2_default_info.max_event_queues,RTE_EVENT_MAX_QUEUES_PER_DEV );
@@ -451,7 +456,8 @@ dlb2_eventdev_info_get(struct rte_eventdev *dev,static int dlb2_hw_create_sched_domain (struct dlb2_hw_dev *handle, -const struct dlb2_hw_rsrcs *resources_asked) +const struct dlb2_hw_rsrcs *resources_asked, +uint8_t device_version) {int ret =0 ;struct dlb2_create_sched_domain_args *cfg;
@@ -468,8 +474,10 @@ dlb2_hw_create_sched_domain(struct dlb2_hw_dev *handle,/* DIR ports and queues */ cfg->num_dir_ports = resources_asked->num_dir_ports; - - cfg->num_dir_credits = resources_asked->num_dir_credits; +if (device_version ==DLB2_HW_V2_5 ) + cfg->num_credits = resources_asked->num_credits; +else + cfg->num_dir_credits = resources_asked->num_dir_credits;/* LDB queues */
@@ -509,8 +517,8 @@ dlb2_hw_create_sched_domain(struct dlb2_hw_dev *handle,break ; } - cfg->num_ldb_credits = - resources_asked->num_ldb_credits; +if (device_version ==DLB2_HW_V2 ) + cfg->num_ldb_credits = resources_asked->num_ldb_credits; cfg->num_atomic_inflights = DLB2_NUM_ATOMIC_INFLIGHTS_PER_QUEUE *
@@ -519,14 +527,24 @@ dlb2_hw_create_sched_domain(struct dlb2_hw_dev *handle, cfg->num_hist_list_entries = resources_asked->num_ldb_ports *DLB2_NUM_HIST_LIST_ENTRIES_PER_LDB_PORT ; -DLB2_LOG_DBG ("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d\n" , - cfg->num_ldb_queues, - resources_asked->num_ldb_ports, - cfg->num_dir_ports, - cfg->num_atomic_inflights, - cfg->num_hist_list_entries, - cfg->num_ldb_credits, - cfg->num_dir_credits); +if (device_version ==DLB2_HW_V2_5 ) { +DLB2_LOG_DBG ("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d\n" , + cfg->num_ldb_queues, + resources_asked->num_ldb_ports, + cfg->num_dir_ports, + cfg->num_atomic_inflights, + cfg->num_hist_list_entries, + cfg->num_credits); + }else { +DLB2_LOG_DBG ("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d\n" , + cfg->num_ldb_queues, + resources_asked->num_ldb_ports, + cfg->num_dir_ports, + cfg->num_atomic_inflights, + cfg->num_hist_list_entries, + cfg->num_ldb_credits, + cfg->num_dir_credits); + }/* Configure the QM */
@@ -606,7 +624,6 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)*/ if (dlb2->configured) {dlb2_hw_reset_sched_domain (dev, true); - ret =dlb2_hw_query_resources (dlb2);if (ret) { DLB2_LOG_ERR("get resources err=%d, devid=%d\n",
@@ -665,20 +682,26 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)/* 1 dir queue per dir port */ rsrcs->num_ldb_queues = config->nb_event_queues - rsrcs->num_dir_ports; -/* Scale down nb_events_limit by 4 for directed credits, since there -* are 4x as many load-balanced credits. -*/ - rsrcs->num_ldb_credits =0 ; - rsrcs->num_dir_credits =0 ; +if (dlb2->version ==DLB2_HW_V2_5 ) { + rsrcs->num_credits =0 ; +if (rsrcs->num_ldb_queues || rsrcs->num_dir_ports) + rsrcs->num_credits = config->nb_events_limit; + }else { +/* Scale down nb_events_limit by 4 for directed credits, +* since there are 4x as many load-balanced credits. +*/ + rsrcs->num_ldb_credits =0 ; + rsrcs->num_dir_credits =0 ; -if (rsrcs->num_ldb_queues) - rsrcs->num_ldb_credits = config->nb_events_limit; -if (rsrcs->num_dir_ports) - rsrcs->num_dir_credits = config->nb_events_limit /4 ; -if (dlb2->num_dir_credits_override !=-1 ) - rsrcs->num_dir_credits = dlb2->num_dir_credits_override; +if (rsrcs->num_ldb_queues) + rsrcs->num_ldb_credits = config->nb_events_limit; +if (rsrcs->num_dir_ports) + rsrcs->num_dir_credits = config->nb_events_limit /4 ; +if (dlb2->num_dir_credits_override !=-1 ) + rsrcs->num_dir_credits = dlb2->num_dir_credits_override; + } -if (dlb2_hw_create_sched_domain (handle, rsrcs) <0 ) { +if (dlb2_hw_create_sched_domain (handle, rsrcs, dlb2->version) <0 ) {DLB2_LOG_ERR ("dlb2_hw_create_sched_domain failed\n" );return -ENODEV ; }
@@ -693,10 +716,15 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev) dlb2->num_ldb_ports = dlb2->num_ports - dlb2->num_dir_ports; dlb2->num_ldb_queues = dlb2->num_queues - dlb2->num_dir_ports; dlb2->num_dir_queues = dlb2->num_dir_ports; - dlb2->ldb_credit_pool = rsrcs->num_ldb_credits; - dlb2->max_ldb_credits = rsrcs->num_ldb_credits; - dlb2->dir_credit_pool = rsrcs->num_dir_credits; - dlb2->max_dir_credits = rsrcs->num_dir_credits; +if (dlb2->version ==DLB2_HW_V2_5 ) { + dlb2->credit_pool = rsrcs->num_credits; + dlb2->max_credits = rsrcs->num_credits; + }else { + dlb2->ldb_credit_pool = rsrcs->num_ldb_credits; + dlb2->max_ldb_credits = rsrcs->num_ldb_credits; + dlb2->dir_credit_pool = rsrcs->num_dir_credits; + dlb2->max_dir_credits = rsrcs->num_dir_credits; + } dlb2->configured = true;
@@ -1170,8 +1198,9 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,struct dlb2_port *qm_port =NULL ;char mz_name[RTE_MEMZONE_NAMESIZE ];uint32_t qm_port_id; -uint16_t ldb_credit_high_watermark; -uint16_t dir_credit_high_watermark; +uint16_t ldb_credit_high_watermark =0 ; +uint16_t dir_credit_high_watermark =0 ; +uint16_t credit_high_watermark =0 ;if (handle ==NULL )return -EINVAL ;
@@ -1206,15 +1235,18 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,/* User controls the LDB high watermark via enqueue depth. The DIR high * watermark is equal, unless the directed credit pool is too small. */ - ldb_credit_high_watermark = enqueue_depth; - -/* If there are no directed ports, the kernel driver will ignore this -* port's directed credit settings. Don't use enqueue_depth if it would -* require more directed credits than are available. -*/ - dir_credit_high_watermark = -RTE_MIN (enqueue_depth, - handle->cfg.num_dir_credits / dlb2->num_ports); +if (dlb2->version ==DLB2_HW_V2 ) { + ldb_credit_high_watermark = enqueue_depth; +/* If there are no directed ports, the kernel driver will +* ignore this port's directed credit settings. Don't use +* enqueue_depth if it would require more directed credits +* than are available. +*/ + dir_credit_high_watermark = +RTE_MIN (enqueue_depth, + handle->cfg.num_dir_credits / dlb2->num_ports); + }else + credit_high_watermark = enqueue_depth;/* Per QM values */
@@ -1249,8 +1281,12 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->id = qm_port_id; - qm_port->cached_ldb_credits =0 ; - qm_port->cached_dir_credits =0 ; +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_ldb_credits =0 ; + qm_port->cached_dir_credits =0 ; + }else + qm_port->cached_credits =0 ; +/* CQs with depth < 8 use an 8-entry queue, but withhold credits so * the effective depth is smaller. */
@@ -1298,17 +1334,26 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->state =PORT_STARTED ;/* enabled at create time */ qm_port->config_state =DLB2_CONFIGURED ; - qm_port->dir_credits = dir_credit_high_watermark; - qm_port->ldb_credits = ldb_credit_high_watermark; - qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; - qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; - -DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d\n" , - qm_port_id, - dequeue_depth, - qm_port->ldb_credits, - qm_port->dir_credits); +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->dir_credits = dir_credit_high_watermark; + qm_port->ldb_credits = ldb_credit_high_watermark; + qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; + qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; + +DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d\n" , + qm_port_id, + dequeue_depth, + qm_port->ldb_credits, + qm_port->dir_credits); + }else { + qm_port->credits = credit_high_watermark; + qm_port->credit_pool[DLB2_COMBINED_POOL ] = &dlb2->credit_pool; +DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, credits=%d\n" , + qm_port_id, + dequeue_depth, + qm_port->credits); + }rte_spinlock_unlock (&handle->resource_lock);return 0 ;
@@ -1356,8 +1401,9 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,struct dlb2_port *qm_port =NULL ;char mz_name[RTE_MEMZONE_NAMESIZE ];uint32_t qm_port_id; -uint16_t ldb_credit_high_watermark; -uint16_t dir_credit_high_watermark; +uint16_t ldb_credit_high_watermark =0 ; +uint16_t dir_credit_high_watermark =0 ; +uint16_t credit_high_watermark =0 ;if (dlb2 ==NULL || handle ==NULL )return -EINVAL ;
@@ -1386,14 +1432,16 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,/* User controls the LDB high watermark via enqueue depth. The DIR high * watermark is equal, unless the directed credit pool is too small. */ - ldb_credit_high_watermark = enqueue_depth; - -/* Don't use enqueue_depth if it would require more directed credits -* than are available. -*/ - dir_credit_high_watermark = -RTE_MIN (enqueue_depth, - handle->cfg.num_dir_credits / dlb2->num_ports); +if (dlb2->version ==DLB2_HW_V2 ) { + ldb_credit_high_watermark = enqueue_depth; +/* Don't use enqueue_depth if it would require more directed +* credits than are available. +*/ + dir_credit_high_watermark = +RTE_MIN (enqueue_depth, + handle->cfg.num_dir_credits / dlb2->num_ports); + }else + credit_high_watermark = enqueue_depth;/* Per QM values */
@@ -1430,8 +1478,12 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->id = qm_port_id; - qm_port->cached_ldb_credits =0 ; - qm_port->cached_dir_credits =0 ; +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_ldb_credits =0 ; + qm_port->cached_dir_credits =0 ; + }else + qm_port->cached_credits =0 ; +/* CQs with depth < 8 use an 8-entry queue, but withhold credits so * the effective depth is smaller. */
@@ -1467,17 +1519,26 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->state =PORT_STARTED ;/* enabled at create time */ qm_port->config_state =DLB2_CONFIGURED ; - qm_port->dir_credits = dir_credit_high_watermark; - qm_port->ldb_credits = ldb_credit_high_watermark; - qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; - qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; - -DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d,%d\n" , - qm_port_id, - dequeue_depth, - dir_credit_high_watermark, - ldb_credit_high_watermark); +if (dlb2->version ==DLB2_HW_V2 ) { + qm_port->dir_credits = dir_credit_high_watermark; + qm_port->ldb_credits = ldb_credit_high_watermark; + qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; + qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; + +DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d,%d\n" , + qm_port_id, + dequeue_depth, + dir_credit_high_watermark, + ldb_credit_high_watermark); + }else { + qm_port->credits = credit_high_watermark; + qm_port->credit_pool[DLB2_COMBINED_POOL ] = &dlb2->credit_pool; +DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d\n" , + qm_port_id, + dequeue_depth, + credit_high_watermark); + }rte_spinlock_unlock (&handle->resource_lock);return 0 ;
@@ -2297,6 +2358,24 @@ dlb2_check_enqueue_hw_dir_credits(struct dlb2_port *qm_port)return 0 ; } +static inline int +dlb2_check_enqueue_hw_credits (struct dlb2_port *qm_port) +{ +if (unlikely (qm_port->cached_credits ==0 )) { + qm_port->cached_credits = +dlb2_port_credits_get (qm_port, +DLB2_COMBINED_POOL ); +if (unlikely (qm_port->cached_credits ==0 )) { +DLB2_INC_STAT ( + qm_port->ev_port->stats.traffic.tx_nospc_hw_credits,1 ); +DLB2_LOG_DBG ("credits exhausted\n" ); +return 1 ;/* credits exhausted */ + } + } + +return 0 ; +} + static __rte_always_inline voiddlb2_pp_write (struct dlb2_enqueue_qe *qe4,struct process_local_port_data *port_data)
@@ -2565,12 +2644,19 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port,if (!qm_queue->is_directed) {/* Load balanced destination queue */ -if (dlb2_check_enqueue_hw_ldb_credits (qm_port)) { - rte_errno = -ENOSPC ; -return 1 ; +if (dlb2->version ==DLB2_HW_V2 ) { +if (dlb2_check_enqueue_hw_ldb_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_ldb_credits; + }else { +if (dlb2_check_enqueue_hw_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_credits; } - cached_credits = &qm_port->cached_ldb_credits; -switch (ev->sched_type) {case RTE_SCHED_TYPE_ORDERED :DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_ORDERED\n" );
@@ -2602,12 +2688,19 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port, }else {/* Directed destination queue */ -if (dlb2_check_enqueue_hw_dir_credits (qm_port)) { - rte_errno = -ENOSPC ; -return 1 ; +if (dlb2->version ==DLB2_HW_V2 ) { +if (dlb2_check_enqueue_hw_dir_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_dir_credits; + }else { +if (dlb2_check_enqueue_hw_credits (qm_port)) { + rte_errno = -ENOSPC ; +return 1 ; + } + cached_credits = &qm_port->cached_credits; } - cached_credits = &qm_port->cached_dir_credits; -DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_DIRECTED\n" ); *sched_type =DLB2_SCHED_DIRECTED ;
@@ -2891,20 +2984,40 @@ dlb2_port_credits_inc(struct dlb2_port *qm_port, int num)/* increment port credits, and return to pool if exceeds threshold */ if (!qm_port->is_directed) { - qm_port->cached_ldb_credits += num; -if (qm_port->cached_ldb_credits >=2 * batch_size) { -__atomic_fetch_add ( - qm_port->credit_pool[DLB2_LDB_QUEUE ], - batch_size, __ATOMIC_SEQ_CST); - qm_port->cached_ldb_credits -= batch_size; +if (qm_port->dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_ldb_credits += num; +if (qm_port->cached_ldb_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_LDB_QUEUE ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_ldb_credits -= batch_size; + } + }else { + qm_port->cached_credits += num; +if (qm_port->cached_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_COMBINED_POOL ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_credits -= batch_size; + } } }else { - qm_port->cached_dir_credits += num; -if (qm_port->cached_dir_credits >=2 * batch_size) { -__atomic_fetch_add ( - qm_port->credit_pool[DLB2_DIR_QUEUE ], - batch_size, __ATOMIC_SEQ_CST); - qm_port->cached_dir_credits -= batch_size; +if (qm_port->dlb2->version ==DLB2_HW_V2 ) { + qm_port->cached_dir_credits += num; +if (qm_port->cached_dir_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_DIR_QUEUE ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_dir_credits -= batch_size; + } + }else { + qm_port->cached_credits += num; +if (qm_port->cached_credits >=2 * batch_size) { +__atomic_fetch_add ( + qm_port->credit_pool[DLB2_COMBINED_POOL ], + batch_size, __ATOMIC_SEQ_CST); + qm_port->cached_credits -= batch_size; + } } } }
Signature · 1 line
2.23.0
PATCH v5 16/26 event/dlb2: add v2.5 queue depth functions
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level hardware functions responsible for getting the queue depth. The command arguments are also validated.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 160 ------------------ .../event/dlb2/pf/base/dlb2_resource_new.c | 135 +++++++++++++++ 2 files changed, 135 insertions(+), 160 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -160
@@ -65,17 +65,6 @@ static inline void dlb2_flush_csr(struct dlb2_hw *hw)DLB2_CSR_RD (hw,DLB2_SYS_TOTAL_VAS ); } -static u32 dlb2_dir_queue_depth (struct dlb2_hw *hw, -struct dlb2_dir_pq_pair *queue) -{ -union dlb2_lsp_qid_dir_enqueue_cnt r0; - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_DIR_ENQUEUE_CNT (queue->id.phys_id)); - -return r0.field.count; -} -static void dlb2_ldb_port_cq_enable (struct dlb2_hw *hw,struct dlb2_ldb_port *port) {
@@ -108,24 +97,6 @@ static void dlb2_ldb_port_cq_disable(struct dlb2_hw *hw,dlb2_flush_csr (hw); } -static u32 dlb2_ldb_queue_depth (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue) -{ -union dlb2_lsp_qid_aqed_active_cnt r0; -union dlb2_lsp_qid_atm_active r1; -union dlb2_lsp_qid_ldb_enqueue_cnt r2; - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_AQED_ACTIVE_CNT (queue->id.phys_id)); - r1.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_ATM_ACTIVE (queue->id.phys_id)); - - r2.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_ENQUEUE_CNT (queue->id.phys_id)); - -return r0.field.count + r1.field.count + r2.field.count; -} -static struct dlb2_ldb_queue * dlb2_get_ldb_queue_from_id(struct dlb2_hw *hw, u32 id,
@@ -1204,134 +1175,3 @@ int dlb2_set_group_sequence_numbers(struct dlb2_hw *hw,return 0 ; } -static struct dlb2_dir_pq_pair * -dlb2_get_domain_used_dir_pq (struct dlb2_hw *hw, -u32 id, -bool vdev_req, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_dir_pq_pair *port; -RTE_SET_USED (iter); - -if (id >=DLB2_MAX_NUM_DIR_PORTS (hw->ver)) -return NULL ; - - DLB2_DOM_LIST_FOR(domain->used_dir_pq_pairs, port, iter) -if ((!vdev_req && port->id.phys_id == id) || - (vdev_req && port->id.virt_id == id)) -return port; - -return NULL ; -} - -static struct dlb2_ldb_queue * -dlb2_get_domain_ldb_queue (u32 id, -bool vdev_req, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_queue *queue; -RTE_SET_USED (iter); - -if (id >=DLB2_MAX_NUM_LDB_QUEUES ) -return NULL ; - - DLB2_DOM_LIST_FOR(domain->used_ldb_queues, queue, iter) -if ((!vdev_req && queue->id.phys_id == id) || - (vdev_req && queue->id.virt_id == id)) -return queue; - -return NULL ; -} - -static void dlb2_log_get_dir_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -u32 queue_id, -bool vdev_req, -unsigned int vf_id) -{ -DLB2_HW_DBG (hw,"DLB get directed queue depth:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from VF %d)\n" , vf_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , queue_id); -} - -int dlb2_hw_get_dir_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_get_dir_queue_depth_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_dir_pq_pair *queue; -struct dlb2_hw_domain *domain; -int id; - - id = domain_id; - -dlb2_log_get_dir_queue_depth (hw, domain_id, args->queue_id, - vdev_req, vdev_id); - - domain =dlb2_get_domain_from_id (hw, id, vdev_req, vdev_id); -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - - id = args->queue_id; - - queue =dlb2_get_domain_used_dir_pq (hw, id, vdev_req, domain); -if (queue ==NULL ) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - - resp->id =dlb2_dir_queue_depth (hw, queue); - -return 0 ; -} - -static void dlb2_log_get_ldb_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -u32 queue_id, -bool vdev_req, -unsigned int vf_id) -{ -DLB2_HW_DBG (hw,"DLB get load-balanced queue depth:\n" ); -if (vdev_req) -DLB2_HW_DBG (hw,"(Request from VF %d)\n" , vf_id); -DLB2_HW_DBG (hw,"\tDomain ID: %d\n" , domain_id); -DLB2_HW_DBG (hw,"\tQueue ID: %d\n" , queue_id); -} - -int dlb2_hw_get_ldb_queue_depth (struct dlb2_hw *hw, -u32 domain_id, -struct dlb2_get_ldb_queue_depth_args *args, -struct dlb2_cmd_response *resp, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; - -dlb2_log_get_ldb_queue_depth (hw, domain_id, args->queue_id, - vdev_req, vdev_id); - - domain =dlb2_get_domain_from_id (hw, domain_id, vdev_req, vdev_id); -if (domain ==NULL ) { - resp->status =DLB2_ST_INVALID_DOMAIN_ID ; -return -EINVAL ; - } - - queue =dlb2_get_domain_ldb_queue (args->queue_id, vdev_req, domain); -if (queue ==NULL ) { - resp->status =DLB2_ST_INVALID_QID ; -return -EINVAL ; - } - - resp->id =dlb2_ldb_queue_depth (hw, queue); - -return 0 ; -}
drivers/event/dlb2/pf/base/dlb2_resource_new.c +135 -0
138 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 17/26 event/dlb2: add v2.5 finish map/unmap
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for finishing the queue map/unmap operation, which is an asynchronous operation.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 1054 ----------------- .../event/dlb2/pf/base/dlb2_resource_new.c | 50 + 2 files changed, 50 insertions(+), 1054 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -1054
@@ -54,1060 +54,6 @@ void dlb2_hw_enable_sparse_ldb_cq_mode(struct dlb2_hw *hw)DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , r0.val); } -/* -* The PF driver cannot assume that a register write will affect subsequent HCW -* writes. To ensure a write completes, the driver must read back a CSR. This -* function only need be called for configuration that can occur after the -* domain has started; prior to starting, applications can't send HCWs. -*/ -static inline void dlb2_flush_csr (struct dlb2_hw *hw) -{ -DLB2_CSR_RD (hw,DLB2_SYS_TOTAL_VAS ); -} - -static void dlb2_ldb_port_cq_enable (struct dlb2_hw *hw, -struct dlb2_ldb_port *port) -{ -union dlb2_lsp_cq_ldb_dsbl reg; - -/* -* Don't re-enable the port if a removal is pending. The caller should -* mark this port as enabled (if it isn't already), and when the -* removal completes the port will be enabled. -*/ -if (port->num_pending_removals) -return ; - - reg.field.disabled =0 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_LDB_DSBL (port->id.phys_id), reg.val); - -dlb2_flush_csr (hw); -} - -static void dlb2_ldb_port_cq_disable (struct dlb2_hw *hw, -struct dlb2_ldb_port *port) -{ -union dlb2_lsp_cq_ldb_dsbl reg; - - reg.field.disabled =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ_LDB_DSBL (port->id.phys_id), reg.val); - -dlb2_flush_csr (hw); -} - -static struct dlb2_ldb_queue * -dlb2_get_ldb_queue_from_id (struct dlb2_hw *hw, -u32 id, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_list_entry *iter1; -struct dlb2_list_entry *iter2; -struct dlb2_function_resources *rsrcs; -struct dlb2_hw_domain *domain; -struct dlb2_ldb_queue *queue; -RTE_SET_USED (iter1); -RTE_SET_USED (iter2); - -if (id >=DLB2_MAX_NUM_LDB_QUEUES ) -return NULL ; - - rsrcs = (vdev_req) ? &hw->vdev[vdev_id] : &hw->pf; - -if (!vdev_req) -return &hw->rsrcs.ldb_queues[id]; - - DLB2_FUNC_LIST_FOR(rsrcs->used_domains, domain, iter1) { - DLB2_DOM_LIST_FOR(domain->used_ldb_queues, queue, iter2) -if (queue->id.virt_id == id) -return queue; - } - - DLB2_FUNC_LIST_FOR(rsrcs->avail_ldb_queues, queue, iter1) -if (queue->id.virt_id == id) -return queue; - -return NULL ; -} - -static struct dlb2_hw_domain *dlb2_get_domain_from_id (struct dlb2_hw *hw, -u32 id, -bool vdev_req, -unsigned int vdev_id) -{ -struct dlb2_list_entry *iteration; -struct dlb2_function_resources *rsrcs; -struct dlb2_hw_domain *domain; -RTE_SET_USED (iteration); - -if (id >=DLB2_MAX_NUM_DOMAINS ) -return NULL ; - -if (!vdev_req) -return &hw->domains[id]; - - rsrcs = &hw->vdev[vdev_id]; - - DLB2_FUNC_LIST_FOR(rsrcs->used_domains, domain, iteration) -if (domain->id.virt_id == id) -return domain; - -return NULL ; -} - -static int dlb2_port_slot_state_transition (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -int slot, -enum dlb2_qid_map_state new_state) -{ -enum dlb2_qid_map_state curr_state = port->qid_map[slot].state; -struct dlb2_hw_domain *domain; -int domain_id; - - domain_id = port->domain_id.phys_id; - - domain =dlb2_get_domain_from_id (hw, domain_id, false,0 ); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: unable to find domain %d\n" , - __func__, domain_id); -return -EINVAL ; - } - -switch (curr_state) { -case DLB2_QUEUE_UNMAPPED : -switch (new_state) { -case DLB2_QUEUE_MAPPED : - queue->num_mappings++; - port->num_mappings++; -break ; -case DLB2_QUEUE_MAP_IN_PROG : - queue->num_pending_additions++; - domain->num_pending_additions++; -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_MAPPED : -switch (new_state) { -case DLB2_QUEUE_UNMAPPED : - queue->num_mappings--; - port->num_mappings--; -break ; -case DLB2_QUEUE_UNMAP_IN_PROG : - port->num_pending_removals++; - domain->num_pending_removals++; -break ; -case DLB2_QUEUE_MAPPED : -/* Priority change, nothing to update */ -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_MAP_IN_PROG : -switch (new_state) { -case DLB2_QUEUE_UNMAPPED : - queue->num_pending_additions--; - domain->num_pending_additions--; -break ; -case DLB2_QUEUE_MAPPED : - queue->num_mappings++; - port->num_mappings++; - queue->num_pending_additions--; - domain->num_pending_additions--; -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_UNMAP_IN_PROG : -switch (new_state) { -case DLB2_QUEUE_UNMAPPED : - port->num_pending_removals--; - domain->num_pending_removals--; - queue->num_mappings--; - port->num_mappings--; -break ; -case DLB2_QUEUE_MAPPED : - port->num_pending_removals--; - domain->num_pending_removals--; -break ; -case DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP : -/* Nothing to update */ -break ; -default : - goto error; - } -break ; -case DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP : -switch (new_state) { -case DLB2_QUEUE_UNMAP_IN_PROG : -/* Nothing to update */ -break ; -case DLB2_QUEUE_UNMAPPED : -/* -* An UNMAP_IN_PROG_PENDING_MAP slot briefly -* becomes UNMAPPED before it transitions to -* MAP_IN_PROG. -*/ - queue->num_mappings--; - port->num_mappings--; - port->num_pending_removals--; - domain->num_pending_removals--; -break ; -default : - goto error; - } -break ; -default : - goto error; - } - - port->qid_map[slot].state = new_state; - -DLB2_HW_DBG (hw, -"[%s()] queue %d -> port %d state transition (%d -> %d)\n" , - __func__, queue->id.phys_id, port->id.phys_id, - curr_state, new_state); -return 0 ; - -error: -DLB2_HW_ERR (hw, -"[%s()] Internal error: invalid queue %d -> port %d state transition (%d -> %d)\n" , - __func__, queue->id.phys_id, port->id.phys_id, - curr_state, new_state); -return -EFAULT ; -} - -static bool dlb2_port_find_slot (struct dlb2_ldb_port *port, -enum dlb2_qid_map_state state, -int *slot) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -if (port->qid_map[i].state == state) -break ; - } - - *slot = i; - -return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); -} - -static bool dlb2_port_find_slot_queue (struct dlb2_ldb_port *port, -enum dlb2_qid_map_state state, -struct dlb2_ldb_queue *queue, -int *slot) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -if (port->qid_map[i].state == state && - port->qid_map[i].qid == queue->id.phys_id) -break ; - } - - *slot = i; - -return (i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ); -} - -/* -* dlb2_ldb_queue_{enable, disable}_mapped_cqs() don't operate exactly as -* their function names imply, and should only be called by the dynamic CQ -* mapping code. -*/ -static void dlb2_ldb_queue_disable_mapped_cqs (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int slot, i; -RTE_SET_USED (iter); - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) { -enum dlb2_qid_map_state state =DLB2_QUEUE_MAPPED ; - -if (!dlb2_port_find_slot_queue (port, state, - queue, &slot)) -continue ; - -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - } - } -} - -static void dlb2_ldb_queue_enable_mapped_cqs (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_queue *queue) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int slot, i; -RTE_SET_USED (iter); - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) { -enum dlb2_qid_map_state state =DLB2_QUEUE_MAPPED ; - -if (!dlb2_port_find_slot_queue (port, state, - queue, &slot)) -continue ; - -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - } - } -} - -static void dlb2_ldb_port_clear_queue_if_status (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -int slot) -{ -union dlb2_lsp_ldb_sched_ctrl r0 = { {0 } }; - - r0.field.cq = port->id.phys_id; - r0.field.qidix = slot; - r0.field.value =0 ; - r0.field.inflight_ok_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r0.val); - -dlb2_flush_csr (hw); -} - -static void dlb2_ldb_port_set_queue_if_status (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -int slot) -{ -union dlb2_lsp_ldb_sched_ctrl r0 = { {0 } }; - - r0.field.cq = port->id.phys_id; - r0.field.qidix = slot; - r0.field.value =1 ; - r0.field.inflight_ok_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r0.val); - -dlb2_flush_csr (hw); -} - -static int dlb2_ldb_port_map_qid_static (struct dlb2_hw *hw, -struct dlb2_ldb_port *p, -struct dlb2_ldb_queue *q, -u8 priority) -{ -union dlb2_lsp_cq2priov r0; -union dlb2_lsp_cq2qid0 r1; -union dlb2_atm_qid2cqidix_00 r2; -union dlb2_lsp_qid2cqidix_00 r3; -union dlb2_lsp_qid2cqidix2_00 r4; -enum dlb2_qid_map_state state; -int i; - -/* Look for a pending or already mapped slot, else an unused slot */ -if (!dlb2_port_find_slot_queue (p,DLB2_QUEUE_MAP_IN_PROG , q, &i) && - !dlb2_port_find_slot_queue (p,DLB2_QUEUE_MAPPED , q, &i) && - !dlb2_port_find_slot (p,DLB2_QUEUE_UNMAPPED , &i)) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: CQ has no available QID mapping slots\n" , - __func__, __LINE__); -return -EFAULT ; - } - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - -/* Read-modify-write the priority and valid bit register */ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2PRIOV (p->id.phys_id)); - - r0.field.v |=1 << i; - r0.field.prio |= (priority &0x7 ) << i *3 ; - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (p->id.phys_id), r0.val); - -/* Read-modify-write the QID map register */ -if (i <4 ) - r1.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2QID0 (p->id.phys_id)); -else - r1.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2QID1 (p->id.phys_id)); - -if (i ==0 || i ==4 ) - r1.field.qid_p0 = q->id.phys_id; -if (i ==1 || i ==5 ) - r1.field.qid_p1 = q->id.phys_id; -if (i ==2 || i ==6 ) - r1.field.qid_p2 = q->id.phys_id; -if (i ==3 || i ==7 ) - r1.field.qid_p3 = q->id.phys_id; - -if (i <4 ) -DLB2_CSR_WR (hw,DLB2_LSP_CQ2QID0 (p->id.phys_id), r1.val); -else -DLB2_CSR_WR (hw,DLB2_LSP_CQ2QID1 (p->id.phys_id), r1.val); - - r2.val =DLB2_CSR_RD (hw, -DLB2_ATM_QID2CQIDIX (q->id.phys_id, - p->id.phys_id /4 )); - - r3.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX (q->id.phys_id, - p->id.phys_id /4 )); - - r4.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX2 (q->id.phys_id, - p->id.phys_id /4 )); - -switch (p->id.phys_id %4 ) { -case 0 : - r2.field.cq_p0 |=1 << i; - r3.field.cq_p0 |=1 << i; - r4.field.cq_p0 |=1 << i; -break ; - -case 1 : - r2.field.cq_p1 |=1 << i; - r3.field.cq_p1 |=1 << i; - r4.field.cq_p1 |=1 << i; -break ; - -case 2 : - r2.field.cq_p2 |=1 << i; - r3.field.cq_p2 |=1 << i; - r4.field.cq_p2 |=1 << i; -break ; - -case 3 : - r2.field.cq_p3 |=1 << i; - r3.field.cq_p3 |=1 << i; - r4.field.cq_p3 |=1 << i; -break ; - } - -DLB2_CSR_WR (hw, -DLB2_ATM_QID2CQIDIX (q->id.phys_id, p->id.phys_id /4 ), - r2.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX (q->id.phys_id, p->id.phys_id /4 ), - r3.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX2 (q->id.phys_id, p->id.phys_id /4 ), - r4.val); - -dlb2_flush_csr (hw); - - p->qid_map[i].qid = q->id.phys_id; - p->qid_map[i].priority = priority; - - state =DLB2_QUEUE_MAPPED ; - -return dlb2_port_slot_state_transition (hw, p, q, i, state); -} - -static int dlb2_ldb_port_set_has_work_bits (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -int slot) -{ -union dlb2_lsp_qid_aqed_active_cnt r0; -union dlb2_lsp_qid_ldb_enqueue_cnt r1; -union dlb2_lsp_ldb_sched_ctrl r2 = { {0 } }; - -/* Set the atomic scheduling haswork bit */ - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_AQED_ACTIVE_CNT (queue->id.phys_id)); - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =1 ; - r2.field.rlist_haswork_v = r0.field.count >0 ; - -/* Set the non-atomic scheduling haswork bit */ -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - - r1.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_ENQUEUE_CNT (queue->id.phys_id)); - -memset (&r2,0 ,sizeof (r2)); - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =1 ; - r2.field.nalb_haswork_v = (r1.field.count >0 ); - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - -dlb2_flush_csr (hw); - -return 0 ; -} - -static void dlb2_ldb_port_clear_has_work_bits (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -u8 slot) -{ -union dlb2_lsp_ldb_sched_ctrl r2 = { {0 } }; - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =0 ; - r2.field.rlist_haswork_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - -memset (&r2,0 ,sizeof (r2)); - - r2.field.cq = port->id.phys_id; - r2.field.qidix = slot; - r2.field.value =0 ; - r2.field.nalb_haswork_v =1 ; - -DLB2_CSR_WR (hw,DLB2_LSP_LDB_SCHED_CTRL , r2.val); - -dlb2_flush_csr (hw); -} - -static void dlb2_ldb_queue_set_inflight_limit (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue) -{ -union dlb2_lsp_qid_ldb_infl_lim r0 = { {0 } }; - - r0.field.limit = queue->num_qid_inflights; - -DLB2_CSR_WR (hw,DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id), r0.val); -} - -static void dlb2_ldb_queue_clear_inflight_limit (struct dlb2_hw *hw, -struct dlb2_ldb_queue *queue) -{ -DLB2_CSR_WR (hw, -DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id), -DLB2_LSP_QID_LDB_INFL_LIM_RST ); -} - -static int dlb2_ldb_port_finish_map_qid_dynamic (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue) -{ -struct dlb2_list_entry *iter; -union dlb2_lsp_qid_ldb_infl_cnt r0; -enum dlb2_qid_map_state state; -int slot, ret, i; -u8 prio; -RTE_SET_USED (iter); - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_INFL_CNT (queue->id.phys_id)); - -if (r0.field.count) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: non-zero QID inflight count\n" , - __func__); -return -EINVAL ; - } - -/* -* Static map the port and set its corresponding has_work bits. -*/ - state =DLB2_QUEUE_MAP_IN_PROG ; -if (!dlb2_port_find_slot_queue (port, state, queue, &slot)) -return -EINVAL ; - -if (slot >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - prio = port->qid_map[slot].priority; - -/* -* Update the CQ2QID, CQ2PRIOV, and QID2CQIDX registers, and -* the port's qid_map state. -*/ - ret =dlb2_ldb_port_map_qid_static (hw, port, queue, prio); -if (ret) -return ret; - - ret =dlb2_ldb_port_set_has_work_bits (hw, port, queue, slot); -if (ret) -return ret; - -/* -* Ensure IF_status(cq,qid) is 0 before enabling the port to -* prevent spurious schedules to cause the queue's inflight -* count to increase. -*/ -dlb2_ldb_port_clear_queue_if_status (hw, port, slot); - -/* Reset the queue's inflight status */ -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) { - state =DLB2_QUEUE_MAPPED ; -if (!dlb2_port_find_slot_queue (port, state, - queue, &slot)) -continue ; - -dlb2_ldb_port_set_queue_if_status (hw, port, slot); - } - } - -dlb2_ldb_queue_set_inflight_limit (hw, queue); - -/* Re-enable CQs mapped to this queue */ -dlb2_ldb_queue_enable_mapped_cqs (hw, domain, queue); - -/* If this queue has other mappings pending, clear its inflight limit */ -if (queue->num_pending_additions >0 ) -dlb2_ldb_queue_clear_inflight_limit (hw, queue); - -return 0 ; -} - -/** -* dlb2_ldb_port_map_qid_dynamic() - perform a "dynamic" QID->CQ mapping -* @hw: dlb2_hw handle for a particular device. -* @port: load-balanced port -* @queue: load-balanced queue -* @priority: queue servicing priority -* -* Returns 0 if the queue was mapped, 1 if the mapping is scheduled to occur -* at a later point, and <0 if an error occurred. -*/ -static int dlb2_ldb_port_map_qid_dynamic (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -u8 priority) -{ -union dlb2_lsp_qid_ldb_infl_cnt r0 = { {0 } }; -enum dlb2_qid_map_state state; -struct dlb2_hw_domain *domain; -int domain_id, slot, ret; - - domain_id = port->domain_id.phys_id; - - domain =dlb2_get_domain_from_id (hw, domain_id, false,0 ); -if (domain ==NULL ) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: unable to find domain %d\n" , - __func__, port->domain_id.phys_id); -return -EINVAL ; - } - -/* -* Set the QID inflight limit to 0 to prevent further scheduling of the -* queue. -*/ -DLB2_CSR_WR (hw,DLB2_LSP_QID_LDB_INFL_LIM (queue->id.phys_id),0 ); - -if (!dlb2_port_find_slot (port,DLB2_QUEUE_UNMAPPED , &slot)) { -DLB2_HW_ERR (hw, -"Internal error: No available unmapped slots\n" ); -return -EFAULT ; - } - -if (slot >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port->qid_map[slot].qid = queue->id.phys_id; - port->qid_map[slot].priority = priority; - - state =DLB2_QUEUE_MAP_IN_PROG ; - ret =dlb2_port_slot_state_transition (hw, port, queue, slot, state); -if (ret) -return ret; - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_INFL_CNT (queue->id.phys_id)); - -if (r0.field.count) { -/* -* The queue is owed completions so it's not safe to map it -* yet. Schedule a kernel thread to complete the mapping later, -* once software has completed all the queue's inflight events. -*/ -if (!os_worker_active (hw)) -os_schedule_work (hw); - -return 1 ; - } - -/* -* Disable the affected CQ, and the CQs already mapped to the QID, -* before reading the QID's inflight count a second time. There is an -* unlikely race in which the QID may schedule one more QE after we -* read an inflight count of 0, and disabling the CQs guarantees that -* the race will not occur after a re-read of the inflight count -* register. -*/ -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - -dlb2_ldb_queue_disable_mapped_cqs (hw, domain, queue); - - r0.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID_LDB_INFL_CNT (queue->id.phys_id)); - -if (r0.field.count) { -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - -dlb2_ldb_queue_enable_mapped_cqs (hw, domain, queue); - -/* -* The queue is owed completions so it's not safe to map it -* yet. Schedule a kernel thread to complete the mapping later, -* once software has completed all the queue's inflight events. -*/ -if (!os_worker_active (hw)) -os_schedule_work (hw); - -return 1 ; - } - -return dlb2_ldb_port_finish_map_qid_dynamic (hw, domain, port, queue); -} - -static void dlb2_domain_finish_map_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port) -{ -int i; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -union dlb2_lsp_qid_ldb_infl_cnt r0; -struct dlb2_ldb_queue *queue; -int qid; - -if (port->qid_map[i].state !=DLB2_QUEUE_MAP_IN_PROG ) -continue ; - - qid = port->qid_map[i].qid; - - queue =dlb2_get_ldb_queue_from_id (hw, qid, false,0 ); - -if (queue ==NULL ) { -DLB2_HW_ERR (hw, -"[%s()] Internal error: unable to find queue %d\n" , - __func__, qid); -continue ; - } - - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_QID_LDB_INFL_CNT (qid)); - -if (r0.field.count) -continue ; - -/* -* Disable the affected CQ, and the CQs already mapped to the -* QID, before reading the QID's inflight count a second time. -* There is an unlikely race in which the QID may schedule one -* more QE after we read an inflight count of 0, and disabling -* the CQs guarantees that the race will not occur after a -* re-read of the inflight count register. -*/ -if (port->enabled) -dlb2_ldb_port_cq_disable (hw, port); - -dlb2_ldb_queue_disable_mapped_cqs (hw, domain, queue); - - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_QID_LDB_INFL_CNT (qid)); - -if (r0.field.count) { -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - -dlb2_ldb_queue_enable_mapped_cqs (hw, domain, queue); - -continue ; - } - -dlb2_ldb_port_finish_map_qid_dynamic (hw, domain, port, queue); - } -} - -static unsigned int -dlb2_domain_finish_map_qid_procedures (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int i; -RTE_SET_USED (iter); - -if (!domain->configured || domain->num_pending_additions ==0 ) -return 0 ; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) -dlb2_domain_finish_map_port (hw, domain, port); - } - -return domain->num_pending_additions; -} - -static int dlb2_ldb_port_unmap_qid (struct dlb2_hw *hw, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue) -{ -enum dlb2_qid_map_state mapped, in_progress, pending_map, unmapped; -union dlb2_lsp_cq2priov r0; -union dlb2_atm_qid2cqidix_00 r1; -union dlb2_lsp_qid2cqidix_00 r2; -union dlb2_lsp_qid2cqidix2_00 r3; -u32 queue_id; -u32 port_id; -int i; - -/* Find the queue's slot */ - mapped =DLB2_QUEUE_MAPPED ; - in_progress =DLB2_QUEUE_UNMAP_IN_PROG ; - pending_map =DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ; - -if (!dlb2_port_find_slot_queue (port, mapped, queue, &i) && - !dlb2_port_find_slot_queue (port, in_progress, queue, &i) && - !dlb2_port_find_slot_queue (port, pending_map, queue, &i)) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: QID %d isn't mapped\n" , - __func__, __LINE__, queue->id.phys_id); -return -EFAULT ; - } - -if (i >=DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_HW_ERR (hw, -"[%s():%d] Internal error: port slot tracking failed\n" , - __func__, __LINE__); -return -EFAULT ; - } - - port_id = port->id.phys_id; - queue_id = queue->id.phys_id; - -/* Read-modify-write the priority and valid bit register */ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ2PRIOV (port_id)); - - r0.field.v &= ~(1 << i); - -DLB2_CSR_WR (hw,DLB2_LSP_CQ2PRIOV (port_id), r0.val); - - r1.val =DLB2_CSR_RD (hw, -DLB2_ATM_QID2CQIDIX (queue_id, port_id /4 )); - - r2.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX (queue_id, port_id /4 )); - - r3.val =DLB2_CSR_RD (hw, -DLB2_LSP_QID2CQIDIX2 (queue_id, port_id /4 )); - -switch (port_id %4 ) { -case 0 : - r1.field.cq_p0 &= ~(1 << i); - r2.field.cq_p0 &= ~(1 << i); - r3.field.cq_p0 &= ~(1 << i); -break ; - -case 1 : - r1.field.cq_p1 &= ~(1 << i); - r2.field.cq_p1 &= ~(1 << i); - r3.field.cq_p1 &= ~(1 << i); -break ; - -case 2 : - r1.field.cq_p2 &= ~(1 << i); - r2.field.cq_p2 &= ~(1 << i); - r3.field.cq_p2 &= ~(1 << i); -break ; - -case 3 : - r1.field.cq_p3 &= ~(1 << i); - r2.field.cq_p3 &= ~(1 << i); - r3.field.cq_p3 &= ~(1 << i); -break ; - } - -DLB2_CSR_WR (hw, -DLB2_ATM_QID2CQIDIX (queue_id, port_id /4 ), - r1.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX (queue_id, port_id /4 ), - r2.val); - -DLB2_CSR_WR (hw, -DLB2_LSP_QID2CQIDIX2 (queue_id, port_id /4 ), - r3.val); - -dlb2_flush_csr (hw); - - unmapped =DLB2_QUEUE_UNMAPPED ; - -return dlb2_port_slot_state_transition (hw, port, queue, i, unmapped); -} - -static int dlb2_ldb_port_map_qid (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -struct dlb2_ldb_queue *queue, -u8 prio) -{ -if (domain->started) -return dlb2_ldb_port_map_qid_dynamic (hw, port, queue, prio); -else -return dlb2_ldb_port_map_qid_static (hw, port, queue, prio); -} - -static void -dlb2_domain_finish_unmap_port_slot (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port, -int slot) -{ -enum dlb2_qid_map_state state; -struct dlb2_ldb_queue *queue; - - queue = &hw->rsrcs.ldb_queues[port->qid_map[slot].qid]; - - state = port->qid_map[slot].state; - -/* Update the QID2CQIDX and CQ2QID vectors */ -dlb2_ldb_port_unmap_qid (hw, port, queue); - -/* -* Ensure the QID will not be serviced by this {CQ, slot} by clearing -* the has_work bits -*/ -dlb2_ldb_port_clear_has_work_bits (hw, port, slot); - -/* Reset the {CQ, slot} to its default state */ -dlb2_ldb_port_set_queue_if_status (hw, port, slot); - -/* Re-enable the CQ if it wasn't manually disabled by the user */ -if (port->enabled) -dlb2_ldb_port_cq_enable (hw, port); - -/* -* If there is a mapping that is pending this slot's removal, perform -* the mapping now. -*/ -if (state ==DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ) { -struct dlb2_ldb_port_qid_map *map; -struct dlb2_ldb_queue *map_queue; -u8 prio; - - map = &port->qid_map[slot]; - - map->qid = map->pending_qid; - map->priority = map->pending_priority; - - map_queue = &hw->rsrcs.ldb_queues[map->qid]; - prio = map->priority; - -dlb2_ldb_port_map_qid (hw, domain, port, map_queue, prio); - } -} - -static bool dlb2_domain_finish_unmap_port (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain, -struct dlb2_ldb_port *port) -{ -union dlb2_lsp_cq_ldb_infl_cnt r0; -int i; - -if (port->num_pending_removals ==0 ) -return false; - -/* -* The unmap requires all the CQ's outstanding inflights to be -* completed. -*/ - r0.val =DLB2_CSR_RD (hw,DLB2_LSP_CQ_LDB_INFL_CNT (port->id.phys_id)); -if (r0.field.count >0 ) -return false; - -for (i =0 ; i <DLB2_MAX_NUM_QIDS_PER_LDB_CQ ; i++) { -struct dlb2_ldb_port_qid_map *map; - - map = &port->qid_map[i]; - -if (map->state !=DLB2_QUEUE_UNMAP_IN_PROG && - map->state !=DLB2_QUEUE_UNMAP_IN_PROG_PENDING_MAP ) -continue ; - -dlb2_domain_finish_unmap_port_slot (hw, domain, port, i); - } - -return true; -} - -static unsigned int -dlb2_domain_finish_unmap_qid_procedures (struct dlb2_hw *hw, -struct dlb2_hw_domain *domain) -{ -struct dlb2_list_entry *iter; -struct dlb2_ldb_port *port; -int i; -RTE_SET_USED (iter); - -if (!domain->configured || domain->num_pending_removals ==0 ) -return 0 ; - -for (i =0 ; i <DLB2_NUM_COS_DOMAINS ; i++) { - DLB2_DOM_LIST_FOR(domain->used_ldb_ports[i], port, iter) -dlb2_domain_finish_unmap_port (hw, domain, port); - } - -return domain->num_pending_removals; -} - -unsigned int dlb2_finish_unmap_qid_procedures (struct dlb2_hw *hw) -{ -int i, num =0 ; - -/* Finish queue unmap jobs for any domain that needs it */ -for (i =0 ; i <DLB2_MAX_NUM_DOMAINS ; i++) { -struct dlb2_hw_domain *domain = &hw->domains[i]; - - num +=dlb2_domain_finish_unmap_qid_procedures (hw, domain); - } - -return num; -} - -unsigned int dlb2_finish_map_qid_procedures (struct dlb2_hw *hw) -{ -int i, num =0 ; - -/* Finish queue map jobs for any domain that needs it */ -for (i =0 ; i <DLB2_MAX_NUM_DOMAINS ; i++) { -struct dlb2_hw_domain *domain = &hw->domains[i]; - - num +=dlb2_domain_finish_map_qid_procedures (hw, domain); - } - -return num; -} -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) {if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS )
drivers/event/dlb2/pf/base/dlb2_resource_new.c +50 -0
53 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH v5 18/26 event/dlb2: add v2.5 sparse cq mode
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions responsible for configuring sparse CQ mode, where each cache line contains just one QE instead of 4.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 22 ----------- .../event/dlb2/pf/base/dlb2_resource_new.c | 39 +++++++++++++++++++ 2 files changed, 39 insertions(+), 22 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -22
@@ -32,28 +32,6 @@#define DLB2_FUNC_LIST_FOR_SAFE (head, ptr, ptr_tmp, it, it_tmp) \ DLB2_LIST_FOR_EACH_SAFE((head), ptr, ptr_tmp, func_list, it, it_tmp) -void dlb2_hw_enable_sparse_dir_cq_mode (struct dlb2_hw *hw) -{ -union dlb2_chp_cfg_chp_csr_ctrl r0; - - r0.val =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); - - r0.field.cfg_64bytes_qe_dir_cq_mode =1 ; - -DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , r0.val); -} - -void dlb2_hw_enable_sparse_ldb_cq_mode (struct dlb2_hw *hw) -{ -union dlb2_chp_cfg_chp_csr_ctrl r0; - - r0.val =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); - - r0.field.cfg_64bytes_qe_ldb_cq_mode =1 ; - -DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , r0.val); -} -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) {if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS )
drivers/event/dlb2/pf/base/dlb2_resource_new.c +39 -0
@@ -6089,3 +6089,42 @@ unsigned int dlb2_finish_map_qid_procedures(struct dlb2_hw *hw)return num; } + +/** +* dlb2_hw_enable_sparse_dir_cq_mode() - enable sparse mode for directed ports. +* @hw: dlb2_hw handle for a particular device. +* +* This function must be called prior to configuring scheduling domains. +*/ + +void dlb2_hw_enable_sparse_dir_cq_mode (struct dlb2_hw *hw) +{ +u32 ctrl; + + ctrl =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); + +DLB2_BIT_SET (ctrl, +DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_DIR_CQ_MODE ); + +DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , ctrl); +} + +/** +* dlb2_hw_enable_sparse_ldb_cq_mode() - enable sparse mode for load-balanced +* ports. +* @hw: dlb2_hw handle for a particular device. +* +* This function must be called prior to configuring scheduling domains. +*/ +void dlb2_hw_enable_sparse_ldb_cq_mode (struct dlb2_hw *hw) +{ +u32 ctrl; + + ctrl =DLB2_CSR_RD (hw,DLB2_CHP_CFG_CHP_CSR_CTRL ); + +DLB2_BIT_SET (ctrl, +DLB2_CHP_CFG_CHP_CSR_CTRL_CFG_64BYTES_QE_LDB_CQ_MODE ); + +DLB2_CSR_WR (hw,DLB2_CHP_CFG_CHP_CSR_CTRL , ctrl); +} +
Signature · 1 line
2.23.0
PATCH v5 19/26 event/dlb2: add v2.5 sequence number management
In reply to McDaniel, TimothyFrom: Timothy McDaniel <[email protected]>
Update the low level HW functions that perform the sequence number management functions. These include getting a groups number of sequence numbers per queue, managing in-use slots, getting the current occupancy, and setting sequence numbers for a group.
The logic is very similar to what was done for v2.0, but the new combined register map for v2.0 and v2.5 uses new register names and bit names. Additionally, new register access macros are used so that the code can perform the correct action, based on the hardware.
--- drivers/event/dlb2/pf/base/dlb2_resource.c | 67 ----------- drivers/event/dlb2/pf/base/dlb2_resource.h | 4 +- .../event/dlb2/pf/base/dlb2_resource_new.c | 105 ++++++++++++++++++ 3 files changed, 107 insertions(+), 69 deletions(-)
drivers/event/dlb2/pf/base/dlb2_resource.c +0 -67
@@ -32,70 +32,3 @@#define DLB2_FUNC_LIST_FOR_SAFE (head, ptr, ptr_tmp, it, it_tmp) \ DLB2_LIST_FOR_EACH_SAFE((head), ptr, ptr_tmp, func_list, it, it_tmp) -int dlb2_get_group_sequence_numbers (struct dlb2_hw *hw,unsigned int group_id) -{ -if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) -return -EINVAL ; - -return hw->rsrcs.sn_groups[group_id].sequence_numbers_per_queue; -} - -int dlb2_get_group_sequence_number_occupancy (struct dlb2_hw *hw, -unsigned int group_id) -{ -if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) -return -EINVAL ; - -return dlb2_sn_group_used_slots (&hw->rsrcs.sn_groups[group_id]); -} - -static void dlb2_log_set_group_sequence_numbers (struct dlb2_hw *hw, -unsigned int group_id, -unsigned long val) -{ -DLB2_HW_DBG (hw,"DLB2 set group sequence numbers:\n" ); -DLB2_HW_DBG (hw,"\tGroup ID: %u\n" , group_id); -DLB2_HW_DBG (hw,"\tValue: %lu\n" , val); -} - -int dlb2_set_group_sequence_numbers (struct dlb2_hw *hw, -unsigned int group_id, -unsigned long val) -{ -u32 valid_allocations[] = {64 ,128 ,256 ,512 ,1024 }; -union dlb2_ro_pipe_grp_sn_mode r0 = { {0 } }; -struct dlb2_sn_group *group; -int mode; - -if (group_id >=DLB2_MAX_NUM_SEQUENCE_NUMBER_GROUPS ) -return -EINVAL ; - - group = &hw->rsrcs.sn_groups[group_id]; - -/* -* Once the first load-balanced queue using an SN group is configured, -* the group cannot be changed. -*/ -if (group->slot_use_bitmap !=0 ) -return -EPERM ; - -for (mode =0 ; mode <DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES ; mode++) -if (val == valid_allocations[mode]) -break ; - -if (mode ==DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES ) -return -EINVAL ; - - group->mode = mode; - group->sequence_numbers_per_queue = val; - - r0.field.sn_mode_0 = hw->rsrcs.sn_groups[0 ].mode; - r0.field.sn_mode_1 = hw->rsrcs.sn_groups[1 ].mode; - -DLB2_CSR_WR (hw,DLB2_RO_PIPE_GRP_SN_MODE , r0.val); - -dlb2_log_set_group_sequence_numbers (hw, group_id, val); - -return 0 ; -} -
drivers/event/dlb2/pf/base/dlb2_resource.h +2 -2
@@ -792,8 +792,8 @@ int dlb2_get_group_sequence_number_occupancy(struct dlb2_hw *hw,* ordered queue is configured. */ int dlb2_set_group_sequence_numbers (struct dlb2_hw *hw, -unsigned int group_id, -unsigned long val); +u32 group_id, +u32 val);/** * dlb2_reset_domain() - reset a scheduling domain
drivers/event/dlb2/pf/base/dlb2_resource_new.c +105 -0
108 lines not on this page · raw message
Signature · 1 line
2.23.0