qp.c (f83b42636a91e63f330ea90996646b4a885aca74) qp.c (fd22f78cf7b95102d8e5b988afe27165e47471fc)
1/*
2 * Copyright (c) 2013, Mellanox Technologies inc. 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:

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

1297
1298 if (attr_mask & IB_QP_PKEY_INDEX)
1299 path->pkey_index = attr->pkey_index;
1300
1301 path->grh_mlid = ah->src_path_bits & 0x7f;
1302 path->rlid = cpu_to_be16(ah->dlid);
1303
1304 if (ah->ah_flags & IB_AH_GRH) {
1/*
2 * Copyright (c) 2013, Mellanox Technologies inc. 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:

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

1297
1298 if (attr_mask & IB_QP_PKEY_INDEX)
1299 path->pkey_index = attr->pkey_index;
1300
1301 path->grh_mlid = ah->src_path_bits & 0x7f;
1302 path->rlid = cpu_to_be16(ah->dlid);
1303
1304 if (ah->ah_flags & IB_AH_GRH) {
1305 if (ah->grh.sgid_index >= dev->mdev->caps.port[port - 1].gid_table_len) {
1306 pr_err(KERN_ERR "sgid_index (%u) too large. max is %d\n",
1307 ah->grh.sgid_index, dev->mdev->caps.port[port - 1].gid_table_len);
1308 return -EINVAL;
1309 }
1310 path->grh_mlid |= 1 << 7;
1311 path->mgid_index = ah->grh.sgid_index;
1312 path->hop_limit = ah->grh.hop_limit;
1313 path->tclass_flowlabel =
1314 cpu_to_be32((ah->grh.traffic_class << 20) |
1315 (ah->grh.flow_label));
1316 memcpy(path->rgid, ah->grh.dgid.raw, 16);
1317 }
1318
1319 err = ib_rate_to_mlx5(dev, ah->static_rate);
1320 if (err < 0)
1321 return err;
1322 path->static_rate = err;
1323 path->port = port;
1324
1305 path->grh_mlid |= 1 << 7;
1306 path->mgid_index = ah->grh.sgid_index;
1307 path->hop_limit = ah->grh.hop_limit;
1308 path->tclass_flowlabel =
1309 cpu_to_be32((ah->grh.traffic_class << 20) |
1310 (ah->grh.flow_label));
1311 memcpy(path->rgid, ah->grh.dgid.raw, 16);
1312 }
1313
1314 err = ib_rate_to_mlx5(dev, ah->static_rate);
1315 if (err < 0)
1316 return err;
1317 path->static_rate = err;
1318 path->port = port;
1319
1320 if (ah->ah_flags & IB_AH_GRH) {
1321 if (ah->grh.sgid_index >= dev->mdev->caps.port[port - 1].gid_table_len) {
1322 pr_err(KERN_ERR "sgid_index (%u) too large. max is %d\n",
1323 ah->grh.sgid_index, dev->mdev->caps.port[port - 1].gid_table_len);
1324 return -EINVAL;
1325 }
1326
1327 path->grh_mlid |= 1 << 7;
1328 path->mgid_index = ah->grh.sgid_index;
1329 path->hop_limit = ah->grh.hop_limit;
1330 path->tclass_flowlabel =
1331 cpu_to_be32((ah->grh.traffic_class << 20) |
1332 (ah->grh.flow_label));
1333 memcpy(path->rgid, ah->grh.dgid.raw, 16);
1334 }
1335
1325 if (attr_mask & IB_QP_TIMEOUT)
1326 path->ackto_lt = attr->timeout << 3;
1327
1328 path->sl = ah->sl & 0xf;
1329
1330 return 0;
1331}
1332

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

2079
2080 /* Input domain check byte mask */
2081 basic->check_byte_mask = sig_attrs->check_mask;
2082 if (mem->sig.dif.pi_interval == wire->sig.dif.pi_interval &&
2083 mem->sig.dif.type == wire->sig.dif.type) {
2084 /* Same block structure */
2085 basic->bsf_size_sbs = 1 << 4;
2086 if (mem->sig.dif.bg_type == wire->sig.dif.bg_type)
1336 if (attr_mask & IB_QP_TIMEOUT)
1337 path->ackto_lt = attr->timeout << 3;
1338
1339 path->sl = ah->sl & 0xf;
1340
1341 return 0;
1342}
1343

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

2090
2091 /* Input domain check byte mask */
2092 basic->check_byte_mask = sig_attrs->check_mask;
2093 if (mem->sig.dif.pi_interval == wire->sig.dif.pi_interval &&
2094 mem->sig.dif.type == wire->sig.dif.type) {
2095 /* Same block structure */
2096 basic->bsf_size_sbs = 1 << 4;
2097 if (mem->sig.dif.bg_type == wire->sig.dif.bg_type)
2087 basic->wire.copy_byte_mask |= 0xc0;
2098 basic->wire.copy_byte_mask |= MLX5_CPY_GRD_MASK;
2088 if (mem->sig.dif.app_tag == wire->sig.dif.app_tag)
2099 if (mem->sig.dif.app_tag == wire->sig.dif.app_tag)
2089 basic->wire.copy_byte_mask |= 0x30;
2100 basic->wire.copy_byte_mask |= MLX5_CPY_APP_MASK;
2090 if (mem->sig.dif.ref_tag == wire->sig.dif.ref_tag)
2101 if (mem->sig.dif.ref_tag == wire->sig.dif.ref_tag)
2091 basic->wire.copy_byte_mask |= 0x0f;
2102 basic->wire.copy_byte_mask |= MLX5_CPY_REF_MASK;
2092 } else
2093 basic->wire.bs_selector = bs_selector(wire->sig.dif.pi_interval);
2094
2095 basic->mem.bs_selector = bs_selector(mem->sig.dif.pi_interval);
2096 basic->raw_data_size = cpu_to_be32(data_size);
2097
2098 ret = format_selector(sig_attrs, mem, &selector);
2099 if (ret)

--- 938 unchanged lines hidden ---
2103 } else
2104 basic->wire.bs_selector = bs_selector(wire->sig.dif.pi_interval);
2105
2106 basic->mem.bs_selector = bs_selector(mem->sig.dif.pi_interval);
2107 basic->raw_data_size = cpu_to_be32(data_size);
2108
2109 ret = format_selector(sig_attrs, mem, &selector);
2110 if (ret)

--- 938 unchanged lines hidden ---