Lines Matching +full:data +full:- +full:out

2  * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
14 * - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
48 if (in_mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_LID_ROUTED && in can_do_mad_ifc()
49 in_mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) in can_do_mad_ifc()
51 return dev->port_caps[port_num - 1].has_smi; in can_do_mad_ifc()
62 return -EPERM; in mlx5_MAD_IFC()
77 void *out) in pma_cnt_ext_assign() argument
83 pma_cnt_ext->port_xmit_data = in pma_cnt_ext_assign()
84 cpu_to_be64(MLX5_SUM_CNT(out, transmitted_ib_unicast.octets, in pma_cnt_ext_assign()
86 pma_cnt_ext->port_rcv_data = in pma_cnt_ext_assign()
87 cpu_to_be64(MLX5_SUM_CNT(out, received_ib_unicast.octets, in pma_cnt_ext_assign()
89 pma_cnt_ext->port_xmit_packets = in pma_cnt_ext_assign()
90 cpu_to_be64(MLX5_SUM_CNT(out, transmitted_ib_unicast.packets, in pma_cnt_ext_assign()
92 pma_cnt_ext->port_rcv_packets = in pma_cnt_ext_assign()
93 cpu_to_be64(MLX5_SUM_CNT(out, received_ib_unicast.packets, in pma_cnt_ext_assign()
95 pma_cnt_ext->port_unicast_xmit_packets = in pma_cnt_ext_assign()
97 out, transmitted_ib_unicast.packets); in pma_cnt_ext_assign()
98 pma_cnt_ext->port_unicast_rcv_packets = in pma_cnt_ext_assign()
100 out, received_ib_unicast.packets); in pma_cnt_ext_assign()
101 pma_cnt_ext->port_multicast_xmit_packets = in pma_cnt_ext_assign()
103 out, transmitted_ib_multicast.packets); in pma_cnt_ext_assign()
104 pma_cnt_ext->port_multicast_rcv_packets = in pma_cnt_ext_assign()
106 out, received_ib_multicast.packets); in pma_cnt_ext_assign()
110 void *out) in pma_cnt_assign() argument
115 void *out_pma = MLX5_ADDR_OF(ppcnt_reg, out, in pma_cnt_assign()
124 MLX5_ASSIGN_PMA_CNTR(pma_cnt->symbol_error_counter, in pma_cnt_assign()
126 MLX5_ASSIGN_PMA_CNTR(pma_cnt->link_error_recovery_counter, in pma_cnt_assign()
128 MLX5_ASSIGN_PMA_CNTR(pma_cnt->link_downed_counter, in pma_cnt_assign()
130 MLX5_ASSIGN_PMA_CNTR(pma_cnt->port_rcv_errors, in pma_cnt_assign()
132 MLX5_ASSIGN_PMA_CNTR(pma_cnt->port_rcv_remphys_errors, in pma_cnt_assign()
134 MLX5_ASSIGN_PMA_CNTR(pma_cnt->port_rcv_switch_relay_errors, in pma_cnt_assign()
136 MLX5_ASSIGN_PMA_CNTR(pma_cnt->port_xmit_discards, in pma_cnt_assign()
138 MLX5_ASSIGN_PMA_CNTR(pma_cnt->port_xmit_constraint_errors, in pma_cnt_assign()
140 MLX5_ASSIGN_PMA_CNTR(pma_cnt->port_xmit_wait, in pma_cnt_assign()
142 MLX5_ASSIGN_PMA_CNTR(pma_cnt->port_rcv_constraint_errors, in pma_cnt_assign()
144 MLX5_ASSIGN_PMA_CNTR(pma_cnt->link_overrun_errors, in pma_cnt_assign()
146 MLX5_ASSIGN_PMA_CNTR(pma_cnt->vl15_dropped, in pma_cnt_assign()
151 void *out) in pma_cnt_ext_assign_ppcnt() argument
153 void *out_pma = MLX5_ADDR_OF(ppcnt_reg, out, in pma_cnt_ext_assign_ppcnt()
160 cnt_ext->port_xmit_data = in pma_cnt_ext_assign_ppcnt()
162 cnt_ext->port_rcv_data = in pma_cnt_ext_assign_ppcnt()
165 cnt_ext->port_xmit_packets = in pma_cnt_ext_assign_ppcnt()
167 cnt_ext->port_rcv_packets = in pma_cnt_ext_assign_ppcnt()
170 cnt_ext->port_unicast_xmit_packets = in pma_cnt_ext_assign_ppcnt()
172 cnt_ext->port_unicast_rcv_packets = in pma_cnt_ext_assign_ppcnt()
175 cnt_ext->port_multicast_xmit_packets = in pma_cnt_ext_assign_ppcnt()
177 cnt_ext->port_multicast_rcv_packets = in pma_cnt_ext_assign_ppcnt()
182 void *out, size_t sz, bool ext) in query_ib_ppcnt() argument
189 err = -ENOMEM; in query_ib_ppcnt()
202 err = mlx5_core_access_reg(dev, in, sz, out, in query_ib_ppcnt()
225 mdev = dev->mdev; in process_pma_cmd()
228 if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1 && in process_pma_cmd()
230 dev->ib_dev.type != RDMA_DEVICE_TYPE_SMI) { in process_pma_cmd()
231 /* set local port to one for Function-Per-Port HCA. */ in process_pma_cmd()
232 mdev = dev->mdev; in process_pma_cmd()
237 if (in_mad->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO) { in process_pma_cmd()
241 memcpy((out_mad->data + 40), &cpi, sizeof(cpi)); in process_pma_cmd()
246 if (in_mad->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS_EXT) { in process_pma_cmd()
248 (struct ib_pma_portcounters_ext *)(out_mad->data + 40); in process_pma_cmd()
258 if (dev->ib_dev.type == RDMA_DEVICE_TYPE_SMI) { in process_pma_cmd()
272 (struct ib_pma_portcounters *)(out_mad->data + 40); in process_pma_cmd()
281 if (dev->ib_dev.type == RDMA_DEVICE_TYPE_SMI) in process_pma_cmd()
302 const struct ib_mad *in, struct ib_mad *out, in mlx5_ib_process_mad() argument
306 u8 mgmt_class = in->mad_hdr.mgmt_class; in mlx5_ib_process_mad()
307 u8 method = in->mad_hdr.method; in mlx5_ib_process_mad()
311 slid = in_wc ? ib_lid_cpu16(in_wc->slid) : in mlx5_ib_process_mad()
325 /* Don't process SMInfo queries -- the SMA can't handle them. in mlx5_ib_process_mad()
327 if (in->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO) in mlx5_ib_process_mad()
331 if (MLX5_CAP_GEN(dev->mdev, vport_counters) && in mlx5_ib_process_mad()
333 return process_pma_cmd(dev, port_num, in, out); in mlx5_ib_process_mad()
348 in_grh, in, out); in mlx5_ib_process_mad()
354 out->mad_hdr.status |= cpu_to_be16(1 << 15); in mlx5_ib_process_mad()
367 int err = -ENOMEM; in mlx5_query_ext_port_caps()
373 goto out; in mlx5_query_ext_port_caps()
376 in_mad->attr_id = MLX5_ATTR_EXTENDED_PORT_INFO; in mlx5_query_ext_port_caps()
377 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_ext_port_caps()
381 packet_error = be16_to_cpu(out_mad->status); in mlx5_query_ext_port_caps()
383 dev->port_caps[port - 1].ext_port_cap = (!err && !packet_error) ? in mlx5_query_ext_port_caps()
386 out: in mlx5_query_ext_port_caps()
400 return -ENOMEM; in mlx5_query_mad_ifc_smp_attr_node_info()
403 in_mad->attr_id = IB_SMP_ATTR_NODE_INFO; in mlx5_query_mad_ifc_smp_attr_node_info()
420 return -ENOMEM; in mlx5_query_mad_ifc_system_image_guid()
424 goto out; in mlx5_query_mad_ifc_system_image_guid()
426 memcpy(sys_image_guid, out_mad->data + 4, 8); in mlx5_query_mad_ifc_system_image_guid()
428 out: in mlx5_query_mad_ifc_system_image_guid()
442 return -ENOMEM; in mlx5_query_mad_ifc_max_pkeys()
446 goto out; in mlx5_query_mad_ifc_max_pkeys()
448 *max_pkeys = be16_to_cpup((__be16 *)(out_mad->data + 28)); in mlx5_query_mad_ifc_max_pkeys()
450 out: in mlx5_query_mad_ifc_max_pkeys()
464 return -ENOMEM; in mlx5_query_mad_ifc_vendor_id()
468 goto out; in mlx5_query_mad_ifc_vendor_id()
470 *vendor_id = be32_to_cpup((__be32 *)(out_mad->data + 36)) & 0xffff; in mlx5_query_mad_ifc_vendor_id()
472 out: in mlx5_query_mad_ifc_vendor_id()
482 int err = -ENOMEM; in mlx5_query_mad_ifc_node_desc()
487 goto out; in mlx5_query_mad_ifc_node_desc()
490 in_mad->attr_id = IB_SMP_ATTR_NODE_DESC; in mlx5_query_mad_ifc_node_desc()
494 goto out; in mlx5_query_mad_ifc_node_desc()
496 memcpy(node_desc, out_mad->data, IB_DEVICE_NODE_DESC_MAX); in mlx5_query_mad_ifc_node_desc()
497 out: in mlx5_query_mad_ifc_node_desc()
507 int err = -ENOMEM; in mlx5_query_mad_ifc_node_guid()
512 goto out; in mlx5_query_mad_ifc_node_guid()
515 in_mad->attr_id = IB_SMP_ATTR_NODE_INFO; in mlx5_query_mad_ifc_node_guid()
519 goto out; in mlx5_query_mad_ifc_node_guid()
521 memcpy(node_guid, out_mad->data + 12, 8); in mlx5_query_mad_ifc_node_guid()
522 out: in mlx5_query_mad_ifc_node_guid()
533 int err = -ENOMEM; in mlx5_query_mad_ifc_pkey()
538 goto out; in mlx5_query_mad_ifc_pkey()
541 in_mad->attr_id = IB_SMP_ATTR_PKEY_TABLE; in mlx5_query_mad_ifc_pkey()
542 in_mad->attr_mod = cpu_to_be32(index / 32); in mlx5_query_mad_ifc_pkey()
547 goto out; in mlx5_query_mad_ifc_pkey()
549 *pkey = be16_to_cpu(((__be16 *)out_mad->data)[index % 32]); in mlx5_query_mad_ifc_pkey()
551 out: in mlx5_query_mad_ifc_pkey()
562 int err = -ENOMEM; in mlx5_query_mad_ifc_gids()
567 goto out; in mlx5_query_mad_ifc_gids()
570 in_mad->attr_id = IB_SMP_ATTR_PORT_INFO; in mlx5_query_mad_ifc_gids()
571 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_mad_ifc_gids()
576 goto out; in mlx5_query_mad_ifc_gids()
578 memcpy(gid->raw, out_mad->data + 8, 8); in mlx5_query_mad_ifc_gids()
581 in_mad->attr_id = IB_SMP_ATTR_GUID_INFO; in mlx5_query_mad_ifc_gids()
582 in_mad->attr_mod = cpu_to_be32(index / 8); in mlx5_query_mad_ifc_gids()
587 goto out; in mlx5_query_mad_ifc_gids()
589 memcpy(gid->raw + 8, out_mad->data + (index % 8) * 8, 8); in mlx5_query_mad_ifc_gids()
591 out: in mlx5_query_mad_ifc_gids()
601 struct mlx5_core_dev *mdev = dev->mdev; in mlx5_query_mad_ifc_port()
605 int err = -ENOMEM; in mlx5_query_mad_ifc_port()
610 goto out; in mlx5_query_mad_ifc_port()
615 in_mad->attr_id = IB_SMP_ATTR_PORT_INFO; in mlx5_query_mad_ifc_port()
616 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_mad_ifc_port()
621 goto out; in mlx5_query_mad_ifc_port()
624 props->lid = be16_to_cpup((__be16 *)(out_mad->data + 16)); in mlx5_query_mad_ifc_port()
625 props->lmc = out_mad->data[34] & 0x7; in mlx5_query_mad_ifc_port()
626 props->sm_lid = be16_to_cpup((__be16 *)(out_mad->data + 18)); in mlx5_query_mad_ifc_port()
627 props->sm_sl = out_mad->data[36] & 0xf; in mlx5_query_mad_ifc_port()
628 props->state = out_mad->data[32] & 0xf; in mlx5_query_mad_ifc_port()
629 props->phys_state = out_mad->data[33] >> 4; in mlx5_query_mad_ifc_port()
630 props->port_cap_flags = be32_to_cpup((__be32 *)(out_mad->data + 20)); in mlx5_query_mad_ifc_port()
631 props->gid_tbl_len = out_mad->data[50]; in mlx5_query_mad_ifc_port()
632 props->max_msg_sz = 1 << MLX5_CAP_GEN(mdev, log_max_msg); in mlx5_query_mad_ifc_port()
633 props->pkey_tbl_len = dev->pkey_table_len; in mlx5_query_mad_ifc_port()
634 props->bad_pkey_cntr = be16_to_cpup((__be16 *)(out_mad->data + 46)); in mlx5_query_mad_ifc_port()
635 props->qkey_viol_cntr = be16_to_cpup((__be16 *)(out_mad->data + 48)); in mlx5_query_mad_ifc_port()
636 props->active_width = out_mad->data[31] & 0xf; in mlx5_query_mad_ifc_port()
637 props->active_speed = out_mad->data[35] >> 4; in mlx5_query_mad_ifc_port()
638 props->max_mtu = out_mad->data[41] & 0xf; in mlx5_query_mad_ifc_port()
639 props->active_mtu = out_mad->data[36] >> 4; in mlx5_query_mad_ifc_port()
640 props->subnet_timeout = out_mad->data[51] & 0x1f; in mlx5_query_mad_ifc_port()
641 props->max_vl_num = out_mad->data[37] >> 4; in mlx5_query_mad_ifc_port()
642 props->init_type_reply = out_mad->data[41] >> 4; in mlx5_query_mad_ifc_port()
644 if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP) { in mlx5_query_mad_ifc_port()
645 props->port_cap_flags2 = in mlx5_query_mad_ifc_port()
646 be16_to_cpup((__be16 *)(out_mad->data + 60)); in mlx5_query_mad_ifc_port()
648 if (props->port_cap_flags2 & IB_PORT_LINK_WIDTH_2X_SUP) in mlx5_query_mad_ifc_port()
649 props->active_width = out_mad->data[31] & 0x1f; in mlx5_query_mad_ifc_port()
653 if (props->port_cap_flags & IB_PORT_EXTENDED_SPEEDS_SUP) { in mlx5_query_mad_ifc_port()
654 ext_active_speed = out_mad->data[62] >> 4; in mlx5_query_mad_ifc_port()
658 props->active_speed = 16; /* FDR */ in mlx5_query_mad_ifc_port()
661 props->active_speed = 32; /* EDR */ in mlx5_query_mad_ifc_port()
664 if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP && in mlx5_query_mad_ifc_port()
665 props->port_cap_flags2 & IB_PORT_LINK_SPEED_HDR_SUP) in mlx5_query_mad_ifc_port()
666 props->active_speed = IB_SPEED_HDR; in mlx5_query_mad_ifc_port()
669 if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP && in mlx5_query_mad_ifc_port()
670 props->port_cap_flags2 & IB_PORT_LINK_SPEED_NDR_SUP) in mlx5_query_mad_ifc_port()
671 props->active_speed = IB_SPEED_NDR; in mlx5_query_mad_ifc_port()
677 if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP && in mlx5_query_mad_ifc_port()
678 props->port_cap_flags2 & IB_PORT_EXTENDED_SPEEDS2_SUP) { in mlx5_query_mad_ifc_port()
679 ext_active_speed = (out_mad->data[56] >> 4) & 0x6; in mlx5_query_mad_ifc_port()
683 if (props->port_cap_flags2 & IB_PORT_LINK_SPEED_XDR_SUP) in mlx5_query_mad_ifc_port()
684 props->active_speed = IB_SPEED_XDR; in mlx5_query_mad_ifc_port()
689 /* If reported active speed is QDR, check if is FDR-10 */ in mlx5_query_mad_ifc_port()
690 if (props->active_speed == 4) { in mlx5_query_mad_ifc_port()
691 if (dev->port_caps[port - 1].ext_port_cap & in mlx5_query_mad_ifc_port()
694 in_mad->attr_id = MLX5_ATTR_EXTENDED_PORT_INFO; in mlx5_query_mad_ifc_port()
695 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_mad_ifc_port()
700 goto out; in mlx5_query_mad_ifc_port()
702 /* Checking LinkSpeedActive for FDR-10 */ in mlx5_query_mad_ifc_port()
703 if (out_mad->data[15] & 0x1) in mlx5_query_mad_ifc_port()
704 props->active_speed = 8; in mlx5_query_mad_ifc_port()
708 out: in mlx5_query_mad_ifc_port()