eib_svc.c revision b494511a9cf72b1fc4eb13a0e593f55c624ab829
/*
* 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
*/
/*
*/
#include <sys/mac_provider.h>
/*
* Thread to handle EoIB events asynchronously
*/
void
{
}
/*
* Are we being asked to die ?
*/
while (evi) {
}
CALLB_CPR_EXIT(&ci);
return;
}
/*
* Otherwise, pull out the first entry from our work queue
*/
/*
* Process this event
*
* handler, since we may have to restart vnics or do stuff that
* to happen in parallel.
*/
case EIB_EV_PORT_DOWN:
"eib_events_handler: Begin EIB_EV_PORT_DOWN");
"eib_events_handler: End EIB_EV_PORT_DOWN");
break;
case EIB_EV_PORT_UP:
"eib_events_handler: Begin EIB_EV_PORT_UP");
"eib_events_handler: End EIB_EV_PORT_UP");
break;
case EIB_EV_PKEY_CHANGE:
"eib_events_handler: Begin EIB_EV_PKEY_CHANGE");
"eib_events_handler: End EIB_EV_PKEY_CHANGE");
break;
case EIB_EV_SGID_CHANGE:
"eib_events_handler: Begin EIB_EV_SGID_CHANGE");
"eib_events_handler: End EIB_EV_SGID_CHANGE");
break;
case EIB_EV_CLNT_REREG:
"eib_events_handler: Begin EIB_EV_CLNT_REREG");
"eib_events_handler: End EIB_EV_CLNT_REREG");
break;
case EIB_EV_GW_UP:
"eib_events_handler: Begin EIB_EV_GW_UP");
/*
* EoIB nexus has notified us that our gateway is now
* reachable. Unless we already think it is reachable,
* mark it so in our records and try to resurrect dead
* vnics.
*/
"eib_events_handler: gw reachable");
"eib_events_handler: End EIB_EV_GW_UP");
break;
}
/*
* If we've not even started yet, we have nothing to do.
*/
"eib_events_handler: End EIB_EV_GW_UP");
break;
}
"eib_events_handler: "
"HCA portstate failed, marking link down");
} else {
"eib_events_handler: "
"HCA portstate ok, resurrecting zombies");
/*
* If we've resurrected the zombies because the gateway
* went down and came back, it is possible our unicast
* mac address changed from what it was earlier. If
* so, we need to update our unicast address with the
* mac layer before marking the link up.
*/
"eib_events_handler: updating unicast "
"addr to %x:%x:%x:%x:%x:%x", vn0_mac[0],
}
"eib_events_handler: eib_mac_link_up(B_FALSE)");
}
"eib_events_handler: End EIB_EV_GW_UP");
break;
case EIB_EV_GW_INFO_UPDATE:
"eib_events_handler: Begin EIB_EV_GW_INFO_UPDATE");
}
"eib_events_handler: End EIB_EV_GW_INFO_UPDATE");
break;
case EIB_EV_MCG_DELETED:
"eib_events_handler: Begin-End EIB_EV_MCG_DELETED");
break;
case EIB_EV_MCG_CREATED:
"eib_events_handler: Begin-End EIB_EV_MCG_CREATED");
break;
case EIB_EV_GW_EPORT_DOWN:
"eib_events_handler: Begin-End EIB_EV_GW_EPORT_DOWN");
break;
case EIB_EV_GW_DOWN:
"eib_events_handler: Begin-End EIB_EV_GW_DOWN");
break;
}
goto wait_for_event;
/*NOTREACHED*/
}
void
{
/*
* Notice to shutdown has a higher priority than the
* rest and goes to the head of the list. Everything
* else goes at the end.
*/
} else {
if (tail)
else
}
}
/*
* Thread to refill channels with rwqes whenever they get low.
*/
void
{
}
/*
* Discard all requests for refill if we're being asked to die
*/
if (ss->ei_rxpost_die) {
CALLB_CPR_EXIT(&ci);
return;
}
/*
* Take the first element out of the queue
*/
/*
* Try to post a bunch of recv wqes into this channel. If we
* fail, it means that we haven't even been able to post a
* single recv wqe. This is alarming, but there's nothing
* we can do. We just move on to the next channel needing
* our service.
*/
"eib_refill_rwqes: eib_chan_post_rx() failed");
}
/*
* Mark it to indicate that the refilling is done
*/
goto wait_for_refill_work;
/*NOTREACHED*/
}
/*
* Thread to create or restart vnics when required
*/
void
{
int ret;
int err;
}
/*
* Pull out the first request
*/
switch (vr_req) {
case EIB_CR_REQ_DIE:
case EIB_CR_REQ_FLUSH:
/*
* Cleanup all pending reqs and failed reqs
*/
}
}
break;
case EIB_CR_REQ_NEW_VNIC:
"new vnic creation request for %x:%x:%x:%x:%x:%x, 0x%x",
/*
* the eoib instance has been unplumbed already, we ignore any
* creation requests that may have been pending.
*/
break;
}
/*
* Try to create a new vnic with the supplied parameters.
*/
err = 0;
"eib_vnic_create(mac=%x:%x:%x:%x:%x:%x, vlan=0x%x) "
}
/*
* If we failed, add this vnic req to our failed list (unless
* it already exists there), so we won't try to create this
* vnic again. Whether we fail or succeed, we're done with
* processing this req, so clear the pending req.
*/
}
/*
* Notify the mac layer that it should retry its tx again. If we
* had created the vnic successfully, we'll be able to send the
* packets; if we had not been successful, we'll drop packets on
* this vnic.
*/
"eib_vnic_creator: calling mac_tx_update()");
break;
default:
break;
}
/*
* Free the current req and quit if we have to
*/
if (vrq) {
}
if (vr_req == EIB_CR_REQ_DIE) {
CALLB_CPR_EXIT(&ci);
return;
}
goto wait_for_vnic_req;
/*NOTREACHED*/
}
/*
* Thread to monitor tx wqes and update the mac layer when needed.
* Note that this thread can only be started after the tx wqe pool
* has been allocated and initialized.
*/
void
{
/*
* Wait till someone falls short of wqes
*/
}
/*
* Have we been asked to die ?
*/
CALLB_CPR_EXIT(&ci);
return;
}
/*
* Start monitoring free wqes till they cross min threshold
*/
}
/*
* Have we been asked to die ?
*/
CALLB_CPR_EXIT(&ci);
return;
}
/*
* Inform the mac layer that tx resources are now available
* and go back to monitoring
*/
if (ss->ei_mac_hdl) {
}
goto monitor_wqe_status;
/*NOTREACHED*/
}
/*
* Thread to monitor lso bufs and update the mac layer as needed.
* Note that this thread can only be started after the lso buckets
* have been allocated and initialized.
*/
void
{
/*
* Wait till someone falls short of LSO buffers or we're asked
* to die
*/
}
CALLB_CPR_EXIT(&ci);
return;
}
/*
* Start monitoring free LSO buffers till there are enough
* free buffers available
*/
}
CALLB_CPR_EXIT(&ci);
return;
}
/*
* We have enough lso buffers available now
*/
/*
* Inform the mac layer that tx lso resources are now available
* and go back to monitoring
*/
if (ss->ei_mac_hdl) {
}
goto monitor_lso_status;
/*NOTREACHED*/
}
/*
* Thread to manage the keepalive requirements for vnics and the gateway.
*/
void
{
int err;
while ((ss->ei_ka_vnics_event &
(EIB_KA_VNICS_DIE | EIB_KA_VNICS_TIMED_OUT)) == 0) {
deadline) == -1) {
}
}
}
CALLB_CPR_EXIT(&ci);
return;
}
/*
* Are there any vnics that need keepalive management ?
*/
goto periodic_keepalive;
/*
* Ok, we need to send vnic keepalives to our gateway. But first
* check if the gateway heartbeat is good as of this moment. Note
* that we need do get the lbolt value after acquiring ei_vnic_lock
* to ensure that ei_gw_last_heartbeat does not change before the
* comparison (to avoid a negative value in the comparison result
* causing us to incorrectly assume that the gateway heartbeat has
* stopped).
*/
lbolt64 = ddi_get_lbolt64();
if (ss->ei_gw_last_heartbeat != 0) {
"eib_manage_keepalives: no keepalives from gateway "
"0x%x for hca_guid=0x%llx, port=0x%x, "
ss->ei_zombie_vnics |=
}
goto periodic_keepalive;
}
}
goto periodic_keepalive;
/*NOTREACHED*/
}
void
{
}
void
{
}
void
{
}
void
{
}
int
{
/*
* If there are some buffers still not reaped and the force
* flag is not set, return without doing anything. Otherwise,
* stop the lso bufs monitor and wait for it to die.
*/
return (EIB_E_FAILURE);
}
return (EIB_E_SUCCESS);
}
void
{
}
void
{
}
/*ARGSUSED*/
void
void *impl_data)
{
"no memory, ignoring this gateway alive event");
} else {
}
}
/*ARGSUSED*/
void
void *impl_data)
{
/*
* We have received a login ack message from the gateway via the EoIB
* nexus (solicitation qpn). The packet is passed to us raw (unparsed)
* and we have to figure out if this is a vnic login ack.
*/
}
/*ARGSUSED*/
void
void *impl_data)
{
"no memory, ignoring this gateway props update event");
return;
}
"no memory, ignoring this gateway props update event");
return;
}
}