From 86a69f9eb5cab3f9eb57afcd984a2ecd215b89df Mon Sep 17 00:00:00 2001 From: Serguei Smirnov Date: Wed, 9 Jun 2021 14:22:12 -0700 Subject: [PATCH] LU-14750 lnet: use ni fatal error when calculating net health When ni is flagged with "fatal_error" by LND, its health score remains unaffected. This allows for the net containing such ni to be selected for tx even if it is the only ni in this net. Take "fatal_error" status of the ni into account when calculating the net health score. Test-Parameters: trivial Signed-off-by: Serguei Smirnov Change-Id: Ib76245f835f1458873f0c05ad9b6727d295857de Reviewed-on: https://review.whamcloud.com/43962 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Chris Horn Reviewed-by: Cyril Bordage Reviewed-by: Oleg Drokin --- lnet/lnet/api-ni.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index d60c905..835d96a 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -3177,11 +3177,12 @@ int lnet_get_net_healthv_locked(struct lnet_net *net) { struct lnet_ni *ni; int best_healthv = 0; - int healthv; + int healthv, ni_fatal; list_for_each_entry(ni, &net->net_ni_list, ni_netlist) { healthv = atomic_read(&ni->ni_healthv); - if (healthv > best_healthv) + ni_fatal = atomic_read(&ni->ni_fatal_error_on); + if (!ni_fatal && healthv > best_healthv) best_healthv = healthv; } -- 1.8.3.1