125981136fb13bcacf5f475f3e0ec750341e1e671Christopher Ferris/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ 22fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* 32fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * Copyright (c) 2012-2016 VMware, Inc. All rights reserved. 42fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 52fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * This program is free software; you can redistribute it and/or 62fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * modify it under the terms of EITHER the GNU General Public License 72fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * version 2 as published by the Free Software Foundation or the BSD 82fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 2-Clause License. This program is distributed in the hope that it 92fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * will be useful, but WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED 102fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 112fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * See the GNU General Public License version 2 for more details at 122fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. 132fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 142fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * You should have received a copy of the GNU General Public License 152fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * along with this program available in the file COPYING in the main 162fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * directory of this source tree. 172fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 182fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * The BSD 2-Clause License 192fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 202fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * Redistribution and use in source and binary forms, with or 212fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * without modification, are permitted provided that the following 222fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * conditions are met: 232fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 242fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * - Redistributions of source code must retain the above 252fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * copyright notice, this list of conditions and the following 262fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * disclaimer. 272fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 282fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * - Redistributions in binary form must reproduce the above 292fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * copyright notice, this list of conditions and the following 302fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * disclaimer in the documentation and/or other materials 312fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * provided with the distribution. 322fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * 332fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 342fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 352fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 362fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 372fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 382fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 392fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 402fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 412fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 422fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 432fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 442fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris * OF THE POSSIBILITY OF SUCH DAMAGE. 452fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris */ 462fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 472fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#ifndef __VMW_PVRDMA_ABI_H__ 482fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define __VMW_PVRDMA_ABI_H__ 492fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 502fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#include <linux/types.h> 512fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 522fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UVERBS_ABI_VERSION 3 /* ABI Version. */ 532fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */ 542fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell. */ 552fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_QP_SEND BIT(30) /* Send bit. */ 562fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_QP_RECV BIT(31) /* Recv bit. */ 572fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_CQ_OFFSET 4 /* CQ doorbell. */ 582fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_CQ_ARM_SOL BIT(29) /* Arm solicited bit. */ 592fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_CQ_ARM BIT(30) /* Arm bit. */ 602fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#define PVRDMA_UAR_CQ_POLL BIT(31) /* Poll bit. */ 612fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 622fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisenum pvrdma_wr_opcode { 632fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_RDMA_WRITE, 642fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_RDMA_WRITE_WITH_IMM, 652fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_SEND, 662fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_SEND_WITH_IMM, 672fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_RDMA_READ, 682fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_ATOMIC_CMP_AND_SWP, 692fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_ATOMIC_FETCH_AND_ADD, 702fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_LSO, 712fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_SEND_WITH_INV, 722fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_RDMA_READ_WITH_INV, 732fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_LOCAL_INV, 742fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_FAST_REG_MR, 752fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP, 762fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD, 772fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_BIND_MW, 782fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WR_REG_SIG_MR, 792fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 802fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 812fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisenum pvrdma_wc_status { 822fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_SUCCESS, 832fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LOC_LEN_ERR, 842fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LOC_QP_OP_ERR, 852fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LOC_EEC_OP_ERR, 862fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LOC_PROT_ERR, 872fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_WR_FLUSH_ERR, 882fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_MW_BIND_ERR, 892fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_BAD_RESP_ERR, 902fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LOC_ACCESS_ERR, 912fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_REM_INV_REQ_ERR, 922fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_REM_ACCESS_ERR, 932fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_REM_OP_ERR, 942fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_RETRY_EXC_ERR, 952fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_RNR_RETRY_EXC_ERR, 962fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LOC_RDD_VIOL_ERR, 972fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_REM_INV_RD_REQ_ERR, 982fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_REM_ABORT_ERR, 992fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_INV_EECN_ERR, 1002fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_INV_EEC_STATE_ERR, 1012fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_FATAL_ERR, 1022fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_RESP_TIMEOUT_ERR, 1032fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_GENERAL_ERR, 1042fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1052fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1062fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisenum pvrdma_wc_opcode { 1072fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_SEND, 1082fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_RDMA_WRITE, 1092fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_RDMA_READ, 1102fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_COMP_SWAP, 1112fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_FETCH_ADD, 1122fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_BIND_MW, 1132fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LSO, 1142fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_LOCAL_INV, 1152fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_FAST_REG_MR, 1162fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_MASKED_COMP_SWAP, 1172fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_MASKED_FETCH_ADD, 1182fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_RECV = 1 << 7, 1192fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_RECV_RDMA_WITH_IMM, 1202fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1212fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1222fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisenum pvrdma_wc_flags { 1232fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_GRH = 1 << 0, 1242fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_WITH_IMM = 1 << 1, 1252fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_WITH_INVALIDATE = 1 << 2, 1262fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_IP_CSUM_OK = 1 << 3, 1272fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_WITH_SMAC = 1 << 4, 1282fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris PVRDMA_WC_WITH_VLAN = 1 << 5, 12925981136fb13bcacf5f475f3e0ec750341e1e671Christopher Ferris PVRDMA_WC_WITH_NETWORK_HDR_TYPE = 1 << 6, 13025981136fb13bcacf5f475f3e0ec750341e1e671Christopher Ferris PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_NETWORK_HDR_TYPE, 1312fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1322fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1332fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_alloc_ucontext_resp { 1342fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 qp_tab_size; 1352fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 1362fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1372fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1382fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_alloc_pd_resp { 1392fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 pdn; 1402fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 1412fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1422fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1432fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_create_cq { 1442fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 buf_addr; 1452fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 buf_size; 1462fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 1472fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1482fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1492fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_create_cq_resp { 1502fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 cqn; 1512fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 1522fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1532fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1542fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_resize_cq { 1552fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 buf_addr; 1562fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 buf_size; 1572fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 1582fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1592fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1602fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_create_srq { 1612fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 buf_addr; 162a1a109eed086336ef38a07b9f90e3d7c786f850eChristopher Ferris __u32 buf_size; 163a1a109eed086336ef38a07b9f90e3d7c786f850eChristopher Ferris __u32 reserved; 1642fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1652fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1662fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_create_srq_resp { 1672fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 srqn; 1682fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 1692fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1702fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1712fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_create_qp { 1722fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 rbuf_addr; 1732fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 sbuf_addr; 1742fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 rbuf_size; 1752fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 sbuf_size; 1762fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 qp_addr; 1772fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1782fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1792fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* PVRDMA masked atomic compare and swap */ 1802fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_ex_cmp_swap { 1812fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 swap_val; 1822fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 compare_val; 1832fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 swap_mask; 1842fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 compare_mask; 1852fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1862fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1872fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* PVRDMA masked atomic fetch and add */ 1882fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_ex_fetch_add { 1892fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 add_val; 1902fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 field_boundary; 1912fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 1922fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 1932fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* PVRDMA address vector. */ 1942fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_av { 1952fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 port_pd; 1962fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 sl_tclass_flowlabel; 1972fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 dgid[16]; 1982fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 src_path_bits; 1992fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 gid_index; 2002fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 stat_rate; 2012fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 hop_limit; 2022fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 dmac[6]; 2032fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 reserved[6]; 2042fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 2052fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 2062fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* PVRDMA scatter/gather entry */ 2072fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_sge { 2082fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 addr; 2092fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 length; 2102fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 lkey; 2112fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 2122fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 2132fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* PVRDMA receive queue work request */ 2142fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_rq_wqe_hdr { 2152fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 wr_id; /* wr id */ 2162fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 num_sge; /* size of s/g array */ 2172fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 total_len; /* reserved */ 2182fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 2192fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* Use pvrdma_sge (ib_sge) for receive queue s/g array elements. */ 2202fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 2212fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* PVRDMA send queue work request */ 2222fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_sq_wqe_hdr { 2232fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 wr_id; /* wr id */ 2242fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 num_sge; /* size of s/g array */ 2252fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 total_len; /* reserved */ 2262fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 opcode; /* operation type */ 2272fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 send_flags; /* wr flags */ 2282fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris union { 2290543f743b6f5bc5c0652568c763e6dfb9ddce647Christopher Ferris __be32 imm_data; 2302fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 invalidate_rkey; 2312fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } ex; 2322fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 2332fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris union { 2342fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct { 2352fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 remote_addr; 2362fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 rkey; 2372fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 reserved[4]; 2382fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } rdma; 2392fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct { 2402fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 remote_addr; 2412fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 compare_add; 2422fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 swap; 2432fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 rkey; 2442fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 reserved; 2452fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } atomic; 2462fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct { 2472fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 remote_addr; 2482fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 log_arg_sz; 2492fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 rkey; 2502fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris union { 2512fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct pvrdma_ex_cmp_swap cmp_swap; 2522fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct pvrdma_ex_fetch_add fetch_add; 2532fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } wr_data; 2542fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } masked_atomics; 2552fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct { 2562fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 iova_start; 2572fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 pl_pdir_dma; 2582fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 page_shift; 2592fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 page_list_len; 2602fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 length; 2612fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 access_flags; 2622fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 rkey; 2632fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } fast_reg; 2642fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct { 2652fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 remote_qpn; 2662fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 remote_qkey; 2672fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris struct pvrdma_av av; 2682fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } ud; 2692fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris } wr; 2702fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 2712fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* Use pvrdma_sge (ib_sge) for send queue s/g array elements. */ 2722fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 2732fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris/* Completion queue element. */ 2742fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferrisstruct pvrdma_cqe { 2752fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 wr_id; 2762fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u64 qp; 2772fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 opcode; 2782fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 status; 2792fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 byte_len; 2800543f743b6f5bc5c0652568c763e6dfb9ddce647Christopher Ferris __be32 imm_data; 2812fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 src_qp; 2822fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 wc_flags; 2832fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u32 vendor_err; 2842fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u16 pkey_index; 2852fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u16 slid; 2862fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 sl; 2872fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 dlid_path_bits; 2882fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 port_num; 2892fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris __u8 smac[6]; 29025981136fb13bcacf5f475f3e0ec750341e1e671Christopher Ferris __u8 network_hdr_type; 29125981136fb13bcacf5f475f3e0ec750341e1e671Christopher Ferris __u8 reserved2[6]; /* Pad to next power of 2 (64). */ 2922fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris}; 2932fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris 2942fd4b3cf888b560db61afa9e50dd42039e07a8b2Christopher Ferris#endif /* __VMW_PVRDMA_ABI_H__ */ 295