summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include/linux
diff options
context:
space:
mode:
authorAmir Shehata <amir.shehata@intel.com>2016-03-02 17:01:46 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-02 15:23:49 -0800
commitb9bbb61c1adc3bb94b8b70d6ef65dcc20b096f6e (patch)
treeb716cdf9fa67bcbfd66bcc1704e7e4a16e032dad /drivers/staging/lustre/include/linux
parent5b16d52be00e78622d0783f5c57474137a60e5a3 (diff)
downloadop-kernel-dev-b9bbb61c1adc3bb94b8b70d6ef65dcc20b096f6e.zip
op-kernel-dev-b9bbb61c1adc3bb94b8b70d6ef65dcc20b096f6e.tar.gz
staging: lustre: Ignore hops if not explicitly set
Since the # of hops is not a mandatory parameter the LU-6060 patch will cause problems to already existing systems since it changes the behavior by which a route is determined down. To fix this case the # of hops now defaults to LNET_UNDEFINED_HOPS if no hop count is specified. LNET_UNDEFINED_HOPS is defined to ((__u32)-1). When it's printed as %d, it displays as -1. __u32 is used through out the call stack for hop count to explicitly define the size of the hop count and to avoid any sizing issues when passing data to and from the kernel. To keep existing behavior both lnet_compare_routes() and LNetDist() will treat undefined hop count as hop count 1. When executing the logic in lnet_parse_rc_info() there is no longer an assumption that the default hop count is 1. If the hop count is 1 then it must've been explicitly set by the user. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6851 Reviewed-on: http://review.whamcloud.com/15719 Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@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.h2
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lib-types.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index d78360d..84642dc 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -456,7 +456,7 @@ void lnet_lib_exit(void);
int lnet_notify(lnet_ni_t *ni, lnet_nid_t peer, int alive, unsigned long when);
void lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive,
unsigned long when);
-int lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway_nid,
+int lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway_nid,
unsigned int priority);
int lnet_check_routes(void);
int lnet_del_route(__u32 net, lnet_nid_t gw_nid);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 07b8db1..d2513db 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -371,7 +371,7 @@ typedef struct {
__u32 lr_net; /* remote network number */
int lr_seq; /* sequence for round-robin */
unsigned int lr_downis; /* number of down NIs */
- unsigned int lr_hops; /* how far I am */
+ __u32 lr_hops; /* how far I am */
unsigned int lr_priority; /* route priority */
} lnet_route_t;
OpenPOWER on IntegriCloud