/*
* 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
*/
/*
*/
/*
* This header file contains the basic data structures which the
* virtual switch (vsw) uses to communicate with vnet clients.
*
* The virtual switch reads the machine description (MD) to
* determine how many port_t structures to create (each port_t
* can support communications to a single network device). The
* port_t's are maintained in a linked list.
*
* Each port in turn contains a number of logical domain channels
* (ldc's) which are inter domain communications channels which
* are used for passing small messages between the domains. There
* may be any number of channels associated with each port, though
* currently most devices only have a single channel. The current
* implementation provides support for only one channel per port.
*
* The ldc is a bi-directional channel, which is divided up into
* two directional 'lanes', one outbound from the switch to the
* virtual network device, the other inbound to the switch.
* Depending on the type of device each lane may have seperate
* communication paramaters (such as mtu etc).
*
* For those network clients which use descriptor rings the
* rings are associated with the appropriate lane. I.e. rings
* which the switch exports are associated with the outbound lanes
* while those which the network clients are exporting to the switch
* are associated with the inbound lane.
*
* In diagram form the data structures look as follows:
*
* vsw instance
* |
* +----->port_t----->port_t----->port_t----->
* |
* +--->ldc_t
* |
* +--->lane_t (inbound)
* | |
* | +--->dring
* |
* +--->lane_t (outbound)
* |
* +--->dring
*
*/
#ifndef _VSW_LDC_H
#define _VSW_LDC_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* LDC pkt tranfer MTU - largest msg size used
*/
#define VSW_DEF_MSG_WORDS \
(VNET_DRING_REG_EXT_MSG_SIZE_MAX / sizeof (uint64_t))
/*
* Default message type.
*/
typedef struct def_msg {
} def_msg_t;
/*
*/
typedef struct ver_sup {
} ver_sup_t;
/*
* Lane states.
*/
/* Handshake milestones */
/*
* Lane direction (relative to ourselves).
*/
/* Peer session id received */
/*
* Maximum number of consecutive reads of data from channel
*/
/*
* Currently only support one ldc per port.
*/
/*
*/
/*
* Descriptor ring info
*
* Each descriptor element has a pre-allocated data buffer
* associated with it, into which data being transmitted is
* copied. By pre-allocating we speed up the copying process.
* The buffer is re-used once the peer has indicated that it is
* finished with the descriptor.
*/
/*
* Size of the mblk in each mblk pool.
*/
/*
* Number of mblks in each mblk pool.
*/
/*
* Number of rcv buffers in RxDringData mode
*/
/* increment recv index */
/* decrement recv index */
/* bounds check rx index */
(((i) >= 0) && ((i) < (dp)->num_descriptors))
/*
* Private descriptor
*/
typedef struct vsw_private_desc {
/*
* Below lock must be held when accessing the state of
* a descriptor on either the private or public sections
* of the ring.
*/
void *datap;
int bound;
/*
* Descriptor ring structure
*/
typedef struct dring_info {
uint64_t ident; /* identifier sent to peer */
} dring_info_t;
/*
* Each ldc connection is comprised of two lanes, incoming
* from a peer, and outgoing to that peer. Each lane shares
* common ldc parameters and also has private lane-specific
* parameters.
*/
typedef struct lane {
} lane_t;
/* channel drain states */
/*
* vnet-protocol-version dependent function prototypes.
*/
typedef void (*vsw_ldcrx_dringdata_t) (void *, void *);
/* ldc information associated with a vsw-port */
typedef struct vsw_ldc {
int drain_state;
/* tx thread fields */
/* message thread fields */
/* receive thread fields */
/* channel statistics */
} vsw_ldc_t;
/* worker thread flags */
/* multicast addresses port is interested in */
typedef struct mcst_addr {
} mcst_addr_t;
/* Port detach states */
/* port information associated with a vsw */
typedef struct vsw_port {
/*
* mac address of the port & connected device
*/
/* HybridIO related info */
/* bandwidth limit */
} vsw_port_t;
/* list of ports per vsw */
typedef struct vsw_port_list {
/*
* Taskq control message
*/
typedef struct vsw_ctrl_task {
/*
* State of connection to peer. Some of these states
* can be mapped to LDC events as follows:
*
* VSW_CONN_RESET -> LDC_RESET_EVT
* VSW_CONN_UP -> LDC_UP_EVT
*/
typedef struct vsw_conn_evt {
/*
* Ethernet broadcast address definition.
*/
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
#ifdef __cplusplus
}
#endif
#endif /* _VSW_LDC_H */