Lines Matching refs:trap
83 static void cleanup_traps(struct hfi1_ibport *ibp, struct trap_node *trap) in cleanup_traps() argument
102 if (node != trap) in cleanup_traps()
111 kfree(trap); in cleanup_traps()
115 struct trap_node *trap) in check_and_add_trap() argument
125 queue_id = trap->data.generic_type & 0x0F; in check_and_add_trap()
129 trap->data.generic_type, trap_count); in check_and_add_trap()
130 kfree(trap); in check_and_add_trap()
142 if (node == trap) { in check_and_add_trap()
153 list_add_tail(&trap->list, &trap_list->list); in check_and_add_trap()
156 trap->data.generic_type); in check_and_add_trap()
157 kfree(trap); in check_and_add_trap()
190 struct trap_node *trap; in subn_handle_opa_trap_repress() local
200 trap = list_first_entry_or_null(&trap_list->list, in subn_handle_opa_trap_repress()
202 if (trap && trap->tid == smp->tid) { in subn_handle_opa_trap_repress()
203 if (trap->in_use) { in subn_handle_opa_trap_repress()
204 trap->repress = 1; in subn_handle_opa_trap_repress()
207 list_del(&trap->list); in subn_handle_opa_trap_repress()
208 kfree(trap); in subn_handle_opa_trap_repress()
271 static void send_trap(struct hfi1_ibport *ibp, struct trap_node *trap) in send_trap() argument
282 cleanup_traps(ibp, trap); in send_trap()
288 cleanup_traps(ibp, trap); in send_trap()
293 trap = check_and_add_trap(ibp, trap); in send_trap()
294 if (!trap) in send_trap()
317 if (trap->tid == 0) { in send_trap()
322 trap->tid = cpu_to_be64(ibp->rvp.tid); in send_trap()
324 smp->tid = trap->tid; in send_trap()
329 memcpy(smp->route.lid.data, &trap->data, trap->len); in send_trap()
355 if (trap->repress) { in send_trap()
356 list_del(&trap->list); in send_trap()
358 kfree(trap); in send_trap()
363 trap->in_use = 0; in send_trap()
373 struct trap_node *trap = NULL; in hfi1_handle_trap_timer() local
379 for (i = 0; !trap && i < RVT_MAX_TRAP_LISTS; i++) { in hfi1_handle_trap_timer()
380 trap = list_first_entry_or_null(&ibp->rvp.trap_lists[i].list, in hfi1_handle_trap_timer()
385 if (trap) in hfi1_handle_trap_timer()
386 send_trap(ibp, trap); in hfi1_handle_trap_timer()
391 struct trap_node *trap; in create_trap_node() local
393 trap = kzalloc(sizeof(*trap), GFP_ATOMIC); in create_trap_node()
394 if (!trap) in create_trap_node()
397 INIT_LIST_HEAD(&trap->list); in create_trap_node()
398 trap->data.generic_type = type; in create_trap_node()
399 trap->data.prod_type_lsb = IB_NOTICE_PROD_CA; in create_trap_node()
400 trap->data.trap_num = trap_num; in create_trap_node()
401 trap->data.issuer_lid = cpu_to_be32(lid); in create_trap_node()
403 return trap; in create_trap_node()
412 struct trap_node *trap; in hfi1_bad_pkey() local
418 trap = create_trap_node(IB_NOTICE_TYPE_SECURITY, OPA_TRAP_BAD_P_KEY, in hfi1_bad_pkey()
420 if (!trap) in hfi1_bad_pkey()
424 trap->data.ntc_257_258.lid1 = cpu_to_be32(lid1); in hfi1_bad_pkey()
425 trap->data.ntc_257_258.lid2 = cpu_to_be32(lid2); in hfi1_bad_pkey()
426 trap->data.ntc_257_258.key = cpu_to_be32(key); in hfi1_bad_pkey()
427 trap->data.ntc_257_258.sl = sl << 3; in hfi1_bad_pkey()
428 trap->data.ntc_257_258.qp1 = cpu_to_be32(qp1); in hfi1_bad_pkey()
429 trap->data.ntc_257_258.qp2 = cpu_to_be32(qp2); in hfi1_bad_pkey()
431 trap->len = sizeof(trap->data); in hfi1_bad_pkey()
432 send_trap(ibp, trap); in hfi1_bad_pkey()
441 struct trap_node *trap; in bad_mkey() local
444 trap = create_trap_node(IB_NOTICE_TYPE_SECURITY, OPA_TRAP_BAD_M_KEY, in bad_mkey()
446 if (!trap) in bad_mkey()
450 trap->data.ntc_256.lid = trap->data.issuer_lid; in bad_mkey()
451 trap->data.ntc_256.method = mad->method; in bad_mkey()
452 trap->data.ntc_256.attr_id = mad->attr_id; in bad_mkey()
453 trap->data.ntc_256.attr_mod = mad->attr_mod; in bad_mkey()
454 trap->data.ntc_256.mkey = mkey; in bad_mkey()
456 trap->data.ntc_256.dr_slid = dr_slid; in bad_mkey()
457 trap->data.ntc_256.dr_trunc_hop = IB_NOTICE_TRAP_DR_NOTICE; in bad_mkey()
458 if (hop_cnt > ARRAY_SIZE(trap->data.ntc_256.dr_rtn_path)) { in bad_mkey()
459 trap->data.ntc_256.dr_trunc_hop |= in bad_mkey()
461 hop_cnt = ARRAY_SIZE(trap->data.ntc_256.dr_rtn_path); in bad_mkey()
463 trap->data.ntc_256.dr_trunc_hop |= hop_cnt; in bad_mkey()
464 memcpy(trap->data.ntc_256.dr_rtn_path, return_path, in bad_mkey()
468 trap->len = sizeof(trap->data); in bad_mkey()
470 send_trap(ibp, trap); in bad_mkey()
478 struct trap_node *trap; in hfi1_cap_mask_chg() local
484 trap = create_trap_node(IB_NOTICE_TYPE_INFO, in hfi1_cap_mask_chg()
487 if (!trap) in hfi1_cap_mask_chg()
490 trap->data.ntc_144.lid = trap->data.issuer_lid; in hfi1_cap_mask_chg()
491 trap->data.ntc_144.new_cap_mask = cpu_to_be32(ibp->rvp.port_cap_flags); in hfi1_cap_mask_chg()
492 trap->data.ntc_144.cap_mask3 = cpu_to_be16(ibp->rvp.port_cap3_flags); in hfi1_cap_mask_chg()
494 trap->len = sizeof(trap->data); in hfi1_cap_mask_chg()
495 send_trap(ibp, trap); in hfi1_cap_mask_chg()
503 struct trap_node *trap; in hfi1_sys_guid_chg() local
506 trap = create_trap_node(IB_NOTICE_TYPE_INFO, OPA_TRAP_CHANGE_SYSGUID, in hfi1_sys_guid_chg()
508 if (!trap) in hfi1_sys_guid_chg()
511 trap->data.ntc_145.new_sys_guid = ib_hfi1_sys_image_guid; in hfi1_sys_guid_chg()
512 trap->data.ntc_145.lid = trap->data.issuer_lid; in hfi1_sys_guid_chg()
514 trap->len = sizeof(trap->data); in hfi1_sys_guid_chg()
515 send_trap(ibp, trap); in hfi1_sys_guid_chg()
523 struct trap_node *trap; in hfi1_node_desc_chg() local
526 trap = create_trap_node(IB_NOTICE_TYPE_INFO, in hfi1_node_desc_chg()
529 if (!trap) in hfi1_node_desc_chg()
532 trap->data.ntc_144.lid = trap->data.issuer_lid; in hfi1_node_desc_chg()
533 trap->data.ntc_144.change_flags = in hfi1_node_desc_chg()
536 trap->len = sizeof(trap->data); in hfi1_node_desc_chg()
537 send_trap(ibp, trap); in hfi1_node_desc_chg()