rdsv3_impl.c revision b27516f55237249607f754e6e42e865f12456675
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * CDDL HEADER START
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * The contents of this file are subject to the terms of the
4b476ed547ce189d989c425cd2f82986abd37b4ddarudy * Common Development and Distribution License (the "License").
4b476ed547ce189d989c425cd2f82986abd37b4ddarudy * You may not use this file except in compliance with the License.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * See the License for the specific language governing permissions
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * and limitations under the License.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * When distributing Covered Code, include this CDDL HEADER in each
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * If applicable, add the following below this CDDL HEADER, with the
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * fields enclosed by brackets "[]" replaced with your own identifying
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * information: Portions Copyright [yyyy] [name of copyright owner]
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * CDDL HEADER END
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
e2ff4ac63d83b80a04de28e4d3d6068fe781fa12rbextern unsigned int ip_ocsum(ushort_t *address, int halfword_count,
e2ff4ac63d83b80a04de28e4d3d6068fe781fa12rb unsigned int sum);
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * Check if the IP interface named by `lifrp' is RDS-capable.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * Strip off the logical interface portion before getting
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * intimate with the name.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * loopback is considered RDS-capable
733a5356058ae0150a67d61f0ad8e5260d2acae3rbrdsv3_do_ip_ioctl(ksocket_t so4, void **ipaddrs, int *size, int *nifs)
733a5356058ae0150a67d61f0ad8e5260d2acae3rb int i, j, n, rc;
4b476ed547ce189d989c425cd2f82986abd37b4ddarudy /* snapshot the current number of interfaces */
4b476ed547ce189d989c425cd2f82986abd37b4ddarudy lifn.lifn_flags = LIFC_NOXMIT | LIFC_TEMPORARY | LIFC_ALLZONES;
4b476ed547ce189d989c425cd2f82986abd37b4ddarudy rval = ksocket_ioctl(so4, SIOCGLIFNUM, (intptr_t)&lifn, &rval,
4b476ed547ce189d989c425cd2f82986abd37b4ddarudy if (rval != 0) {
733a5356058ae0150a67d61f0ad8e5260d2acae3rb if (numifs <= 0) {
733a5356058ae0150a67d61f0ad8e5260d2acae3rb RDSV3_DPRINTF2("rdsv3_do_ip_ioctl", "No interfaces found");
733a5356058ae0150a67d61f0ad8e5260d2acae3rb return (0);
733a5356058ae0150a67d61f0ad8e5260d2acae3rb /* allocate extra room in case more interfaces appear */
733a5356058ae0150a67d61f0ad8e5260d2acae3rb /* get the interface names and ip addresses */
733a5356058ae0150a67d61f0ad8e5260d2acae3rb lifc.lifc_flags = LIFC_NOXMIT | LIFC_TEMPORARY | LIFC_ALLZONES;
733a5356058ae0150a67d61f0ad8e5260d2acae3rb rc = ksocket_ioctl(so4, SIOCGLIFCONF, (intptr_t)&lifc, &rval, CRED());
733a5356058ae0150a67d61f0ad8e5260d2acae3rb if (rc != 0) {
733a5356058ae0150a67d61f0ad8e5260d2acae3rb RDSV3_DPRINTF2("rdsv3_do_ip_ioctl", "SIOCGLIFCONF failed");
733a5356058ae0150a67d61f0ad8e5260d2acae3rb return (rc);
733a5356058ae0150a67d61f0ad8e5260d2acae3rb /* if our extra room is used up, try again */
733a5356058ae0150a67d61f0ad8e5260d2acae3rb /* calc actual number of ifconfs */
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * Count the RDS interfaces
733a5356058ae0150a67d61f0ad8e5260d2acae3rb for (i = 0, j = 0, lp = lifc.lifc_req; i < n; i++, lp++) {
case AF_INET:
if (rc != 0) continue;
return (rval);
numifs = j;
case AF_INET:
if (rc != 0) {
rlp++;
return (rval);
char *cp;
return (B_TRUE);
int rval = 0;
int numifs;
int i, j, n, rc;
*size = 0;
*nifs = 0;
CRED());
if (rval != 0) {
return (rval);
if (numifs <= 0) {
if (rc != 0) {
return (rc);
goto retry_count;
case AF_INET:
if (rc != 0) continue;
return (rval);
numifs = j;
case AF_INET:
if (rc != 0) {
rlp++;
return (rval);
return (B_FALSE);
return (B_TRUE);
#define RDSV3_WQ_THREAD_IDLE 0
while (work) {
case RDSV3_WQ_THREAD_IDLE:
case RDSV3_WQ_THREAD_RUNNING:
case RDSV3_WQ_THREAD_FLUSHING:
case RDSV3_WQ_THREAD_EXITING:
case RDSV3_WQ_THREAD_RUNNING:
case RDSV3_WQ_THREAD_FLUSHING:
case RDSV3_WQ_THREAD_IDLE:
case RDSV3_WQ_THREAD_EXITING:
if (delay == 0) {
dwp);
return (NULL);
return (NULL);
return (wq);
struct rsock *
return (NULL);
return (sk);
sizeof (struct rdsv3_page_frag),
/* loop.c */
struct rdsv3_loop_connection
rdsv3_loop_init(void)
/* rdma.c */
/* transport.c */
rdsv3_trans_exit(void)
for (i = 0; i < RDS_TRANS_COUNT; i++) {
if (transports[i]) {
if (trans)
void *payload)
char *bp;
/* bind.c */
rdsv3_bind_node_compare(const void *a, const void *b)
else if (needle <
sizeof (struct rdsv3_sock),
uint_t i;
for (i = 0; i < num; i++, s++) {
if (i != IBT_SUCCESS) {
s = first;
return (num);
if (num != 0) {
int ret;
sizeof (struct rdsv3_header);
KM_SLEEP);
sizeof (struct rdsv3_header)));
sizeof (struct rdsv3_header)));
c = old;
return ((ulong_t)c != u);