enx_q.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
*/
/*
*/
/*
* Acquire an SWQE
*/
/*ARGSUSED*/
{
int i;
for (i = 0; i < ENX_NUM_SWQE; i++) {
break;
}
}
/*
* We probably have enough swqe entries for doing our solicitations.
* If we find it not enough in practice, we need to implement some
* sort of dynamic allocation.
*/
if (i == ENX_NUM_SWQE)
return (wqe);
}
/*
* Return a SWQE from completion. We may have to release
* it or keep it.
*/
void
{
/*
* This send wqe is from the completion queue. We need to
* clear the 'posted' flag first.
*/
/*
* See if we need to release this send wqe back to the pool
* on completion. We may not need to do so if, for example,
* this were a swqe acquired specifically for a particular gw.
*/
}
}
/*
* Return a RWQE from completion. We probably have to repost it.
*/
void
{
/*
* We should never need to free an rwqe on completion.
*/
/*
* An rwqe is always in-use and posted, so we only need to make
* sure the ds_len is adjusted back to the value it's supposed
* to have.
*/
/*
* Repost the recv wqe
*/
if (ret != IBT_SUCCESS) {
ENX_DPRINTF_WARN("ibt_post_recv(chan_hdl=0x%llx) failed, "
}
}
/*
* Release an SWQE that was acquired earlier.
*/
void
{
/*
* Make sure this swqe is in use. Since this routine may also be
* called when we're trying to cleanup the eoib nodes, we
* should clear all flag bits.
*/
}
/*
* Insert the passed child to the head of the queue
*/
void
{
/*
* Search existing children to see if we already have this
* child. If so, simply update its dip and node_name
*/
if (ch->ch_node_name) {
}
return;
}
}
/*
* If not, add the new child to the list of children
*/
}
int
{
ENX_DPRINTF_DEBUG("updating child dip for "
"gw portid 0x%x to 0x%llx",
}
return (ENX_E_SUCCESS);
}
}
return (ENX_E_FAILURE);
}
{
break;
}
return (dip);
}
{
break;
}
return (dip);
}
/*
* See if the passed gateway is already found in our list. Note
* that we assume that the gateway port id uniquely identifies each
* gateway.
*/
{
break;
}
return (lgw);
}
/*
* Add a newly discovered gateway to the gateway list. Since we'll
* need to send unicast solicitations to this gateway soon, we'll
* also grab a swqe entry, and initialize basic gw adress parameters
* such as the gid, qpn, qkey and pkey of the GW. When we eventually
* get to sending the unicast to this gateway for the first time,
* we'll discover the path to this gateway using these parameters
* and modify the ud destination handle appropriately.
*/
{
/*
* For now, we'll simply do KM_NOSLEEP allocation, since this code
* is called from within rx processing
*/
ENX_DPRINTF_WARN("no memory, gw port_id 0x%x "
"will be ignored by hca_guid=0x%llx, port=0x%x",
return (NULL);
}
/*
* We also need to acquire a send wqe to do unicast solicitations
* to this gateway later on. We should've enough pre-allocated swqes
* to do this without sleeping.
*/
ENX_DPRINTF_WARN("no swqe available, gw port_id 0x%x "
"will be ignored by hca_guid=0x%llx, port=0x%x",
return (NULL);
}
/*
* Initialize gw state and wqe information.
*/
/*
* Set up gateway advertisement monitoring parameters. Since we
* always need to check against a timeout value of 2.5 * gw_adv_period,
* we'll keep this pre-calculated value as well.
*/
/*
* Initialize gateway address information. Note that if the message has
* a GRH, we'll use the subnet prefix, otherwise we'll assume that the
* gateway is in the same subnet as ourselves.
*/
} else {
}
/*
* Initialize gateway parameters received via the advertisement
*/
sizeof (new_gwi->gw_system_name));
sizeof (new_gwi->gw_port_name));
sizeof (new_gwi->gw_vendor_id));
/*
* Queue up the new gwi and return it
*/
return (new_gwi);
}
/*
* Update old data for the gateway in our list with the new data.
*/
void
{
/*
* We'll update all info received in the new advertisement in
* the original gwi and also move the gw_state to that of the state
* in the new gwi.
*/
/*
* The guids shouldn't really change for the "same" gateway
*/
ENX_DPRINTF_WARN("gateway system guid changed for the "
"*same* gateway from 0x%llx to 0x%llx",
}
ENX_DPRINTF_WARN("gateway guid changed for the "
"*same* gateway from 0x%llx to 0x%llx",
}
ENX_DPRINTF_DEBUG("gateway adv period changed "
}
ENX_DPRINTF_DEBUG("gateway ka period changed "
}
ENX_DPRINTF_DEBUG("vnic ka period changed "
}
ENX_DPRINTF_DEBUG("gateway control qpn changed "
}
ENX_DPRINTF_DEBUG("gateway lid changed from 0x%x to 0x%x",
}
/*
* The identity of the gateway is currently defined by its portid,
* so this cannot be different or eibnx_find_gw_in_gwlist() wouldn't
* have thought it's the same. For now though, we'll treat it
* like any other parameter, and flag it if we find this different.
*/
ENX_DPRINTF_WARN("gateway portid changed for the *same* "
}
ENX_DPRINTF_DEBUG("host adm vnics changed from 0x%x to 0x%x",
}
ENX_DPRINTF_DEBUG("gateway sl changed from 0x%x to 0x%x",
}
ENX_DPRINTF_DEBUG("gateway n_rss_qpn changed from 0x%x to 0x%x",
}
/*
* The gw_flag_ucast_advt and gw_flag_available are expected to
* change over time (and even gw_num_net_vnics could change, but
* it's of no use to us presently), and we shouldn't trigger any
* flag for these
*/
ENX_DPRINTF_DEBUG("gateway system name changed from %s to %s",
}
ENX_DPRINTF_DEBUG("gateway port name changed from %s to %s",
}
ENX_DPRINTF_DEBUG("vendor id changed from %s to %s",
}
/*
* See if the subnet prefix for the gateway has changed
*/
} else {
}
ENX_DPRINTF_WARN("subnet prefix changed from 0x%llx to 0x%llx",
}
/*
* If the gateway address has changed in any way, clear the current
* address vector and update the gateway guid and gateway qpn. The
* address vector will be created the next time a unicast solicit
* is attempted for this gateway.
*/
if (gw_addr_changed) {
sizeof (ibt_adds_vect_t));
}
}
if (gwi_changed) {
*gwi_changed = changed;
}
}
/*
* Queue up a node for EoIB instantiation and wake up the thread
* that creates eoib nodes.
*/
void
{
/*
* For now, we'll simply do KM_NOSLEEP allocation, since this
* code is called from within rx processing
*/
ENX_DPRINTF_WARN("no memory, eoib node will not be "
"created for hca_guid=0x%llx, hca_port=0x%x, "
return;
}
/*
* If the eoib node creation thread is dying (or dead), don't
* queue up any more requests for creation
*/
if (ss->nx_nodeq_thr_die) {
} else {
}
}