5810N/A/*
5810N/A * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
5810N/A */
5810N/A
5810N/A/*
5810N/A * Redistribution and use in source and binary forms, with or without modification,
5810N/A * are permitted provided that the following conditions are met:
5810N/A *
5810N/A * 1. Redistributions of source code must retain the above copyright notice,
5810N/A * this list of conditions and the following disclaimer.
5810N/A *
5810N/A * 2. Redistributions in binary form must reproduce the above copyright notice,
5810N/A * this list of conditions and the following disclaimer in the documentation
5810N/A * and/or other materials provided with the distribution.
5810N/A *
5810N/A * 3. Neither the name of the copyright holder nor the names of its contributors
5810N/A * may be used to endorse or promote products derived from this software without
5810N/A * specific prior written permission.
5810N/A *
5810N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5810N/A * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
5810N/A * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
5810N/A * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
5810N/A * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
5810N/A * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
5810N/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
5810N/A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
5810N/A * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
5810N/A * OF THE POSSIBILITY OF SUCH DAMAGE.
5810N/A */
5810N/A
5810N/A#ifndef _PSIF_HW_DATA_H_BE
5810N/A#define _PSIF_HW_DATA_H_BE
5810N/A
5810N/A/*
5810N/A * Context used by tsu_mmu when performing address translation. The structure
5810N/A * is follows: [63:56] st [55:55] no_snoop [54:53] tph [52:52] ro [51:12]
5810N/A * table_ptr [11:11] th [10:8] translation_type [7:4] page_size [3:3]
5810N/A * wr_access [2:0] table_level
5810N/A */
5810N/Astruct psif_mmu_cntx {
5810N/A /* PCIe steering tag. */
5810N/A u64 st:8;
5810N/A /* PCIe no snoop. */
5810N/A u64 ns:1;
5810N/A /* PCIe TLP hints. */
5810N/A u64 tph:2;
5810N/A /* PCIe relaxed ordering. */
5810N/A u64 ro:1;
5810N/A /*
5810N/A * This is bit [51:12] of the table pointer. The lower twelve bits are always
5810N/A * set to zero. The pointer is pointing to a certain level in the page table
5810N/A * structure. Only applicable if translation_type is set.
5810N/A */
5810N/A u64 table_ptr:40;
5810N/A /* Indicates that the TPH field is valid for the PCIe request. */
5810N/A u64 th:1;
5810N/A /*
5810N/A * Translation types supported by the PSIF MMU. The modes are:
5810N/A * MMU_PASS_THROUGH MMU_GVA2GPA_MODE, MMU_EPSA_MODE, MMU_EPSC_MODE
5810N/A */
5810N/A enum psif_mmu_translation translation_type:3;
5810N/A
5810N/A /* Different supported page sizes. */
5810N/A enum psif_page_size page_size:4;
5810N/A
5810N/A /* Set for write access. */
5810N/A u64 wr_access:1;
5810N/A /*
5810N/A * XXX: Should this be enumerated? XXX: Make sure description is added when
5810N/A * encoding is decided...
5810N/A */
5810N/A u64 table_level:3;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_mmu_cntx [ 8 byte] */
5810N/A
5810N/A/* Descriptor for hardware updated portion of XRC receive queue. */
5810N/Astruct psif_xrq_hw { /* Subjected to copy and convert */
5810N/A /*
5810N/A * Do not evict this entry if this bit is set. There can only be a fixed
5810N/A * number of descriptors with this bit set. XXX: Should this be used as a
5810N/A * hint, or should it be fixed?
5810N/A */
5810N/A u32 sticky:1;
5810N/A /* This is a shared receive queue. This is always set for XRCSRQs. */
5810N/A u32 srq:1;
5810N/A /* The shared receive queue is in error. */
5810N/A u32 srq_err:1;
5810N/A /* Reserved */
5810N/A u32 noname:1;
5810N/A /* This is indicating how many scatter entries are valid. */
5810N/A u32 scatter:4;
5810N/A /* pd(24[0] bits)Protection domain. */
5810N/A u32 pd:24;
5810N/A /* This is the shift value to use to find start of the receive queue element. */
5810N/A u32 extent_log2:4;
5810N/A /*
5810N/A * Hardware modified index pointing to the head of the receive queue. TSU is
5810N/A * using this to find the address of the receive queue entry.
5810N/A */
5810N/A u32 head_indx:14;
5810N/A /*
5810N/A * If set to something greater than zero, event notification is armed. An
5810N/A * Affiliated Synchronous Event will be sent when number of WQE are less than
5810N/A * srq_lim.
5810N/A */
5810N/A u32 srq_lim:14;
5810N/A /* Base address for the receive queue in host memory. */
5810N/A u64 base_addr;
5810N/A /* Inlined rq : struct psif_rq_no_pad (256 bits) */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /*
5810N/A * Log2 size of the receive queue. Maximum number of entries in the receive
5810N/A * queue. This is used for calculating when to wrap the head and tail
5810N/A * indexes.
5810N/A */
5810N/A u64 size_log2:4;
5810N/A /*
5810N/A * Pre-fetch threshold (clog2) indicating when to read the software portion
5810N/A * of the descriptor. If there are less entries than indicated by this
5810N/A * threshold, the software portion of the descriptor must be read.
5810N/A */
5810N/A u64 prefetch_threshold_log2:4;
5810N/A /* The desciptor is valid. */
5810N/A u64 valid:1;
5810N/A /* Reserved */
5810N/A u64 noname1:7;
5810N/A /*
5810N/A * XRC domain used to check if this descriptor can be used for the incoming
5810N/A * packet.
5810N/A */
5810N/A u64 xrc_domain:24;
5810N/A /* Completion queue to use for the incoming packet. */
5810N/A u64 cqd_id:24;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_xrq_hw [32 byte] */
5810N/A
5810N/A/* Temp.definition of Shared receive queue content */
5810N/Astruct psif_xrq { /* Subjected to copy and convert */
5810N/A /* Content pt. not defined in ASIC XML */
5810N/A u64 something_tbd;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_xrq [ 8 byte] */
5810N/A
5810N/Astruct psif_vlan_union_struct {
5810N/A /* VLAN priority. */
5810N/A u32 vlan_pri:4;
5810N/A /* Reserved */
5810N/A u32 noname:20;
5810N/A} PSIF_PACKED; /* struct psif_vlan_union_struct [ 3 byte] */
5810N/A
5810N/A/*
5810N/A * Union between the CQ descriptor ID and VLAN pri. The CQ desc id is only
5810N/A * used for privileged requests, and the vlan_pri is only used for EoIB
5810N/A * offloading.
5810N/A */
5810N/Aunion psif_cq_desc_vlan_pri {
5810N/A /*
5810N/A * This is only used for privileged requests. Completion queue descriptor
5810N/A * index where completions for privileged requests end up. This index points
5810N/A * to the completion queue to be used with this work request.
5810N/A */
5810N/A u32 cqd_id:24;
5810N/A /* VLAN priority. */
5810N/A struct psif_vlan_union_struct vlan_pri;
5810N/A} PSIF_PACKED; /* union psif_cq_desc_vlan_pri [ 3 byte] */
5810N/A
5810N/A/*
5810N/A * Generic header for work requests to PSIF. This is present for all packet
5810N/A * types.
5810N/A */
5810N/Astruct psif_wr_common {
5810N/A /* Indicates shat type of request this is. */
5810N/A enum psif_wr_type op:8;
5810N/A
5810N/A /*
5810N/A * QP sending this request. XXX: Should name be own_qp_num as defined in QP
5810N/A * state?
5810N/A */
5810N/A u32 local_qp:24;
5810N/A /*
5810N/A * The TSL (Tsu SL) must be matched against the TSL in the QP State (XXX: or
5810N/A * in the AHA?). If it is unequal, the QP should be put in error.
5810N/A */
5810N/A u16 tsu_sl:4;
5810N/A /* Port number to use for QP0/1 packets. This field is ignored if not QP0/1. */
5810N/A enum psif_port port:1;
5810N/A
5810N/A /* Only applicable to UD. This is an indication that AHA should be used. */
5810N/A enum psif_use_ah ud_pkt:1;
5810N/A
5810N/A /*
5810N/A * High Bandwidth/Low Latency BAR. The QoSL must be matched against the QoSL
5810N/A * in the QP State. If it is unequal, the QP should be in error.
5810N/A */
5810N/A enum psif_tsu_qos tsu_qosl:1;
5810N/A
5810N/A /* Length (number of bytes of valid data in the collect payload buffer). */
5810N/A u16 collect_length:9;
5810N/A /*
5810N/A * Send queue sequence number. Used to map request to a particular work
5810N/A * request in the send queue.
5810N/A */
5810N/A u16 sq_seq;
5810N/A /* Solicited event bit to be set in IB packet. */
5810N/A u64 se:1;
5810N/A /* Dynamic MTU is enabled for this work request. */
5810N/A u64 dynamic_mtu_enable:1;
5810N/A /* L3 checksum enabled when set. This is used for EoIB and IPoIB packets. */
5810N/A u64 l3_checksum_en:1;
5810N/A /* L4 checksum enabled when set. This is used for EoIB and IPoIB packets. */
5810N/A u64 l4_checksum_en:1;
5810N/A /* Number of SGL entries are valid for this request. */
5810N/A u64 num_sgl:4;
5810N/A /* UF used for DR loopback packets. This field is ignored otherwise. */
5810N/A u64 destuf:6;
5810N/A /* Reserved */
5810N/A u64 noname:2;
5810N/A /*
5810N/A * EPS tag - used by EPS to associate process and work request. This field is
5810N/A * not used by non-EPS work requests.
5810N/A */
5810N/A u64 eps_tag:16;
5810N/A /* Completion notification identifier. */
5810N/A u64 completion:1;
5810N/A /* Fence indicator. */
5810N/A u64 fence:1;
5810N/A /* UF used for all EPS-C QP0/1 packets. This field is ignored otherwise. */
5810N/A u64 srcuf:6;
5810N/A /* Union between VLAN priority and CQ descriptor ID. */
5810N/A union psif_cq_desc_vlan_pri cq_desc_vlan_pri_union;
5810N/A /*
5810N/A * Checksum used for data protection and consistency between work request and
5810N/A * QP state.
5810N/A */
5810N/A u32 checksum;
5810N/A /* Info: Edge padding added (for endian convert) */
5810N/A u32 space19;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_common [24 byte] */
5810N/A
5810N/Astruct psif_wr_qp {
5810N/A /* Reserved */
5810N/A u32 noname:8;
5810N/A /* QP number for the remote node. */
5810N/A u32 remote_qp:24;
5810N/A /* Q-Key for the remote node. */
5810N/A u32 qkey;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_qp [ 8 byte] */
5810N/A
5810N/A/* Local address structure. */
5810N/Astruct psif_wr_local {
5810N/A /* Host address. */
5810N/A u64 addr;
5810N/A /* Local key used to validate the memory region this address is pointing to. */
5810N/A u32 lkey;
5810N/A /* This is the total length of the message. */
5810N/A u32 length;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_local [16 byte] */
5810N/A
5810N/Astruct psif_wr_addr {
5810N/A /* Reserved */
5810N/A u32 noname:8;
5810N/A /* Index into the Address Handle Array. */
5810N/A u32 ah_indx:24;
5810N/A} PSIF_PACKED; /* struct psif_wr_addr [ 4 byte] */
5810N/A
5810N/A/*
5810N/A * This header is used for IB send operations. The header is a union and
5810N/A * consists of either a connected mode header or a datagram mode header. The
5810N/A * following opcodes are using this header: PSIF_WR_SEND PSIF_WR_SEND_IMM
5810N/A * PSIF_WR_SPECIAL_QP_SEND PSIF_WR_QP0_SEND_DR_XMIT
5810N/A * PSIF_WR_QP0_SEND_DR_LOOPBACK PSIF_WR_EPS_SPECIAL_QP_SEND
5810N/A * PSIF_WR_EPS_QP0_SEND_DR_XMIT PSIF_WR_EPS_QP0_SEND_DR_LOOPBACK PSIF_WR_LSO
5810N/A */
5810N/Astruct psif_wr_send_header_ud {
5810N/A struct psif_wr_qp qp;
5810N/A struct psif_wr_local local_addr;
5810N/A /* Header used for IB send commands using UD mode. */
5810N/A /* Inlined ud : struct psif_wr_ud_send (224 bits) */
5810N/A struct psif_wr_addr remote_addr;
5810N/A /* Reserved */
5810N/A u32 noname:18;
5810N/A /*
5810N/A * Max segment size used for PSIF_WR_LSO. This field is not used for other
5810N/A * operations.
5810N/A */
5810N/A u32 mss:14;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_send_header_ud [32 byte] */
5810N/A
5810N/A/*
5810N/A * This header is used for IB send operations. The header is a union and
5810N/A * consists of either a connected mode header or a datagram mode header. The
5810N/A * following opcodes are using this header: PSIF_WR_SEND PSIF_WR_SEND_IMM
5810N/A * PSIF_WR_SPECIAL_QP_SEND PSIF_WR_QP0_SEND_DR_XMIT
5810N/A * PSIF_WR_QP0_SEND_DR_LOOPBACK PSIF_WR_EPS_SPECIAL_QP_SEND
5810N/A * PSIF_WR_EPS_QP0_SEND_DR_XMIT PSIF_WR_EPS_QP0_SEND_DR_LOOPBACK PSIF_WR_LSO
5810N/A */
5810N/Astruct psif_wr_send_header_uc_rc_xrc {
5810N/A struct psif_wr_local local_addr;
5810N/A /*
5810N/A * Reserved. XXX: FIX ME - calculation of this field based on constant, not
5810N/A * psif_wr_local_address_header as it should.
5810N/A */
5810N/A u32 reserved10[3];
5810N/A /* Header used with IB send commands using connected mode. */
5810N/A /* Inlined uc_rc_xrc : struct psif_wr_cm (224 bits) */
5810N/A /* Reserved */
5810N/A u32 noname:18;
5810N/A /*
5810N/A * Max segment size used for PSIF_WR_LSO. This field is not used for other
5810N/A * operations.
5810N/A */
5810N/A u32 mss:14;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_send_header_uc_rc_xrc [32 byte] */
5810N/A
5810N/A/*
5810N/A * This header is used for IB send operations. The header is a union and
5810N/A * consists of either a connected mode header or a datagram mode header. The
5810N/A * following opcodes are using this header: PSIF_WR_SEND PSIF_WR_SEND_IMM
5810N/A * PSIF_WR_SPECIAL_QP_SEND PSIF_WR_QP0_SEND_DR_XMIT
5810N/A * PSIF_WR_QP0_SEND_DR_LOOPBACK PSIF_WR_EPS_SPECIAL_QP_SEND
5810N/A * PSIF_WR_EPS_QP0_SEND_DR_XMIT PSIF_WR_EPS_QP0_SEND_DR_LOOPBACK PSIF_WR_LSO
5810N/A */
5810N/Aunion psif_wr_send_header {
5810N/A /* Header used for IB send commands using UD mode. */
5810N/A struct psif_wr_send_header_ud ud;
5810N/A /* Header used with IB send commands using connected mode. */
5810N/A struct psif_wr_send_header_uc_rc_xrc uc_rc_xrc;
5810N/A} PSIF_PACKED; /* union psif_wr_send_header [32 byte] */
5810N/A
5810N/A/* Remote address structure. */
5810N/Astruct psif_wr_remote {
5810N/A /* Address to the remote side. */
5810N/A u64 addr;
5810N/A /*
5810N/A * Remote key used to validate the memory region the associated address is
5810N/A * pointing to.
5810N/A */
5810N/A u32 rkey;
5810N/A /* For RDMA and DM this is the length to add to dmalen in RETH of IB packet. */
5810N/A u32 length;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_remote [16 byte] */
5810N/A
5810N/A/*
5810N/A * This header is used for RDMA type operations. The following opcodes are
5810N/A * using this header: PSIF_WR_RDMA_WR PSIF_WR_RDMA_WR_IMM PSIF_WR_RDMA_RD
5810N/A * PSIF_WR_CMP_SWAP PSIF_WR_FETCH_ADD PSIF_WR_MASK_CMP_SWAP
5810N/A * PSIF_WR_MASK_FETCH_ADD
5810N/A */
5810N/Astruct psif_wr_rdma {
5810N/A struct psif_wr_local local_addr;
5810N/A struct psif_wr_remote remote_addr;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_rdma [32 byte] */
5810N/A
5810N/A/* Send completion ID. */
5810N/Astruct psif_send_completion_id {
5810N/A /*
5810N/A * Completion queue sequence number for the completion queue being re-armed.
5810N/A * This is going into the completion for the privileged request.
5810N/A */
5810N/A u32 sequence_number;
5810N/A /*
5810N/A * Send queue sequence number. This is used to map the completion back to a
5810N/A * request in the send queue.
5810N/A */
5810N/A u16 sq_seq_num;
5810N/A /*
5810N/A * This field is only valid for ring buffer send completions (proxy type send
5810N/A * requests). In all other cases this field is ignored.
5810N/A */
5810N/A u16 eps_tag;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_send_completion_id [ 8 byte] */
5810N/A
5810N/A/* Event completion ID. */
5810N/Astruct psif_event_completion_id {
5810N/A /* Reserved */
5810N/A u64 noname:40;
5810N/A /* Completion queue descriptor ID which is the source of the event. */
5810N/A u64 cq_id:24;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_event_completion_id [ 8 byte] */
5810N/A
5810N/A/* Union containing a send or receive completion ID. */
5810N/Aunion psif_completion_wc_id {
5810N/A /*
5810N/A * Receive Queue completion ID. This is the receive queue entry ID found as
5810N/A * part of receive queue entry.
5810N/A */
5810N/A u64 rq_id;
5810N/A /*
5810N/A * Send Queue completion ID. This contain the send queue sequence number. In
5810N/A * ring buffer send completions this field also conatain a valid EPS tag.
5810N/A */
5810N/A struct psif_send_completion_id sq_id;
5810N/A /* Completion queue descriptor ID which is the source of the event. */
5810N/A struct psif_event_completion_id ecq_id;
5810N/A} PSIF_PACKED; /* union psif_completion_wc_id [ 8 byte] */
5810N/A
5810N/A/*
5810N/A * Union used for descriptor types used when operations on the descriptors
5810N/A * themselves are done, like invalidation, resizing etc. It can the take the
5810N/A * follwing types: rq_id xrq_id cq_id target_qp
5810N/A */
5810N/Aunion psif_descriptor_union {
5810N/A /*
5810N/A * Receive queue descriptor used for the following request:
5810N/A * PSIF_WR_SET_SRQ_LIM: this is the receive queue to set the new limit for.
5810N/A * PSIF_WR_INVALIDATE_RQ: this is the receive queue to invalidate/flush from
5810N/A * the descriptor cache.
5810N/A */
5810N/A u32 rq_id:24;
5810N/A /*
5810N/A * XRCSRQ descriptor used for the following request: PSIF_WR_SET_XRCSRQ_LIM:
5810N/A * this is the XRCSRQ to set the new limit for. PSIF_WR_INVALIDATE_XRCSRQ:
5810N/A * this is the XRCSRQ to invalidate/flush from the descriptor cache.
5810N/A */
5810N/A u32 xrq_id:24;
5810N/A /*
5810N/A * Completion queue descriptor ID used when operations are done on the CQ
5810N/A * descriptor, no completion is sent to this CQ. This field is valid for
5810N/A * PSIF_WR_INVALIDATE_CQ, PSIF_WR_RESIZE_CQ, PSIF_WR_REQ_CMPL_NOTIFY,
5810N/A * PSIF_WR_CMPL_NOTIFY_RCVD, PSIF_WR_REARM_CMPL_EVENT.
5810N/A */
5810N/A u32 cq_id:24;
5810N/A /*
5810N/A * Target QP for PSIF_WR_INVALIDATE_SGL_CACHE command. This field is also
5810N/A * valid for PSIF_WR_GENERATE_COMPLETION, then this is the QP number put in
5810N/A * the completion.
5810N/A */
5810N/A u32 target_qp:24;
5810N/A} PSIF_PACKED; /* union psif_descriptor_union [ 3 byte] */
5810N/A
5810N/A/*
5810N/A * This header is used for privileged operations. The following opcodes are
5810N/A * using this header: PSIF_WR_INVALIDATE_LKEY PSIF_WR_INVALIDATE_RKEY
5810N/A * PSIF_WR_INVALIDATE_BOTH_KEYS PSIF_WR_INVALIDATE_TLB PSIF_WR_RESIZE_CQ
5810N/A * PSIF_WR_SET_SRQ_LIM PSIF_WR_SET_XRCSRQ_LIM PSIF_WR_REQ_CMPL_NOTIFY
5810N/A * PSIF_WR_CMPL_NOTIFY_RCVD PSIF_WR_REARM_CMPL_EVENT
5810N/A * PSIF_WR_GENERATE_COMPLETION PSIF_WR_INVALIDATE_RQ PSIF_WR_INVALIDATE_CQ
5810N/A * PSIF_WR_INVALIDATE_XRCSRQ PSIF_WR_INVALIDATE_SGL_CACHE
5810N/A */
5810N/Astruct psif_wr_su {
5810N/A /* PSIF_WR_GENERATE_COMPLETION: This is the WC ID to put in the completion. */
5810N/A union psif_completion_wc_id wc_id;
5810N/A /*
5810N/A * PSIF_WR_INVALIDATE_TLB: this is the address vector to invalidate in the
5810N/A * TLB. PSIF_WR_RESIZE_CQ: this is the new address of the CQ.
5810N/A */
5810N/A u64 addr;
5810N/A /*
5810N/A * PSIF_WR_INVALIDATE_LKEY: key to invalidate/flush from the DMA VT cache.
5810N/A * PSIF_WR_INVALIDATE_RKEY: key to invalidate/flush from the DMA VT cache.
5810N/A * PSIF_WR_INVALIDATE_BOTH_KEYS: key to invalidate/flush from the DMA VT
5810N/A * cache. PSIF_WR_INVALIDATE_TLB: this is the address vector to invalidate in
5810N/A * the TLB.
5810N/A */
5810N/A u32 key;
5810N/A /*
5810N/A * PSIF_WR_INVALIDATE_TLB: this is the length for invalidate in the TLB. Only
5810N/A * the lower 16 bits are valid for specifying length of TLB invalidation.
5810N/A * PSIF_WR_RESIZE_CQ: this is the new length of the CQ.
5810N/A */
5810N/A u32 length;
5810N/A /* This is used by the PSIF_WR_SET_SRQ_LIM request. */
5810N/A u64 srq_lim:14;
5810N/A /* Reserved */
5810N/A u64 noname:10;
5810N/A /*
5810N/A * This field is valid for PSIF_WR_GENERATE_COMPLETION. This is the opcode
5810N/A * going into the completion.
5810N/A */
5810N/A enum psif_wc_opcode completion_opcode:8;
5810N/A
5810N/A /*
5810N/A * This field is valid for PSIF_WR_GENERATE_COMPLETION. This is the
5810N/A * completion status to put in the completion.
5810N/A */
5810N/A enum psif_wc_status completion_status:8;
5810N/A
5810N/A union psif_descriptor_union u2;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr_su [32 byte] */
5810N/A
5810N/A/* SEND RDMA DM ATOMIC or PRIVILEGED data - depending on opcode. */
5810N/Aunion psif_wr_details {
5810N/A union psif_wr_send_header send;
5810N/A struct psif_wr_rdma rdma;
5810N/A struct psif_wr_rdma atomic;
5810N/A struct psif_wr_su su;
5810N/A} PSIF_PACKED; /* union psif_wr_details [32 byte] */
5810N/A
5810N/Astruct psif_wr_xrc {
5810N/A /* Reserved */
5810N/A u32 noname:8;
5810N/A /* Descriptor index for XRC SRQ. */
5810N/A u32 xrqd_id:24;
5810N/A} PSIF_PACKED; /* struct psif_wr_xrc [ 4 byte] */
5810N/A
5810N/A/* PSIF work request. */
5810N/Astruct psif_wr { /* Subjected to copy and convert */
5810N/A /* Indicates shat type of request this is. */
5810N/A enum psif_wr_type op:8;
5810N/A
5810N/A /*
5810N/A * QP sending this request. XXX: Should name be own_qp_num as defined in QP
5810N/A * state?
5810N/A */
5810N/A u32 local_qp:24;
5810N/A /*
5810N/A * The TSL (Tsu SL) must be matched against the TSL in the QP State (XXX: or
5810N/A * in the AHA?). If it is unequal, the QP should be put in error.
5810N/A */
5810N/A u16 tsu_sl:4;
5810N/A /* Port number to use for QP0/1 packets. This field is ignored if not QP0/1. */
5810N/A enum psif_port port:1;
5810N/A
5810N/A /* Only applicable to UD. This is an indication that AHA should be used. */
5810N/A enum psif_use_ah ud_pkt:1;
5810N/A
5810N/A /*
5810N/A * High Bandwidth/Low Latency BAR. The QoSL must be matched against the QoSL
5810N/A * in the QP State. If it is unequal, the QP should be in error.
5810N/A */
5810N/A enum psif_tsu_qos tsu_qosl:1;
5810N/A
5810N/A /* Length (number of bytes of valid data in the collect payload buffer). */
5810N/A u16 collect_length:9;
5810N/A /*
5810N/A * Send queue sequence number. Used to map request to a particular work
5810N/A * request in the send queue.
5810N/A */
5810N/A u16 sq_seq;
5810N/A /* Solicited event bit to be set in IB packet. */
5810N/A u64 se:1;
5810N/A /* Dynamic MTU is enabled for this work request. */
5810N/A u64 dynamic_mtu_enable:1;
5810N/A /* L3 checksum enabled when set. This is used for EoIB and IPoIB packets. */
5810N/A u64 l3_checksum_en:1;
5810N/A /* L4 checksum enabled when set. This is used for EoIB and IPoIB packets. */
5810N/A u64 l4_checksum_en:1;
5810N/A /* Number of SGL entries are valid for this request. */
5810N/A u64 num_sgl:4;
5810N/A /* UF used for DR loopback packets. This field is ignored otherwise. */
5810N/A u64 destuf:6;
5810N/A /* Reserved */
5810N/A u64 noname:2;
5810N/A /*
5810N/A * EPS tag - used by EPS to associate process and work request. This field is
5810N/A * not used by non-EPS work requests.
5810N/A */
5810N/A u64 eps_tag:16;
5810N/A /* Completion notification identifier. */
5810N/A u64 completion:1;
5810N/A /* Fence indicator. */
5810N/A u64 fence:1;
5810N/A /* UF used for all EPS-C QP0/1 packets. This field is ignored otherwise. */
5810N/A u64 srcuf:6;
5810N/A /* Union between VLAN priority and CQ descriptor ID. */
5810N/A union psif_cq_desc_vlan_pri cq_desc_vlan_pri_union;
5810N/A /* Inlined common : struct psif_wr_common (192 bits) */
5810N/A /*
5810N/A * Checksum used for data protection and consistency between work request and
5810N/A * QP state.
5810N/A */
5810N/A u32 checksum;
5810N/A /* Immediate data is only valid when indicated by the opcode. */
5810N/A u64 imm:32;
5810N/A union psif_wr_details details;
5810N/A struct psif_wr_xrc xrc_hdr;
5810N/A /* Manually added spacing to pad out wr */
5810N/A u32 space20;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_wr [64 byte] */
5810N/A
5810N/A/** \brief Table of TSU SL and QoS mappings
5810N/A * \details
5810N/A * Driver queries EPS-C for mapping of privileged QP and Infinband SL to
5810N/A * TSU SL and QoS. These values then need to be applied in QP and WR
5810N/A * as well as selecting hi or low PCIe BAR VCB (tqos) to obtain PSIF TSU
5810N/A * internal traffic separation.
5810N/A */
5810N/Astruct psif_tsl_map {
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m7_tsl:4;
5810N/A u16 noname:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m7_tqos:1;
5810N/A
5810N/A u16 noname1:1;
5810N/A /* Inlined m6 : struct psif_tsl_map_entry (8 bits) */
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m6_tsl:4;
5810N/A u16 noname2:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m6_tqos:1;
5810N/A
5810N/A u16 noname3:1;
5810N/A /* Inlined m5 : struct psif_tsl_map_entry (8 bits) */
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m5_tsl:4;
5810N/A u16 noname4:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m5_tqos:1;
5810N/A
5810N/A u16 noname5:1;
5810N/A /* Inlined m4 : struct psif_tsl_map_entry (8 bits) */
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m4_tsl:4;
5810N/A u16 noname6:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m4_tqos:1;
5810N/A
5810N/A u16 noname7:1;
5810N/A /* Inlined m3 : struct psif_tsl_map_entry (8 bits) */
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m3_tsl:4;
5810N/A u16 noname8:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m3_tqos:1;
5810N/A
5810N/A u16 noname9:1;
5810N/A /* Inlined m2 : struct psif_tsl_map_entry (8 bits) */
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m2_tsl:4;
5810N/A u16 noname10:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m2_tqos:1;
5810N/A
5810N/A u16 noname11:1;
5810N/A /* Inlined m1 : struct psif_tsl_map_entry (8 bits) */
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m1_tsl:4;
5810N/A u16 noname12:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m1_tqos:1;
5810N/A
5810N/A u16 noname13:1;
5810N/A /* Inlined m0 : struct psif_tsl_map_entry (8 bits) */
5810N/A /* PSIF TSU SL assignmnet */
5810N/A u16 m0_tsl:4;
5810N/A u16 noname14:2;
5810N/A /* PSIF TSU QoS selection */
5810N/A enum psif_tsu_qos m0_tqos:1;
5810N/A
5810N/A u16 noname15:1;
5810N/A /* Inlined m7 : struct psif_tsl_map_entry (8 bits) */
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_tsl_map [ 8 byte] */
5810N/A
5810N/A/* Hardware structure indicating what is the next QP. */
5810N/Astruct psif_next {
5810N/A /* QP number for the next QP to be processed. */
5810N/A u32 next_qp_num:24;
5810N/A /*
5810N/A * If all high, the next pointer is null. If next_null == 1, it is transport
5810N/A * timer on evicted QP
5810N/A */
5810N/A u32 next_null:8;
5810N/A} PSIF_PACKED; /* struct psif_next [ 4 byte] */
5810N/A
5810N/A/* Response (ACK) data structure used by the response queue descriptor. */
5810N/Astruct psif_rspq_ack_data {
5810N/A enum ib_opcode opcode:8;
5810N/A
5810N/A /* ib_bth_psn(24[0] bits)Packet Sequence Number */
5810N/A u32 psn:24;
5810N/A /* ib_aeth_syndrome(8[0] bits)Syndrome */
5810N/A u32 syndrome:8;
5810N/A /* ib_aeth_msn(24[0] bits)Message Sequence Number */
5810N/A u32 msn:24;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rspq_ack_data [ 8 byte] */
5810N/A
5810N/A/* Response descriptor structure used by the response queue descriptor. */
5810N/Astruct psif_rspq_rsp_descriptor {
5810N/A /* QP and UF to be processed next. */
5810N/A struct psif_next rspq_next;
5810N/A u32 rspq_done:1;
5810N/A u32 head_dup_ack:1;
5810N/A u32 head_ack:1;
5810N/A /* resp_sched_sched_ptr(5[0] bits) * Write pointer type to rdma read and atomic data stored in reqsponse queue
5810N/A * descriptor. Every time an rdma read and atomic is performed, this pointer
5810N/A * is incremented.
5810N/A */
5810N/A u32 head_sched_ptr:5;
5810N/A /* ib_bth_psn(24[0] bits)Packet Sequence Number */
5810N/A u32 head_count_sched:24;
5810N/A struct psif_rspq_ack_data tail_ack_aeth;
5810N/A /* Reserved */
5810N/A u64 noname:6;
5810N/A /*
5810N/A * This bit is set through the doorbell. SW should initialize this bit to 0
5810N/A * when the QP is setup and check this bit plus psif_next = null to ensure SW
5810N/A * can own the RSPQ descriptor
5810N/A */
5810N/A u64 destroyed:1;
5810N/A u64 tail_ack:1;
5810N/A /* Reserved */
5810N/A u64 noname1:3;
5810N/A /* resp_sched_sched_ptr(5[0] bits) * Write pointer type to rdma read and atomic data stored in reqsponse queue
5810N/A * descriptor. Every time an rdma read and atomic is performed, this pointer
5810N/A * is incremented.
5810N/A */
5810N/A u64 tail_sched_ptr:5;
5810N/A /* ib_bth_psn(24[0] bits)Packet Sequence Number */
5810N/A u64 tail_count_sched:24;
5810N/A /* Reserved */
5810N/A u64 noname2:7;
5810N/A u64 tail_dup_ack:1;
5810N/A /* Inlining rspq_ack_data_t tail_dup_ack_aeth due to bondary violation */
5810N/A enum ib_opcode opcode:8;
5810N/A
5810N/A /* psn divided in two to mitigate for 64 bit bondary crossing */
5810N/A u16 psn_0_7:8;
5810N/A u64 psn_8_23:16;
5810N/A /* ib_aeth_syndrome(8[0] bits)Syndrome */
5810N/A u64 syndrome:8;
5810N/A /* ib_aeth_msn(24[0] bits)Message Sequence Number */
5810N/A u64 msn:24;
5810N/A /* Reserved */
5810N/A u64 noname3:16;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rspq_rsp_descriptor [32 byte] */
5810N/A
5810N/A/* Temp.definition of content */
5810N/Astruct psif_sq_tvl {
5810N/A /* Content pt. not defined in ASIC XML */
5810N/A u64 something_tbd[2];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_sq_tvl [16 byte] */
5810N/A
5810N/A/* This is the portion of the descriptor which is updated by software. */
5810N/Astruct psif_sq_sw { /* Subjected to copy and convert */
5810N/A /* Reserved */
5810N/A u16 noname:16;
5810N/A /*
5810N/A * Index to where elements are added to the send queue by SW. SW is
5810N/A * responsibel for keeping track of how many entries there are in the send
5810N/A * queue. I.e. SW needs to keep track of the head_index so it doesn't
5810N/A * overwrite entries in the send queue which is not yet completed.
5810N/A */
5810N/A u16 tail_indx;
5810N/A /* Info: Edge padding added (for endian convert) */
5810N/A u32 space21;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_sq_sw [ 8 byte] */
5810N/A
5810N/A/* Temp.definition of content */
5810N/Astruct psif_sq_rspq {
5810N/A /* Content pt. not defined in ASIC XML */
5810N/A u64 something_tbd[52];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_sq_rspq [416 byte] */
5810N/A
5810N/A/* Descriptor used by the send queue scheduler to operate on the send queue. */
5810N/Astruct psif_sq_hw { /* Subjected to copy and convert */
5810N/A /* QP and UF to be processed next. */
5810N/A struct psif_next sq_next;
5810N/A /*
5810N/A * Send queue sequence number used by the SQS to maintain ordering and keep
5810N/A * track of where which send queue elements to fetch. This field is not in
5810N/A * sync with the field in qp_t. This number is typically a little bit before
5810N/A * the number in the qp_t as SQS has to fetch the elements from host memory.
5810N/A * This is also used as tail_index when checking if there are more elements
5810N/A * in the send queue.
5810N/A */
5810N/A u16 last_seq;
5810N/A u16 u_1;
5810N/A u32 u_2;
5810N/A /* Reserved */
5810N/A u32 noname:4;
5810N/A /*
5810N/A * This bit is set through the doorbell. SW should check this bit plus
5810N/A * psif_next = null to ensure SW can own the SQ descriptor.
5810N/A */
5810N/A u32 destroyed:1;
5810N/A /*
5810N/A * Done[0] is set when the last SQ WR is processed (sq_sequence_number ==
5810N/A * tail_indx). When done[0] is set, SQS only process the SQ WR when
5810N/A * sq_sequence_number != tail_index. Done[1] is set when done[0] is set and
5810N/A * sq_sequence_number == tail_index.
5810N/A */
5810N/A u32 sq_done:2;
5810N/A /*
5810N/A * Timestamp qualifier. This bit is set when retry is entered to the queue
5810N/A * and clear when the timestamp has expired.
5810N/A */
5810N/A u32 sq_timestamp_valid:1;
5810N/A /*
5810N/A * Indication if this QP is configured as a low latency or high throughput
5810N/A * quality of service level.
5810N/A */
5810N/A u32 qos:1;
5810N/A /*
5810N/A * The size between each work queue element in the send queue. This is the
5810N/A * shift value to use in order to find the start of a work queue element.
5810N/A */
5810N/A u32 extent_log2:5;
5810N/A /* Maximum number of SGEs supported by this send queue. */
5810N/A u32 sq_max_sge:5;
5810N/A /* Maximum number of SGEs supported by this send queue. */
5810N/A u32 size_log2:4;
5810N/A /* Maximum inline data length supported by this send queue. */
5810N/A u32 sq_max_inline:9;
5810N/A /* The base address to the send queue. */
5810N/A u64 base_addr;
5810N/A /* The MMU context used to get the send queue. */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_sq_hw [32 byte] */
5810N/A
5810N/A/* Temp.definition of Send queue content */
5810N/Astruct psif_sq_entry { /* Subjected to copy and convert */
5810N/A /* Content pt. not defined in ASIC XML */
5810N/A struct psif_wr wr;
5810N/A u64 payload[32];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_sq_entry [320 byte] */
5810N/A
5810N/A/**
5810N/A * SQS ring buffer entry
5810N/A */
5810N/Astruct psif_sq_ring {
5810N/A u64 something;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_sq_ring [ 8 byte] */
5810N/A
5810N/A/* Temp.definition of the send queue entry cache for the completion block
5810N/A * The only info used by the driver is the size of this struct,
5810N/A * when allocating space for the cache in memory:
5810N/A */
5810N/Astruct psif_sq_cmpl {
5810N/A /* Content pt. not defined in ASIC XML */
5810N/A u64 payload[8];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_sq_cmpl [64 byte] */
5810N/A
5810N/A/* Recveive queue scatter entry. */
5810N/Astruct psif_rq_scatter {
5810N/A /* Base address for this scatter element. */
5810N/A u64 base_addr;
5810N/A /* Length of scatter element. */
5810N/A u32 length;
5810N/A /* L-Key to be used for this scatter element. */
5810N/A u32 lkey;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rq_scatter [16 byte] */
5810N/A
5810N/A/* Data type for TSU_RQH_QP_BASE_ADDR - rq scratch pad
5810N/A * Layout as defined by struct psif_rq_entry
5810N/A */
5810N/Astruct psif_rqsp {
5810N/A /*
5810N/A * Receive queue entry ID. This is added to the receive completion using this
5810N/A * receive queue entry.
5810N/A */
5810N/A u64 rqe_id;
5810N/A /* Scatter entries for this receive queue element. */
5810N/A struct psif_rq_scatter scatter[16];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rqsp [264 byte] */
5810N/A
5810N/A/* This is the part of the descriptor which is updated by SW (user space). */
5810N/Astruct psif_rq_sw { /* Subjected to copy and convert */
5810N/A /* Reserved */
5810N/A u32 noname:18;
5810N/A /* Software modified index pointing to the tail reecive entry in host memory. */
5810N/A u32 tail_indx:14;
5810N/A /* Info: Edge padding added (for endian convert) */
5810N/A u32 space22;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rq_sw [ 8 byte] */
5810N/A
5810N/Astruct psif_rq_hw { /* Subjected to copy and convert */
5810N/A /*
5810N/A * Do not evict this entry if this bit is set. There can only be a fixed
5810N/A * number of descriptors with this bit set. XXX: Should this be used as a
5810N/A * hint, or should it be fixed?
5810N/A */
5810N/A u32 sticky:1;
5810N/A /* This is a shared receive queue. This is always set for XRCSRQs. */
5810N/A u32 srq:1;
5810N/A /* The shared receive queue is in error. */
5810N/A u32 srq_err:1;
5810N/A /* Reserved */
5810N/A u32 noname:1;
5810N/A /* This is indicating how many scatter entries are valid. */
5810N/A u32 scatter:4;
5810N/A /* pd(24[0] bits)Protection domain. */
5810N/A u32 pd:24;
5810N/A /* This is the shift value to use to find start of the receive queue element. */
5810N/A u32 extent_log2:4;
5810N/A /*
5810N/A * Hardware modified index pointing to the head of the receive queue. TSU is
5810N/A * using this to find the address of the receive queue entry.
5810N/A */
5810N/A u32 head_indx:14;
5810N/A /*
5810N/A * If set to something greater than zero, event notification is armed. An
5810N/A * Affiliated Synchronous Event will be sent when number of WQE are less than
5810N/A * srq_lim.
5810N/A */
5810N/A u32 srq_lim:14;
5810N/A /* Base address for the receive queue in host memory. */
5810N/A u64 base_addr;
5810N/A /* Hardware updated portion of descriptor. */
5810N/A /* Inlined hw_no_pad : struct psif_rq_no_pad (256 bits) */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /*
5810N/A * Log2 size of the receive queue. Maximum number of entries in the receive
5810N/A * queue. This is used for calculating when to wrap the head and tail
5810N/A * indexes.
5810N/A */
5810N/A u64 size_log2:4;
5810N/A /*
5810N/A * Pre-fetch threshold (clog2) indicating when to read the software portion
5810N/A * of the descriptor. If there are less entries than indicated by this
5810N/A * threshold, the software portion of the descriptor must be read.
5810N/A */
5810N/A u64 prefetch_threshold_log2:4;
5810N/A /* The desciptor is valid. */
5810N/A u64 valid:1;
5810N/A /* Reserved */
5810N/A u64 noname1:55;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rq_hw [32 byte] */
5810N/A
5810N/A/* A receive queue entry structure contianing scatter entries. */
5810N/Astruct psif_rq_entry { /* Subjected to copy and convert */
5810N/A /*
5810N/A * Receive queue entry ID. This is added to the receive completion using this
5810N/A * receive queue entry.
5810N/A */
5810N/A u64 rqe_id;
5810N/A /* Scatter entries for this receive queue element. */
5810N/A struct psif_rq_scatter scatter[16];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rq_entry [264 byte] */
5810N/A
5810N/A/* This is the portion of the descriptor which is updated by software. */
5810N/Astruct psif_rb_sw { /* Subjected to copy and convert */
5810N/A /* Index to ring buffer elements added by SW. */
5810N/A u32 head_indx;
5810N/A /* Info: Edge padding added (for endian convert) */
5810N/A u32 space23;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rb_sw [ 8 byte] */
5810N/A
5810N/A/*
5810N/A * Descriptor entry for a ring buffer. This entry is used to address into the
5810N/A * ring buffer and write the correct entries. This structure is the hardware
5810N/A * updateable part of the RB descriptor.
5810N/A */
5810N/Astruct psif_rb_hw { /* Subjected to copy and convert */
5810N/A /* Do not evict this entry if this bit is set. */
5810N/A u32 sticky:1;
5810N/A /*
5810N/A * This functionality is not valid unless armed is set. If set and incoming
5810N/A * message has SE bit set, an event should be generated to the event queue
5810N/A * indicated by eventq_dscr_id. If not set, an event is sent reqardless of
5810N/A * the value of the SE bit in the incoming message.
5810N/A */
5810N/A u32 filter_se:1;
5810N/A /*
5810N/A * When this bit is set, the solicited bit is used in order to send events to
5810N/A * event queues.
5810N/A */
5810N/A u32 armed:1;
5810N/A /* The descriptor is valid. */
5810N/A u32 valid:1;
5810N/A /* rb_size_log2(5[0] bits)Log2 size of the ring buffer. */
5810N/A u32 max_size_log2:5;
5810N/A /* Reserved */
5810N/A u32 noname:11;
5810N/A /*
5810N/A * Interrupt channel associated with the event queue. In the PSIF design the
5810N/A * event queues are one to one with interrupt channel.
5810N/A */
5810N/A u32 int_channel:7;
5810N/A /*
5810N/A * Log2 size of the ring buffer. The entries are specified as 64B entities.
5810N/A * The number indicates when the tail_index should wrap. If one message is
5810N/A * running over the edge, the message is stored in consecutive entries
5810N/A * outside the ring buffer. max_message_size additional space is added to the
5810N/A * edge of the buffer.
5810N/A */
5810N/A u32 size_log2:5;
5810N/A /* Index to ring buffer elements to be consumed by HW. */
5810N/A u32 tail_indx;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /*
5810N/A * VA or PA of the base of the completion queue. If PA the MMU context above
5810N/A * will be a bypass context. Updated by software. The head and tail pointers
5810N/A * can be calculated by the following calculations: Address = base_ptr +
5810N/A * (head * 64B ) Head Pointer and Tail Pointer will use the same MMU context
5810N/A * as the base, and all need to be VA from one address space, or all need to
5810N/A * be PA. In typical use, to allow direct user access to the head and tail
5810N/A * pointer VAs are used.
5810N/A */
5810N/A u64 base_addr;
5810N/A /* Reserved */
5810N/A u32 noname1:3;
5810N/A /*
5810N/A * Pre-fetch threshold (clog2) indicating when to read the software portion
5810N/A * of the descriptor. If there are less entries than indicated by this
5810N/A * threshold, the software portion of the descriptor must be read.
5810N/A */
5810N/A u32 prefetch_threshold_log2:5;
5810N/A /* pd(24[0] bits)Protection domain. */
5810N/A u32 pd:24;
5810N/A /* XXX: should this be defined as rb_sequence_number_t? */
5810N/A u32 sequence_number;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rb_hw [32 byte] */
5810N/A
5810N/A/*
5810N/A * Ring buffer header. A ring buffer header is preceding payload data when
5810N/A * written to host memory. The full message with RB header and payload data
5810N/A * is padded out to become a multiple of 64 bytes. The last 4 bytes of every
5810N/A * 64B data written, will contain the ring buffer sequence number.
5810N/A */
5810N/Astruct psif_rb_entry { /* Subjected to copy and convert */
5810N/A /*
5810N/A * Defining the packet type the headers valid for this ring buffer.
5810N/A * PSIF_RB_TYPE_INVALID PSIF_RB_TYPE_DM_PUT PSIF_RB_TYPE_DM_GET_RESP
5810N/A * PSIF_RB_TYPE_RCV_PROXY_COMPLETION
5810N/A * PSIF_RB_TYPE_RCV_PROXY_COMPLETION_AND_DATA
5810N/A * PSIF_RB_TYPE_SEND_PROXY_COMPLETION PSIF_RB_TYPE_SEND_COMPLETION
5810N/A */
5810N/A enum psif_rb_type pkt_type:3;
5810N/A
5810N/A /* Reserved */
5810N/A u32 noname:3;
5810N/A /* Applicable only if this is for EPS-A. */
5810N/A enum psif_eps_a_core eps_a_core:2;
5810N/A
5810N/A /* ib_bth_qp_number(24[0] bits)Queue Pair */
5810N/A u32 qp_num:24;
5810N/A /* Length of data associated with this ring buffer header. */
5810N/A u32 byte_len;
5810N/A /* Payload bulk */
5810N/A u64 payload[6];
5810N/A /* Payload last */
5810N/A u32 payload_tail;
5810N/A /* sequence number for sanity checking */
5810N/A u32 seq_num;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_rb_entry [64 byte] */
5810N/A
5810N/A/*
5810N/A * QP state information as laid out in system memory. This structure should
5810N/A * be used to cast the state information stored to a register.
5810N/A */
5810N/Astruct psif_qp_core { /* Subjected to copy and convert */
5810N/A /*
5810N/A * If set, this QP will not be evicted unless QP state is filled up by QPs
5810N/A * with this bit set.
5810N/A */
5810N/A u32 do_not_evict:1;
5810N/A /*
5810N/A * When 1, indicates that the receive queue of this QP is a shared receive
5810N/A * queue. This bit is used by tsu_err to classify errors.
5810N/A */
5810N/A u32 rq_is_srq:1;
5810N/A /* Bit used internally in tsu_cmpl. */
5810N/A u32 first_at_floor_seen:1;
5810N/A /*
5810N/A * Indication that a receive queue access is in progress. The bit is set on a
5810N/A * Send First packet and cleared on a Send Last packet. It is used to
5810N/A * indicate if there exists an RQ which can be re-used in the case of UC
5810N/A * transport packet drop.
5810N/A */
5810N/A u32 dscr_rq_in_progress:1;
5810N/A /*
5810N/A * This is a multicast QP, and is creating UC multicasts. The is_multicast
5810N/A * bit is based on the destination QP being the multicast QP number
5810N/A * (0xffffff). When the QP is not a UD QP, this bit is forwarded to DMA as
5810N/A * the is_multicast bit.
5810N/A */
5810N/A u32 is_multicast:1;
5810N/A /*
5810N/A * Current number of retired read or atomic requests. Initialze to zero.
5810N/A * Updated by tsu_cmpl every time a read or atomic request is completed.
5810N/A */
5810N/A u32 current_retired:5;
5810N/A /*
5810N/A * Current number of outstanding read or atomic requests. Intialize to zero.
5810N/A * It is updated by tsu_rqs every time a new read or atomic requests is
5810N/A * transmitted.
5810N/A */
5810N/A u32 current_outstanding:5;
5810N/A /* The size (log2 number of entries) of the send queue. */
5810N/A u32 sq_clog2_size:4;
5810N/A /* Send queue extent - the clog2 size between the work requests. */
5810N/A u32 sq_clog2_extent:5;
5810N/A /* A hit in the set locally spun out of tsu_cmpl is found. */
5810N/A u32 spin_hit:1;
5810N/A /*
5810N/A * When 1, indicates that the receive queue of this QP is a shared receive
5810N/A * queue. This bit is used by tsu_err to classify errors.
5810N/A */
5810N/A u32 cq_in_err:1;
5810N/A /*
5810N/A * Retry counter associated with retries to received NAK or implied NAK. If
5810N/A * it expires, a path migration will be attempted if it is armed, or the QP
5810N/A * will go to error state. Read by tsu_dma and used by tsu_cmpl.
5810N/A */
5810N/A u32 error_retry_count:3;
5810N/A /*
5810N/A * Error retry counter initial value. Read by tsu_dma and used by tsu_cmpl to
5810N/A * calculate exp_backoff etc..
5810N/A */
5810N/A u32 error_retry_init:3;
5810N/A /*
5810N/A * The XRC domain is used to check against the XRC domain in the XRCSRQ
5810N/A * descriptor indexed by the request. If the XRC domain matches, the
5810N/A * protection domain in the XRCSRQ descriptor is used instead of the
5810N/A * protection domain associated with the QP.
5810N/A */
5810N/A u32 xrc_domain:24;
5810N/A /*
5810N/A * If the DMA is getting an R-Key violation or an error from PCIe when
5810N/A * fetching data for RDMA read responses, it has to set this bit. When set,
5810N/A * all packets sitting behind the RDMA read on this QP (requests and
5810N/A * responses), must be marked bad so they are not transmitted on IB.
5810N/A */
5810N/A u32 resp_access_error:1;
5810N/A /*
5810N/A * If the DMA is getting an L-Key violation or an error from PCIe when
5810N/A * fetching data for requests, it has to set this bit. When set, all requests
5810N/A * behind must be marked in error and not transmitted on IB. Responses are
5810N/A * sent as normal.
5810N/A */
5810N/A u32 req_access_error:1;
5810N/A /*
5810N/A * This retry tag is updated by the error block when an error occur. If
5810N/A * tsu_rqs reads this retry tag and it is different than the
5810N/A * retry_tag_comitted, tsu_rqs must update retry_tag_comitted to the value of
5810N/A * retry_tag_err when the sq_sequence_number indicates this is the valid
5810N/A * request. The sq_sequence_number has been updated by tsu_err at the same
5810N/A * time the retry_tag_err is updated.
5810N/A */
5810N/A u32 retry_tag_err:3;
5810N/A /*
5810N/A * This retry tag is the one used by tsu_rqs and added to the packets sent to
5810N/A * tsu_dma. It is the responsibility of tsu_rqs to update this retry tag
5810N/A * whenever the sq_sequence_number in QP state is equal to the one in the
5810N/A * request.
5810N/A */
5810N/A u32 retry_tag_committed:3;
5810N/A /* R-Key of received multipacket message. */
5810N/A u32 rcv_rkey;
5810N/A /* QP number for the remote node. */
5810N/A u32 remote_qp:24;
5810N/A /* QP State for this QP. */
5810N/A enum psif_qp_state state:3;
5810N/A
5810N/A /*
5810N/A * Minium RNR NAK timeout. This is added to RNR NAK packets and the requester
5810N/A * receiving the RNR NAK must wait until the timer has expired before the
5810N/A * retry is sent.
5810N/A */
5810N/A u32 min_rnr_nak_time:5;
5810N/A /* sq_seq(16[0] bits) * Send queue sequence number. This sequence number is used to make sure
5810N/A * order is maintained for requests sent from the process/host.
5810N/A */
5810N/A u16 sq_seq;
5810N/A /* sq_seq(16[0] bits) * Send queue sequence number. This sequence number is used to make sure
5810N/A * order is maintained for requests sent from the process/host.
5810N/A */
5810N/A u16 retry_sq_seq;
5810N/A /*
5810N/A * Number of bytes received for in progress RDMA RD Responses. This is
5810N/A * maintained by tsu_cmpl.
5810N/A */
5810N/A u32 rcv_bytes;
5810N/A /*
5810N/A * Completion queue sequence number. This is used for privileged requests,
5810N/A * where sequence number for one CQ is added to a different completion.
5810N/A */
5810N/A u32 cq_seq;
5810N/A /*
5810N/A * Magic number used to verify use of QP state. This is done by calculating a
5810N/A * checksum of the work request incorporating the magic number. This checksum
5810N/A * is checked against the checksum in the work request.
5810N/A */
5810N/A u32 magic;
5810N/A /*
5810N/A * Sequence number of the last ACK received. Read and written by tsu_cmpl.
5810N/A * Used to verify that the received response packet is a valid response.
5810N/A */
5810N/A u32 last_acked_psn:24;
5810N/A /*
5810N/A * This is set by CMPL when there are outstanding requests and a TX error is
5810N/A * received from DMA. It is cleared when the error is sent on.
5810N/A */
5810N/A enum psif_cmpl_outstanding_error outstanding_error:4;
5810N/A
5810N/A /*
5810N/A * Bit used for internal use when QP is moved to error and error completions
5810N/A * etc should be sent. Should alway be initialized to zero by SW.
5810N/A */
5810N/A u32 request_handled:1;
5810N/A /*
5810N/A * When 1, indicates that we have started a flush retry. SQ or QP in error.
5810N/A * Must be cleared on modify QP - SQErr to RTS.
5810N/A */
5810N/A u32 flush_started:1;
5810N/A /* When 1 indicates that we have a fence retry outstanding. */
5810N/A u32 fence_retry_outstanding:1;
5810N/A /* When 1 indicates that we have an IB retry outstanding. */
5810N/A u32 ib_retry_outstanding:1;
5810N/A /*
5810N/A * Q-Key received in incoming IB packet is checked towards this Q-Key. Q-Key
5810N/A * used on transmit if top bit of Q-Key in WR is set.
5810N/A */
5810N/A u32 qkey;
5810N/A /*
5810N/A * Expected packet sequence number: Sequence number on next expected packet.
5810N/A */
5810N/A u32 expected_psn:24;
5810N/A /*
5810N/A * When 1, indicates that a psn_nak has been sent. Need a valid request in
5810N/A * order to clear the bit.
5810N/A */
5810N/A u32 psn_nak:1;
5810N/A /*
5810N/A * 2 bits (next_opcode) 0x0: No operation in progress 0x1: Expect SEND middle
5810N/A * or last 0x2: Expect RDMA_WR middle or last
5810N/A */
5810N/A enum psif_expected_op expected_opcode:2;
5810N/A
5810N/A /* Index to scatter element of in progress SEND. */
5810N/A u32 scatter_indx:5;
5810N/A /* Offset within scatter element of in progress SEND. */
5810N/A u32 scatter_offs;
5810N/A /* IB defined capability enable for receiving RDMA RD. */
5810N/A u64 rdma_rd_enable:1;
5810N/A /* IB defined capability enable for receiving RDMA WR. */
5810N/A u64 rdma_wr_enable:1;
5810N/A /* IB defined capability enable for receiving Atomic operations. */
5810N/A u64 atomic_enable:1;
5810N/A /* PSIF specific capability enable for receiving Masked Atomic operations. */
5810N/A u64 masked_atomic_enable:1;
5810N/A /* Reserved */
5810N/A u64 noname:2;
5810N/A /* Enable capability for RSS. */
5810N/A u64 rss_enable:1;
5810N/A /*
5810N/A * This is a proxy QP. Packets less than a particular size are forwarded to
5810N/A * EPS-A core indicated in the CQ descriptor.
5810N/A */
5810N/A u64 proxy_qp_enable:1;
5810N/A /*
5810N/A * Dynamic MTU is enabled - i.e. incoming requests can have 256B payload
5810N/A * instead of MTU size specified in QP state.
5810N/A */
5810N/A u64 rcv_dynamic_mtu_enable:1;
5810N/A /*
5810N/A * Enable header/data split for offloading. Header and data should end up in
5810N/A * separate scatter elements.
5810N/A */
5810N/A u64 hdr_split_enable:1;
5810N/A /* This is an IB over IB QP. */
5810N/A u64 ipoib_enable:1;
5810N/A /* This is an Ethernet over IB QP. */
5810N/A u64 eoib_enable:1;
5810N/A /*
5810N/A * Migration state (migrated, re-arm and armed). Since path migration is
5810N/A * handled by tsu_qps, this is controlled by tsu_qps. XXX: Should error
5810N/A * handler also be able to change the path?
5810N/A */
5810N/A enum psif_migration mstate:2;
5810N/A
5810N/A /*
5810N/A * TSU quality of service level. Can take values indicating low latency and
5810N/A * high throughput. This is equivalent to high/low BAR when writing doorbells
5810N/A * to PSIF. The qosl bit in the doorbell request must match this bit in the
5810N/A * QP state, otherwise the QP must be put in error. This check only applies
5810N/A * to tsu_rqs.
5810N/A */
5810N/A enum psif_tsu_qos qosl:1;
5810N/A
5810N/A /*
5810N/A * When 1, indicates that a NAK has been for committed_psn+1. Need a valid
5810N/A * request in order to clear the bit. This means receiving a good first/only
5810N/A * packet for the committed_psn+1.
5810N/A */
5810N/A u64 nak_sent:1;
5810N/A /*
5810N/A * Timeout timestamp - if the timer is running and the timestamp indicates a
5810N/A * timeout, a retry iss issued.
5810N/A */
5810N/A u64 timeout_time:48;
5810N/A /*
5810N/A * Maximum number of outstanding read or atomic requests allowed by the
5810N/A * remote HCA. Initialized by software.
5810N/A */
5810N/A u64 max_outstanding:5;
5810N/A /*
5810N/A * TSU Service Level used to decide the TSU VL for requests associated with
5810N/A * this QP.
5810N/A */
5810N/A u64 tsl:4;
5810N/A /* The timestamp is valid and will indicate when to time out the request.. */
5810N/A u64 timer_running:1;
5810N/A /*
5810N/A * An error is found by tsu_cmpl. All packets on this QP is forwarded to
5810N/A * tsu_err until this bit is cleared. The bit is cleared either from QP
5810N/A * cleanup or when tsu_cmpl is receiving is_retry.
5810N/A */
5810N/A u64 rc_in_error:1;
5810N/A /*
5810N/A * Index to scatter element of in progress RDMA RD response. This field does
5810N/A * not need to be written to host memory.
5810N/A */
5810N/A u64 resp_scatter_indx:5;
5810N/A /*
5810N/A * Retry transmit packet sequence number. This is the xmit_psn which should
5810N/A * be used on the first packet of a retry. This is set by tsu_err. When
5810N/A * tsu_dma see that a packet is the first of a retry, it must use this psn as
5810N/A * the xmit_psn and write back xmit_psn as this psn+1.
5810N/A */
5810N/A u64 retry_xmit_psn:24;
5810N/A /*
5810N/A * Transmit packet sequence number. Read and updated by tsu_dma before
5810N/A * sending packets to tsu_ibpb and tsu_cmpl.
5810N/A */
5810N/A u64 xmit_psn:24;
5810N/A /* Receive capabilities enabled for this QP. */
5810N/A /* Inlined rcv_cap : struct psif_qp_rcv_cap (64 bits) */
5810N/A /*
5810N/A * This is an index to a receive queue descriptor. The descriptor points to
5810N/A * the next receive queue element to be used. Receive queues are used for IB
5810N/A * Send and RDMA Writes with Immediate data.
5810N/A */
5810N/A u32 rq_indx:24;
5810N/A /*
5810N/A * When set, RQS should only check that the orig_checksum is equal to magic
5810N/A * number. When not set, RQS should perform the checksum check towards the
5810N/A * checksum in the psif_wr.
5810N/A */
5810N/A u32 no_checksum:1;
5810N/A /*
5810N/A * When this bit is set, ordering from the send queue is ignored. The
5810N/A * sq_sequence_number check in the RQS is ignored. When the bit is not set,
5810N/A * sq_sequence_number check is done. This bit must be set for QP0 and QP1.
5810N/A */
5810N/A u32 no_ordering:1;
5810N/A /*
5810N/A * Retry counter associated with RNR NAK retries. If it expires, a path
5810N/A * migration will be attempted if it is armed, or the QP will go to error
5810N/A * state.
5810N/A */
5810N/A u32 rnr_retry_count:3;
5810N/A /* Send Queue RNR retry count initialization value. */
5810N/A u32 rnr_retry_init:3;
5810N/A /*
5810N/A * DMA length found in first packet of inbound request. When last packet is
5810N/A * received, it must be made sure the dmalen and received_bytes are equal.
5810N/A */
5810N/A u32 dmalen;
5810N/A /*
5810N/A * Number of bytes received of in progress RDMA Write or SEND. The data
5810N/A * received for SENDs and RDMA WR w/Imm are needed for completions. This
5810N/A * should be added to the msg_length.
5810N/A */
5810N/A u32 bytes_received;
5810N/A /*
5810N/A * This is an index to completion queue descriptor. The descriptor points to
5810N/A * a receive completion queue, which may or may not be the same as the send
5810N/A * completion queue. For XRC QPs, this field is written by the CQ descriptor
5810N/A * received by the XRCSRQ on the first packet. This way we don't need to look
5810N/A * up the XRCSRQ for every packet. of the message.
5810N/A */
5810N/A u32 rcv_cq_indx:24;
5810N/A /* Reserved */
5810N/A u32 noname1:5;
5810N/A /*
5810N/A * Transport type of the QP (RC, UC, UD, XRC, MANSP1). MANSP1 is set for
5810N/A * privileged QPs.
5810N/A */
5810N/A enum psif_qp_trans transport_type:3;
5810N/A
5810N/A /*
5810N/A * This bit is set by RQS when a TSU_RQS_MAX_OUTSTANDING_REACHED_ERR or
5810N/A * TSU_RQS_REQUEST_FENCED_ERR error is seen and cleared when the first packet
5810N/A * of a retry is seen. While this bit is set, all packets towards DMA shall
5810N/A * have the TSU_RQS_SEQNUM_ERR set.
5810N/A */
5810N/A u32 retry_needed:1;
5810N/A /*
5810N/A * Flag indicating if the swap in the last atomic swap operation was
5810N/A * performed or not. If swapped, the next RDMA WR should be performed towards
5810N/A * host memory. If not swapped, the next RDMA WR should not be performed
5810N/A * towards host memory, but should be ACK'ed at the IB level as normal.
5810N/A */
5810N/A enum psif_bool swapped:1;
5810N/A
5810N/A /*
5810N/A * Set when entering response scheduling mode and cleared when going out of
5810N/A * the mode. We exit this mode when resp_sched_count_sched ==
5810N/A * resp_sched_count_done.
5810N/A */
5810N/A u32 resp_sched_mode:1;
5810N/A /*
5810N/A * Write pointer for the scheduling of responses. Host is updating and
5810N/A * forwarding this to tsu_sqs.
5810N/A */
5810N/A u32 resp_sched_sched_ptr:5;
5810N/A /*
5810N/A * The counter is compared towards the resp_sched_count_done and incremented
5810N/A * every time a packet is sent to the SQS.
5810N/A */
5810N/A u32 resp_sched_count_sched:24;
5810N/A /*
5810N/A * The counter is taken from the response packet and stored. tsu_host is
5810N/A * using this value to decide if we go into or out of response scheduling
5810N/A * mode.
5810N/A */
5810N/A u32 resp_sched_count_done:24;
5810N/A /* Used for retry handling. */
5810N/A u32 wait_for_psn:1;
5810N/A /* Send capabilities enabled for this QP. */
5810N/A /* Inlined send_cap : struct psif_qp_snd_cap (64 bits) */
5810N/A /* This QP is running Ethernet over IB. */
5810N/A u32 eoib:1;
5810N/A /* This QP is running IP over IB. */
5810N/A u32 ipoib:1;
5810N/A /*
5810N/A * Dynamic MTU is enabled - i.e. requests can use 256B payload instead of
5810N/A * what is specified in QP state.
5810N/A */
5810N/A u32 send_dynamic_mtu_enable:1;
5810N/A /*
5810N/A * The privileged QP is not so privileged, which means that it is not allowed
5810N/A * to perform all privileged requests.
5810N/A */
5810N/A u32 not_so_privileged:1;
5810N/A /* PSIF specific exponential backoff enable. */
5810N/A u32 exp_backoff_enable:1;
5810N/A /*
5810N/A * Offloading type for EoIB. Indicating how the Enforcement of EoIB is done
5810N/A * by PSIF.
5810N/A */
5810N/A enum psif_eoib_type eoib_type:2;
5810N/A
5810N/A /* This is inverted by the APM module when an event should be sent. */
5810N/A u64 apm_success_event_needed:1;
5810N/A /* This is inverted by the APM module when an event should be sent. */
5810N/A u64 apm_failed_event_needed:1;
5810N/A /*
5810N/A * When this bit is not equal to apm_success_event_needed, CBLD should send
5810N/A * an event and set this bit equal to apm_success_event_needed. When the QP
5810N/A * is initialized, this value should be set equal to
5810N/A * apm_success_event_needed.
5810N/A */
5810N/A u64 apm_success_event_sent:1;
5810N/A /*
5810N/A * When this bit is not equal to apm_failed_event_needed, CBLD should send an
5810N/A * event and set this bit equal to apm_failed_event_needed. When the QP is
5810N/A * initialized, this value should be set equal to apm_failed_event_needed.
5810N/A */
5810N/A u64 apm_failed_event_sent:1;
5810N/A /*
5810N/A * This is set when the field operation_successful == 0 from HOST. It is used
5810N/A * to make sure that no good completion is to be sent after an atomic error
5810N/A * has occurred. When set, the QP state is moved to error when seen on the
5810N/A * exec side.
5810N/A */
5810N/A u64 atomic_error:1;
5810N/A /*
5810N/A * This bit indicates that the QP is now handling responses in a safe manner
5810N/A * with respect to MSN values in the incoming IB packets.
5810N/A */
5810N/A u64 in_safe_mode:1;
5810N/A /*
5810N/A * This bit is set when a HOST initiated NAK is sent due to errors when
5810N/A * handling an atomic. When this bit is set, no data is forwarded to EPS or
5810N/A * XIU, and no responses or ACK/NAKs should be forwarded to RQS.
5810N/A */
5810N/A u64 host_sent_nak:1;
5810N/A /* Reserved */
5810N/A u64 noname2:41;
5810N/A /*
5810N/A * Combined 'Last Received MSN' and 'Last Outstanding MSN', used to maintain
5810N/A * 'spin set floor' and indicate 'all retries completed', respectively.
5810N/A */
5810N/A u16 last_received_outstanding_msn;
5810N/A /*
5810N/A * Request address. In the case of RDMA WR, this is the current write
5810N/A * pointer. In the case of a SEND, this is the address to the receive queue
5810N/A * element.
5810N/A */
5810N/A u64 req_addr;
5810N/A /*
5810N/A * Offset within scatter element of in progress RDMA RD response. This field
5810N/A * does not need to be written to host memory.
5810N/A */
5810N/A u32 resp_scatter_offs;
5810N/A /* This PSN is committed - ACKs sent will contain this PSN. */
5810N/A u32 committed_received_psn:24;
5810N/A /*
5810N/A * Communication established bit. When a packet is received when in RTR
5810N/A * state, this bit should be set, and an asynchronous event should be sent.
5810N/A */
5810N/A enum psif_comm_live comm_established:1;
5810N/A
5810N/A enum psif_path_mtu path_mtu:3;
5810N/A
5810N/A /*
5810N/A * Write pointer to atomic data stored in QP. Every time an atomic operation
5810N/A * is performed, the original atomic data is stored in order be to returned
5810N/A * in the event of duplicate atomic.
5810N/A */
5810N/A u32 orig_atomic_wr_ptr:4;
5810N/A /*
5810N/A * Committed MSN - the MSN of the newest committed request for this QP. Only
5810N/A * the bottom 16 bits of the MSN is used.
5810N/A */
5810N/A u64 last_committed_msn:16;
5810N/A /*
5810N/A * This is an index to send completion queue descriptor. The descriptor
5810N/A * points to a send completion queue, which may or may not be the same as the
5810N/A * send completion queue.
5810N/A */
5810N/A u64 send_cq_indx:24;
5810N/A /*
5810N/A * Message sequence number used in AETH when sending ACKs. The number is
5810N/A * incremented every time a new inbound message is processed.
5810N/A */
5810N/A u64 msn:24;
5810N/A /*
5810N/A * This is the eps_tag to be used in the case there is an outstanding error
5810N/A * detected in CMPL. The field is owned CMPL and is used for internal
5810N/A * handling.
5810N/A */
5810N/A u64 eps_tag:16;
5810N/A /* pd(24[0] bits)Protection domain. */
5810N/A u64 pd:24;
5810N/A /* pd(24[0] bits)Protection domain. */
5810N/A u64 srq_pd:24;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_qp_core [128 byte] */
5810N/A
5810N/A/*
5810N/A * Path specific information. This is information which can be different for
5810N/A * primary and alternate path.
5810N/A */
5810N/Astruct psif_qp_path { /* Subjected to copy and convert */
5810N/A u64 remote_gid_0;
5810N/A u64 remote_gid_1;
5810N/A /* Inlined grh : struct psif_grh (192 bits) */
5810N/A /* ib_grh_flowl(20[0] bits)Flow Label */
5810N/A u64 flowlabel:20;
5810N/A /* ib_grh_tclass(8[0] bits)Traffic Class */
5810N/A u64 tclass:8;
5810N/A /* ib_grh_hoplmt(8[0] bits)Hop Limit */
5810N/A u64 hoplmt:8;
5810N/A /* Reserved */
5810N/A u64 noname:4;
5810N/A /* ib_lrh_sl(4[0] bits)Service Level */
5810N/A u64 sl:4;
5810N/A enum psif_use_grh use_grh:1;
5810N/A
5810N/A enum psif_loopback loopback:1;
5810N/A
5810N/A enum psif_port port:1;
5810N/A
5810N/A /* gid_indx(1[0] bits)GID index indicating which of the UFs two GIDs are used. */
5810N/A u64 gid_indx:1;
5810N/A /* ib_lrh_lid(16[0] bits)Local ID */
5810N/A u16 remote_lid;
5810N/A /* pkey_indx(9[0] bits)Index into the P-Key table. */
5810N/A u64 pkey_indx:9;
5810N/A /*
5810N/A * This is the LID path bits. This is used by tsu_ibpb when generating the
5810N/A * SLID in the packet, and it is used by tsu_rcv when checking the DLID.
5810N/A */
5810N/A u64 local_lid_path:7;
5810N/A /* Reserved */
5810N/A u64 noname1:8;
5810N/A /* ipd(8[0] bits)Inter packet delay. Encoded as specified in IB spec. */
5810N/A u64 ipd:8;
5810N/A /* timeout(5[0] bits) * Local ACK timeout. This is the exponent used to calculate the delay before
5810N/A * an ACK is declared 'lost'
5810N/A */
5810N/A u64 local_ack_timeout:5;
5810N/A /* Reserved field - used by hardware for error handling on PCIe errors. */
5810N/A u64 path_invalid:1;
5810N/A /* Reserved */
5810N/A u64 noname2:26;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_qp_path [32 byte] */
5810N/A
5810N/A/* Query QP structure. */
5810N/Astruct psif_query_qp {
5810N/A /* QP state information from query. */
5810N/A struct psif_qp_core qp;
5810N/A /* Primary path information. */
5810N/A struct psif_qp_path primary_path;
5810N/A /* Alternate path information. */
5810N/A struct psif_qp_path alternate_path;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_query_qp [192 byte] */
5810N/A
5810N/A/*
5810N/A * Modify/query QP attributes. Bit mask indicating which field should be
5810N/A * modified.
5810N/A */
5810N/Astruct psif_qp_attributes {
5810N/A /* Manually added spacing to pad outpsif_qp_attributes */
5810N/A u8 :7;
5810N/A /* Change path req_access error if set. */
5810N/A u8 req_access_error:1;
5810N/A /* Change path MTU if set. */
5810N/A u16 path_mtu:1;
5810N/A /* Change expected PSN (RQ PSN) if set. */
5810N/A u16 expected_psn:1;
5810N/A /* Change primary path if set. */
5810N/A u16 prim_path:1;
5810N/A /*
5810N/A * Change migration state if set. In some cases this might lead to a path
5810N/A * migration.
5810N/A */
5810N/A u16 mig_state:1;
5810N/A /* Change alternate path if set. */
5810N/A u16 alt_path:1;
5810N/A /* Change the state of the QP when set. */
5810N/A u16 qp_state:1;
5810N/A /* Change the receive capabilities when set. */
5810N/A u16 qp_rcv_cap:1;
5810N/A /* Change the Q-Key when set. */
5810N/A u16 qkey:1;
5810N/A /* Change P-Key index if set. */
5810N/A u16 pkey_index:1;
5810N/A /* Change the local ack timeout when set. */
5810N/A u16 local_ack_timeout:1;
5810N/A /* Change the RNR minimum timer value when set. */
5810N/A u16 min_rnr_nak_time:1;
5810N/A /* Change the retry count when set. */
5810N/A u16 error_retry_count:1;
5810N/A /* Change the RNR retry count when set. */
5810N/A u16 rnr_retry_count:1;
5810N/A /* Change the xmit psn (SQ PSN) when set. */
5810N/A u16 xmit_psn:1;
5810N/A /* Change max outstanding RD/ATOMIC towards destination. */
5810N/A u16 max_outstanding:1;
5810N/A /* Do not modify unless current state is as indicated in command. */
5810N/A u16 use_current_state:1;
5810N/A} PSIF_PACKED; /* struct psif_qp_attributes [ 3 byte] */
5810N/A
5810N/A/* XXX: This is how the QP state in host memory is organized. */
5810N/Astruct psif_qp { /* Subjected to copy and convert */
5810N/A struct psif_qp_core state;
5810N/A /*
5810N/A * Path information for path A specific for this QP connection. This field
5810N/A * only makes sense for QPs using connected mode. For datagram mode, this
5810N/A * information comes from the AHA.
5810N/A */
5810N/A struct psif_qp_path path_a;
5810N/A /*
5810N/A * Path information for path B specific for this QP connection. This field
5810N/A * only makes sense for QPs using connected mode. For datagram mode, this
5810N/A * information comes from the AHA.
5810N/A */
5810N/A struct psif_qp_path path_b;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_qp [192 byte] */
5810N/A
5810N/A/* Temp.definition of collect buffers */
5810N/Astruct psif_cb { /* Subjected to copy and convert */
5810N/A /* Content pt. not defined in ASIC XML */
5810N/A struct psif_wr wr;
5810N/A u64 payload[32];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_cb [320 byte] */
5810N/A
5810N/A/* Temp.definition of PCIe WR BAR SQS WR layout = first 8 bytes of WR */
5810N/Astruct psif_pcie_sqs_wr {
5810N/A /*
5810N/A * XXX: Naming - do we want to use opcode for this also, or should we use
5810N/A * pkt_type.
5810N/A */
5810N/A enum psif_wr_type op:8;
5810N/A
5810N/A /*
5810N/A * QP sending this request. XXX: Should name be own_qp_num as defined in QP
5810N/A * state?
5810N/A */
5810N/A u32 local_qp:24;
5810N/A /*
5810N/A * The TSL (Tsu SL) must be matched against the TSL in the QP State (XXX: or
5810N/A * in the AHA?). If it is unequal, the QP should be put in error.
5810N/A */
5810N/A u16 tsu_sl:4;
5810N/A /* Port number to use for QP0/1 packets. This field is ignored if not QP0/1. */
5810N/A enum psif_port port:1;
5810N/A
5810N/A /* Only applicable to UD. This is an indication that AHA should be used. */
5810N/A enum psif_use_ah ud_pkt:1;
5810N/A
5810N/A /*
5810N/A * High Bandwidth/Low Latency BAR. The QoSL must be matched against the QoSL
5810N/A * in the QP State. If it is unequal, the QP should be in error.
5810N/A */
5810N/A enum psif_tsu_qos tsu_qosl:1;
5810N/A
5810N/A /* Length (number of bytes of valid data in the collect payload buffer). */
5810N/A u16 collect_length:9;
5810N/A /*
5810N/A * Send queue sequence number. Used to map request to a particular work
5810N/A * request in the send queue.
5810N/A */
5810N/A u16 sq_seq;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_pcie_sqs_wr [ 8 byte] */
5810N/A
5810N/A/* Temp.definition of PCIe WR BAR layout */
5810N/Astruct psif_pcie_wr {
5810N/A struct psif_cb cb;
5810N/A u64 reserved_1[464];
5810N/A struct psif_pcie_sqs_wr sqs_wr;
5810N/A u64 reserved_2[6];
5810N/A u64 clear;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_pcie_wr [4096 byte] */
5810N/A
5810N/Astruct psif_mbox {
5810N/A /* Host posting to EPS-x */
5810N/A
5810N/A u64 in;
5810N/A /* EPS-x posting to Host */
5810N/A
5810N/A u64 out;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_mbox [16 byte] */
5810N/A
5810N/Astruct psif_pcie_mbox {
5810N/A /* MBOX_EPS_MAX mbox'es for all the EPS's */
5810N/A
5810N/A struct psif_mbox eps[5];
5810N/A /* (Reset all mailboxes) */
5810N/A
5810N/A u64 eps_reset;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_pcie_mbox [88 byte] */
5810N/A
5810N/A/* Modify QP structure. */
5810N/Astruct psif_modify_qp {
5810N/A /* Q-Key received in incoming IB packet is checked towards this Q-Key. */
5810N/A u32 rx_qkey;
5810N/A /*
5810N/A * If the DMA is getting an L-Key violation or an error from PCIe when
5810N/A * fetching data for requests, it has to set this bit. When set, all requests
5810N/A * behind must be marked in error and not transmitted on IB. Responses are
5810N/A * sent as normal.
5810N/A */
5810N/A u16 req_access_error:1;
5810N/A /*
5810N/A * Retry counter associated with RNR NAK retries. If it expires, a path
5810N/A * migration will be attempted if it is armed, or the QP will go to error
5810N/A * state.
5810N/A */
5810N/A u16 rnr_retry_count:3;
5810N/A /* Receive capabilities enabled for this QP. */
5810N/A /* Inlined rcv_cap : struct psif_qp_rcv_cap (64 bits) */
5810N/A /* IB defined capability enable for receiving RDMA RD. */
5810N/A u16 rdma_rd_enable:1;
5810N/A /* IB defined capability enable for receiving RDMA WR. */
5810N/A u16 rdma_wr_enable:1;
5810N/A /* IB defined capability enable for receiving Atomic operations. */
5810N/A u16 atomic_enable:1;
5810N/A /* PSIF specific capability enable for receiving Masked Atomic operations. */
5810N/A u16 masked_atomic_enable:1;
5810N/A /* Reserved */
5810N/A u16 noname:2;
5810N/A /* Enable capability for RSS. */
5810N/A u16 rss_enable:1;
5810N/A /*
5810N/A * This is a proxy QP. Packets less than a particular size are forwarded to
5810N/A * EPS-A core indicated in the CQ descriptor.
5810N/A */
5810N/A u16 proxy_qp_enable:1;
5810N/A /*
5810N/A * Dynamic MTU is enabled - i.e. incoming requests can have 256B payload
5810N/A * instead of MTU size specified in QP state.
5810N/A */
5810N/A u16 rcv_dynamic_mtu_enable:1;
5810N/A /*
5810N/A * Enable header/data split for offloading. Header and data should end up in
5810N/A * separate scatter elements.
5810N/A */
5810N/A u16 hdr_split_enable:1;
5810N/A /* This is an IB over IB QP. */
5810N/A u16 ipoib_enable:1;
5810N/A /* This is an Ethernet over IB QP. */
5810N/A u16 eoib_enable:1;
5810N/A /*
5810N/A * Error retry counter initial value. Read by tsu_dma and used by tsu_cmpl to
5810N/A * calculate exp_backoff etc..
5810N/A */
5810N/A u16 error_retry_count:3;
5810N/A /*
5810N/A * Minium RNR NAK timeout. This is added to RNR NAK packets and the requester
5810N/A * receiving the RNR NAK must wait until the timer has expired before the
5810N/A * retry is sent.
5810N/A */
5810N/A u16 min_rnr_nak_time:5;
5810N/A /* QP State for this QP. */
5810N/A enum psif_qp_state state:3;
5810N/A
5810N/A /*
5810N/A * Current number of retired read or atomic requests. Initialze to zero.
5810N/A * Updated by tsu_cmpl every time a read or atomic request is completed.
5810N/A */
5810N/A u16 max_outstanding:5;
5810N/A /*
5810N/A * Receive packet sequence number. Read and updated by tsu_dscr before
5810N/A * passing packets to tsu_rqh.
5810N/A */
5810N/A u32 expected_psn:24;
5810N/A /* Path MTU. */
5810N/A enum psif_path_mtu path_mtu:3;
5810N/A
5810N/A /* Reserved */
5810N/A u32 noname1:3;
5810N/A /*
5810N/A * Migration state (migrated, re-arm and armed). Since path migration is
5810N/A * handled by tsu_qps, this is controlled by tsu_qps. XXX: Should error
5810N/A * handler also be able to change the path?
5810N/A */
5810N/A enum psif_migration mstate:2;
5810N/A
5810N/A /* Reserved */
5810N/A u32 noname2:8;
5810N/A /*
5810N/A * Transmit packet sequence number. Read and updated by tsu_dma before
5810N/A * sending packets to tsu_ibpb and tsu_cmpl.
5810N/A */
5810N/A u32 xmit_psn:24;
5810N/A /* Primary path information. */
5810N/A struct psif_qp_path primary_path;
5810N/A /* Alternate path information. */
5810N/A struct psif_qp_path alternate_path;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_modify_qp [80 byte] */
5810N/A
5810N/A/* QP number UF and command for either modify or query QP. */
5810N/Astruct psif_modify_command {
5810N/A /* Command indicating operation - query or modify. */
5810N/A enum psif_qp_command cmd:2;
5810N/A
5810N/A /* UF this QP belongs to. */
5810N/A u8 uf:6;
5810N/A /*
5810N/A * Port number used for accesses to QP0/1. This field is don't care for all
5810N/A * other QPs.
5810N/A */
5810N/A enum psif_port port_num:1;
5810N/A
5810N/A /* Current state the QP must be in to do the modification. */
5810N/A enum psif_qp_state current_state:3;
5810N/A
5810N/A /* QP number for this operation. */
5810N/A u32 qp_num:24;
5810N/A /*
5810N/A * This will arm interrupt to be sent when the refcount for the QP index used
5810N/A * have reached zero. It should be used when modify to Reset - when interrupt
5810N/A * is seen, there are no outstanding transactions towards RQs or CQs for the
5810N/A * QP, and it should be safe to take these queues down.
5810N/A */
5810N/A u32 notify_when_zero:1;
5810N/A /* Manually added spacing to pad out psif_modify_command */
5810N/A u32 :3;
5810N/A} PSIF_PACKED; /* struct psif_modify_command [ 5 byte] */
5810N/A
5810N/A/*
5810N/A * Structure defining DMA Key Validation entries. This structure is specific
5810N/A * to IB and has information about R/L-Key states. One entry kan represent an
5810N/A * R-Key, an L-Key or both at the same time. This is is decided bythe key
5810N/A * states.
5810N/A */
5810N/Astruct psif_key {
5810N/A /* R-key state for this DMA validation entry */
5810N/A enum psif_dma_vt_key_states rkey_state:2;
5810N/A
5810N/A /* L-key state for this DMA validation entry */
5810N/A enum psif_dma_vt_key_states lkey_state:2;
5810N/A
5810N/A /* Reserved */
5810N/A u32 noname:4;
5810N/A /* pd(24[0] bits)Protection domain. */
5810N/A u32 pd:24;
5810N/A /* Remote access rights. Used for R-Key accesses when this is a valid R-Key. */
5810N/A /* Inlined remote_access : struct psif_dma_vt_mem_access (64 bits) */
5810N/A /* Read access enabled. */
5810N/A u32 remote_access_rd:1;
5810N/A /* Write access enabled. */
5810N/A u32 remote_access_wr:1;
5810N/A /* Atomic access enabled. */
5810N/A u32 remote_access_atomic:1;
5810N/A /*
5810N/A * Local access rights. Used for L-Key accesses when this is a valid L-Key.
5810N/A * Must be set correctly by SW so that RD access is always set.
5810N/A */
5810N/A /* Inlined local_access : struct psif_dma_vt_mem_access (64 bits) */
5810N/A /* Read access enabled. */
5810N/A u32 local_access_rd:1;
5810N/A /* Write access enabled. */
5810N/A u32 local_access_wr:1;
5810N/A /* Atomic access enabled. */
5810N/A u32 local_access_atomic:1;
5810N/A /*
5810N/A * If this bit is set, it means that this memory region is enabled for
5810N/A * conditional RDMA write. The bit must be added to the header at tsu_val and
5810N/A * follow the request towards tsu_host. When tsu_host receives this bit, it
5810N/A * is checking the 'swapped' bit in the QP state in order to decide if the
5810N/A * payload is written to host memory or not.
5810N/A */
5810N/A u32 conditional_wr:1;
5810N/A /*
5810N/A * If this bit is set, the va in the key is used as an offset to the base
5810N/A * address given in this descriptor.
5810N/A */
5810N/A u32 zero_based_addr_en:1;
5810N/A /* Reserved */
5810N/A u32 noname1:24;
5810N/A /* Length of memory region this validation entry is associated with. */
5810N/A u64 length;
5810N/A struct psif_mmu_cntx mmu_context;
5810N/A /* host_address(64[0] bits)Host address used for accesses to/from TSU HOST. */
5810N/A u64 base_addr;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_key [32 byte] */
5810N/A
5810N/A/**
5810N/A * Flash image header format for application image
5810N/A * extention of struct psif_flash_header_all
5810N/A */
5810N/Astruct psif_flash_header_app {
5810N/A /* byte[4:7] image type */
5810N/A enum psif_flash_image_type type:32;
5810N/A
5810N/A /* byte[0:3] signature is 0xdeadbeef */
5810N/A u32 signature;
5810N/A /* byte[12:15] code/data size */
5810N/A u32 image_length;
5810N/A /* byte[8:11] SHRDMEM start address */
5810N/A u32 exec_base;
5810N/A /* byte[20:23] ZI size */
5810N/A u32 zi_length;
5810N/A /* byte[16:19] SHRDMEM ZI base address */
5810N/A u32 zi_base;
5810N/A /* byte[28:31] Execution start address */
5810N/A u32 start_addr;
5810N/A /* byte[24:27] Storage only used by boot loader */
5810N/A u32 flash_base;
5810N/A /* byte[36:39] Flash address base of low vectors */
5810N/A u32 low_vec_flash_base;
5810N/A /* byte[32:35] SHRDMEM address base of low vectors */
5810N/A u32 low_vec_base;
5810N/A /* byte[44:47] FLASH_DATE_LEN > = sizeof(__DATE__) */
5810N/A u8 date[4];
5810N/A /* byte[40:43] Size of low vectors */
5810N/A u32 low_vec_length;
5810N/A /* byte[48:55] */
5810N/A u8 date_1[8];
5810N/A /* byte[60:63] FLASH_TIME_LEN > = sizeof(__TIME__) */
5810N/A u8 time[4];
5810N/A /* byte[56:59] */
5810N/A u8 date_2[4];
5810N/A /* byte[64:71] */
5810N/A u8 time_1[8];
5810N/A /* byte[72:79] FLASH_REV_STR_LEN > = sizeof(REV_STRING) */
5810N/A u8 rev_string[8];
5810N/A /* byte[84:87] */
5810N/A u32 app_vec_flash_base;
5810N/A /* byte[80:83] checkssum_ptr - this value + 4 equals the size of the immage in bytes */
5810N/A u32 checksum_ptr;
5810N/A /* byte[92:95] */
5810N/A u32 app_vec_length;
5810N/A /* byte[88:91] */
5810N/A u32 app_vec_base;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_flash_header_app [96 byte] */
5810N/A
5810N/A/**
5810N/A * Flash image header format
5810N/A * Note: image length is not valid for the boot loader image itself (64k bytes)
5810N/A * struct is always located at offset 0x800 within an image
5810N/A */
5810N/Astruct psif_flash_header_all {
5810N/A /* byte[4:7] image type */
5810N/A enum psif_flash_image_type type:32;
5810N/A
5810N/A /* byte[0:3] signature of 0xdeadbeef */
5810N/A u32 signature;
5810N/A /* byte[12:15] image length.
5810N/A The length is defined in bytes and starts at offset 0x0A00 into the image. */
5810N/A u32 length;
5810N/A /* byte[8:11] execution base */
5810N/A u32 base;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_flash_header_all [16 byte] */
5810N/A
5810N/A/* This is the portion of the descriptor which is updated by software. */
5810N/Astruct psif_eq_sw {
5810N/A /* Index to event elements consumed by SW. */
5810N/A u32 head_indx;
5810N/A} PSIF_PACKED; /* struct psif_eq_sw [ 4 byte] */
5810N/A
5810N/A/*
5810N/A * Descriptor entry for an event queue. This entry is used to address into
5810N/A * the event queue and write the correct entries. This structure is the
5810N/A * hardware updateable part of the EQ descriptor.
5810N/A */
5810N/Astruct psif_eq_hw {
5810N/A /* Reserved */
5810N/A u32 noname:21;
5810N/A /* Inlined ctrl : struct psif_eq_ctrl (64 bits) */
5810N/A /* The descriptor is valid. */
5810N/A u32 valid:1;
5810N/A /*
5810N/A * The size between event queue entries. This is the shift value to find the
5810N/A * start of the next entry.
5810N/A */
5810N/A u32 extent_log2:5;
5810N/A /*
5810N/A * The size (log2 number of entries) of the event queue. This is used for
5810N/A * calculating when to wrap the head and tail indexes.
5810N/A */
5810N/A u32 size_log2:5;
5810N/A /*
5810N/A * Event queue sequence number. This is the sequence number to be used for
5810N/A * this event. When used by a client, it is incremented and written back to
5810N/A * this descriptor.
5810N/A */
5810N/A u32 sequence_number;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /*
5810N/A * VA or PA of the base of the queue. If PA the MMU context above will be a
5810N/A * bypass context. Updated by software. The head and tail pointers can be
5810N/A * calculated by the following calculations: Address = base_ptr + (head *
5810N/A * ($bits(event_entry_t)/8 ) Head Pointer and Tail Pointer will use the same
5810N/A * MMU context as the base, and all need to be VA from one address space, or
5810N/A * all need to be PA. In typical use, to allow direct user access to the head
5810N/A * and tail pointer VAs are used.
5810N/A */
5810N/A u64 base_addr;
5810N/A /* Index to event queue elements added by HW. */
5810N/A u32 tail_indx;
5810N/A /* Info: Edge padding added (for endian convert) */
5810N/A u32 space24;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_eq_hw [32 byte] */
5810N/A
5810N/A/* Event queue entry. */
5810N/Astruct psif_eq_entry {
5810N/A /* PSIF_EVENT_PATH_MIGRATED. */
5810N/A u16 event_status_path_migrated:1;
5810N/A /* PSIF_EVENT_COMMUNICATION_ESTABLISHED. */
5810N/A u16 event_status_communication_established:1;
5810N/A /* PSIF_EVENT_SRQ_LIMIT_REACHED. */
5810N/A u16 event_status_srq_limit_reached:1;
5810N/A /* PSIF_EVENT_LAST_WQE_REACHED. */
5810N/A u16 event_status_last_wqe_reached:1;
5810N/A /* PSIF_EVENT_CQ_ERROR. */
5810N/A u16 event_status_cq_error:1;
5810N/A /* PSIF_EVENT_INVALID_REQUEST_LOCAL_WQ_ERROR. */
5810N/A u16 event_status_invalid_request_local_wq_error:1;
5810N/A /* PSIF_EVENT_LOCAL_ACCESS_VIOLATION_WQ_ERROR. */
5810N/A u16 event_status_local_access_violation_wq_error:1;
5810N/A /* PSIF_EVENT_PATH_MIGRATION_REQUEST_ERROR. */
5810N/A u16 event_status_path_migration_request_error:1;
5810N/A /* PSIF_EVENT_XRC_DOMAIN_VIOLATION. */
5810N/A u16 event_status_xrc_domain_violation:1;
5810N/A /* PSIF_EVENT_INVALID_XRCETH. */
5810N/A u16 event_status_invalid_xrceth:1;
5810N/A /* PSIF_EVENT_SRQ_CATASTROPHIC_ERROR. */
5810N/A u16 event_status_srq_catastrophic_error:1;
5810N/A /* PSIF_EVENT_LOCAL_WORK_QUEUE_CATASTROPHIC_ERROR. */
5810N/A u16 event_status_local_work_queue_catastrophic_error:1;
5810N/A /* PSIF_EVENT_PORT_ACTIVE. */
5810N/A u16 event_status_port_active:1;
5810N/A /* PSIF_EVENT_CLIENT_REGISTRATION. */
5810N/A u16 event_status_client_registration:1;
5810N/A /* PSIF_EVENT_PORT_CHANGED. */
5810N/A u16 event_status_port_changed:1;
5810N/A /* PSIF_EVENT_LOCAL_CATASTROPHIC_ERROR. */
5810N/A u16 event_status_local_catastrophic_error:1;
5810N/A /* PSIF_EVENT_PORT_ERROR. */
5810N/A u16 event_status_port_error:1;
5810N/A /* PSIF_EVENT_CMPL_NOTIFY. */
5810N/A u16 event_status_cmpl_notify:1;
5810N/A /* PSIF_EVENT_EPS_C. */
5810N/A u16 event_status_eps_c:1;
5810N/A /* PSIF_EVENT_EPS_A. */
5810N/A u16 event_status_eps_a:1;
5810N/A /*
5810N/A * The port_flags are only applicable for port type events. These are not set
5810N/A * from the TSU, but implemented from EPS.
5810N/A */
5810N/A u16 port_flags:4;
5810N/A /* Error field indicating vendor error when this is an error event. */
5810N/A enum psif_tsu_error_types vendor_error:8;
5810N/A
5810N/A /* Completion queue descriptor ID. */
5810N/A u32 cqd_id:24;
5810N/A /* IB port number */
5810N/A enum psif_port port:1;
5810N/A
5810N/A /* vendor_fields(3[0] bits)Should this be an enum? */
5810N/A u32 vendor_fields:3;
5810N/A enum psif_eps_core_id eps_core_id:4;
5810N/A
5810N/A /* Receive queue descriptor ID. */
5810N/A u64 rqd_id:24;
5810N/A /* QP number. */
5810N/A u64 qp:24;
5810N/A /* LID. */
5810N/A u16 lid;
5810N/A /* Inlined event_status : struct psif_event_status (64 bits) */
5810N/A /* Completion queue sequence number causing the event to be sent. */
5810N/A u32 cq_sequence_number;
5810N/A /* Event type if port_flags is PSIF_EVENT_EXTENSION */
5810N/A enum psif_event extension_type:32;
5810N/A
5810N/A /* More info on event */
5810N/A u64 event_info;
5810N/A /* Additional data on event */
5810N/A u64 event_data;
5810N/A /* Padding out struct bulk */
5810N/A u64 reserved[2];
5810N/A /* Padding out struct last */
5810N/A u32 noname:32;
5810N/A /* sequence number for sanity checking */
5810N/A u32 seq_num;
5810N/A} PSIF_PACKED_ALIGNED32; /* struct psif_eq_entry [64 byte] */
5810N/A
5810N/Astruct psif_epsc_log_stat {
5810N/A /* Owned by epsc runs all the way to 64 bit */
5810N/A u64 produce_offset;
5810N/A /* Owned by host */
5810N/A u64 consume_offset;
5810N/A /* Owned by host real offset modulo sz */
5810N/A u64 size;
5810N/A /* Allign to 32 byte */
5810N/A u64 pad;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_log_stat [32 byte] */
5810N/A
5810N/A/**
5810N/A * CSR Query port structure
5810N/A */
5810N/Astruct psif_epsc_port_attr {
5810N/A /** port number */
5810N/A u32 portNumber;
5810N/A /** port state */
5810N/A enum psif_epsc_port_state state:32;
5810N/A
5810N/A /** maximum supported path MTU */
5810N/A enum psif_epsc_path_mtu max_mtu:32;
5810N/A
5810N/A /** currently configured path MTU */
5810N/A enum psif_epsc_path_mtu active_mtu:32;
5810N/A
5810N/A u32 gid_tbl_len;
5810N/A u32 port_cap_flags;
5810N/A u32 max_msg_sz;
5810N/A u32 bad_pkey_cntr;
5810N/A u32 qkey_viol_cntr;
5810N/A u16 pkey_tbl_len;
5810N/A u16 lid;
5810N/A u16 sm_lid;
5810N/A u16 lmc:8;
5810N/A u16 max_vl_num:8;
5810N/A u16 sm_sl:8;
5810N/A u16 subnet_timeout:8;
5810N/A u16 init_type_reply:8;
5810N/A u16 active_width:8;
5810N/A enum psif_port_speed active_speed:8;
5810N/A
5810N/A u64 phys_state:8;
5810N/A u64 noname:48;
5810N/A u64 pad;
5810N/A} PSIF_PACKED_ALIGNED32; /* struct psif_epsc_port_attr [64 byte] */
5810N/A
5810N/A/**
5810N/A * Query GID response in host memory
5810N/A */
5810N/Astruct psif_epsc_gid_attr {
5810N/A u64 gid_0;
5810N/A u64 gid_1;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_gid_attr [16 byte] */
5810N/A
5810N/A/**
5810N/A * Populate MMU table
5810N/A */
5810N/Astruct psif_epsc_exercise_mmu {
5810N/A /* Start adress */
5810N/A u64 host_addr;
5810N/A /* MMU context supplied by driver */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /* Buffer length in bytes */
5810N/A u64 length;
5810N/A /* Stride in bytes */
5810N/A u64 stride;
5810N/A u64 reserved[7];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_exercise_mmu [88 byte] */
5810N/A
5810N/A/**
5810N/A * CSR Query device structure
5810N/A */
5810N/Astruct psif_epsc_device_attr {
5810N/A u64 fw_ver;
5810N/A u64 sys_image_guid;
5810N/A u64 node_guid;
5810N/A u64 max_mr_size;
5810N/A u64 page_size_cap;
5810N/A u32 vendor_id;
5810N/A u32 vendor_part_id;
5810N/A u32 hw_ver;
5810N/A u32 max_qp;
5810N/A u32 max_qp_wr;
5810N/A u32 device_cap_flags;
5810N/A u32 max_sge;
5810N/A u32 max_sge_rd;
5810N/A u32 max_cq;
5810N/A u32 max_cqe;
5810N/A u32 max_mr;
5810N/A u32 max_pd;
5810N/A u32 max_qp_rd_atom;
5810N/A u32 max_ee_rd_atom;
5810N/A u32 max_res_rd_atom;
5810N/A u32 max_qp_init_rd_atom;
5810N/A u32 max_ee_init_rd_atom;
5810N/A enum psif_epsc_atomic_cap atomic_cap:32;
5810N/A
5810N/A enum psif_epsc_atomic_cap masked_atomic_cap:32;
5810N/A
5810N/A u32 max_ee;
5810N/A u32 max_rdd;
5810N/A u32 max_mw;
5810N/A u32 max_raw_ipv6_qp;
5810N/A u32 max_raw_ethy_qp;
5810N/A u32 max_mcast_grp;
5810N/A u32 max_mcast_qp_attach;
5810N/A u32 max_total_mcast_qp_attach;
5810N/A u32 max_ah;
5810N/A u32 max_fmr;
5810N/A u32 max_map_per_fmr;
5810N/A u32 max_srq;
5810N/A u32 max_srq_wr;
5810N/A u32 max_srq_sge;
5810N/A u32 max_fast_reg_page_list_len;
5810N/A u64 max_pkeys:16;
5810N/A u64 local_ca_ack_delay:8;
5810N/A u64 phys_port_cnt:32;
5810N/A u64 noname:8;
5810N/A u64 pad;
5810N/A} PSIF_PACKED_ALIGNED32; /* struct psif_epsc_device_attr [192 byte] */
5810N/A
5810N/A/**
5810N/A * The eps-c fw csr to host sw completion
5810N/A * Response to a CSR request
5810N/A */
5810N/Astruct psif_epsc_csr_rsp {
5810N/A /* return status of operation */
5810N/A enum psif_epsc_csr_status status:8;
5810N/A
5810N/A /* enum psif_epsc_csr_opcode from request */
5810N/A enum psif_epsc_csr_opcode opcode:8;
5810N/A
5810N/A /* Data integrity */
5810N/A u16 crc;
5810N/A /* Address from request */
5810N/A u32 addr;
5810N/A /* Data from operation */
5810N/A u64 data;
5810N/A /* Info from operation */
5810N/A u64 info;
5810N/A /* Sequence number from request */
5810N/A u64 seq_num;
5810N/A} PSIF_PACKED_ALIGNED32; /* struct psif_epsc_csr_rsp [32 byte] */
5810N/A
5810N/Astruct psif_epsc_csr_opaque {
5810N/A u64 data[11];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_opaque [88 byte] */
5810N/A
5810N/Astruct psif_epsc_csr_single {
5810N/A u64 data;
5810N/A u64 reserved[10];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_single [88 byte] */
5810N/A
5810N/A/**
5810N/A * \brief Padded base address structure
5810N/A * \details
5810N/A * With this structure the driver provides the information needed be the
5810N/A * firmware to set up queue, queue pair and address handle descriptor base
5810N/A * addresses before they can be used.
5810N/A * \par Used in
5810N/A * psif_epsc_csr_details for \ref EPSC_SET_BASEADDR and
5810N/A * \ref EPSC_SET_BASEADDR_EQ mailbox requests
5810N/A * \par Classification
5810N/A * driver
5810N/A */
5810N/Astruct psif_epsc_csr_base_addr {
5810N/A /** base address in host memory to be used for the descriptor */
5810N/A u64 address;
5810N/A /** MMU context for `address` */
5810N/A struct psif_mmu_cntx mmu_context;
5810N/A /** number of entries in the table */
5810N/A u32 num_entries;
5810N/A /** unused (padding) */
5810N/A u32 noname:27;
5810N/A /** size of an entry as log2 value. The address to an entry is calculated
5810N/A * as host_addr + entry_num*(1 << extent_log2) */
5810N/A u32 extent_log2:5;
5810N/A /** MSI-X interrupt index only valid for EQ setup */
5810N/A u32 msix_index;
5810N/A /** unused (padding) */
5810N/A u32 noname1:32;
5810N/A /** unused (padding) */
5810N/A u64 padding[7];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_base_addr [88 byte] */
5810N/A
5810N/A/* CSR automated type for TSU_QPS_MODIFY_QP_CTRL */
5810N/A/*
5810N/A * Per UF modify/query QP command/attribute register. Only one register is
5810N/A * implemented in hardware - one at a time. EPS implements one register per
5810N/A * UF. When one is written, the modify data is written to modify_qp_data
5810N/A * register before this register is written. The Modify or Query QP command
5810N/A * is autmatically kicked when this register is written. Is one outstanding
5810N/A * modify/query QP per UF ok, or do we need more?
5810N/A */
5810N/Astruct psif_csr_modify_qp_ctrl {
5810N/A /* Command indicating operation - query or modify. */
5810N/A enum psif_qp_command cmd:2;
5810N/A
5810N/A /* UF this QP belongs to. */
5810N/A u64 uf:6;
5810N/A /*
5810N/A * Port number used for accesses to QP0/1. This field is don't care for all
5810N/A * other QPs.
5810N/A */
5810N/A enum psif_port port_num:1;
5810N/A
5810N/A /* Current state the QP must be in to do the modification. */
5810N/A enum psif_qp_state current_state:3;
5810N/A
5810N/A /* QP number for this operation. */
5810N/A u64 qp_num:24;
5810N/A /*
5810N/A * This will arm interrupt to be sent when the refcount for the QP index used
5810N/A * have reached zero. It should be used when modify to Reset - when interrupt
5810N/A * is seen, there are no outstanding transactions towards RQs or CQs for the
5810N/A * QP, and it should be safe to take these queues down.
5810N/A */
5810N/A u64 notify_when_zero:1;
5810N/A /* Manually added spacing to pad out psif_modify_command */
5810N/A u64 :3;
5810N/A /* Inlined cmd_attributes : struct psif_qp_attributes (24 bits) */
5810N/A /* Manually added spacing to pad outpsif_qp_attributes */
5810N/A u64 :7;
5810N/A /* Change path req_access error if set. */
5810N/A u64 req_access_error:1;
5810N/A /* Change path MTU if set. */
5810N/A u16 path_mtu:1;
5810N/A /* Change expected PSN (RQ PSN) if set. */
5810N/A u16 expected_psn:1;
5810N/A /* Change primary path if set. */
5810N/A u16 prim_path:1;
5810N/A /*
5810N/A * Change migration state if set. In some cases this might lead to a path
5810N/A * migration.
5810N/A */
5810N/A u16 mig_state:1;
5810N/A /* Change alternate path if set. */
5810N/A u16 alt_path:1;
5810N/A /* Change the state of the QP when set. */
5810N/A u16 qp_state:1;
5810N/A /* Change the receive capabilities when set. */
5810N/A u16 qp_rcv_cap:1;
5810N/A /* Change the Q-Key when set. */
5810N/A u16 qkey:1;
5810N/A /* Change P-Key index if set. */
5810N/A u16 pkey_index:1;
5810N/A /* Change the local ack timeout when set. */
5810N/A u16 local_ack_timeout:1;
5810N/A /* Change the RNR minimum timer value when set. */
5810N/A u16 min_rnr_nak_time:1;
5810N/A /* Change the retry count when set. */
5810N/A u16 error_retry_count:1;
5810N/A /* Change the RNR retry count when set. */
5810N/A u16 rnr_retry_count:1;
5810N/A /* Change the xmit psn (SQ PSN) when set. */
5810N/A u16 xmit_psn:1;
5810N/A /* Change max outstanding RD/ATOMIC towards destination. */
5810N/A u16 max_outstanding:1;
5810N/A /* Do not modify unless current state is as indicated in command. */
5810N/A u16 use_current_state:1;
5810N/A /* Inlined cmd : struct psif_modify_command (40 bits) */
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_csr_modify_qp_ctrl [ 8 byte] */
5810N/A
5810N/A/**
5810N/A * Modify QP CSR structure
5810N/A */
5810N/Astruct psif_epsc_csr_modify_qp {
5810N/A struct psif_csr_modify_qp_ctrl ctrl;
5810N/A struct psif_modify_qp data;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_modify_qp [88 byte] */
5810N/A
5810N/A/**
5810N/A * Query QP
5810N/A *
5810N/A * int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, enum
5810N/A * ibv_qp_attr_mask attr_mask, struct ibv_qp_init_attr *init_attr)
5810N/A *
5810N/A * Input Parameters:
5810N/A * qp struct ibv_qp from ibv_create_qp
5810N/A * attr_mask bitmask of items to query (see ibv_modify_qp)
5810N/A * Output Parameters:
5810N/A * attr struct ibv_qp_attr to be filled in with requested attributes
5810N/A * init_attr struct ibv_qp_init_attr to be filled in with initial
5810N/A * attributes
5810N/A * Return Value:
5810N/A * 0 on success, errno on failure.
5810N/A */
5810N/Astruct psif_epsc_csr_query_qp {
5810N/A /* host_address(64[0] bits)Host address used for accesses to/from TSU HOST. */
5810N/A u64 address;
5810N/A struct psif_csr_modify_qp_ctrl ctrl;
5810N/A /* MMU context supplied by driver */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 padding[8];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_query_qp [88 byte] */
5810N/A
5810N/A/* CSR automated type for TSU_RQS_P{1,2}_OWN_LID_BASE */
5810N/A/*
5810N/A * Own LIDs base and LMC. Potentially all own LID bits come from the QP state
5810N/A * entry. The number of bits to use is based on the LMC. Per UF register.
5810N/A */
5810N/Astruct psif_csr_own_lid_base {
5810N/A u64 noname:44;
5810N/A /* ib_lrh_lid(16[0] bits)Local ID */
5810N/A u64 lid_base:16;
5810N/A /* lmc(3[0] bits)LID Mask Control data type. */
5810N/A u64 lmc:3;
5810N/A u64 gid_flag:1;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_csr_own_lid_base [ 8 byte] */
5810N/A
5810N/A/* CSR automated type for TSU_IBPB_P{1,2}_OWN_LID_BASE */
5810N/A/*
5810N/A * Own LIDs base and LMC. Potentially all own LID bits come from the QP state
5810N/A * entry. The number of bits to use is based on the LMC. Per UF register.
5810N/A */
5810N/Astruct psif_csr_snd_lid {
5810N/A u64 noname:45;
5810N/A /* ib_lrh_lid(16[0] bits)Local ID */
5810N/A u64 lid_base:16;
5810N/A /* lmc(3[0] bits)LID Mask Control data type. */
5810N/A u64 lmc:3;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_csr_snd_lid [ 8 byte] */
5810N/A
5810N/A/* CSR automated type for TSU_IBPR_P{1,2}_OWN_LID_BASE */
5810N/A/*
5810N/A * Own LIDs base and LMC. Potentially all own LID bits come from the QP state
5810N/A * entry. The number of bits to use is based on the LMC. Per UF register.
5810N/A */
5810N/Astruct psif_csr_rcv_lid {
5810N/A u64 noname:44;
5810N/A /* Inlined data : struct psif_lid_base (64 bits) */
5810N/A /* LID base. */
5810N/A u64 lid_base:16;
5810N/A /* LID mask control. */
5810N/A u64 lmc:3;
5810N/A /* If set GID routing must be used. */
5810N/A u64 gid_flag:1;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_csr_rcv_lid [ 8 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_SET_LID
5810N/A */
5810N/Astruct psif_epsc_csr_set_lid {
5810N/A struct psif_csr_own_lid_base lid_rqs;
5810N/A struct psif_csr_snd_lid lid_snd;
5810N/A struct psif_csr_rcv_lid lid_rcv;
5810N/A u64 port:8;
5810N/A /* Index pt. not used (PSIF.ARCH.03.12 and later) */
5810N/A u64 index:8;
5810N/A u64 noname:48;
5810N/A u64 padding[7];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_set_lid [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_SET_GID{,_P1,_P2}
5810N/A */
5810N/Astruct psif_epsc_csr_set_gid {
5810N/A u64 gid_0;
5810N/A u64 gid_1;
5810N/A u64 port:8;
5810N/A u64 index:8;
5810N/A u64 noname:48;
5810N/A u64 padding[8];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_set_gid [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_SET_EOIB_MAC
5810N/A */
5810N/Astruct psif_epsc_csr_set_eoib_mac {
5810N/A u64 mac;
5810N/A u64 port:8;
5810N/A u64 index:8;
5810N/A u64 noname:48;
5810N/A u64 padding[9];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_set_eoib_mac [88 byte] */
5810N/A
5810N/A/**
5810N/A * Set EPSC_SET_VLINK_STATE
5810N/A */
5810N/Astruct psif_epsc_csr_vlink_state {
5810N/A /* universal_function(6[0] bits)UF */
5810N/A u64 uf:6;
5810N/A enum psif_port port:1;
5810N/A
5810N/A enum psif_vlink_state vlink_state:5;
5810N/A
5810N/A u64 noname:52;
5810N/A u64 padding[10];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_vlink_state [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_QUERY_DEVICE, EPSC_QUERY_PORT, EPSC_QUERY_INFO,
5810N/A */
5810N/Astruct psif_epsc_csr_query_hw {
5810N/A /* host_address(64[0] bits)Host address used for accesses to/from TSU HOST. */
5810N/A u64 address;
5810N/A /* MMU context supplied by driver */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 padding[9];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_query_hw [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_QUERY_PKEY, EPSC_QUERY_GID,
5810N/A */
5810N/Astruct psif_epsc_csr_query_table {
5810N/A u64 port:8;
5810N/A u64 index:16;
5810N/A u64 noname:40;
5810N/A u64 padding[10];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_query_table [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_MC_ATTACH, EPSC_MC_DETACH, EPSC_QUERY_MC
5810N/A */
5810N/Astruct psif_epsc_csr_mc {
5810N/A u32 port:8;
5810N/A u32 qp:24;
5810N/A u32 noname:32;
5810N/A u64 mgid_0;
5810N/A u64 mgid_1;
5810N/A u64 padding[8];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_mc [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_EVENT_ACK
5810N/A */
5810N/Astruct psif_epsc_csr_event {
5810N/A u16 port:8;
5810N/A u16 eq_num:8;
5810N/A u16 noname:16;
5810N/A u32 eq_index;
5810N/A /* Will become : psif_eq_event event */
5810N/A u64 event[8];
5810N/A u64 padding[2];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_event [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_MODIFY_DEVICE
5810N/A */
5810N/Astruct psif_epsc_csr_modify_device {
5810N/A enum psif_epsc_csr_modify_device_flags modify_mask:16;
5810N/A
5810N/A u64 noname:48;
5810N/A u64 sys_image_guid;
5810N/A u8 node_desc[64];
5810N/A u64 padding;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_modify_device [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_MODIFY_PORT_{1,2}
5810N/A */
5810N/Astruct psif_epsc_csr_modify_port {
5810N/A enum psif_epsc_csr_modify_port_flags modify_mask:16;
5810N/A
5810N/A u16 port:8;
5810N/A u16 init_type:8;
5810N/A u32 noname:32;
5810N/A u32 set_port_cap_mask;
5810N/A u32 clr_port_cap_mask;
5810N/A u64 reserved[9];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_modify_port [88 byte] */
5810N/A
5810N/A/**
5810N/A * Test operations : EPSC_TEST_HOST_RD & EPSC_TEST_HOST_WR
5810N/A */
5810N/Astruct psif_epsc_csr_test_host_wrd {
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 host_addr;
5810N/A u32 epsc_offs;
5810N/A u32 length;
5810N/A /* pattern number 0..xxx */
5810N/A u32 pattern;
5810N/A u32 noname:32;
5810N/A u64 reserved_2[7];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_test_host_wrd [88 byte] */
5810N/A
5810N/A/**
5810N/A * Flash programming: EPSC_FLASH_START, EPSC_FLASH_RD,
5810N/A * EPSC_FLASH_WR & EPSC_FLASH_STOP
5810N/A */
5810N/Astruct psif_epsc_csr_flash_access {
5810N/A u32 offset;
5810N/A u32 length;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 host_addr;
5810N/A u64 crc;
5810N/A u64 reserved[7];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_flash_access [88 byte] */
5810N/A
5810N/A/**
5810N/A * IB packet trace acquire : EPSC_TRACE_ACQUIRE
5810N/A *
5810N/A */
5810N/Astruct psif_epsc_csr_trace_acquire {
5810N/A /* Pointer to trace buffer */
5810N/A u64 host_addr;
5810N/A /* Buffer offset in bytes */
5810N/A u32 offset;
5810N/A /* Buffer length in bytes */
5810N/A u32 maxtrace;
5810N/A /* MMU context supplied by driver */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 padding[8];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_trace_acquire [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_FW_VERSION
5810N/A */
5810N/Astruct psif_epsc_csr_fw_version {
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 host_addr;
5810N/A u64 data;
5810N/A u64 reserved[8];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_fw_version [88 byte] */
5810N/A
5810N/Astruct psif_epsc_csr_log_ctrl {
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /* Log level to use */
5810N/A enum psif_epsc_log_level level:32;
5810N/A
5810N/A /* Log mode to use */
5810N/A enum psif_epsc_log_mode mode:32;
5810N/A
5810N/A /* Fields only used by log mode EPSC_LOG_MODE_HOST:
5810N/A Start address of the data area to write to */
5810N/A u64 base;
5810N/A /* pointer to a log_stat data area */
5810N/A u64 stat_base;
5810N/A /* Length in bytes of the buffer */
5810N/A u64 length;
5810N/A u64 reserved_2[6];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_log_ctrl [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPS-A to EPS-C
5810N/A */
5810N/Astruct psif_epsc_csr_epsa_cntrl {
5810N/A /* Operation */
5810N/A enum psif_epsc_csr_epsa_command command:32;
5810N/A
5810N/A /* Which EPS-A core */
5810N/A enum psif_eps_a_core epsa:2;
5810N/A
5810N/A u32 noname:30;
5810N/A /* Offset within flash */
5810N/A u64 flash_addr;
5810N/A /* Address in EPS-A memory */
5810N/A u64 epsa_addr;
5810N/A u64 reserved[8];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_epsa_cntrl [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPS-A to EPS-A
5810N/A */
5810N/Astruct psif_epsc_csr_epsa_cmd {
5810N/A enum psif_epsa_command cmd:32;
5810N/A
5810N/A u32 length;
5810N/A /* MMU context supplied by driver */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /* Buffer adress in host memory */
5810N/A u64 host_addr;
5810N/A u8 entry_point[16];
5810N/A u32 key;
5810N/A u32 qpnum;
5810N/A u64 reserved[5];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_epsa_cmd [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_CLI_ACCESS - buffer size is assumed to be 4K
5810N/A */
5810N/Astruct psif_epsc_csr_cli_access {
5810N/A u64 host_addr;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u8 command[72];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_cli_access [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_MAD_PROCESS:
5810N/A */
5810N/Astruct psif_epsc_csr_mad_process {
5810N/A u64 host_addr;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /* ib_reth_dmalen(32[0] bits)Direct Memory Access Length */
5810N/A u32 byte_len;
5810N/A enum psif_wc_opcode opcode:8;
5810N/A
5810N/A /* ib_bth_qp_number(24[0] bits)Queue Pair */
5810N/A u32 qp:24;
5810N/A enum psif_wc_status status:8;
5810N/A
5810N/A /* Only valid for UD QPs. */
5810N/A u32 src_qp:24;
5810N/A /* Flags indicating GRH and immediate presence.Only valid if not privileged. */
5810N/A /* Inlined wc_flags : struct psif_wc_flags (64 bits) */
5810N/A u16 wc_flags_grh:1;
5810N/A u16 wc_flags_with_imm:1;
5810N/A /* P-Key index from UD packet. */
5810N/A u16 pkey_indx:9;
5810N/A /* Only valid for UD QPs. */
5810N/A u16 sl:4;
5810N/A /* IB portnumber this packet was received on. Only valid if not privileged. */
5810N/A enum psif_port port:1;
5810N/A
5810N/A /*
5810N/A * SLID taken from the received packet. This is only valid for UD QPs. Only
5810N/A * valid if not privileged.
5810N/A */
5810N/A u16 slid;
5810N/A /*
5810N/A * Path bits (lower 7 bits) taken from the DLID in the received packet. This
5810N/A * is only valid for UD QPs. Only valid if not privileged.
5810N/A */
5810N/A u64 dlid_path_bits:7;
5810N/A u64 noname:57;
5810N/A u64 reserved_2[6];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_mad_process [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_MAD_SEND_WR:
5810N/A */
5810N/Astruct psif_epsc_csr_mad_send_wr {
5810N/A u64 host_addr;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 reserved[9];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_mad_send_wr [88 byte] */
5810N/A
5810N/Astruct psif_epsc_query_req {
5810N/A enum psif_epsc_query_op op:32;
5810N/A
5810N/A u32 index;
5810N/A /* Value for EPSC_SET operation */
5810N/A u64 value;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_query_req [16 byte] */
5810N/A
5810N/A/**
5810N/A * Structure for EPSC_QUERY
5810N/A *
5810N/A */
5810N/Astruct psif_epsc_csr_query {
5810N/A /* UF number */
5810N/A u32 uf;
5810N/A /* Future */
5810N/A u32 noname:32;
5810N/A /* Query destin for the response data field */
5810N/A struct psif_epsc_query_req data;
5810N/A /* Query destin for the response info field */
5810N/A struct psif_epsc_query_req info;
5810N/A u64 reserved[6];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_query [88 byte] */
5810N/A
5810N/A/**
5810N/A * Structure for EPSC_SET
5810N/A *
5810N/A */
5810N/Astruct psif_epsc_csr_set {
5810N/A /* UF number */
5810N/A u32 uf;
5810N/A /* Future */
5810N/A u32 noname:32;
5810N/A /* Set destin for the response data field */
5810N/A struct psif_epsc_query_req data;
5810N/A /* Set destin for the response info field */
5810N/A struct psif_epsc_query_req info;
5810N/A u64 reserved[6];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_set [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_HOST_INT_COMMON_CTRL - PF only
5810N/A */
5810N/Astruct psif_epsc_csr_interrupt_common {
5810N/A /* Moderate total interrupt generation. How many usecs to delay. */
5810N/A u64 total_usec:16;
5810N/A u64 noname:48;
5810N/A u64 reserved_2[10];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_interrupt_common [88 byte] */
5810N/A
5810N/A/**
5810N/A * EPSC_HOST_INT_CHANNEL_CTRL - PF + VF
5810N/A */
5810N/Astruct psif_interrupt_attributes {
5810N/A u64 enable_adaptive:1;
5810N/A u64 channel_rx_scale:1;
5810N/A u64 channel_rate_low:1;
5810N/A u64 channel_rate_high:1;
5810N/A u64 channel_ausec:1;
5810N/A u64 channel_ausec_low:1;
5810N/A u64 channel_ausec_high:1;
5810N/A u64 channel_pusec:1;
5810N/A u64 channel_pusec_low:1;
5810N/A u64 channel_pusec_high:1;
5810N/A u64 noname:54;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_interrupt_attributes [ 8 byte] */
5810N/A
5810N/Astruct psif_epsc_csr_interrupt_channel {
5810N/A /* Mask of attributes to set */
5810N/A struct psif_interrupt_attributes attributes;
5810N/A /* EQ number */
5810N/A u64 int_channel:16;
5810N/A /* Set to 1 for adaptive coalescing */
5810N/A u64 enable_adaptive:1;
5810N/A /* Future */
5810N/A u64 noname:31;
5810N/A /* rx-to-tx timer scaling factor 2-exponent value */
5810N/A u16 channel_rx_scale;
5810N/A /* Message rate in messages per second. Low rate threshold. */
5810N/A u32 channel_rate_low;
5810N/A /* Message rate in messages per second. High rate threshold. */
5810N/A u64 channel_rate_high:32;
5810N/A /* How many usecs to delay after first packet. */
5810N/A u16 channel_ausec;
5810N/A /* How many usecs to delay after first packet. Low rate value. */
5810N/A u16 channel_ausec_low;
5810N/A /* How many usecs to delay after first packet. High rate value. */
5810N/A u16 channel_ausec_high;
5810N/A /* How many usecs to delay after packet. */
5810N/A u16 channel_pusec;
5810N/A /* How many usecs to delay after packet. Low rate value. */
5810N/A u16 channel_pusec_low;
5810N/A /* How many usecs to delay after packet. High rate value. */
5810N/A u16 channel_pusec_high;
5810N/A /* Align to 64 bit */
5810N/A u32 noname1:32;
5810N/A u64 reserved_2[6];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_interrupt_channel [88 byte] */
5810N/A
5810N/Aunion psif_epsc_update_set_or_offset {
5810N/A u32 offset;
5810N/A enum psif_epsc_update_set set:32;
5810N/A
5810N/A} PSIF_PACKED; /* union psif_epsc_update_set_or_offset [ 4 byte] */
5810N/A
5810N/A/**
5810N/A * Flash update: EPSC_UPDATE
5810N/A */
5810N/Astruct psif_epsc_csr_update {
5810N/A enum psif_epsc_csr_update_opcode opcode:16;
5810N/A
5810N/A enum psif_epsc_flash_slot slot:16;
5810N/A
5810N/A union psif_epsc_update_set_or_offset u;
5810N/A u32 length;
5810N/A u32 id;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A u64 host_addr;
5810N/A u64 reserved[7];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_update [88 byte] */
5810N/A
5810N/A/**
5810N/A * UF maintenance: EPSC_UF_CTRL
5810N/A */
5810N/Astruct psif_epsc_csr_uf_ctrl {
5810N/A enum psif_epsc_csr_uf_ctrl_opcode opcode:32;
5810N/A
5810N/A u32 flags;
5810N/A u64 uf_vector;
5810N/A u64 reserved[9];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_uf_ctrl [88 byte] */
5810N/A
5810N/A/* CSR automated type for TSU_MMU_FLUSH_CACHES */
5810N/A/* Flush MMU and-or PTW Caches. */
5810N/Astruct psif_csr_mmu_flush_caches {
5810N/A u64 noname:60;
5810N/A u64 ptw_cache_flushed:1;
5810N/A u64 mmu_cache_flushed:1;
5810N/A u64 flush_ptw_cache:1;
5810N/A u64 flush_mmu_cache:1;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_csr_mmu_flush_caches [ 8 byte] */
5810N/A
5810N/A/**
5810N/A * Flush MMU and-or PTW Caches: EPSC_FLUSH_CACHES
5810N/A */
5810N/Astruct psif_epsc_flush_caches {
5810N/A struct psif_csr_mmu_flush_caches flush_mmu_caches;
5810N/A u64 reserved[10];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_flush_caches [88 byte] */
5810N/A
5810N/A/**
5810N/A * Structure for EPSC_PMA_COUNTERS
5810N/A * Common structure for virtual port per UF and
5810N/A * external (physical) port per vSwitch.
5810N/A */
5810N/Astruct psif_epsc_csr_pma_counters {
5810N/A /* UF number */
5810N/A u32 uf;
5810N/A /**
5810N/A * If MSB is set then it's a physical port number.
5810N/A * Otherwise it's a virtual port number.
5810N/A */
5810N/A u32 port;
5810N/A /* Base address in host memory */
5810N/A u64 host_addr;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /**
5810N/A * Bitmask to indicate which counters to clear. Bit
5810N/A * positions are based on the response structure's enum.
5810N/A */
5810N/A u64 clear_mask;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_pma_counters [32 byte] */
5810N/A
5810N/A/** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_VFP_VHCA_DEREGISTER
5810N/A \note
5810N/A This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
5810N/A \par Classification
5810N/A external
5810N/A */
5810N/Astruct psif_epsc_vimma_dereg {
5810N/A /* size 5*u64 */
5810N/A u32 noname:32;
5810N/A /* lowest uf index set in array below */
5810N/A u16 low_uf;
5810N/A /* highest uf index set in array below */
5810N/A u16 high_uf;
5810N/A /* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
5810N/A u64 uf_vector[4];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_dereg [40 byte] */
5810N/A
5810N/A/** \brief Struct defintion for vHCA registration details
5810N/A \note
5810N/A This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
5810N/A \par Classification
5810N/A external
5810N/A */
5810N/Astruct psif_epsc_vimma_vfp_reg {
5810N/A /* size 5*u64 */
5810N/A u16 uf;
5810N/A u16 noname:16;
5810N/A u32 vm_context;
5810N/A u8 vm_id[16];
5810N/A u32 vm_incarnation;
5810N/A u16 vhca_instance;
5810N/A u16 noname1:16;
5810N/A u64 noname2:64;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_vfp_reg [40 byte] */
5810N/A
5810N/A/** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_ADMIN_MODE
5810N/A \note
5810N/A This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
5810N/A \par Classification
5810N/A external
5810N/A */
5810N/Astruct psif_epsc_vimma_set_admmode {
5810N/A /* size 5*u64 */
5810N/A enum psif_epsc_vimma_admmode mode:16;
5810N/A
5810N/A u16 noname:16;
5810N/A /* lowest uf index set in array below */
5810N/A u16 low_uf;
5810N/A /* highest uf index set in array below */
5810N/A u16 high_uf;
5810N/A /* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
5810N/A u64 uf_vector[4];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_set_admmode [40 byte] */
5810N/A
5810N/A/** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_VFP_VHCA_REGISTER
5810N/A \note
5810N/A This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
5810N/A \par Classification
5810N/A external
5810N/A */
5810N/Astruct psif_epsc_vimma_reg_info {
5810N/A u32 noname:32;
5810N/A /* lowest uf index set in array below */
5810N/A u16 low_uf;
5810N/A /* highest uf index set in array below */
5810N/A u16 high_uf;
5810N/A /* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
5810N/A u64 uf_vector[4];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_reg_info [40 byte] */
5810N/A
5810N/A/** \brief Defining params for VIMMA opcodes
5810N/A \par Classification
5810N/A external
5810N/A */
5810N/Aunion psif_epsc_vimma_ctrl_cmd {
5810N/A /* all union elements are size 5*u64 */
5810N/A struct psif_epsc_vimma_dereg dereg;
5810N/A struct psif_epsc_vimma_vfp_reg vfp_reg;
5810N/A struct psif_epsc_vimma_set_admmode adm_mode;
5810N/A struct psif_epsc_vimma_reg_info reg_info;
5810N/A} PSIF_PACKED; /* union psif_epsc_vimma_ctrl_cmd [40 byte] */
5810N/A
5810N/A/** \brief Defines the complete command params for VIMMA opcodes
5810N/A \note
5810N/A This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_BASIC_CAPS
5810N/A and should never change in an incompatible way.
5810N/A \par Classification
5810N/A external
5810N/A */
5810N/Astruct psif_epsc_csr_vimma_ctrl {
5810N/A /* VIMMA sub-opcodes triggered by EPSC_VIMMA_CTRL */
5810N/A enum psif_epsc_vimma_ctrl_opcode opcode:32;
5810N/A
5810N/A /* length of DMA response buffer pinned in host memory */
5810N/A u32 length;
5810N/A /* Size 5*64 bits: union of the params for the various opcodes */
5810N/A union psif_epsc_vimma_ctrl_cmd u;
5810N/A /* Size 64 bits */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /* Place to DMA back longer responses during retrieval */
5810N/A u64 host_addr;
5810N/A /* Summing up to 11 * u64 which is total and max */
5810N/A u64 reserved[3];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_vimma_ctrl [88 byte] */
5810N/A
5810N/A/* Public API for mailbox requests details */
5810N/Aunion psif_epsc_csr_details {
5810N/A /* Anonymous data */
5810N/A struct psif_epsc_csr_opaque opaque;
5810N/A /* Single data to write */
5810N/A struct psif_epsc_csr_single single;
5810N/A /* Descriptor base address */
5810N/A struct psif_epsc_csr_base_addr base_addr;
5810N/A /* Modify QP request */
5810N/A struct psif_epsc_csr_modify_qp modify_qp;
5810N/A /* Query QP */
5810N/A struct psif_epsc_csr_query_qp query_qp;
5810N/A /* Set LID entry (backdoor setup) */
5810N/A struct psif_epsc_csr_set_lid set_lid;
5810N/A /* Set GID entry (backdoor setup) */
5810N/A struct psif_epsc_csr_set_gid set_gid;
5810N/A /* Set EoIB MAC address (backdoor setup) */
5810N/A struct psif_epsc_csr_set_eoib_mac set_eoib_mac;
5810N/A /* Set vlink state */
5810N/A struct psif_epsc_csr_vlink_state set_vlink;
5810N/A /* Query HW state of device port or other */
5810N/A struct psif_epsc_csr_query_hw query_hw;
5810N/A /* Query table info pkey or gid */
5810N/A struct psif_epsc_csr_query_table query_table;
5810N/A /* MC subscription */
5810N/A struct psif_epsc_csr_mc mc;
5810N/A /* Asynchronous event */
5810N/A struct psif_epsc_csr_event event;
5810N/A /* EPSC_MODIFY_DEVICE */
5810N/A struct psif_epsc_csr_modify_device device;
5810N/A /* EPSC_MODIFY_PORT_{1 2} */
5810N/A struct psif_epsc_csr_modify_port port;
5810N/A /* EPSC_TEST_HOST_RD & EPSC_TEST_HOST_WR */
5810N/A struct psif_epsc_csr_test_host_wrd host_wrd;
5810N/A /* EPSC_FLASH_START EPSC_FLASH_RD EPSC_FLASH_WR & EPSC_FLASH_STOP */
5810N/A struct psif_epsc_csr_flash_access flash;
5810N/A /* EPSC_TRACE_ACQUIRE */
5810N/A struct psif_epsc_csr_trace_acquire trace_acquire;
5810N/A /* EPSC_FW_VERSION */
5810N/A struct psif_epsc_csr_fw_version fw_version;
5810N/A /* EPSC_LOG_CTRL */
5810N/A struct psif_epsc_csr_log_ctrl log_ctrl;
5810N/A /* Control epsa */
5810N/A struct psif_epsc_csr_epsa_cntrl epsa_cntrl;
5810N/A struct psif_epsc_csr_epsa_cmd epsa_cmd;
5810N/A /* Issue commands to serial console */
5810N/A struct psif_epsc_csr_cli_access cli;
5810N/A /* Process incomming (QP 1) packet from host */
5810N/A struct psif_epsc_csr_mad_process mad_process;
5810N/A /* Send MAD formated WR to host for sending */
5810N/A struct psif_epsc_csr_mad_send_wr mad_send_wr;
5810N/A /* Single value query */
5810N/A struct psif_epsc_csr_query query;
5810N/A /* Single value set */
5810N/A struct psif_epsc_csr_set set;
5810N/A /* Setup interrupt control */
5810N/A struct psif_epsc_csr_interrupt_common int_common;
5810N/A struct psif_epsc_csr_interrupt_channel int_channel;
5810N/A /* EPSC_UPDATE (update firmware) */
5810N/A struct psif_epsc_csr_update update;
5810N/A /* EPSC_UF_CTRL: UF maintenance functions */
5810N/A struct psif_epsc_csr_uf_ctrl uf_ctrl;
5810N/A /* EPSC_FLUSH_CACHES: Flush MMU and-or PTW Caches */
5810N/A struct psif_epsc_flush_caches flush_caches;
5810N/A /* PMA counters query */
5810N/A struct psif_epsc_csr_pma_counters pma_counters;
5810N/A /* EPSC_VIMMA_CTRL: VIMMA functions */
5810N/A struct psif_epsc_csr_vimma_ctrl vimma_ctrl;
5810N/A} PSIF_PACKED; /* union psif_epsc_csr_details [88 byte] */
5810N/A
5810N/A/**
5810N/A * The host sw to eps-c fw csr workrequest
5810N/A *
5810N/A * The EPSC will post the completion responses for request `#seq_num`
5810N/A * into the completion queue at :
5810N/A * `index = #seq_num % epsc_cq.base_addr.num_entries`
5810N/A * as provided by the initial EPSC_SETUP work request:
5810N/A */
5810N/Astruct psif_epsc_csr_req {
5810N/A enum psif_epsc_csr_opcode opcode:8;
5810N/A
5810N/A enum psif_epsc_csr_flags flags:8;
5810N/A
5810N/A /* Sequence number - included in response */
5810N/A u16 seq_num;
5810N/A /* UF - only valid for UF 0 - must be 0 otherwise */
5810N/A u16 uf;
5810N/A /* Data integrity */
5810N/A u16 crc;
5810N/A /* Register offset or port number */
5810N/A u64 addr;
5810N/A /* Operation specific data */
5810N/A union psif_epsc_csr_details u;
5810N/A u64 reserved[3];
5810N/A} PSIF_PACKED_ALIGNED32; /* struct psif_epsc_csr_req [128 byte] */
5810N/A
5810N/A/** Doorbel/mail-box register layout */
5810N/Astruct psif_epsc_csr_doorbell {
5810N/A /** Transfer index */
5810N/A u64 head:16;
5810N/A /** Payload or info */
5810N/A u64 data:32;
5810N/A /** Identical to head to assure 8 byte atomic write */
5810N/A u16 tail;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_doorbell [ 8 byte] */
5810N/A
5810N/A/**
5810N/A * Basic configuration data for each UF
5810N/A */
5810N/Astruct psif_epsc_csr_config {
5810N/A /** Minor protocol version identifier. */
5810N/A u32 minor_ver;
5810N/A /** Major protocol version identifier. */
5810N/A u32 major_ver;
5810N/A /** Request base address. */
5810N/A u64 request;
5810N/A /** Respose base address. */
5810N/A u64 response;
5810N/A /** Number of entries in table. */
5810N/A u32 entries;
5810N/A /** Size of request entry. */
5810N/A u16 extent_req;
5810N/A /** Size of response entry. */
5810N/A u16 extent_rsp;
5810N/A /** MMU context for mailbox. */
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /** PCI access: setup for sparc memory layout (PF only). */
5810N/A u64 sparc_pages:1;
5810N/A /** PCI access: enable atomic support from SIF (PF only). */
5810N/A enum psif_epsc_csr_atomic_op atomic_support:2;
5810N/A
5810N/A /** Flush SIF pipeline similar to FLR (PF and VF). */
5810N/A u64 clean_state:1;
5810N/A /** PCI access: Select host endian memory layout (PF only). */
5810N/A u64 big_endian:1;
5810N/A /** VCB access: Exact length for scoreboard data copy (PF only). */
5810N/A u64 vcb_exact:1;
5810N/A /** Enable all VFs to receive SMPs at startup (PF only). */
5810N/A u64 enable_vf_smp:1;
5810N/A /** Connect all vlinks to external port (PF only). */
5810N/A u64 vlink_connect:1;
5810N/A /** Setup CMPL spin set mode to be fast - default is safe (PF only). */
5810N/A u64 fast_spin:1;
5810N/A /** Padded field. */
5810N/A u64 noname:55;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_config [48 byte] */
5810N/A
5810N/A/* This is the portion of the descriptor which is updated by software. */
5810N/Astruct psif_cq_sw { /* Subjected to copy and convert */
5810N/A /* Index to completion elements added by SW. */
5810N/A u32 head_indx;
5810N/A /* Info: Edge padding added (for endian convert) */
5810N/A u32 space25;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_cq_sw [ 8 byte] */
5810N/A
5810N/A/*
5810N/A * Descriptor entry for a completion queue. This entry is used to address
5810N/A * into the completion queue and write the correct entries. This structure is
5810N/A * the hardware updateable part of the CQ descriptor.
5810N/A */
5810N/Astruct psif_cq_hw { /* Subjected to copy and convert */
5810N/A /* Do not evict this entry if this bit is set. */
5810N/A u32 sticky:1;
5810N/A /*
5810N/A * CQ notification states. The use of these are as defined in the description
5810N/A * of the PSIF interrupt coalsecing scheme.
5810N/A */
5810N/A enum psif_cq_state cq_not_state:2;
5810N/A
5810N/A /* The descriptor is valid. */
5810N/A u32 valid:1;
5810N/A /*
5810N/A * Log2 size of the completion queue. Maximum number of entries in the
5810N/A * completion queue. This is used for calculating when to wrap the head and
5810N/A * tail indexes.
5810N/A */
5810N/A u32 size_log2:5;
5810N/A /*
5810N/A * If set, this completion queue is proxy enabled and should send completions
5810N/A * to EPS core indicated by the eps_core field.
5810N/A */
5810N/A u32 proxy_en:1;
5810N/A /*
5810N/A * EPS-A core number completions are forwarded to if the proxy_enabled bit is
5810N/A * set.
5810N/A */
5810N/A enum psif_eps_a_core eps_core:2;
5810N/A
5810N/A /*
5810N/A * Pre-fetch threshold (clog2) indicating when to read the software portion
5810N/A * of the descriptor. If there are less entries than indicated by this
5810N/A * threshold, the software portion of the descriptor must be read.
5810N/A */
5810N/A u32 prefetch_threshold_log2:5;
5810N/A /* Reserved */
5810N/A u32 noname:7;
5810N/A /*
5810N/A * Set by DSCR when CQ overrun async event is sent for this CQ. Not cleared
5810N/A * before CQ is destroyed.
5810N/A */
5810N/A u32 cq_overrun_event_sent:1;
5810N/A /*
5810N/A * Interrupt channel associated with the event queue. In the PSIF design the
5810N/A * event queues are one to one with interrupt channel.
5810N/A */
5810N/A u32 int_channel:7;
5810N/A /* cq_max_msg(32[0] bits)Maximum message size in bytes. */
5810N/A u32 max_size;
5810N/A struct psif_mmu_cntx mmu_cntx;
5810N/A /*
5810N/A * VA or PA of the base of the completion queue. If PA the MMU context above
5810N/A * will be a bypass context. Updated by software. The head and tail pointers
5810N/A * can be calculated by the following calculations: Address = base_ptr +
5810N/A * (head * ($bits(completion_entry_t)/8 ) Head Pointer and Tail Pointer will
5810N/A * use the same MMU context as the base, and all need to be VA from one
5810N/A * address space, or all need to be PA. In typical use, to allow direct user
5810N/A * access to the head and tail pointer VAs are used.
5810N/A */
5810N/A u64 base_addr;
5810N/A /* Index to completion elements to be consumed by HW. */
5810N/A u32 tail_indx;
5810N/A /*
5810N/A * Completion queue sequence number. This is the sequence number to be used
5810N/A * for this completion. When used by a client, it is incremented and written
5810N/A * back to this descriptor.
5810N/A */
5810N/A u32 sequence_number;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_cq_hw [32 byte] */
5810N/A
5810N/A/*
5810N/A * Union between CQ sequence number and immediate date. CQ sequence number is
5810N/A * only valid for privileged QP requests.
5810N/A */
5810N/Aunion psif_seq_num_immdt {
5810N/A /*
5810N/A * Completion queue sequence number for arming of completion queues. This is
5810N/A * the CQ sequence number for the completion queue which was armed.
5810N/A */
5810N/A u32 cq_sequence_number;
5810N/A /* ib_immediate(32[0] bits)Immediate Data */
5810N/A u32 imm;
5810N/A} PSIF_PACKED; /* union psif_seq_num_immdt [ 4 byte] */
5810N/A
5810N/Astruct psif_offload_info {
5810N/A /* RSS hash. Only valid if not privileged. */
5810N/A u32 rss_hash;
5810N/A /*
5810N/A * Packet classification structure for offloading packets. Only valid if not
5810N/A * privileged.
5810N/A */
5810N/A /* Inlined packet_classification : struct psif_packet_classification (64 bits) */
5810N/A /*
5810N/A * 0: means LLC_SNAP, 1: means Ethernet type 2. (L2 packet classification.)
5810N/A * This field is applicable for EoIB only.
5810N/A */
5810N/A u32 packet_classification_eth2:1;
5810N/A /* L3/L4 packet classification. */
5810N/A /* Inlined packet_classification_ip_class : struct psif_ip_class (64 bits) */
5810N/A /* This is set for IPv4 packets only. */
5810N/A u32 packet_classification_ipv4:1;
5810N/A /* This is set for IPv6 packets only. */
5810N/A u32 packet_classification_ipv6:1;
5810N/A /* IP fragment. */
5810N/A u32 packet_classification_ip_frag:1;
5810N/A /* IPv4 options or IPv6 extension headers present. */
5810N/A u32 packet_classification_ip_options:1;
5810N/A /* Packet is ARP */
5810N/A u32 packet_classification_arp:1;
5810N/A /* Packet is ARP reply */
5810N/A u32 packet_classification_arp_reply:1;
5810N/A /* Unsupported IPv6 extension headers detected. */
5810N/A u32 packet_classification_ip6_unsupported_exthdr:1;
5810N/A /* L4 is TCP. */
5810N/A u32 packet_classification_tcp:1;
5810N/A /* L4 is UDP. */
5810N/A u32 packet_classification_udp:1;
5810N/A /*
5810N/A * L3 checksum calculated ok. This is either an IPv6 packet or a correctly
5810N/A * checksummed IPv4 header. Only valid if not privileged.
5810N/A */
5810N/A u32 l3_checksum_ok:1;
5810N/A /*
5810N/A * L4 checksum calculated ok. This is either correct TCP/UDP checksum or UDP
5810N/A * checksum not generated by the transmitter. Only valid if not privileged.
5810N/A */
5810N/A u32 l4_checksum_ok:1;
5810N/A /*
5810N/A * Original UF for QP0/1 packets going to the EPS-C. Only valid if not
5810N/A * privileged.
5810N/A */
5810N/A u32 orig_uf:6;
5810N/A /* This is set if the packet was a DR packet. Only valid if not privileged. */
5810N/A u32 is_dr:1;
5810N/A /*
5810N/A * When valid, header/data split is performed and the header length is given
5810N/A * in hdr_length.
5810N/A */
5810N/A /* Inlined hdr_split : struct psif_hdr_split_offload (64 bits) */
5810N/A /* The header length is valid for header/data split offloading. */
5810N/A u32 hdr_split_valid:1;
5810N/A /*
5810N/A * Header length used for header/data split offloading. The length of this
5810N/A * header is added to one scatter element.
5810N/A */
5810N/A u32 hdr_split_hdr_length:9;
5810N/A /*
5810N/A * Receive Tossed Packet. PSIF thought there was something wrong with this
5810N/A * offloaded packet so it should be tossed.
5810N/A */
5810N/A u32 rtp:1;
5810N/A /*
5810N/A * This bit is set if the incoming request is a conditional RDMA WR w/Imm
5810N/A * which is not written to memory.
5810N/A */
5810N/A u32 not_written:1;
5810N/A /* Reserved */
5810N/A u32 noname:1;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_offload_info [ 8 byte] */
5810N/A
5810N/A/*
5810N/A * Union - offload is valid for normal QPs. For privileged QPs, it is the WC
5810N/A * ID needed to completed if outstanding is set.
5810N/A */
5810N/Aunion psif_offload_wc_id {
5810N/A /*
5810N/A * This is used if this is a privileged commend INVALIDATE_SGL_CACHE.
5810N/A * Software must figure out if this WC_ID is valid or not.
5810N/A */
5810N/A union psif_completion_wc_id wc_id;
5810N/A /* This countain offload or PSIF specific infornation. */
5810N/A struct psif_offload_info offload;
5810N/A} PSIF_PACKED; /* union psif_offload_wc_id [ 8 byte] */
5810N/A
5810N/A/*
5810N/A * Completion entry. A completion entry written to host memory, will be
5810N/A * padded out to 64 bytes. The last 4 bytes will contain a completion queue
5810N/A * sequence number.
5810N/A */
5810N/Astruct psif_cq_entry { /* Subjected to copy and convert */
5810N/A /*
5810N/A * Work queue completion ID. For receive completions this is the entry number
5810N/A * in the receive queue and the receive queue descriptor index. For send
5810N/A * completions this is the sq_sequence number.
5810N/A */
5810N/A union psif_completion_wc_id wc_id;
5810N/A /* Length of message. Only valid if not privileged. */
5810N/A u32 byte_len;
5810N/A enum psif_wc_opcode opcode:8;
5810N/A
5810N/A /* ib_bth_qp_number(24[0] bits)Queue Pair */
5810N/A u32 qp:24;
5810N/A union psif_seq_num_immdt seq_num_imm;
5810N/A enum psif_wc_status status:8;
5810N/A
5810N/A /* Only valid for UD QPs. */
5810N/A u32 src_qp:24;
5810N/A u16 grh:1;
5810N/A u16 with_imm:1;
5810N/A /* P-Key index from UD packet. */
5810N/A u16 pkey_indx:9;
5810N/A /* Only valid for UD QPs. */
5810N/A u16 sl:4;
5810N/A /* IB portnumber this packet was received on. Only valid if not privileged. */
5810N/A enum psif_port port:1;
5810N/A
5810N/A /*
5810N/A * SLID taken from the received packet. This is only valid for UD QPs. Only
5810N/A * valid if not privileged.
5810N/A */
5810N/A u16 slid;
5810N/A /*
5810N/A * Path bits (lower 7 bits) taken from the DLID in the received packet. This
5810N/A * is only valid for UD QPs. Only valid if not privileged.
5810N/A */
5810N/A u32 dlid_path_bits:7;
5810N/A /*
5810N/A * Checksum with error. This is not inverted for UDP if zero result from
5810N/A * check. It can be either a full or partial checksum. Only valid if not
5810N/A * privileged.
5810N/A */
5810N/A u32 error_checksum:16;
5810N/A enum psif_tsu_error_types vendor_err:8;
5810N/A
5810N/A /* RSS source. Only valid if not privileged. */
5810N/A enum psif_rss_hash_source rss_hash_src:1;
5810N/A
5810N/A /*
5810N/A * For normal QPs, this is offload information. For privileged QPs, this is
5810N/A * WC ID for in progress RQE.
5810N/A */
5810N/A union psif_offload_wc_id offload_wc_id;
5810N/A /* Flags indicating GRH and immediate presence.Only valid if not privileged. */
5810N/A /* Inlined wc_flags : struct psif_wc_flags (64 bits) */
5810N/A /* Padding out struct bulk */
5810N/A u64 reserved[2];
5810N/A /* Padding out struct last */
5810N/A u32 noname:32;
5810N/A /* sequence number for sanity checking */
5810N/A u32 seq_num;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_cq_entry [64 byte] */
5810N/A
5810N/A/* Generic CSR */
5810N/Astruct psif_csr_generic {
5810N/A u64 data;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_csr_generic [ 8 byte] */
5810N/A
5810N/A/* Compact Base Address Register format. Not for use in register definitions. */
5810N/Astruct psif_base_addr { /* Subjected to copy and convert */
5810N/A /* host_address(64[0] bits)Host address used for accesses to/from TSU HOST. */
5810N/A u64 address;
5810N/A struct psif_mmu_cntx mmu_context;
5810N/A /* Number of entries in table. */
5810N/A u32 num_entries;
5810N/A /* Manually added spacing to pad out base addr */
5810N/A u32 :27;
5810N/A /*
5810N/A * clog2_extent used for entry alignment. This field used to calculate
5810N/A * address for a particular entry. Address to an entry is calculated as
5810N/A * follows: host_addr + entry_num*(1 (leftshift) clog2_extent)
5810N/A */
5810N/A u32 extent_log2:5;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_base_addr [24 byte] */
5810N/A
5810N/A/* Retry data for one atomic request. Layout per BugZilla 3710 */
5810N/Astruct psif_atomic_retry_element {
5810N/A /* [255:192] response atomic data */
5810N/A u64 orig_data;
5810N/A /* [191:184] padding. always zero */
5810N/A u32 zero:8;
5810N/A /* [183:160] psn */
5810N/A u32 psn:24;
5810N/A /* [159] When set to one entry has been used. When set to zero
5810N/A no duplicate has been written in this entry. */
5810N/A u32 used:1;
5810N/A /* [158] This atomic response was in error. */
5810N/A u32 response_error:1;
5810N/A /* [157:0] Padding. Always set to zero. */
5810N/A u32 padding:30;
5810N/A u64 reserved[2];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_atomic_retry_element [32 byte] */
5810N/A
5810N/A/* Data type for TSU_HOST_QP_BASE_ADDR - atomic replay scratch pad
5810N/A * Layout as of 16 deep atomic queue - elements padded to 32 byte
5810N/A */
5810N/Astruct psif_atsp {
5810N/A struct psif_atomic_retry_element retry[16];
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_atsp [512 byte] */
5810N/A
5810N/A/*
5810N/A * Address handle array entry used for sending UD packets. The structure
5810N/A * contains information about the destination for a request.
5810N/A */
5810N/Astruct psif_ah { /* Subjected to copy and convert */
5810N/A u64 grh_remote_gid_0;
5810N/A u64 grh_remote_gid_1;
5810N/A /* Inlined grh : struct psif_grh (192 bits) */
5810N/A /* ib_grh_flowl(20[0] bits)Flow Label */
5810N/A u64 grh_flowlabel:20;
5810N/A /* ib_grh_tclass(8[0] bits)Traffic Class */
5810N/A u64 grh_tclass:8;
5810N/A /* ib_grh_hoplmt(8[0] bits)Hop Limit */
5810N/A u64 grh_hoplmt:8;
5810N/A /* Reserved */
5810N/A u64 noname:4;
5810N/A /* ib_lrh_sl(4[0] bits)Service Level */
5810N/A u64 sl:4;
5810N/A enum psif_use_grh use_grh:1;
5810N/A
5810N/A enum psif_loopback loopback:1;
5810N/A
5810N/A enum psif_port port:1;
5810N/A
5810N/A /* gid_indx(1[0] bits)GID index indicating which of the UFs two GIDs are used. */
5810N/A u64 gid_indx:1;
5810N/A /* ib_lrh_lid(16[0] bits)Local ID */
5810N/A u16 remote_lid;
5810N/A /* Reserved */
5810N/A u64 noname1:9;
5810N/A /* ib_lrh_lid_path_bits(7[0] bits)Path bits for the LID. Used as the least signficant bits in a LID */
5810N/A u64 local_lid_path:7;
5810N/A /* Reserved */
5810N/A u64 noname2:8;
5810N/A /* ipd(8[0] bits)Inter packet delay. Encoded as specified in IB spec. */
5810N/A u64 ipd:8;
5810N/A /*
5810N/A * The protection domain is checked against the protection domain in the QP
5810N/A * state. As long as they are equal, the QP is allowed to use this AHA entry.
5810N/A */
5810N/A u64 pd:24;
5810N/A /* Reserved */
5810N/A u64 noname3:8;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_ah [32 byte] */
5810N/A
5810N/A/* CSR automated type for TSU_IBPR_P{1,2}_EOIB_MAC1 */
5810N/A/* Per vHCA + EPS-C ethernet MAC address register. */
5810N/Astruct psif_csr_ibpr_eoib_mac1 {
5810N/A u64 noname:15;
5810N/A u64 valid:1;
5810N/A u64 mac1:48;
5810N/A} PSIF_PACKED_ALIGNED; /* struct psif_csr_ibpr_eoib_mac1 [ 8 byte] */
5810N/A
5810N/A
5810N/A
5810N/A#endif /* _PSIF_HW_DATA_H_BE */