int err = 0;
/* ensure we haven't violated max datagram size */
- CLASSERT(sizeof(kgn_connreq_t) <= GNI_DATAGRAM_MAXSIZE);
+ BUILD_BUG_ON(sizeof(kgn_connreq_t) > GNI_DATAGRAM_MAXSIZE);
/* no need to zero out, we do that when allocating dgram */
connreq->gncr_magic = GNILND_MSG_MAGIC;
int
kgnilnd_cancel_net_dgrams(kgn_net_t *net)
{
- kgn_dgram_t *dg, *dgN;
- struct list_head zombies;
- int i;
+ kgn_dgram_t *dg, *dgN;
+ LIST_HEAD(zombies);
+ int i;
ENTRY;
/* we want to cancel any outstanding dgrams - we don't want to rely
"in reset %d\n", net->gnn_shutdown,
kgnilnd_data.kgn_in_reset);
- INIT_LIST_HEAD(&zombies);
-
spin_lock(&net->gnn_dev->gnd_dgram_lock);
for (i = 0; i < *kgnilnd_tunables.kgn_peer_hash_size; i++) {
kgnilnd_cancel_wc_dgrams(kgn_device_t *dev)
{
kgn_dgram_t *dg, *dgN;
- struct list_head zombies;
+ LIST_HEAD(zombies);
ENTRY;
/* Time to kill the outstanding WC's
"in reset %d\n", kgnilnd_data.kgn_wc_kill,
kgnilnd_data.kgn_in_reset);
- INIT_LIST_HEAD(&zombies);
spin_lock(&dev->gnd_dgram_lock);
do {
kgnilnd_cancel_dgram_locked(dg);
/* WC could be DONE already, check and if so add to list to be released */
- if (dg->gndg_state == GNILND_DGRAM_DONE) {
- list_del_init(&dg->gndg_list);
- list_add_tail(&dg->gndg_list, &zombies);
- }
+ if (dg->gndg_state == GNILND_DGRAM_DONE)
+ list_move_tail(&dg->gndg_list, &zombies);
}
} while (dg != NULL);
write_unlock(&kgnilnd_data.kgn_peer_conn_lock);
/* Notify LNET that we now have a working connection to this peer.
- * This is a Cray extension to the "standard" LND behavior. */
- lnet_notify(peer->gnp_net->gnn_ni, peer->gnp_nid,
- 1, cfs_time_current());
+ * This is a Cray extension to the "standard" LND behavior.
+ */
+ lnet_notify(peer->gnp_net->gnn_ni, peer->gnp_nid, true, true,
+ ktime_get_seconds());
/* drop our 'hold' ref */
kgnilnd_conn_decref(conn);