vnet_gen.c revision 06db247c678f0e3956535e8a6dec31d6c2108827
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * CDDL HEADER START
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * The contents of this file are subject to the terms of the
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * Common Development and Distribution License (the "License").
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * You may not use this file except in compliance with the License.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * See the License for the specific language governing permissions
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * and limitations under the License.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * When distributing Covered Code, include this CDDL HEADER in each
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * If applicable, add the following below this CDDL HEADER, with the
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * fields enclosed by brackets "[]" replaced with your own identifying
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * information: Portions Copyright [yyyy] [name of copyright owner]
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * CDDL HEADER END
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * Use is subject to license terms.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson#pragma ident "%Z%%M% %I% %E% SMI"
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * Implementation of the mac functionality for vnet using the
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * generic(default) transport layer of sun4v Logical Domain Channels(LDC).
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson * Function prototypes.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson/* vgen proxy entry points */
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonint vgen_init(void *vnetp, dev_info_t *vnetdip, const uint8_t *macaddr,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_multicst(void *arg, boolean_t add,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_promisc(void *arg, boolean_t on);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_unicst(void *arg, const uint8_t *mca);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_stat(void *arg, uint_t stat, uint64_t *val);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_ioctl(void *arg, queue_t *wq, mblk_t *mp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson/* externs - functions provided by vnet to add/remove/modify entries in fdb */
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonvoid vnet_add_fdb(void *arg, uint8_t *macaddr, mac_tx_t m_tx, void *txarg);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonvoid vnet_modify_fdb(void *arg, uint8_t *macaddr, mac_tx_t m_tx,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonvoid vnet_add_def_rte(void *arg, mac_tx_t m_tx, void *txarg);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonvoid vnet_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson/* vgen internal functions */
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_port_detach(vgen_port_t *portp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_port_list_insert(vgen_port_t *portp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_port_list_remove(vgen_port_t *portp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic vgen_port_t *vgen_port_lookup(vgen_portlist_t *plistp,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_mdeg_cb(void *cb_argp, mdeg_result_t *resp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_add_port(vgen_t *vgenp, md_t *mdp, mde_cookie_t mdex);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_remove_port(vgen_t *vgenp, md_t *mdp, mde_cookie_t mdex);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_port_attach_mdeg(vgen_t *vgenp, int port_num, uint64_t *ldcids,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson int num_ids, struct ether_addr *macaddr, boolean_t vsw_port);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_port_detach_mdeg(vgen_port_t *portp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_update_port(vgen_t *vgenp, md_t *curr_mdp,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson mde_cookie_t curr_mdex, md_t *prev_mdp, mde_cookie_t prev_mdex);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic uint64_t vgen_port_stat(vgen_port_t *portp, uint_t stat);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_ldc_attach(vgen_port_t *portp, uint64_t ldc_id);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_port_uninit(vgen_port_t *portp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_uninit_ldcs(vgen_port_t *portp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_clobber_tbufs(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic uint64_t vgen_ldc_stat(vgen_ldc_t *ldcp, uint_t stat);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic uint_t vgen_ldc_cb(uint64_t event, caddr_t arg);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_portsend(vgen_port_t *portp, mblk_t *mp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_ldcsend(vgen_ldc_t *ldcp, mblk_t *mp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_reclaim_dring(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson/* vgen handshake functions */
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic vgen_ldc_t *vh_nextphase(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_supported_version(vgen_ldc_t *ldcp, uint16_t ver_major,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_next_version(vgen_ldc_t *ldcp, vgen_ver_t *verp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_sendmsg(vgen_ldc_t *ldcp, caddr_t msg, size_t msglen,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_send_version_negotiate(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_send_attr_info(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_send_dring_reg(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_send_dring_data(vgen_ldc_t *ldcp, uint32_t start, int32_t end);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_send_mcast_info(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handshake_phase2(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_handshake_reset(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handshake_done(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_handshake_retry(vgen_ldc_t *ldcp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_version_negotiate(vgen_ldc_t *ldcp,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_attr_info(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_dring_reg(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_rdx_info(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_mcast_info(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_ctrlmsg(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_dring_data(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_dring_data_info(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_process_dring_data(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_dring_data_ack(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_dring_data_nack(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_send_dring_ack(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_handle_datamsg(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_handle_errmsg(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_handle_evt_up(vgen_ldc_t *ldcp, boolean_t flag);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic void vgen_handle_evt_reset(vgen_ldc_t *ldcp, boolean_t flag);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic int vgen_check_sid(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleesonstatic uint64_t vgen_macaddr_strtoul(const uint8_t *macaddr);
#ifdef DEBUG
int vgen_trigger_txtimeout = 0;
int vgen_trigger_rxlost = 0;
NULL,
NULL,
#ifdef DEBUG
extern int vnet_dbglevel;
int instance;
return (DDI_FAILURE);
return (DDI_FAILURE);
sizeof (struct ether_addr));
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_SUCCESS);
static mblk_t *
for (i = 0; i < vgen_tx_retries; ) {
if (++i < vgen_tx_retries)
return (mp);
return (NULL);
int status;
return (VGEN_FAILURE);
return (rv);
int rv = 0;
goto vgen_tx_exit;
goto vgen_tx_exit;
goto vgen_tx_exit;
return (VGEN_TX_NORESOURCES);
goto vgen_tx_exit;
if (is_bcast)
else if (is_mcast)
if (rv != 0) {
* in vnet_m_tx(). See comments in vnet_modify_fdb() in vnet.c.
return (VGEN_TX_SUCCESS);
uint32_t i;
return (rv);
goto vgen_mcast_exit;
goto vgen_mcast_exit;
if (add) {
goto vgen_mcast_exit;
sizeof (struct ether_addr));
return (rv);
return (DDI_SUCCESS);
return (DDI_SUCCESS);
*val = 0;
int port_num;
static vgen_port_t *
return (portp);
int rv;
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
int idx;
return (MDEG_FAILURE);
if (val == 0) {
DDI_SUCCESS) {
vnetdip));
return (MDEG_FAILURE);
return (MDEG_FAILURE);
return (MDEG_SUCCESS);
int num_ldcs;
int addrsz;
int num_nodes = 0;
int listsz = 0;
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
if (num_ldcs <= 0) {
return (DDI_FAILURE);
return (DDI_FAILURE);
for (i = 0; i < num_ldcs; i++) {
return (DDI_FAILURE);
&addrsz)) {
return (DDI_FAILURE);
return (DDI_FAILURE);
if (val == 0) {
return (rv);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_FAILURE);
for (i = 0; i < num_ids; i++) {
return (DDI_FAILURE);
if (vsw_port)
return (DDI_SUCCESS);
return (DDI_SUCCESS);
static uint64_t
val = 0;
return (val);
int status;
int instance;
goto ldc_attach_failed;
if (status != 0) {
goto ldc_attach_failed;
if (vgen_rcv_thread_enabled) {
status);
goto ldc_attach_failed;
goto ldc_attach_failed;
if (status != 0) {
status);
goto ldc_attach_failed;
if (status != 0) {
goto ldc_attach_failed;
if (status != 0) {
goto ldc_attach_failed;
goto ldc_attach_failed;
return (DDI_SUCCESS);
return (DDI_FAILURE);
void *tbufp;
int status;
return (DDI_FAILURE);
if (status) {
return (DDI_FAILURE);
if (status) {
return (DDI_FAILURE);
return (DDI_SUCCESS);
int rv;
if (rv != 0) {
goto ldcinit_failed;
goto ldcinit_failed;
if (rv != 0) {
goto ldcinit_failed;
if (rv != 0) {
goto ldcinit_failed;
return (DDI_SUCCESS);
return (DDI_FAILURE);
int rv;
if (rv != 0) {
if (rv != 0) {
int rv;
int ci;
if (rv) {
goto init_tbufs_failed;
if (rv != 0) {
goto init_tbufs_failed;
if ((ncookies == 0) ||
goto init_tbufs_failed;
if (rv != 0) {
goto init_tbufs_failed;
return (DDI_SUCCESS);
return (DDI_FAILURE);
#ifdef DEBUG
int ndone = 0;
#ifdef DEBUG
ndone++;
int rv;
if (rv != 0) {
return (DDI_FAILURE);
if (rv != 0) {
return (DDI_FAILURE);
return (DDI_SUCCESS);
static uint64_t
val = 0;
switch (stat) {
case MAC_STAT_MULTIRCV:
case MAC_STAT_BRDCSTRCV:
case MAC_STAT_MULTIXMT:
case MAC_STAT_BRDCSTXMT:
case MAC_STAT_NORCVBUF:
case MAC_STAT_IERRORS:
case MAC_STAT_NOXMTBUF:
case MAC_STAT_OERRORS:
case MAC_STAT_COLLISIONS:
case MAC_STAT_RBYTES:
case MAC_STAT_IPACKETS:
case MAC_STAT_OBYTES:
case MAC_STAT_OPACKETS:
case MAC_STAT_IFSPEED:
case ETHER_STAT_ALIGN_ERRORS:
case ETHER_STAT_FCS_ERRORS:
case ETHER_STAT_DEFER_XMTS:
case ETHER_STAT_EX_COLLISIONS:
case ETHER_STAT_MACXMT_ERRORS:
case ETHER_STAT_XCVR_ADDR:
case ETHER_STAT_XCVR_ID:
case ETHER_STAT_XCVR_INUSE:
case ETHER_STAT_CAP_1000FDX:
case ETHER_STAT_CAP_1000HDX:
case ETHER_STAT_CAP_100FDX:
case ETHER_STAT_CAP_100HDX:
case ETHER_STAT_CAP_10FDX:
case ETHER_STAT_CAP_10HDX:
case ETHER_STAT_CAP_ASMPAUSE:
case ETHER_STAT_CAP_PAUSE:
case ETHER_STAT_CAP_AUTONEG:
case ETHER_STAT_ADV_CAP_10FDX:
case ETHER_STAT_ADV_CAP_10HDX:
case ETHER_STAT_ADV_CAP_PAUSE:
case ETHER_STAT_LP_CAP_100FDX:
case ETHER_STAT_LP_CAP_100HDX:
case ETHER_STAT_LP_CAP_10FDX:
case ETHER_STAT_LP_CAP_10HDX:
case ETHER_STAT_LP_CAP_PAUSE:
case ETHER_STAT_LINK_ASMPAUSE:
case ETHER_STAT_LINK_PAUSE:
case ETHER_STAT_LINK_AUTONEG:
case ETHER_STAT_LINK_DUPLEX:
val = 0;
return (val);
int rv;
if (rv != 0) {
static uint_t
return (LDC_SUCCESS);
return (LDC_SUCCESS);
int rv;
if (rv != 0) {
goto vgen_evtread_error;
if (msglen == 0) {
#ifdef DEBUG
goto vgen_evtread_error;
case VIO_TYPE_CTRL:
case VIO_TYPE_DATA:
case VIO_TYPE_ERR:
if (rv != 0) {
goto vgen_evtread_error;
} while (msglen);
goto vgen_evt_read;
} else if (rv) {
static vgen_ldc_t *
return (ldcp);
while (i < VGEN_NUM_VER) {
return (VGEN_SUCCESS);
return (VGEN_FAILURE);
while (i < VGEN_NUM_VER) {
return (VGEN_SUCCESS);
return (VGEN_FAILURE);
int rv;
return (VGEN_FAILURE);
if (!caller_holds_lock) {
if (!caller_holds_lock) {
if (rv != 0) {
return (rv);
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
int rv;
return (rv);
return (VGEN_SUCCESS);
int rv;
return (rv);
return (VGEN_SUCCESS);
int rv;
sizeof (ldc_mem_cookie_t));
return (rv);
return (VGEN_SUCCESS);
int rv;
return (rv);
return (VGEN_SUCCESS);
int rv;
return (rv);
return (VGEN_SUCCESS);
int rv;
uint32_t n;
B_FALSE);
return (rv);
mccount -= n;
} while (mccount);
return (VGEN_SUCCESS);
int rv;
#ifdef DEBUG
return (rv);
return (VGEN_SUCCESS);
return (rv);
if (rv != 0) {
return (rv);
sizeof (ldc_mem_cookie_t));
return (rv);
return (VGEN_SUCCESS);
int rv;
if (rv != 0) {
if (rv != 0) {
int rv = 0;
switch (hphase) {
case VH_PHASE1:
case VH_PHASE2:
case VH_PHASE3:
case VH_DONE:
} else if (rv) {
int status = 0;
switch (hphase) {
case VH_PHASE1:
case VH_PHASE2:
case VH_PHASE3:
if (status == 0) {
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
int ack = 0;
int failed = 0;
int idx;
int rv = 0;
case VIO_SUBTYPE_INFO:
return (rv);
return (VGEN_FAILURE);
idx = 0;
idx++;
B_FALSE);
return (rv);
if (ack) {
if (failed) {
return (VGEN_FAILURE);
case VIO_SUBTYPE_ACK:
return (VGEN_FAILURE);
case VIO_SUBTYPE_NACK:
return (VGEN_FAILURE);
return (VGEN_FAILURE);
idx = 0;
idx++;
return (VGEN_FAILURE);
return (rv);
return (VGEN_SUCCESS);
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
int ack = 0;
int rv = 0;
return (VGEN_FAILURE);
case VIO_SUBTYPE_INFO:
B_FALSE);
return (rv);
if (ack) {
return (VGEN_FAILURE);
case VIO_SUBTYPE_ACK:
case VIO_SUBTYPE_NACK:
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
sizeof (vnet_public_desc_t))) {
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
int ack = 0;
int rv = 0;
return (VGEN_FAILURE);
case VIO_SUBTYPE_INFO:
if (ack == 0) {
sizeof (dcookie));
B_FALSE);
return (rv);
if (ack) {
return (VGEN_FAILURE);
case VIO_SUBTYPE_ACK:
case VIO_SUBTYPE_NACK:
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
int rv = 0;
return (VGEN_FAILURE);
case VIO_SUBTYPE_INFO:
B_FALSE);
return (rv);
case VIO_SUBTYPE_ACK:
case VIO_SUBTYPE_NACK:
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
int count;
case VIO_SUBTYPE_INFO:
case VIO_SUBTYPE_ACK:
case VIO_SUBTYPE_NACK:
return (VGEN_SUCCESS);
int rv = 0;
case VIO_VER_INFO:
case VIO_ATTR_INFO:
case VIO_DRING_REG:
case VIO_RDX:
case VNET_MCAST_INFO:
return (rv);
int rv = 0;
return (rv);
case VIO_DRING_DATA:
return (rv);
int rv = 0;
return (rv);
int rv = 0;
case VIO_SUBTYPE_INFO:
case VIO_SUBTYPE_ACK:
case VIO_SUBTYPE_NACK:
return (rv);
int rv = 0;
#ifdef VGEN_HANDLE_LOST_PKTS
return (rv);
return (rv);
#ifdef DEBUG
if (vgen_trigger_rxlost) {
vgen_trigger_rxlost = 0;
return (rv);
#ifdef VGEN_HANDLE_LOST_PKTS
return (rv);
return (rv);
#ifdef VGEN_REXMIT
return (rv);
return (rv);
int count = 0;
int rv = 0;
if (rv != 0) {
return (rv);
count = 0;
retries++;
goto vgen_recv_retry;
retries = 0;
if (set_ack_start) {
(ncookies == 0) ||
if (!mp) {
BPRI_MED);
if (rxd_err) {
if (rv != 0) {
return (rv);
if (ack_needed) {
goto error_ret;
goto vgen_next_rxi;
if (rv) {
goto error_ret;
if (rv != 0) {
goto error_ret;
if (ack_needed) {
goto error_ret;
goto vgen_next_rxi;
count = 0;
if (set_ack_start) {
goto error_ret;
return (rv);
int rv = 0;
return (rv);
return (rv);
return (rv);
if (ready_txd) {
return (rv);
return (rv);
int rv = 0;
#ifdef VGEN_REXMIT
return (rv);
return (rv);
return (rv);
#ifdef VGEN_REXMIT
if (rv != 0) {
return (rv);
int count = 0;
#ifdef DEBUG
count++;
return (VGEN_SUCCESS);
return (VGEN_FAILURE);
(vnet_ldcwd_txtimeout) &&
return (VGEN_SUCCESS);
return (VGEN_FAILURE);
int rv;
#ifdef DEBUG
if (vgen_trigger_txtimeout) {
return (VGEN_FAILURE);
return (VGEN_SUCCESS);
static uint64_t
for (i = 0; i < ETHERADDRL; i++) {
return (val);
return (VGEN_SUCCESS);
static caddr_t
return (ebuf);
thread_exit();
static uint_t
return (DDI_INTR_CLAIMED);
#if DEBUG