Lines Matching refs:ah_attr

42 int mlx4_ib_resolve_grh(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah_attr,  in mlx4_ib_resolve_grh()  argument
49 memcpy(&in6, ah_attr->grh.dgid.raw, sizeof in6); in mlx4_ib_resolve_grh()
61 static struct ib_ah *create_ib_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr, in create_ib_ah() argument
66 ah->av.ib.port_pd = cpu_to_be32(to_mpd(pd)->pdn | (ah_attr->port_num << 24)); in create_ib_ah()
67 ah->av.ib.g_slid = ah_attr->src_path_bits; in create_ib_ah()
68 if (ah_attr->ah_flags & IB_AH_GRH) { in create_ib_ah()
70 ah->av.ib.gid_index = ah_attr->grh.sgid_index; in create_ib_ah()
71 ah->av.ib.hop_limit = ah_attr->grh.hop_limit; in create_ib_ah()
73 cpu_to_be32((ah_attr->grh.traffic_class << 20) | in create_ib_ah()
74 ah_attr->grh.flow_label); in create_ib_ah()
75 memcpy(ah->av.ib.dgid, ah_attr->grh.dgid.raw, 16); in create_ib_ah()
78 ah->av.ib.dlid = cpu_to_be16(ah_attr->dlid); in create_ib_ah()
79 if (ah_attr->static_rate) { in create_ib_ah()
80 ah->av.ib.stat_rate = ah_attr->static_rate + MLX4_STAT_RATE_OFFSET; in create_ib_ah()
85 ah->av.ib.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 28); in create_ib_ah()
90 static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr, in create_iboe_ah() argument
101 err = mlx4_ib_resolve_grh(ibdev, ah_attr, mac, &is_mcast, ah_attr->port_num); in create_iboe_ah()
106 err = ib_get_cached_gid(pd->device, ah_attr->port_num, ah_attr->grh.sgid_index, &sgid); in create_iboe_ah()
111 vlan_tag |= (ah_attr->sl & 7) << 13; in create_iboe_ah()
112 ah->av.eth.port_pd = cpu_to_be32(to_mpd(pd)->pdn | (ah_attr->port_num << 24)); in create_iboe_ah()
113 ah->av.eth.gid_index = ah_attr->grh.sgid_index; in create_iboe_ah()
115 if (ah_attr->static_rate) { in create_iboe_ah()
116 ah->av.eth.stat_rate = ah_attr->static_rate + MLX4_STAT_RATE_OFFSET; in create_iboe_ah()
128 memcpy(ah->av.eth.dgid, ah_attr->grh.dgid.raw, 16); in create_iboe_ah()
129 ah->av.eth.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 29); in create_iboe_ah()
134 struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr) in mlx4_ib_create_ah() argument
143 if (rdma_port_get_link_layer(pd->device, ah_attr->port_num) == IB_LINK_LAYER_ETHERNET) { in mlx4_ib_create_ah()
144 if (!(ah_attr->ah_flags & IB_AH_GRH)) { in mlx4_ib_create_ah()
155 ret = create_iboe_ah(pd, ah_attr, ah); in mlx4_ib_create_ah()
163 return create_ib_ah(pd, ah_attr, ah); /* never fails */ in mlx4_ib_create_ah()
166 int mlx4_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr) in mlx4_ib_query_ah() argument
171 memset(ah_attr, 0, sizeof *ah_attr); in mlx4_ib_query_ah()
172 ah_attr->sl = be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 28; in mlx4_ib_query_ah()
173 ah_attr->port_num = be32_to_cpu(ah->av.ib.port_pd) >> 24; in mlx4_ib_query_ah()
174 ll = rdma_port_get_link_layer(ibah->device, ah_attr->port_num); in mlx4_ib_query_ah()
175 ah_attr->dlid = ll == IB_LINK_LAYER_INFINIBAND ? be16_to_cpu(ah->av.ib.dlid) : 0; in mlx4_ib_query_ah()
177 ah_attr->static_rate = ah->av.ib.stat_rate - MLX4_STAT_RATE_OFFSET; in mlx4_ib_query_ah()
178 ah_attr->src_path_bits = ah->av.ib.g_slid & 0x7F; in mlx4_ib_query_ah()
181 ah_attr->ah_flags = IB_AH_GRH; in mlx4_ib_query_ah()
183 ah_attr->grh.traffic_class = in mlx4_ib_query_ah()
185 ah_attr->grh.flow_label = in mlx4_ib_query_ah()
187 ah_attr->grh.hop_limit = ah->av.ib.hop_limit; in mlx4_ib_query_ah()
188 ah_attr->grh.sgid_index = ah->av.ib.gid_index; in mlx4_ib_query_ah()
189 memcpy(ah_attr->grh.dgid.raw, ah->av.ib.dgid, 16); in mlx4_ib_query_ah()