Path: blob/master/drivers/infiniband/hw/mthca/mthca_wqe.h
15112 views
/*1* Copyright (c) 2005 Cisco Systems. All rights reserved.2*3* This software is available to you under a choice of one of two4* licenses. You may choose to be licensed under the terms of the GNU5* General Public License (GPL) Version 2, available from the file6* COPYING in the main directory of this source tree, or the7* OpenIB.org BSD license below:8*9* Redistribution and use in source and binary forms, with or10* without modification, are permitted provided that the following11* conditions are met:12*13* - Redistributions of source code must retain the above14* copyright notice, this list of conditions and the following15* disclaimer.16*17* - Redistributions in binary form must reproduce the above18* copyright notice, this list of conditions and the following19* disclaimer in the documentation and/or other materials20* provided with the distribution.21*22* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,23* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF24* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND25* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS26* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN27* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN28* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE29* SOFTWARE.30*/3132#ifndef MTHCA_WQE_H33#define MTHCA_WQE_H3435#include <linux/types.h>3637enum {38MTHCA_NEXT_DBD = 1 << 7,39MTHCA_NEXT_FENCE = 1 << 6,40MTHCA_NEXT_CQ_UPDATE = 1 << 3,41MTHCA_NEXT_EVENT_GEN = 1 << 2,42MTHCA_NEXT_SOLICIT = 1 << 1,43MTHCA_NEXT_IP_CSUM = 1 << 4,44MTHCA_NEXT_TCP_UDP_CSUM = 1 << 5,4546MTHCA_MLX_VL15 = 1 << 17,47MTHCA_MLX_SLR = 1 << 1648};4950enum {51MTHCA_INVAL_LKEY = 0x100,52MTHCA_TAVOR_MAX_WQES_PER_RECV_DB = 256,53MTHCA_ARBEL_MAX_WQES_PER_SEND_DB = 25554};5556struct mthca_next_seg {57__be32 nda_op; /* [31:6] next WQE [4:0] next opcode */58__be32 ee_nds; /* [31:8] next EE [7] DBD [6] F [5:0] next WQE size */59__be32 flags; /* [3] CQ [2] Event [1] Solicit */60__be32 imm; /* immediate data */61};6263struct mthca_tavor_ud_seg {64u32 reserved1;65__be32 lkey;66__be64 av_addr;67u32 reserved2[4];68__be32 dqpn;69__be32 qkey;70u32 reserved3[2];71};7273struct mthca_arbel_ud_seg {74__be32 av[8];75__be32 dqpn;76__be32 qkey;77u32 reserved[2];78};7980struct mthca_bind_seg {81__be32 flags; /* [31] Atomic [30] rem write [29] rem read */82u32 reserved;83__be32 new_rkey;84__be32 lkey;85__be64 addr;86__be64 length;87};8889struct mthca_raddr_seg {90__be64 raddr;91__be32 rkey;92u32 reserved;93};9495struct mthca_atomic_seg {96__be64 swap_add;97__be64 compare;98};99100struct mthca_data_seg {101__be32 byte_count;102__be32 lkey;103__be64 addr;104};105106struct mthca_mlx_seg {107__be32 nda_op;108__be32 nds;109__be32 flags; /* [17] VL15 [16] SLR [14:12] static rate110[11:8] SL [3] C [2] E */111__be16 rlid;112__be16 vcrc;113};114115static __always_inline void mthca_set_data_seg(struct mthca_data_seg *dseg,116struct ib_sge *sg)117{118dseg->byte_count = cpu_to_be32(sg->length);119dseg->lkey = cpu_to_be32(sg->lkey);120dseg->addr = cpu_to_be64(sg->addr);121}122123static __always_inline void mthca_set_data_seg_inval(struct mthca_data_seg *dseg)124{125dseg->byte_count = 0;126dseg->lkey = cpu_to_be32(MTHCA_INVAL_LKEY);127dseg->addr = 0;128}129130#endif /* MTHCA_WQE_H */131132133