X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fklnds%2Fo2iblnd%2Fo2iblnd.c;h=87341202ce074e5a7a7c2f1a94cfb058327bf979;hp=18ad6a6d10784fd2755f2f86041cbd2936101685;hb=1436c2e3309a50800e8578fd9157926279db6234;hpb=c2f15d619beaec812ccf077dbecd2d67a7cb2f57 diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 18ad6a6..8734120 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -40,19 +40,11 @@ #include "o2iblnd.h" -lnd_t the_o2iblnd = { - .lnd_type = O2IBLND, - .lnd_startup = kiblnd_startup, - .lnd_shutdown = kiblnd_shutdown, - .lnd_ctl = kiblnd_ctl, - .lnd_query = kiblnd_query, - .lnd_send = kiblnd_send, - .lnd_recv = kiblnd_recv, -}; +static lnd_t the_o2iblnd; kib_data_t kiblnd_data; -__u32 +static __u32 kiblnd_cksum (void *ptr, int nob) { char *c = ptr; @@ -426,9 +418,9 @@ kiblnd_unlink_peer_locked (kib_peer_t *peer) kiblnd_peer_decref(peer); } -int -kiblnd_get_peer_info (lnet_ni_t *ni, int index, - lnet_nid_t *nidp, int *count) +static int +kiblnd_get_peer_info(lnet_ni_t *ni, int index, + lnet_nid_t *nidp, int *count) { kib_peer_t *peer; struct list_head *ptmp; @@ -465,7 +457,7 @@ kiblnd_get_peer_info (lnet_ni_t *ni, int index, return -ENOENT; } -void +static void kiblnd_del_peer_locked (kib_peer_t *peer) { struct list_head *ctmp; @@ -486,7 +478,7 @@ kiblnd_del_peer_locked (kib_peer_t *peer) * last ref on it. */ } -int +static int kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid) { struct list_head zombies = LIST_HEAD_INIT(zombies); @@ -540,7 +532,7 @@ kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid) return rc; } -kib_conn_t * +static kib_conn_t * kiblnd_get_conn_by_idx(lnet_ni_t *ni, int index) { kib_peer_t *peer; @@ -580,7 +572,7 @@ kiblnd_get_conn_by_idx(lnet_ni_t *ni, int index) return NULL; } -void +static void kiblnd_debug_rx (kib_rx_t *rx) { CDEBUG(D_CONSOLE, " %p status %d msg_type %x cred %d\n", @@ -588,7 +580,7 @@ kiblnd_debug_rx (kib_rx_t *rx) rx->rx_msg->ibm_credits); } -void +static void kiblnd_debug_tx (kib_tx_t *tx) { CDEBUG(D_CONSOLE, " %p snd %d q %d w %d rc %d dl %lx " @@ -1040,7 +1032,7 @@ kiblnd_close_stale_conns_locked(kib_peer_t *peer, return count; } -int +static int kiblnd_close_matching_conns(lnet_ni_t *ni, lnet_nid_t nid) { kib_peer_t *peer; @@ -1088,7 +1080,7 @@ kiblnd_close_matching_conns(lnet_ni_t *ni, lnet_nid_t nid) return (count == 0) ? -ENOENT : 0; } -int +static int kiblnd_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg) { struct libcfs_ioctl_data *data = arg; @@ -1142,7 +1134,7 @@ kiblnd_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg) return rc; } -void +static void kiblnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) { cfs_time_t last_alive = 0; @@ -1177,7 +1169,7 @@ kiblnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) return; } -void +static void kiblnd_free_pages(kib_pages_t *p) { int npages = p->ibp_npages; @@ -1441,7 +1433,7 @@ kiblnd_find_rd_dma_mr(kib_hca_dev_t *hdev, kib_rdma_desc_t *rd) return mr; } -void +static void kiblnd_destroy_fmr_pool(kib_fmr_pool_t *pool) { LASSERT (pool->fpo_map_count == 0); @@ -1455,7 +1447,7 @@ kiblnd_destroy_fmr_pool(kib_fmr_pool_t *pool) LIBCFS_FREE(pool, sizeof(kib_fmr_pool_t)); } -void +static void kiblnd_destroy_fmr_pool_list(struct list_head *head) { kib_fmr_pool_t *pool; @@ -1481,7 +1473,7 @@ static int kiblnd_fmr_flush_trigger(int ncpts) return max(IBLND_FMR_POOL_FLUSH, size); } -int +static int kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo) { /* FMR pool for RDMA */ @@ -1720,7 +1712,7 @@ kiblnd_init_pool(kib_poolset_t *ps, kib_pool_t *pool, int size) pool->po_size = size; } -void +static void kiblnd_destroy_pool_list(struct list_head *head) { kib_pool_t *pool; @@ -2193,7 +2185,7 @@ kiblnd_tx_init(kib_pool_t *pool, struct list_head *node) tx->tx_cookie = tps->tps_next_tx_cookie++; } -void +static void kiblnd_net_fini_pools(kib_net_t *net) { int i; @@ -2235,7 +2227,7 @@ kiblnd_net_fini_pools(kib_net_t *net) } } -int +static int kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts) { unsigned long flags; @@ -2409,7 +2401,7 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev) return -EINVAL; } -void +static void kiblnd_hdev_cleanup_mrs(kib_hca_dev_t *hdev) { int i; @@ -2443,7 +2435,7 @@ kiblnd_hdev_destroy(kib_hca_dev_t *hdev) LIBCFS_FREE(hdev, sizeof(*hdev)); } -int +static int kiblnd_hdev_setup_mrs(kib_hca_dev_t *hdev) { struct ib_mr *mr; @@ -2747,7 +2739,7 @@ kiblnd_destroy_dev (kib_dev_t *dev) LIBCFS_FREE(dev, sizeof(*dev)); } -kib_dev_t * +static kib_dev_t * kiblnd_create_dev(char *ifname) { struct net_device *netdev; @@ -2805,7 +2797,7 @@ kiblnd_create_dev(char *ifname) return dev; } -void +static void kiblnd_base_shutdown(void) { struct kib_sched_info *sched; @@ -2872,7 +2864,7 @@ kiblnd_base_shutdown(void) module_put(THIS_MODULE); } -void +static void kiblnd_shutdown (lnet_ni_t *ni) { kib_net_t *net = ni->ni_data; @@ -2945,7 +2937,7 @@ out: return; } -int +static int kiblnd_base_startup(void) { struct kib_sched_info *sched; @@ -3035,7 +3027,7 @@ kiblnd_base_startup(void) return -ENETDOWN; } -int +static int kiblnd_start_schedulers(struct kib_sched_info *sched) { int rc = 0; @@ -3076,7 +3068,7 @@ kiblnd_start_schedulers(struct kib_sched_info *sched) return rc; } -int +static int kiblnd_dev_start_threads(kib_dev_t *dev, int newdev, __u32 *cpts, int ncpts) { int cpt; @@ -3102,7 +3094,7 @@ kiblnd_dev_start_threads(kib_dev_t *dev, int newdev, __u32 *cpts, int ncpts) return 0; } -kib_dev_t * +static kib_dev_t * kiblnd_dev_search(char *ifname) { kib_dev_t *alias = NULL; @@ -3135,7 +3127,7 @@ kiblnd_dev_search(char *ifname) return alias; } -int +static int kiblnd_startup (lnet_ni_t *ni) { char *ifname; @@ -3231,14 +3223,24 @@ failed: return -ENETDOWN; } -void __exit +static lnd_t the_o2iblnd = { + .lnd_type = O2IBLND, + .lnd_startup = kiblnd_startup, + .lnd_shutdown = kiblnd_shutdown, + .lnd_ctl = kiblnd_ctl, + .lnd_query = kiblnd_query, + .lnd_send = kiblnd_send, + .lnd_recv = kiblnd_recv, +}; + +static void __exit kiblnd_module_fini (void) { lnet_unregister_lnd(&the_o2iblnd); kiblnd_tunables_fini(); } -int __init +static int __init kiblnd_module_init (void) { int rc;