X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Fklnds%2Fgnilnd%2Fgnilnd.c;h=d1a73a7fc62f1c8e3cbb3703f98d8e94cbe272f6;hb=refs%2Fchanges%2F11%2F36711%2F4;hp=4976a07fcd3455e9add3f5bef832b7970868199d;hpb=a05fcba379017554afe0a6ffba93dccb2bf7c820;p=fs%2Flustre-release.git diff --git a/lnet/klnds/gnilnd/gnilnd.c b/lnet/klnds/gnilnd/gnilnd.c index 4976a07..d1a73a7 100644 --- a/lnet/klnds/gnilnd/gnilnd.c +++ b/lnet/klnds/gnilnd/gnilnd.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2012 Cray, Inc. * - * Copyright (c) 2013, 2015, Intel Corporation. + * Copyright (c) 2013, 2017, Intel Corporation. * * Author: Nic Henke * Author: James Shimek @@ -25,7 +25,7 @@ #include "gnilnd.h" /* Primary entry points from LNET. There are no guarantees against reentrance. */ -lnd_t the_kgnilnd = { +struct lnet_lnd the_kgnilnd = { .lnd_type = GNILND, .lnd_startup = kgnilnd_startup, .lnd_shutdown = kgnilnd_shutdown, @@ -272,7 +272,7 @@ kgnilnd_create_conn(kgn_conn_t **connp, kgn_device_t *dev) conn->gnc_next_tx = (int) GNILND_MAX_MSG_ID - 10; /* if this fails, we have conflicts and MAX_TX is too large */ - CLASSERT(GNILND_MAX_MSG_ID < GNILND_MSGID_CLOSE); + BUILD_BUG_ON(GNILND_MAX_MSG_ID >= GNILND_MSGID_CLOSE); /* get a new unique CQ id for this conn */ write_lock(&kgnilnd_data.kgn_peer_conn_lock); @@ -505,7 +505,9 @@ kgnilnd_destroy_conn(kgn_conn_t *conn) void kgnilnd_peer_alive(kgn_peer_t *peer) { - set_mb(peer->gnp_last_alive, jiffies); + time64_t now = ktime_get_seconds(); + + set_mb(peer->gnp_last_alive, now); } void @@ -601,11 +603,12 @@ kgnilnd_peer_notify(kgn_peer_t *peer, int error, int alive) peer_nid = kgnilnd_lnd2lnetnid(net->gnn_ni->ni_nid, peer->gnp_nid); - CDEBUG(D_NET, "peer 0x%p->%s last_alive %lu (%lus ago)\n", + CDEBUG(D_NET, "peer 0x%p->%s last_alive %lld (%llds ago)\n", peer, libcfs_nid2str(peer_nid), peer->gnp_last_alive, - cfs_duration_sec(jiffies - peer->gnp_last_alive)); + ktime_get_seconds() - peer->gnp_last_alive); lnet_notify(net->gnn_ni, peer_nid, alive, + (alive) ? true : false, peer->gnp_last_alive); kgnilnd_net_decref(net); @@ -1800,7 +1803,7 @@ kgnilnd_report_node_state(lnet_nid_t nid, int down) } int -kgnilnd_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg) +kgnilnd_ctl(struct lnet_ni *ni, unsigned int cmd, void *arg) { struct libcfs_ioctl_data *data = arg; kgn_net_t *net = ni->ni_data; @@ -1920,13 +1923,13 @@ kgnilnd_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg) } void -kgnilnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) +kgnilnd_query(struct lnet_ni *ni, lnet_nid_t nid, time64_t *when) { kgn_net_t *net = ni->ni_data; kgn_tx_t *tx; kgn_peer_t *peer = NULL; kgn_conn_t *conn = NULL; - lnet_process_id_t id = { + struct lnet_process_id id = { .nid = nid, .pid = LNET_PID_LUSTRE, }; @@ -1939,7 +1942,7 @@ kgnilnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) /* LIE if in a quiesce - we will update the timeouts after, * but we don't want sends failing during it */ if (kgnilnd_data.kgn_quiesce_trigger) { - *when = jiffies; + *when = ktime_get_seconds(); read_unlock(&kgnilnd_data.kgn_peer_conn_lock); GOTO(out, 0); } @@ -1955,7 +1958,7 @@ kgnilnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) * - if it was, we lie to LNet because we believe a TX would complete * on reconnect */ if (kgnilnd_conn_clean_errno(peer->gnp_last_errno)) { - *when = jiffies; + *when = ktime_get_seconds(); } /* we still want to fire a TX and new conn in this case */ } else { @@ -1985,7 +1988,7 @@ kgnilnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) kgnilnd_launch_tx(tx, net, &id); } out: - CDEBUG(D_NETTRACE, "peer 0x%p->%s when %lu\n", peer, + CDEBUG(D_NETTRACE, "peer 0x%p->%s when %lld\n", peer, libcfs_nid2str(nid), *when); EXIT; } @@ -2336,7 +2339,7 @@ int kgnilnd_base_startup(void) } kgnilnd_data.kgn_mbox_cache = - kmem_cache_create("kgn_mbox_block", KMALLOC_MAX_SIZE, 0, + kmem_cache_create("kgn_mbox_block", GNILND_MBOX_SIZE, 0, SLAB_HWCACHE_ALIGN, NULL); if (kgnilnd_data.kgn_mbox_cache == NULL) { CERROR("Can't create slab for physical mbox blocks\n"); @@ -2677,7 +2680,7 @@ kgnilnd_base_shutdown(void) } int -kgnilnd_startup(lnet_ni_t *ni) +kgnilnd_startup(struct lnet_ni *ni) { int rc, devno; kgn_net_t *net; @@ -2775,7 +2778,7 @@ kgnilnd_startup(lnet_ni_t *ni) } void -kgnilnd_shutdown(lnet_ni_t *ni) +kgnilnd_shutdown(struct lnet_ni *ni) { kgn_net_t *net = ni->ni_data; int i; @@ -2891,7 +2894,7 @@ static int __init kgnilnd_init(void) if (rc != 0) return rc; - printk(KERN_INFO "Lustre: kgnilnd build version: "KGNILND_BUILD_REV"\n"); + LCONSOLE_INFO("Lustre: kgnilnd build version: "LUSTRE_VERSION_STRING"\n"); kgnilnd_insert_sysctl(); kgnilnd_proc_init(); @@ -2903,7 +2906,7 @@ static int __init kgnilnd_init(void) MODULE_AUTHOR("Cray, Inc. "); MODULE_DESCRIPTION("Gemini LNet Network Driver"); -MODULE_VERSION(KGNILND_BUILD_REV); +MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); module_init(kgnilnd_init);