aggr_send.c revision ae6aa22afeb444ae208c287e7227a4a7c877f17a
/*
* 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.
*/
/*
* IEEE 802.3ad Link Aggregation - Send code.
*
* Implements the Distributor function.
*/
#include <sys/aggr_impl.h>
/*
* Update the TX load balancing policy of the specified group.
*/
void
{
uint8_t mac_policy = 0;
if ((policy & AGGR_POLICY_L2) != 0)
if ((policy & AGGR_POLICY_L3) != 0)
if ((policy & AGGR_POLICY_L4) != 0)
}
/*
* Send function invoked by the MAC service module.
*/
mblk_t *
{
void *mytx_handle;
for (;;) {
if (grp->lg_ntx_ports == 0) {
/*
* We could have returned from aggr_m_start() before
* the ports were actually attached. Drop the chain.
*/
return (NULL);
}
B_TRUE);
/*
* Bump the active Tx ref count so that the port won't
* be deleted. The reference count will be dropped in mac_tx().
*/
if (mytx_handle == NULL) {
/*
* The port is quiesced.
*/
} else {
/*
* It is fine that the port state changes now.
* Set MAC_TX_NO_HOLD to inform mac_tx() not to bump
* the active Tx ref again. Use hash as the hint so
* to direct traffic to different TX rings. Note below
* bit operation is needed to get the most benefit
* from the mac_tx() hash algorithm.
*/
break;
}
}
break;
}
return (mp);
}
/*
* Enable sending on the specified port.
*/
void
{
/* already enabled or port not yet attached */
return;
}
/*
* Add to group's array of tx ports.
*/
/* current array too small */
KM_SLEEP);
if (grp->lg_tx_ports_size > 0) {
}
}
}
/*
* Disable sending from the specified port.
*/
void
{
if (!port->lp_tx_enabled) {
/* not yet enabled */
return;
}
/* remove from array of attached ports */
} else {
/* not the last entry, replace with last one */
}
grp->lg_ntx_ports--;
}