Whamcloud - gitweb
LU-7734 lnet: power8 compile fix
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 29 Jun 2016 17:19:41 +0000 (13:19 -0400)
committerAmir Shehata <amir.shehata@intel.com>
Wed, 25 Jan 2017 03:10:16 +0000 (19:10 -0800)
On Power8 the following error occured:

error: inlining failed in call to always_inline ‘lnet_get_numa_range’:
function body not available inline __u32 lnet_get_numa_range(void);

The reason for this was for the linux kernel you
must fill in the body of a inline function. Replace
this inline function with exposing the lnet_numa_range
module parameter like we do for portal_rotor. Also
treat all the lnet_numa_range handling as unsigned int.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Olaf Weber <olaf@sgi.com>
Change-Id: Ic566e56eb1e333d145de21d1c197218c6425dc5b
Reviewed-on: http://review.whamcloud.com/21078
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Amir Shehata <amir.shehata@intel.com>
lnet/include/lnet/lib-lnet.h
lnet/lnet/api-ni.c
lnet/lnet/lib-move.c

index ba98de0..c7c7ba3 100644 (file)
@@ -497,6 +497,7 @@ struct lnet_net *lnet_get_net_locked(__u32 net_id);
 int lnet_lib_init(void);
 void lnet_lib_exit(void);
 
 int lnet_lib_init(void);
 void lnet_lib_exit(void);
 
+extern unsigned int lnet_numa_range;
 extern int portal_rotor;
 
 int lnet_notify(lnet_ni_t *ni, lnet_nid_t peer, int alive, cfs_time_t when);
 extern int portal_rotor;
 
 int lnet_notify(lnet_ni_t *ni, lnet_nid_t peer, int alive, cfs_time_t when);
@@ -789,7 +790,6 @@ bool lnet_net_unique(__u32 net_id, struct list_head *nilist,
 bool lnet_ni_unique_net(struct list_head *nilist, char *iface);
 void lnet_incr_dlc_seq(void);
 __u32 lnet_get_dlc_seq_locked(void);
 bool lnet_ni_unique_net(struct list_head *nilist, char *iface);
 void lnet_incr_dlc_seq(void);
 __u32 lnet_get_dlc_seq_locked(void);
-inline __u32 lnet_get_numa_range(void);
 
 struct lnet_peer_ni *lnet_get_next_peer_ni_locked(struct lnet_peer *peer,
                                                  struct lnet_peer_net *peer_net,
 
 struct lnet_peer_ni *lnet_get_next_peer_ni_locked(struct lnet_peer *peer,
                                                  struct lnet_peer_net *peer_net,
index c997c47..c43193d 100644 (file)
@@ -62,8 +62,8 @@ module_param(use_tcp_bonding, int, 0444);
 MODULE_PARM_DESC(use_tcp_bonding,
                 "Set to 1 to use socklnd bonding. 0 to use Multi-Rail");
 
 MODULE_PARM_DESC(use_tcp_bonding,
                 "Set to 1 to use socklnd bonding. 0 to use Multi-Rail");
 
-static __u32 lnet_numa_range = 0;
-module_param(lnet_numa_range, int, 0444);
+unsigned int lnet_numa_range = 0;
+module_param(lnet_numa_range, uint, 0444);
 MODULE_PARM_DESC(lnet_numa_range,
                "NUMA range to consider during Multi-Rail selection");
 
 MODULE_PARM_DESC(lnet_numa_range,
                "NUMA range to consider during Multi-Rail selection");
 
@@ -2602,11 +2602,6 @@ __u32 lnet_get_dlc_seq_locked(void)
        return atomic_read(&lnet_dlc_seq_no);
 }
 
        return atomic_read(&lnet_dlc_seq_no);
 }
 
-inline __u32 lnet_get_numa_range(void)
-{
-       return lnet_numa_range;
-}
-
 /**
  * LNet ioctl handler.
  *
 /**
  * LNet ioctl handler.
  *
index 6a617d5..3403542 100644 (file)
@@ -1331,7 +1331,7 @@ lnet_select_pathway(lnet_nid_t src_nid, lnet_nid_t dst_nid,
        int                     best_credits;
        int                     best_lpni_credits;
        int                     md_cpt;
        int                     best_credits;
        int                     best_lpni_credits;
        int                     md_cpt;
-       int                     shortest_distance;
+       unsigned int            shortest_distance;
 
        /*
         * get an initial CPT to use for locking. The idea here is not to
 
        /*
         * get an initial CPT to use for locking. The idea here is not to
@@ -1522,7 +1522,7 @@ again:
         * b. Iterate through each of the peer_nets/nis to decide
         * the best peer/local_ni pair to use
         */
         * b. Iterate through each of the peer_nets/nis to decide
         * the best peer/local_ni pair to use
         */
-       shortest_distance = INT_MAX;
+       shortest_distance = UINT_MAX;
        best_credits = INT_MIN;
        list_for_each_entry(peer_net, &peer->lp_peer_nets, lpn_on_peer_list) {
                if (!lnet_is_peer_net_healthy_locked(peer_net))
        best_credits = INT_MIN;
        list_for_each_entry(peer_net, &peer->lp_peer_nets, lpn_on_peer_list) {
                if (!lnet_is_peer_net_healthy_locked(peer_net))
@@ -1583,8 +1583,8 @@ again:
                 */
                ni = NULL;
                while ((ni = lnet_get_next_ni_locked(local_net, ni))) {
                 */
                ni = NULL;
                while ((ni = lnet_get_next_ni_locked(local_net, ni))) {
+                       unsigned int distance;
                        int ni_credits;
                        int ni_credits;
-                       int distance;
 
                        if (!lnet_is_ni_healthy_locked(ni))
                                continue;
 
                        if (!lnet_is_ni_healthy_locked(ni))
                                continue;
@@ -1604,8 +1604,8 @@ again:
                         * All distances smaller than the NUMA range
                         * are treated equally.
                         */
                         * All distances smaller than the NUMA range
                         * are treated equally.
                         */
-                       if (distance < lnet_get_numa_range())
-                               distance = lnet_get_numa_range();
+                       if (distance < lnet_numa_range)
+                               distance = lnet_numa_range;
 
                        /*
                         * Select on shorter distance, then available
 
                        /*
                         * Select on shorter distance, then available