hermon_srq.h revision 9e39c5ba00a55fa05777cc94b148296af305e135
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_ADAPTERS_HERMON_SRQ_H
#define _SYS_IB_ADAPTERS_HERMON_SRQ_H
/*
* Contains all of the prototypes, #defines, and structures necessary
* for the Shared Receive Queue Processing routines.
*
* (including those routines directly exposed through the IBTF CI
* interface).
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following defines the default number of Shared Receive Queues (SRQ).
* This value is controllable via the "hermon_log_num_srq" configuration
* variable.
* We also have a define for the minimum size of a SRQ. SRQs allocated with
* size 0, 1, 2, or 3 will always get back a SRQ of size 4.
*/
#define HERMON_NUM_SRQ_SHIFT 0x10
#define HERMON_SRQ_MIN_SIZE 0x4
/*
* The hermon firmware currently limits an SRQ to maximum of 31 SGL
* per WQE (WQE size is 512 bytes or less). With a WQE size of 256
* (SGL 15 or less) no problems are seen. We set SRQ_MAX_SGL size here, for
* use in the config profile to be 0xF.
*/
#define HERMON_SRQ_MAX_SGL 0xF
/*
* SRQ States as defined by Hermon.
*/
#define HERMON_SRQ_STATE_SW_OWNER 0xF
#define HERMON_SRQ_STATE_HW_OWNER 0x0
#define HERMON_SRQ_STATE_ERROR 0x1
/*
* The hermon_sw_srq_s structure is also referred to using the "hermon_srqhdl_t"
* typedef (see hermon_typedef.h). It encodes all the information necessary
* to track the various resources needed to allocate, initialize, query, modify,
* post, and (later) free a shared receive queue (SRQ).
*/
struct hermon_sw_srq_s {
void *srq_hdlrarg;
/* Work Queue */
/* DoorBell Record information */
/* For zero-based */
/* Queue Memory for SRQ */
struct hermon_qalloc_info_s srq_wqinfo;
};
/*
* The hermon_srq_info_t structure is used internally by the Hermon driver to
* pass information to and from the hermon_srq_alloc() routine. It contains
* placeholders for all of the potential inputs and outputs that this routine
* can take.
*/
typedef struct hermon_srq_info_s {
/*
* The hermon_srq_options_t structure is used in the Hermon SRQ allocation
* routines to provide additional option functionality. When a NULL pointer
* is passed in place of a pointer to this struct, it is a way of specifying
* the "default" behavior. Using this structure, however, is a way of
* controlling any extended behavior.
*/
typedef struct hermon_srq_options_s {
/*
* old call
* int hermon_srq_alloc(hermon_state_t *state, hermon_srq_info_t *srqinfo,
* uint_t sleepflag, hermon_srq_options_t *op);
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_ADAPTERS_HERMON_SRQ_H */