#endif
#ifndef fallthrough
-#define fallthrough do {} while (0) /* fallthrough */
+# if defined(__GNUC__) && __GNUC__ >= 7
+# define fallthrough __attribute__((fallthrough)) /* fallthrough */
+# else
+# define fallthrough do {} while (0) /* fallthrough */
+# endif
#endif
int choose_ipv4_src(__u32 *ret,
extern unsigned int lnet_recovery_limit;
extern unsigned int lnet_peer_discovery_disabled;
extern unsigned int lnet_drop_asym_route;
+extern unsigned int lnet_max_recovery_ping_interval;
+extern unsigned int lnet_max_recovery_ping_count;
extern unsigned int router_sensitivity_percentage;
extern int alive_router_check_interval;
extern int live_router_check_interval;
return false;
}
-#define LNET_RECOVERY_INTERVAL_MAX 900
static inline unsigned int
lnet_get_next_recovery_ping(unsigned int ping_count, time64_t now)
{
unsigned int interval;
- /* 2^9 = 512, 2^10 = 1024 */
- if (ping_count > 9)
- interval = LNET_RECOVERY_INTERVAL_MAX;
+ /* lnet_max_recovery_interval <= 2^lnet_max_recovery_ping_count */
+ if (ping_count > lnet_max_recovery_ping_count)
+ interval = lnet_max_recovery_ping_interval;
else
interval = 1 << ping_count;