if (!already_live) {
wake_up_all(&dev->gnd_waitq);
}
- return;
}
void kgnilnd_schedule_device_timer(unsigned long arg)
int hold_timeout = 0;
/* code below relies on +1 relationship ... */
- CLASSERT(GNILND_BUF_PHYS_MAPPED == (GNILND_BUF_PHYS_UNMAPPED + 1));
- CLASSERT(GNILND_BUF_VIRT_MAPPED == (GNILND_BUF_VIRT_UNMAPPED + 1));
+ BUILD_BUG_ON(GNILND_BUF_PHYS_MAPPED !=
+ (GNILND_BUF_PHYS_UNMAPPED + 1));
+ BUILD_BUG_ON(GNILND_BUF_VIRT_MAPPED !=
+ (GNILND_BUF_VIRT_UNMAPPED + 1));
switch (tx->tx_buftype) {
default:
tx->tx_offset = ((__u64)((unsigned long)sink->gnrd_addr)) & 3;
if (tx->tx_offset)
- kgnilnd_admin_addref(kgnilnd_data.kgn_rev_offset);
+ atomic_inc(&kgnilnd_data.kgn_rev_offset);
if ((nob + tx->tx_offset) & 3) {
desc_nob = ((nob + tx->tx_offset) + (4 - ((nob + tx->tx_offset) & 3)));
- kgnilnd_admin_addref(kgnilnd_data.kgn_rev_length);
+ atomic_inc(&kgnilnd_data.kgn_rev_length);
} else {
desc_nob = (nob + tx->tx_offset);
}
kgnilnd_tx_done(tx, -EFAULT);
return 0;
}
- kgnilnd_admin_addref(kgnilnd_data.kgn_rev_copy_buff);
+ atomic_inc(&kgnilnd_data.kgn_rev_copy_buff);
rc = kgnilnd_mem_register(conn->gnc_device->gnd_handle, (__u64)tx->tx_buffer_copy, desc_nob, NULL, GNI_MEM_READWRITE, &tx->tx_buffer_copy_map_key);
if (rc != GNI_RC_SUCCESS) {
/* Registration Failed nak rdma and kill the tx. */
GNIDBG_SMSG_CREDS(D_NET, conn);
kgnilnd_schedule_conn(conn);
-
- return;
}
void
kmem_cache_free(kgnilnd_data.kgn_rx_cache, rx);
CDEBUG(D_MALLOC, "slab-freed 'rx': %lu at %p.\n",
sizeof(*rx), rx);
-
- return;
}
int
peer, libcfs_nid2str(peer->gnp_nid),
peer->gnp_reconnect_interval);
- timeout = cfs_time_seconds(MAX(*kgnilnd_tunables.kgn_timeout,
+ timeout = cfs_time_seconds(max(*kgnilnd_tunables.kgn_timeout,
GNILND_MIN_TIMEOUT));
conn = kgnilnd_find_conn_locked(peer);
CDEBUG(D_NET, "starting connect to %s\n",
libcfs_nid2str(peer->gnp_nid));
- LASSERTF(peer->gnp_connecting == GNILND_PEER_IDLE, "Peer was idle and we"
- "have a write_lock, state issue %d\n", peer->gnp_connecting);
+ LASSERTF(peer->gnp_connecting == GNILND_PEER_IDLE,
+ "Peer was idle and we have a write_lock, state issue %d\n",
+ peer->gnp_connecting);
peer->gnp_connecting = GNILND_PEER_CONNECT;
kgnilnd_peer_addref(peer); /* extra ref for connd */
}
}
}
-
- return;
}
void
{
struct list_head *peers = &kgnilnd_data.kgn_peers[idx];
struct list_head *ctmp, *ctmpN;
- struct list_head geriatrics;
- struct list_head souls;
-
- INIT_LIST_HEAD(&geriatrics);
- INIT_LIST_HEAD(&souls);
+ LIST_HEAD(geriatrics);
+ LIST_HEAD(souls);
write_lock(&kgnilnd_data.kgn_peer_conn_lock);
/* set overrun too */
event_data |= (1UL << 63);
LASSERTF(GNI_CQ_OVERRUN(event_data),
- "(1UL << 63) is no longer the bit to"
- "set to indicate CQ_OVERRUN\n");
+ "(1UL << 63) is no longer the bit to set to indicate CQ_OVERRUN\n");
}
}
/* sender should get error event too and take care