Lines Matching refs:trap
125 static void cleanup_traps(struct hfi1_ibport *ibp, struct trap_node *trap) in cleanup_traps() argument
144 if (node != trap) in cleanup_traps()
153 kfree(trap); in cleanup_traps()
157 struct trap_node *trap) in check_and_add_trap() argument
167 queue_id = trap->data.generic_type & 0x0F; in check_and_add_trap()
171 trap->data.generic_type, trap_count); in check_and_add_trap()
172 kfree(trap); in check_and_add_trap()
184 if (node == trap) { in check_and_add_trap()
195 list_add_tail(&trap->list, &trap_list->list); in check_and_add_trap()
198 trap->data.generic_type); in check_and_add_trap()
199 kfree(trap); in check_and_add_trap()
232 struct trap_node *trap; in subn_handle_opa_trap_repress() local
242 trap = list_first_entry_or_null(&trap_list->list, in subn_handle_opa_trap_repress()
244 if (trap && trap->tid == smp->tid) { in subn_handle_opa_trap_repress()
245 if (trap->in_use) { in subn_handle_opa_trap_repress()
246 trap->repress = 1; in subn_handle_opa_trap_repress()
249 list_del(&trap->list); in subn_handle_opa_trap_repress()
250 kfree(trap); in subn_handle_opa_trap_repress()
313 static void send_trap(struct hfi1_ibport *ibp, struct trap_node *trap) in send_trap() argument
324 cleanup_traps(ibp, trap); in send_trap()
330 cleanup_traps(ibp, trap); in send_trap()
335 trap = check_and_add_trap(ibp, trap); in send_trap()
336 if (!trap) in send_trap()
359 if (trap->tid == 0) { in send_trap()
364 trap->tid = cpu_to_be64(ibp->rvp.tid); in send_trap()
366 smp->tid = trap->tid; in send_trap()
371 memcpy(smp->route.lid.data, &trap->data, trap->len); in send_trap()
397 if (trap->repress) { in send_trap()
398 list_del(&trap->list); in send_trap()
400 kfree(trap); in send_trap()
405 trap->in_use = 0; in send_trap()
415 struct trap_node *trap = NULL; in hfi1_handle_trap_timer() local
421 for (i = 0; !trap && i < RVT_MAX_TRAP_LISTS; i++) { in hfi1_handle_trap_timer()
422 trap = list_first_entry_or_null(&ibp->rvp.trap_lists[i].list, in hfi1_handle_trap_timer()
427 if (trap) in hfi1_handle_trap_timer()
428 send_trap(ibp, trap); in hfi1_handle_trap_timer()
433 struct trap_node *trap; in create_trap_node() local
435 trap = kzalloc(sizeof(*trap), GFP_ATOMIC); in create_trap_node()
436 if (!trap) in create_trap_node()
439 INIT_LIST_HEAD(&trap->list); in create_trap_node()
440 trap->data.generic_type = type; in create_trap_node()
441 trap->data.prod_type_lsb = IB_NOTICE_PROD_CA; in create_trap_node()
442 trap->data.trap_num = trap_num; in create_trap_node()
443 trap->data.issuer_lid = cpu_to_be32(lid); in create_trap_node()
445 return trap; in create_trap_node()
454 struct trap_node *trap; in hfi1_bad_pkey() local
460 trap = create_trap_node(IB_NOTICE_TYPE_SECURITY, OPA_TRAP_BAD_P_KEY, in hfi1_bad_pkey()
462 if (!trap) in hfi1_bad_pkey()
466 trap->data.ntc_257_258.lid1 = cpu_to_be32(lid1); in hfi1_bad_pkey()
467 trap->data.ntc_257_258.lid2 = cpu_to_be32(lid2); in hfi1_bad_pkey()
468 trap->data.ntc_257_258.key = cpu_to_be32(key); in hfi1_bad_pkey()
469 trap->data.ntc_257_258.sl = sl << 3; in hfi1_bad_pkey()
470 trap->data.ntc_257_258.qp1 = cpu_to_be32(qp1); in hfi1_bad_pkey()
471 trap->data.ntc_257_258.qp2 = cpu_to_be32(qp2); in hfi1_bad_pkey()
473 trap->len = sizeof(trap->data); in hfi1_bad_pkey()
474 send_trap(ibp, trap); in hfi1_bad_pkey()
483 struct trap_node *trap; in bad_mkey() local
486 trap = create_trap_node(IB_NOTICE_TYPE_SECURITY, OPA_TRAP_BAD_M_KEY, in bad_mkey()
488 if (!trap) in bad_mkey()
492 trap->data.ntc_256.lid = trap->data.issuer_lid; in bad_mkey()
493 trap->data.ntc_256.method = mad->method; in bad_mkey()
494 trap->data.ntc_256.attr_id = mad->attr_id; in bad_mkey()
495 trap->data.ntc_256.attr_mod = mad->attr_mod; in bad_mkey()
496 trap->data.ntc_256.mkey = mkey; in bad_mkey()
498 trap->data.ntc_256.dr_slid = dr_slid; in bad_mkey()
499 trap->data.ntc_256.dr_trunc_hop = IB_NOTICE_TRAP_DR_NOTICE; in bad_mkey()
500 if (hop_cnt > ARRAY_SIZE(trap->data.ntc_256.dr_rtn_path)) { in bad_mkey()
501 trap->data.ntc_256.dr_trunc_hop |= in bad_mkey()
503 hop_cnt = ARRAY_SIZE(trap->data.ntc_256.dr_rtn_path); in bad_mkey()
505 trap->data.ntc_256.dr_trunc_hop |= hop_cnt; in bad_mkey()
506 memcpy(trap->data.ntc_256.dr_rtn_path, return_path, in bad_mkey()
510 trap->len = sizeof(trap->data); in bad_mkey()
512 send_trap(ibp, trap); in bad_mkey()
520 struct trap_node *trap; in hfi1_cap_mask_chg() local
526 trap = create_trap_node(IB_NOTICE_TYPE_INFO, in hfi1_cap_mask_chg()
529 if (!trap) in hfi1_cap_mask_chg()
532 trap->data.ntc_144.lid = trap->data.issuer_lid; in hfi1_cap_mask_chg()
533 trap->data.ntc_144.new_cap_mask = cpu_to_be32(ibp->rvp.port_cap_flags); in hfi1_cap_mask_chg()
534 trap->data.ntc_144.cap_mask3 = cpu_to_be16(ibp->rvp.port_cap3_flags); in hfi1_cap_mask_chg()
536 trap->len = sizeof(trap->data); in hfi1_cap_mask_chg()
537 send_trap(ibp, trap); in hfi1_cap_mask_chg()
545 struct trap_node *trap; in hfi1_sys_guid_chg() local
548 trap = create_trap_node(IB_NOTICE_TYPE_INFO, OPA_TRAP_CHANGE_SYSGUID, in hfi1_sys_guid_chg()
550 if (!trap) in hfi1_sys_guid_chg()
553 trap->data.ntc_145.new_sys_guid = ib_hfi1_sys_image_guid; in hfi1_sys_guid_chg()
554 trap->data.ntc_145.lid = trap->data.issuer_lid; in hfi1_sys_guid_chg()
556 trap->len = sizeof(trap->data); in hfi1_sys_guid_chg()
557 send_trap(ibp, trap); in hfi1_sys_guid_chg()
565 struct trap_node *trap; in hfi1_node_desc_chg() local
568 trap = create_trap_node(IB_NOTICE_TYPE_INFO, in hfi1_node_desc_chg()
571 if (!trap) in hfi1_node_desc_chg()
574 trap->data.ntc_144.lid = trap->data.issuer_lid; in hfi1_node_desc_chg()
575 trap->data.ntc_144.change_flags = in hfi1_node_desc_chg()
578 trap->len = sizeof(trap->data); in hfi1_node_desc_chg()
579 send_trap(ibp, trap); in hfi1_node_desc_chg()