qp.c (2019d70e919f01c43975b8d9ea2803b890eabba9) qp.c (7416790e22452bfa86de6b55638eacf7780c8f6f)
1/*
2 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 3162 unchanged lines hidden (view full) ---

3171 u8 ah_flags = rdma_ah_get_ah_flags(ah);
3172 u8 sl = rdma_ah_get_sl(ah);
3173
3174 if (attr_mask & IB_QP_PKEY_INDEX)
3175 MLX5_SET(ads, path, pkey_index,
3176 alt ? attr->alt_pkey_index : attr->pkey_index);
3177
3178 if (ah_flags & IB_AH_GRH) {
1/*
2 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 3162 unchanged lines hidden (view full) ---

3171 u8 ah_flags = rdma_ah_get_ah_flags(ah);
3172 u8 sl = rdma_ah_get_sl(ah);
3173
3174 if (attr_mask & IB_QP_PKEY_INDEX)
3175 MLX5_SET(ads, path, pkey_index,
3176 alt ? attr->alt_pkey_index : attr->pkey_index);
3177
3178 if (ah_flags & IB_AH_GRH) {
3179 if (grh->sgid_index >=
3180 dev->port_caps[port - 1].gid_table_len) {
3179 const struct ib_port_immutable *immutable;
3180
3181 immutable = ib_port_immutable_read(&dev->ib_dev, port);
3182 if (grh->sgid_index >= immutable->gid_tbl_len) {
3181 pr_err("sgid_index (%u) too large. max is %d\n",
3182 grh->sgid_index,
3183 pr_err("sgid_index (%u) too large. max is %d\n",
3184 grh->sgid_index,
3183 dev->port_caps[port - 1].gid_table_len);
3185 immutable->gid_tbl_len);
3184 return -EINVAL;
3185 }
3186 }
3187
3188 if (ah->type == RDMA_AH_ATTR_TYPE_ROCE) {
3189 if (!(ah_flags & IB_AH_GRH))
3190 return -EINVAL;
3191

--- 2227 unchanged lines hidden ---
3186 return -EINVAL;
3187 }
3188 }
3189
3190 if (ah->type == RDMA_AH_ATTR_TYPE_ROCE) {
3191 if (!(ah_flags & IB_AH_GRH))
3192 return -EINVAL;
3193

--- 2227 unchanged lines hidden ---