Whamcloud - gitweb
LU-6851 lnet: Ignore hops if not explicitly set 19/15719/12
authorAmir Shehata <amir.shehata@intel.com>
Fri, 24 Jul 2015 21:14:38 +0000 (14:14 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 2 Dec 2015 03:55:09 +0000 (03:55 +0000)
commitcdc97ad749b541ea2e2f1c0b5b9bc35c37762877
treea8c667394c2d5d5d4faacc0a205037808c7251f9
parent082eabdeaa0c2a0f536accf7028e5ab5061c2c46
LU-6851 lnet: 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>
Change-Id: I1a28a35a4edc2437cf95cb9d455e59c8102736fa
Reviewed-on: http://review.whamcloud.com/15719
Tested-by: Jenkins
Reviewed-by: Olaf Weber <olaf@sgi.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/include/lnet/lib-dlc.h
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-types.h
lnet/lnet/config.c
lnet/lnet/lib-move.c
lnet/lnet/router.c
lnet/lnet/router_proc.c
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/portals.c