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->mdev->port_caps[port_num - 1].has_smi; in can_do_mad_ifc()
62 return -EPERM; in mlx5_MAD_IFC()
72 return mlx5_cmd_mad_ifc(dev->mdev, in_mad, response_mad, op_modifier, 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()
166 mdev = dev->mdev; in process_pma_cmd()
170 if (in_mad->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO) { in process_pma_cmd()
174 memcpy((out_mad->data + 40), &cpi, sizeof(cpi)); in process_pma_cmd()
179 if (in_mad->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS_EXT) { in process_pma_cmd()
181 (struct ib_pma_portcounters_ext *)(out_mad->data + 40); in process_pma_cmd()
196 (struct ib_pma_portcounters *)(out_mad->data + 40); in process_pma_cmd()
221 const struct ib_mad *in, struct ib_mad *out, in mlx5_ib_process_mad() argument
225 u8 mgmt_class = in->mad_hdr.mgmt_class; in mlx5_ib_process_mad()
226 u8 method = in->mad_hdr.method; in mlx5_ib_process_mad()
230 slid = in_wc ? ib_lid_cpu16(in_wc->slid) : in mlx5_ib_process_mad()
244 /* Don't process SMInfo queries -- the SMA can't handle them. in mlx5_ib_process_mad()
246 if (in->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO) in mlx5_ib_process_mad()
250 if (MLX5_CAP_GEN(dev->mdev, vport_counters) && in mlx5_ib_process_mad()
252 return process_pma_cmd(dev, port_num, in, out); in mlx5_ib_process_mad()
267 in_grh, in, out); in mlx5_ib_process_mad()
273 out->mad_hdr.status |= cpu_to_be16(1 << 15); in mlx5_ib_process_mad()
286 int err = -ENOMEM; in mlx5_query_ext_port_caps()
292 goto out; in mlx5_query_ext_port_caps()
295 in_mad->attr_id = MLX5_ATTR_EXTENDED_PORT_INFO; in mlx5_query_ext_port_caps()
296 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_ext_port_caps()
300 packet_error = be16_to_cpu(out_mad->status); in mlx5_query_ext_port_caps()
302 dev->mdev->port_caps[port - 1].ext_port_cap = (!err && !packet_error) ? in mlx5_query_ext_port_caps()
305 out: in mlx5_query_ext_port_caps()
315 int err = -ENOMEM; in mlx5_query_mad_ifc_smp_attr_node_info()
319 return -ENOMEM; in mlx5_query_mad_ifc_smp_attr_node_info()
322 in_mad->attr_id = IB_SMP_ATTR_NODE_INFO; in mlx5_query_mad_ifc_smp_attr_node_info()
335 int err = -ENOMEM; in mlx5_query_mad_ifc_system_image_guid()
339 return -ENOMEM; in mlx5_query_mad_ifc_system_image_guid()
343 goto out; in mlx5_query_mad_ifc_system_image_guid()
345 memcpy(sys_image_guid, out_mad->data + 4, 8); in mlx5_query_mad_ifc_system_image_guid()
347 out: in mlx5_query_mad_ifc_system_image_guid()
357 int err = -ENOMEM; in mlx5_query_mad_ifc_max_pkeys()
361 return -ENOMEM; in mlx5_query_mad_ifc_max_pkeys()
365 goto out; in mlx5_query_mad_ifc_max_pkeys()
367 *max_pkeys = be16_to_cpup((__be16 *)(out_mad->data + 28)); in mlx5_query_mad_ifc_max_pkeys()
369 out: in mlx5_query_mad_ifc_max_pkeys()
379 int err = -ENOMEM; in mlx5_query_mad_ifc_vendor_id()
383 return -ENOMEM; in mlx5_query_mad_ifc_vendor_id()
387 goto out; in mlx5_query_mad_ifc_vendor_id()
389 *vendor_id = be32_to_cpup((__be32 *)(out_mad->data + 36)) & 0xffff; in mlx5_query_mad_ifc_vendor_id()
391 out: in mlx5_query_mad_ifc_vendor_id()
401 int err = -ENOMEM; in mlx5_query_mad_ifc_node_desc()
406 goto out; in mlx5_query_mad_ifc_node_desc()
409 in_mad->attr_id = IB_SMP_ATTR_NODE_DESC; in mlx5_query_mad_ifc_node_desc()
413 goto out; in mlx5_query_mad_ifc_node_desc()
415 memcpy(node_desc, out_mad->data, IB_DEVICE_NODE_DESC_MAX); in mlx5_query_mad_ifc_node_desc()
416 out: in mlx5_query_mad_ifc_node_desc()
426 int err = -ENOMEM; in mlx5_query_mad_ifc_node_guid()
431 goto out; in mlx5_query_mad_ifc_node_guid()
434 in_mad->attr_id = IB_SMP_ATTR_NODE_INFO; in mlx5_query_mad_ifc_node_guid()
438 goto out; in mlx5_query_mad_ifc_node_guid()
440 memcpy(node_guid, out_mad->data + 12, 8); in mlx5_query_mad_ifc_node_guid()
441 out: in mlx5_query_mad_ifc_node_guid()
452 int err = -ENOMEM; in mlx5_query_mad_ifc_pkey()
457 goto out; in mlx5_query_mad_ifc_pkey()
460 in_mad->attr_id = IB_SMP_ATTR_PKEY_TABLE; in mlx5_query_mad_ifc_pkey()
461 in_mad->attr_mod = cpu_to_be32(index / 32); in mlx5_query_mad_ifc_pkey()
466 goto out; in mlx5_query_mad_ifc_pkey()
468 *pkey = be16_to_cpu(((__be16 *)out_mad->data)[index % 32]); in mlx5_query_mad_ifc_pkey()
470 out: in mlx5_query_mad_ifc_pkey()
481 int err = -ENOMEM; in mlx5_query_mad_ifc_gids()
486 goto out; in mlx5_query_mad_ifc_gids()
489 in_mad->attr_id = IB_SMP_ATTR_PORT_INFO; in mlx5_query_mad_ifc_gids()
490 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_mad_ifc_gids()
495 goto out; in mlx5_query_mad_ifc_gids()
497 memcpy(gid->raw, out_mad->data + 8, 8); in mlx5_query_mad_ifc_gids()
500 in_mad->attr_id = IB_SMP_ATTR_GUID_INFO; in mlx5_query_mad_ifc_gids()
501 in_mad->attr_mod = cpu_to_be32(index / 8); in mlx5_query_mad_ifc_gids()
506 goto out; in mlx5_query_mad_ifc_gids()
508 memcpy(gid->raw + 8, out_mad->data + (index % 8) * 8, 8); in mlx5_query_mad_ifc_gids()
510 out: in mlx5_query_mad_ifc_gids()
520 struct mlx5_core_dev *mdev = dev->mdev; in mlx5_query_mad_ifc_port()
524 int err = -ENOMEM; in mlx5_query_mad_ifc_port()
529 goto out; in mlx5_query_mad_ifc_port()
534 in_mad->attr_id = IB_SMP_ATTR_PORT_INFO; in mlx5_query_mad_ifc_port()
535 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_mad_ifc_port()
540 goto out; in mlx5_query_mad_ifc_port()
543 props->lid = be16_to_cpup((__be16 *)(out_mad->data + 16)); in mlx5_query_mad_ifc_port()
544 props->lmc = out_mad->data[34] & 0x7; in mlx5_query_mad_ifc_port()
545 props->sm_lid = be16_to_cpup((__be16 *)(out_mad->data + 18)); in mlx5_query_mad_ifc_port()
546 props->sm_sl = out_mad->data[36] & 0xf; in mlx5_query_mad_ifc_port()
547 props->state = out_mad->data[32] & 0xf; in mlx5_query_mad_ifc_port()
548 props->phys_state = out_mad->data[33] >> 4; in mlx5_query_mad_ifc_port()
549 props->port_cap_flags = be32_to_cpup((__be32 *)(out_mad->data + 20)); in mlx5_query_mad_ifc_port()
550 props->gid_tbl_len = out_mad->data[50]; in mlx5_query_mad_ifc_port()
551 props->max_msg_sz = 1 << MLX5_CAP_GEN(mdev, log_max_msg); in mlx5_query_mad_ifc_port()
552 props->pkey_tbl_len = mdev->port_caps[port - 1].pkey_table_len; in mlx5_query_mad_ifc_port()
553 props->bad_pkey_cntr = be16_to_cpup((__be16 *)(out_mad->data + 46)); in mlx5_query_mad_ifc_port()
554 props->qkey_viol_cntr = be16_to_cpup((__be16 *)(out_mad->data + 48)); in mlx5_query_mad_ifc_port()
555 props->active_width = out_mad->data[31] & 0xf; in mlx5_query_mad_ifc_port()
556 props->active_speed = out_mad->data[35] >> 4; in mlx5_query_mad_ifc_port()
557 props->max_mtu = out_mad->data[41] & 0xf; in mlx5_query_mad_ifc_port()
558 props->active_mtu = out_mad->data[36] >> 4; in mlx5_query_mad_ifc_port()
559 props->subnet_timeout = out_mad->data[51] & 0x1f; in mlx5_query_mad_ifc_port()
560 props->max_vl_num = out_mad->data[37] >> 4; in mlx5_query_mad_ifc_port()
561 props->init_type_reply = out_mad->data[41] >> 4; in mlx5_query_mad_ifc_port()
563 if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP) { in mlx5_query_mad_ifc_port()
564 props->port_cap_flags2 = in mlx5_query_mad_ifc_port()
565 be16_to_cpup((__be16 *)(out_mad->data + 60)); in mlx5_query_mad_ifc_port()
567 if (props->port_cap_flags2 & IB_PORT_LINK_WIDTH_2X_SUP) in mlx5_query_mad_ifc_port()
568 props->active_width = out_mad->data[31] & 0x1f; in mlx5_query_mad_ifc_port()
572 if (props->port_cap_flags & IB_PORT_EXTENDED_SPEEDS_SUP) { in mlx5_query_mad_ifc_port()
573 ext_active_speed = out_mad->data[62] >> 4; in mlx5_query_mad_ifc_port()
577 props->active_speed = 16; /* FDR */ in mlx5_query_mad_ifc_port()
580 props->active_speed = 32; /* EDR */ in mlx5_query_mad_ifc_port()
583 if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP && in mlx5_query_mad_ifc_port()
584 props->port_cap_flags2 & IB_PORT_LINK_SPEED_HDR_SUP) in mlx5_query_mad_ifc_port()
585 props->active_speed = IB_SPEED_HDR; in mlx5_query_mad_ifc_port()
590 /* If reported active speed is QDR, check if is FDR-10 */ in mlx5_query_mad_ifc_port()
591 if (props->active_speed == 4) { in mlx5_query_mad_ifc_port()
592 if (mdev->port_caps[port - 1].ext_port_cap & in mlx5_query_mad_ifc_port()
595 in_mad->attr_id = MLX5_ATTR_EXTENDED_PORT_INFO; in mlx5_query_mad_ifc_port()
596 in_mad->attr_mod = cpu_to_be32(port); in mlx5_query_mad_ifc_port()
601 goto out; in mlx5_query_mad_ifc_port()
603 /* Checking LinkSpeedActive for FDR-10 */ in mlx5_query_mad_ifc_port()
604 if (out_mad->data[15] & 0x1) in mlx5_query_mad_ifc_port()
605 props->active_speed = 8; in mlx5_query_mad_ifc_port()
609 out: in mlx5_query_mad_ifc_port()