ibd.h revision 71be8d8f808a6f8b1a1bbb502fb01c7ccdb8512d
/*
* 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_CLIENTS_IBD_H
#define _SYS_IB_CLIENTS_IBD_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* IETF defined IPoIB encapsulation header, with 2b of ethertype
* followed by 2 reserved bytes. This is at the start of the
* datagram sent to and received over the wire by the driver.
*/
typedef struct ipoib_header {
} ipoib_hdr_t;
#define IPOIB_HDRSIZE sizeof (struct ipoib_header)
/*
* IETF defined IPoIB link address; IBA QPN, followed by GID,
* which has a prefix and suffix, as reported via ARP.
*/
typedef struct ipoib_mac {
} ipoib_mac_t;
#define IPOIB_ADDRL sizeof (struct ipoib_mac)
/*
* Pseudo header prepended to datagram in DLIOCRAW transmit path
* and when GLD hands the datagram to the gldm_send entry point.
*/
typedef struct ipoib_ptxhdr {
/*
* The pseudo-GRH structure that sits before the data in the
* receive buffer, and is overlaid on top of the real GRH.
* The driver sets the ipoib_vertcflow to 0 if the pseudo-GRH
* does not hold valid information. If it is indicated valid,
* the driver must additionally provide the sender's qpn in
* network byte order in ipoib_sqpn, and not touch the
* remaining parts which were DMA'ed in by the IBA hardware.
*/
typedef struct ipoib_pgrh {
} ipoib_pgrh_t;
/*
* The GRH is also dma'ed into recv buffers, thus space needs
* to be allocated for them.
*/
#define IPOIB_GRH_SIZE sizeof (ipoib_pgrh_t)
#include <sys/mac_provider.h>
/*
* Structure to encapsulate various types of async requests.
*/
typedef struct ibd_acache_rq {
int rq_op; /* what operation */
void *rq_ptr;
} ibd_req_t;
typedef struct ibd_mcache {
} ibd_mce_t;
typedef struct ibd_acache_s {
} ibd_ace_t;
#define IBD_MAX_SQSEG 59
#define IBD_MAX_RQSEG 1
typedef enum {
typedef enum {
IBD_WQE_TXBUF = 1,
IBD_WQE_LSOBUF = 2,
IBD_WQE_MAPPED = 3
/*
* Pre-registered copybuf used for send and receive
*/
typedef struct ibd_copybuf_s {
typedef struct ibd_wqe_s {
} ibd_wqe_t;
/*
* Send WQE
*/
typedef struct ibd_swqe_s {
} ibd_swqe_t;
/*
* Receive WQE
*/
typedef struct ibd_rwqe_s {
struct ibd_state_s *w_state;
} ibd_rwqe_t;
typedef struct ibd_list_s {
union {
} ustat;
} ibd_list_t;
/*
* LSO buffers
*
* Under normal circumstances we should never need to use any buffer
* that's larger than MTU. Unfortunately, IB HCA has limitations
* on the length of SGL that are much smaller than those for regular
* ethernet NICs. Since the network layer doesn't care to limit the
* number of mblk fragments in any send mp chain, we end up having to
* use these larger-than-MTU sized (larger than id_tx_buf_sz actually)
* buffers occasionally.
*/
typedef struct ibd_lsobuf_s {
struct ibd_lsobuf_s *lb_next;
int lb_isfree;
} ibd_lsobuf_t;
typedef struct ibd_lsobkt_s {
} ibd_lsobkt_t;
/*
* Posting to a single software rx post queue is contentious,
* so break it out to (multiple) an array of queues.
*
* Try to ensure rx_queue structs fall in different cache lines using a filler.
* Note: the RX_QUEUE_CACHE_LINE needs to change if the struct changes.
*/
#define RX_QUEUE_CACHE_LINE \
2 * sizeof (uint32_t))))
typedef struct ibd_rx_queue_s {
/*
* This structure maintains information per port per HCA
* (per network interface).
*/
typedef struct ibd_state_s {
int id_tx_busy;
int id_scq_poll_busy;
int id_rx_post_busy;
int id_rx_nqueues;
int id_rcq_poll_busy;
int id_mtu;
struct list id_req_list;
struct list id_ah_active;
struct list id_ah_free;
char id_ah_op;
struct list id_mc_full;
char id_prom_op;
int id_sched_needed;
int id_sched_cnt;
int id_sched_lso_cnt;
} ibd_state_t;
#endif /* _KERNEL && !_BOOT */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_CLIENTS_IBD_H */