2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _DAPL_TAVOR_WR_H
2N/A#define _DAPL_TAVOR_WR_H
2N/A
2N/A/*
2N/A * dapl_tavor_wr.h
2N/A * Contains the definition of all structures that are used for
2N/A * doing the work request handling.
2N/A */
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include "dapl_osd.h"
2N/A#include "dapl_hash.h"
2N/A#include "dapl_tavor_ibtf.h"
2N/A#include "dapl_tavor_hw.h"
2N/A
2N/Atypedef struct dapls_tavor_workq_hdr_s dapls_tavor_workq_hdr_t;
2N/Atypedef struct dapls_tavor_wrid_list_hdr_s dapls_tavor_wrid_list_hdr_t;
2N/Atypedef struct dapls_tavor_wrid_entry_s dapls_tavor_wrid_entry_t;
2N/Atypedef struct dapls_tavor_wrid_lock_s dapls_tavor_wrid_lock_t;
2N/A
2N/A/*
2N/A * Defines the lock that protects the wrid list.
2N/A * For send queues and receive queues this is allocated with the workq header
2N/A * structure. For SRQs it is allocated with the wrid_list_hdr and the receive
2N/A * workq header points to it.
2N/A */
2N/Astruct dapls_tavor_wrid_lock_s {
2N/A uint32_t wrl_on_srq; /* lock resides in the srq wridlist */
2N/A DAPL_OS_LOCK wrl_lock;
2N/A};
2N/A
2N/A/*
2N/A * Defines the workq header for each queue in the QP. This points to the
2N/A * dapls_tavor_wrid_list_hdr_t which has the work request id list.
2N/A */
2N/Astruct dapls_tavor_workq_hdr_s {
2N/A uint32_t wq_qpn;
2N/A uint32_t wq_send_or_recv;
2N/A dapls_tavor_wrid_lock_t *wq_wrid_lock;
2N/A uint32_t wq_size;
2N/A uint32_t wq_head;
2N/A uint32_t wq_tail;
2N/A uint32_t wq_full;
2N/A dapls_tavor_wrid_list_hdr_t *wq_wrid_poll;
2N/A dapls_tavor_wrid_list_hdr_t *wq_wrid_post;
2N/A};
2N/A/* Type of the work queue */
2N/A#define TAVOR_WR_SEND 0x1
2N/A#define TAVOR_WR_RECV 0x0
2N/A
2N/A
2N/A/*
2N/A * Defines each work request id entry
2N/A */
2N/Astruct dapls_tavor_wrid_entry_s {
2N/A uint64_t wr_wrid;
2N/A uint32_t wr_wqeaddrsz;
2N/A uint32_t wr_signaled_dbd;
2N/A};
2N/A#define TAVOR_WRID_ENTRY_SIGNALED (1 << 0)
2N/A#define TAVOR_WRID_ENTRY_DOORBELLED (1 << 1)
2N/A
2N/A/*
2N/A * Defines each work request id list which has an array of wrid entries
2N/A */
2N/Astruct dapls_tavor_wrid_list_hdr_s {
2N/A dapls_tavor_wrid_list_hdr_t *wl_next;
2N/A dapls_tavor_wrid_list_hdr_t *wl_prev;
2N/A dapls_tavor_wrid_list_hdr_t *wl_reap_next;
2N/A dapls_tavor_workq_hdr_t *wl_wqhdr;
2N/A dapls_tavor_wrid_entry_t *wl_wre;
2N/A dapls_tavor_wrid_entry_t *wl_wre_old_tail;
2N/A uint32_t wl_size;
2N/A uint32_t wl_full;
2N/A uint32_t wl_head;
2N/A uint32_t wl_tail;
2N/A dapls_tavor_wrid_lock_t *wl_lock; /* valid only for SRQs */
2N/A
2N/A /* For SRQ */
2N/A uint_t wl_srq_en;
2N/A uint32_t *wl_free_list; /* free descrptr list */
2N/A uint32_t wl_freel_head;
2N/A uint32_t wl_freel_tail;
2N/A uint32_t wl_freel_entries; /* # free entries */
2N/A uint32_t wl_srq_wqesz;
2N/A uint64_t wl_srq_desc_addr;
2N/A};
2N/A
2N/Aextern dapls_tavor_wrid_entry_t *dapli_tavor_wrid_find_match_srq(
2N/A dapls_tavor_wrid_list_hdr_t *, tavor_hw_cqe_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _DAPL_TAVOR_WR_H */