Path: blob/main/sys/ofed/include/uapi/rdma/ib_user_cm.h
39488 views
/*-1* SPDX-License-Identifier: BSD-2-Clause OR GPL-2.02*3* Copyright (c) 2005 Topspin Communications. All rights reserved.4* Copyright (c) 2005 Intel Corporation. All rights reserved.5*6* This software is available to you under a choice of one of two7* licenses. You may choose to be licensed under the terms of the GNU8* General Public License (GPL) Version 2, available from the file9* COPYING in the main directory of this source tree, or the10* OpenIB.org BSD license below:11*12* Redistribution and use in source and binary forms, with or13* without modification, are permitted provided that the following14* conditions are met:15*16* - Redistributions of source code must retain the above17* copyright notice, this list of conditions and the following18* disclaimer.19*20* - Redistributions in binary form must reproduce the above21* copyright notice, this list of conditions and the following22* disclaimer in the documentation and/or other materials23* provided with the distribution.24*25* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,26* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF27* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND28* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS29* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN30* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN31* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE32* SOFTWARE.33*/3435#ifndef IB_USER_CM_H36#define IB_USER_CM_H3738#ifdef _KERNEL39#include <linux/types.h>40#else41#include <infiniband/types.h>42#endif43#include <rdma/ib_user_sa.h>4445#define IB_USER_CM_ABI_VERSION 54647enum {48IB_USER_CM_CMD_CREATE_ID,49IB_USER_CM_CMD_DESTROY_ID,50IB_USER_CM_CMD_ATTR_ID,5152IB_USER_CM_CMD_LISTEN,53IB_USER_CM_CMD_NOTIFY,5455IB_USER_CM_CMD_SEND_REQ,56IB_USER_CM_CMD_SEND_REP,57IB_USER_CM_CMD_SEND_RTU,58IB_USER_CM_CMD_SEND_DREQ,59IB_USER_CM_CMD_SEND_DREP,60IB_USER_CM_CMD_SEND_REJ,61IB_USER_CM_CMD_SEND_MRA,62IB_USER_CM_CMD_SEND_LAP,63IB_USER_CM_CMD_SEND_APR,64IB_USER_CM_CMD_SEND_SIDR_REQ,65IB_USER_CM_CMD_SEND_SIDR_REP,6667IB_USER_CM_CMD_EVENT,68IB_USER_CM_CMD_INIT_QP_ATTR,69};70/*71* command ABI structures.72*/73struct ib_ucm_cmd_hdr {74__u32 cmd;75__u16 in;76__u16 out;77};7879struct ib_ucm_create_id {80__u64 uid;81__u64 response;82};8384struct ib_ucm_create_id_resp {85__u32 id;86};8788struct ib_ucm_destroy_id {89__u64 response;90__u32 id;91__u32 reserved;92};9394struct ib_ucm_destroy_id_resp {95__u32 events_reported;96};9798struct ib_ucm_attr_id {99__u64 response;100__u32 id;101__u32 reserved;102};103104struct ib_ucm_attr_id_resp {105__be64 service_id;106__be64 service_mask;107__be32 local_id;108__be32 remote_id;109};110111struct ib_ucm_init_qp_attr {112__u64 response;113__u32 id;114__u32 qp_state;115};116117struct ib_ucm_listen {118__be64 service_id;119__be64 service_mask;120__u32 id;121__u32 reserved;122};123124struct ib_ucm_notify {125__u32 id;126__u32 event;127};128129struct ib_ucm_private_data {130__u64 data;131__u32 id;132__u8 len;133__u8 reserved[3];134};135136struct ib_ucm_req {137__u32 id;138__u32 qpn;139__u32 qp_type;140__u32 psn;141__be64 sid;142__u64 data;143__u64 primary_path;144__u64 alternate_path;145__u8 len;146__u8 peer_to_peer;147__u8 responder_resources;148__u8 initiator_depth;149__u8 remote_cm_response_timeout;150__u8 flow_control;151__u8 local_cm_response_timeout;152__u8 retry_count;153__u8 rnr_retry_count;154__u8 max_cm_retries;155__u8 srq;156__u8 reserved[5];157};158159struct ib_ucm_rep {160__u64 uid;161__u64 data;162__u32 id;163__u32 qpn;164__u32 psn;165__u8 len;166__u8 responder_resources;167__u8 initiator_depth;168__u8 target_ack_delay;169__u8 failover_accepted;170__u8 flow_control;171__u8 rnr_retry_count;172__u8 srq;173__u8 reserved[4];174};175176struct ib_ucm_info {177__u32 id;178__u32 status;179__u64 info;180__u64 data;181__u8 info_len;182__u8 data_len;183__u8 reserved[6];184};185186struct ib_ucm_mra {187__u64 data;188__u32 id;189__u8 len;190__u8 timeout;191__u8 reserved[2];192};193194struct ib_ucm_lap {195__u64 path;196__u64 data;197__u32 id;198__u8 len;199__u8 reserved[3];200};201202struct ib_ucm_sidr_req {203__u32 id;204__u32 timeout;205__be64 sid;206__u64 data;207__u64 path;208__u16 reserved_pkey;209__u8 len;210__u8 max_cm_retries;211__u8 reserved[4];212};213214struct ib_ucm_sidr_rep {215__u32 id;216__u32 qpn;217__u32 qkey;218__u32 status;219__u64 info;220__u64 data;221__u8 info_len;222__u8 data_len;223__u8 reserved[6];224};225/*226* event notification ABI structures.227*/228struct ib_ucm_event_get {229__u64 response;230__u64 data;231__u64 info;232__u8 data_len;233__u8 info_len;234__u8 reserved[6];235};236237struct ib_ucm_req_event_resp {238struct ib_user_path_rec primary_path;239struct ib_user_path_rec alternate_path;240__be64 remote_ca_guid;241__u32 remote_qkey;242__u32 remote_qpn;243__u32 qp_type;244__u32 starting_psn;245__u8 responder_resources;246__u8 initiator_depth;247__u8 local_cm_response_timeout;248__u8 flow_control;249__u8 remote_cm_response_timeout;250__u8 retry_count;251__u8 rnr_retry_count;252__u8 srq;253__u8 port;254__u8 reserved[7];255};256257struct ib_ucm_rep_event_resp {258__be64 remote_ca_guid;259__u32 remote_qkey;260__u32 remote_qpn;261__u32 starting_psn;262__u8 responder_resources;263__u8 initiator_depth;264__u8 target_ack_delay;265__u8 failover_accepted;266__u8 flow_control;267__u8 rnr_retry_count;268__u8 srq;269__u8 reserved[5];270};271272struct ib_ucm_rej_event_resp {273__u32 reason;274/* ari in ib_ucm_event_get info field. */275};276277struct ib_ucm_mra_event_resp {278__u8 timeout;279__u8 reserved[3];280};281282struct ib_ucm_lap_event_resp {283struct ib_user_path_rec path;284};285286struct ib_ucm_apr_event_resp {287__u32 status;288/* apr info in ib_ucm_event_get info field. */289};290291struct ib_ucm_sidr_req_event_resp {292__u16 pkey;293__u8 port;294__u8 reserved;295};296297struct ib_ucm_sidr_rep_event_resp {298__u32 status;299__u32 qkey;300__u32 qpn;301/* info in ib_ucm_event_get info field. */302};303304#define IB_UCM_PRES_DATA 0x01305#define IB_UCM_PRES_INFO 0x02306#define IB_UCM_PRES_PRIMARY 0x04307#define IB_UCM_PRES_ALTERNATE 0x08308309struct ib_ucm_event_resp {310__u64 uid;311__u32 id;312__u32 event;313__u32 present;314__u32 reserved;315union {316struct ib_ucm_req_event_resp req_resp;317struct ib_ucm_rep_event_resp rep_resp;318struct ib_ucm_rej_event_resp rej_resp;319struct ib_ucm_mra_event_resp mra_resp;320struct ib_ucm_lap_event_resp lap_resp;321struct ib_ucm_apr_event_resp apr_resp;322323struct ib_ucm_sidr_req_event_resp sidr_req_resp;324struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;325326__u32 send_status;327} u;328};329330#endif /* IB_USER_CM_H */331332333