| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. |
|---|
| 3 | 4 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. |
|---|
| 4 | 5 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. |
|---|
| 5 | 6 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This software is available to you under a choice of one of two |
|---|
| 8 | | - * licenses. You may choose to be licensed under the terms of the GNU |
|---|
| 9 | | - * General Public License (GPL) Version 2, available from the file |
|---|
| 10 | | - * COPYING in the main directory of this source tree, or the |
|---|
| 11 | | - * OpenIB.org BSD license below: |
|---|
| 12 | | - * |
|---|
| 13 | | - * Redistribution and use in source and binary forms, with or |
|---|
| 14 | | - * without modification, are permitted provided that the following |
|---|
| 15 | | - * conditions are met: |
|---|
| 16 | | - * |
|---|
| 17 | | - * - Redistributions of source code must retain the above |
|---|
| 18 | | - * copyright notice, this list of conditions and the following |
|---|
| 19 | | - * disclaimer. |
|---|
| 20 | | - * |
|---|
| 21 | | - * - Redistributions in binary form must reproduce the above |
|---|
| 22 | | - * copyright notice, this list of conditions and the following |
|---|
| 23 | | - * disclaimer in the documentation and/or other materials |
|---|
| 24 | | - * provided with the distribution. |
|---|
| 25 | | - * |
|---|
| 26 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|---|
| 27 | | - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|---|
| 28 | | - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|---|
| 29 | | - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
|---|
| 30 | | - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
|---|
| 31 | | - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|---|
| 32 | | - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|---|
| 33 | | - * SOFTWARE. |
|---|
| 7 | + * Copyright (c) 2019, Mellanox Technologies inc. All rights reserved. |
|---|
| 34 | 8 | */ |
|---|
| 35 | | -#if !defined(IB_CM_H) |
|---|
| 9 | + |
|---|
| 10 | +#ifndef IB_CM_H |
|---|
| 36 | 11 | #define IB_CM_H |
|---|
| 37 | 12 | |
|---|
| 38 | 13 | #include <rdma/ib_mad.h> |
|---|
| 39 | 14 | #include <rdma/ib_sa.h> |
|---|
| 40 | | - |
|---|
| 41 | | -/* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */ |
|---|
| 42 | | -extern struct class cm_class; |
|---|
| 15 | +#include <rdma/rdma_cm.h> |
|---|
| 43 | 16 | |
|---|
| 44 | 17 | enum ib_cm_state { |
|---|
| 45 | 18 | IB_CM_IDLE, |
|---|
| .. | .. |
|---|
| 141 | 114 | unsigned int retry_count:3; |
|---|
| 142 | 115 | unsigned int rnr_retry_count:3; |
|---|
| 143 | 116 | unsigned int srq:1; |
|---|
| 117 | + struct rdma_ucm_ece ece; |
|---|
| 144 | 118 | }; |
|---|
| 145 | 119 | |
|---|
| 146 | 120 | struct ib_cm_rep_event_param { |
|---|
| .. | .. |
|---|
| 155 | 129 | unsigned int flow_control:1; |
|---|
| 156 | 130 | unsigned int rnr_retry_count:3; |
|---|
| 157 | 131 | unsigned int srq:1; |
|---|
| 132 | + struct rdma_ucm_ece ece; |
|---|
| 158 | 133 | }; |
|---|
| 159 | 134 | |
|---|
| 160 | 135 | enum ib_cm_rej_reason { |
|---|
| .. | .. |
|---|
| 190 | 165 | IB_CM_REJ_DUPLICATE_LOCAL_COMM_ID = 30, |
|---|
| 191 | 166 | IB_CM_REJ_INVALID_CLASS_VERSION = 31, |
|---|
| 192 | 167 | IB_CM_REJ_INVALID_FLOW_LABEL = 32, |
|---|
| 193 | | - IB_CM_REJ_INVALID_ALT_FLOW_LABEL = 33 |
|---|
| 168 | + IB_CM_REJ_INVALID_ALT_FLOW_LABEL = 33, |
|---|
| 169 | + IB_CM_REJ_VENDOR_OPTION_NOT_SUPPORTED = 35, |
|---|
| 194 | 170 | }; |
|---|
| 195 | 171 | |
|---|
| 196 | 172 | struct ib_cm_rej_event_param { |
|---|
| .. | .. |
|---|
| 386 | 362 | u32 starting_psn; |
|---|
| 387 | 363 | const void *private_data; |
|---|
| 388 | 364 | u8 private_data_len; |
|---|
| 389 | | - u8 peer_to_peer; |
|---|
| 390 | 365 | u8 responder_resources; |
|---|
| 391 | 366 | u8 initiator_depth; |
|---|
| 392 | 367 | u8 remote_cm_response_timeout; |
|---|
| .. | .. |
|---|
| 396 | 371 | u8 rnr_retry_count; |
|---|
| 397 | 372 | u8 max_cm_retries; |
|---|
| 398 | 373 | u8 srq; |
|---|
| 374 | + struct rdma_ucm_ece ece; |
|---|
| 399 | 375 | }; |
|---|
| 400 | 376 | |
|---|
| 401 | 377 | /** |
|---|
| .. | .. |
|---|
| 419 | 395 | u8 flow_control; |
|---|
| 420 | 396 | u8 rnr_retry_count; |
|---|
| 421 | 397 | u8 srq; |
|---|
| 398 | + struct rdma_ucm_ece ece; |
|---|
| 422 | 399 | }; |
|---|
| 423 | 400 | |
|---|
| 424 | 401 | /** |
|---|
| .. | .. |
|---|
| 526 | 503 | u8 private_data_len); |
|---|
| 527 | 504 | |
|---|
| 528 | 505 | /** |
|---|
| 529 | | - * ib_send_cm_lap - Sends a load alternate path request. |
|---|
| 530 | | - * @cm_id: Connection identifier associated with the load alternate path |
|---|
| 531 | | - * message. |
|---|
| 532 | | - * @alternate_path: A path record that identifies the alternate path to |
|---|
| 533 | | - * load. |
|---|
| 534 | | - * @private_data: Optional user-defined private data sent with the |
|---|
| 535 | | - * load alternate path message. |
|---|
| 536 | | - * @private_data_len: Size of the private data buffer, in bytes. |
|---|
| 537 | | - */ |
|---|
| 538 | | -int ib_send_cm_lap(struct ib_cm_id *cm_id, |
|---|
| 539 | | - struct sa_path_rec *alternate_path, |
|---|
| 540 | | - const void *private_data, |
|---|
| 541 | | - u8 private_data_len); |
|---|
| 542 | | - |
|---|
| 543 | | -/** |
|---|
| 544 | 506 | * ib_cm_init_qp_attr - Initializes the QP attributes for use in transitioning |
|---|
| 545 | 507 | * to a specified QP state. |
|---|
| 546 | 508 | * @cm_id: Communication identifier associated with the QP attributes to |
|---|
| .. | .. |
|---|
| 560 | 522 | struct ib_qp_attr *qp_attr, |
|---|
| 561 | 523 | int *qp_attr_mask); |
|---|
| 562 | 524 | |
|---|
| 563 | | -/** |
|---|
| 564 | | - * ib_send_cm_apr - Sends an alternate path response message in response to |
|---|
| 565 | | - * a load alternate path request. |
|---|
| 566 | | - * @cm_id: Connection identifier associated with the alternate path response. |
|---|
| 567 | | - * @status: Reply status sent with the alternate path response. |
|---|
| 568 | | - * @info: Optional additional information sent with the alternate path |
|---|
| 569 | | - * response. |
|---|
| 570 | | - * @info_length: Size of the additional information, in bytes. |
|---|
| 571 | | - * @private_data: Optional user-defined private data sent with the |
|---|
| 572 | | - * alternate path response message. |
|---|
| 573 | | - * @private_data_len: Size of the private data buffer, in bytes. |
|---|
| 574 | | - */ |
|---|
| 575 | | -int ib_send_cm_apr(struct ib_cm_id *cm_id, |
|---|
| 576 | | - enum ib_cm_apr_status status, |
|---|
| 577 | | - void *info, |
|---|
| 578 | | - u8 info_length, |
|---|
| 579 | | - const void *private_data, |
|---|
| 580 | | - u8 private_data_len); |
|---|
| 581 | | - |
|---|
| 582 | 525 | struct ib_cm_sidr_req_param { |
|---|
| 583 | 526 | struct sa_path_rec *path; |
|---|
| 584 | 527 | const struct ib_gid_attr *sgid_attr; |
|---|
| 585 | 528 | __be64 service_id; |
|---|
| 586 | | - int timeout_ms; |
|---|
| 529 | + unsigned long timeout_ms; |
|---|
| 587 | 530 | const void *private_data; |
|---|
| 588 | 531 | u8 private_data_len; |
|---|
| 589 | 532 | u8 max_cm_retries; |
|---|
| .. | .. |
|---|
| 607 | 550 | u8 info_length; |
|---|
| 608 | 551 | const void *private_data; |
|---|
| 609 | 552 | u8 private_data_len; |
|---|
| 553 | + struct rdma_ucm_ece ece; |
|---|
| 610 | 554 | }; |
|---|
| 611 | 555 | |
|---|
| 612 | 556 | /** |
|---|