summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include/linux
diff options
context:
space:
mode:
authorChris Horn <hornc@cray.com>2016-02-15 10:25:46 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-20 14:29:23 -0800
commit4ee23a84bf04894a38005bdc342513e423e5704b (patch)
treeab54f658f97bc8c2434a9f9b6fb9aacf55324d35 /drivers/staging/lustre/include/linux
parent4f0bedeccf1564171b51c513b1f23b02ffb9a462 (diff)
downloadop-kernel-dev-4ee23a84bf04894a38005bdc342513e423e5704b.zip
op-kernel-dev-4ee23a84bf04894a38005bdc342513e423e5704b.tar.gz
staging: lustre: reflect down routes in /proc/sys/lnet/routes
We consider routes "down" if the router is down or the router NI for the target network is down. This should be reflected in the output of /proc/sys/lnet/routes Signed-off-by: Chris Horn <hornc@cray.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3679 Reviewed-on: http://review.whamcloud.com/7857 Reviewed-by: Cory Spitz <spitzcor@cray.com> Reviewed-by: Isaac Huang <he.huang@intel.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/linux')
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lib-lnet.h13
1 files changed, 13 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 b0f80b4..b2e5017 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -64,6 +64,19 @@ extern lnet_t the_lnet; /* THE network */
/** exclusive lock */
#define LNET_LOCK_EX CFS_PERCPT_LOCK_EX
+static inline int lnet_is_route_alive(lnet_route_t *route)
+{
+ /* gateway is down */
+ if (!route->lr_gateway->lp_alive)
+ return 0;
+ /* no NI status, assume it's alive */
+ if ((route->lr_gateway->lp_ping_feats &
+ LNET_PING_FEAT_NI_STATUS) == 0)
+ return 1;
+ /* has NI status, check # down NIs */
+ return route->lr_downis == 0;
+}
+
static inline int lnet_is_wire_handle_none(lnet_handle_wire_t *wh)
{
return (wh->wh_interface_cookie == LNET_WIRE_HANDLE_COOKIE_NONE &&
OpenPOWER on IntegriCloud