summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include
diff options
context:
space:
mode:
authorAmir Shehata <amir.shehata@intel.com>2016-02-22 17:29:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-22 18:05:49 -0800
commit9c26b89dd0dfcea23cd8b27ade244d1e92926629 (patch)
treecc6d33b322b538e2a25162a456a0f6d68bace5ef /drivers/staging/lustre/include
parentfe7cb65dc51cbbd52c1aae97b1a754c89069a0b2 (diff)
downloadop-kernel-dev-9c26b89dd0dfcea23cd8b27ade244d1e92926629.zip
op-kernel-dev-9c26b89dd0dfcea23cd8b27ade244d1e92926629.tar.gz
staging: lustre: improve LNet clean up code and API
This patch addresses a set of related issues: LU-5568, LU-5734, LU-5839, LU-5849, LU-5850. Create the local lnet_startup_lndni() API. This function starts up one LND. lnet_startup_lndnis() calls this function in a loop on every ni in the list passed in. lnet_startup_lndni() is responsible for cleaning up after itself in case of failure. It calls lnet_free_ni() if the ni fails to start. It calls lnet_shutdown_lndni() if it successfully called the lnd startup function, but fails later on. lnet_startup_lndnis() also cleans up after itself. If lnet_startup_lndni() fails then lnet_shutdown_lndnis() is called to clean up all nis that might have been started, and then free the rest of the nis on the list which have not been started yet. To facilitate the above changes lnet_dyn_del_ni() now manages the ping info. It calls lnet_shutdown_lndni(), to shutdown the NI. lnet_shutdown_lndni() is no longer an exposed API and doesn't manage the ping info, making it callable from lnet_startup_lndni() as well. There are two scenarios for calling lnet_startup_lndni() 1. from lnet_startup_lndnis() If lnet_startup_lndni() fails it requires to shutdown the ni without doing anything with the ping information as it hasn't been created yet. 2. from lnet_dyn_add_ni() As above it will shutdown the ni, and then lnet_dyn_add_ni() will take care of managing the ping info The second part of this change is to ensure that the LOLND is not added by lnet_parse_networks(), but the caller which needs to do it (IE: LNetNIInit) This change ensures that lnet_dyn_add_ni() need only check if there is only one net that's being added, if not then it frees everything, otherwise it proceeds to startup the requested net. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5734 Reviewed-on: http://review.whamcloud.com/12658 Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/include')
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lib-lnet.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 5e16fe0..2ee3d73 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -422,6 +422,8 @@ lnet_ni_decref(lnet_ni_t *ni)
}
void lnet_ni_free(lnet_ni_t *ni);
+lnet_ni_t *
+lnet_ni_alloc(__u32 net, struct cfs_expr_list *el, struct list_head *nilist);
static inline int
lnet_nid2peerhash(lnet_nid_t nid)
OpenPOWER on IntegriCloud