Message ID | 20211124081040.19533-1-jinpu.wang@ionos.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Jason Gunthorpe |
Headers | show |
Series | RDMA/rtrs-clt: Fix the initial value of min_latency | expand |
On 11/24/21 4:10 PM, Jack Wang wrote: > The type of min_latency is ktime_t, so use KTIME_MAX to initialize > the initial value. > > Fixes: dc3b66a0ce70 ("RDMA/rtrs-clt: Add a minimum latency multipath policy") > Signed-off-by: Jack Wang<jinpu.wang@ionos.com> > --- > drivers/infiniband/ulp/rtrs/rtrs-clt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c > index 15c0077dd27e..e39709dee179 100644 > --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c > +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c > @@ -867,7 +867,7 @@ static struct rtrs_clt_sess *get_next_path_min_latency(struct path_it *it) > struct rtrs_clt_sess *min_path = NULL; > struct rtrs_clt *clt = it->clt; > struct rtrs_clt_sess *sess; > - ktime_t min_latency = INT_MAX; > + ktime_t min_latency = KTIME_MAX; > ktime_t latency; > > list_for_each_entry_rcu(sess, &clt->paths_list, s.entry) { LGTM. Reviewed-by: Guoqing Jiang <Guoqing.Jiang@linux.dev> Thanks, Guoqing
On Wed, Nov 24, 2021 at 9:56 AM Guoqing Jiang <guoqing.jiang@linux.dev> wrote: > > > > On 11/24/21 4:10 PM, Jack Wang wrote: > > The type of min_latency is ktime_t, so use KTIME_MAX to initialize > > the initial value. > > > > Fixes: dc3b66a0ce70 ("RDMA/rtrs-clt: Add a minimum latency multipath policy") > > Signed-off-by: Jack Wang<jinpu.wang@ionos.com> > > --- > > drivers/infiniband/ulp/rtrs/rtrs-clt.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c > > index 15c0077dd27e..e39709dee179 100644 > > --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c > > +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c > > @@ -867,7 +867,7 @@ static struct rtrs_clt_sess *get_next_path_min_latency(struct path_it *it) > > struct rtrs_clt_sess *min_path = NULL; > > struct rtrs_clt *clt = it->clt; > > struct rtrs_clt_sess *sess; > > - ktime_t min_latency = INT_MAX; > > + ktime_t min_latency = KTIME_MAX; > > ktime_t latency; > > > > list_for_each_entry_rcu(sess, &clt->paths_list, s.entry) { > > LGTM. > > Reviewed-by: Guoqing Jiang <Guoqing.Jiang@linux.dev> Thank you for the quick review! > > Thanks, > Guoqing
On Wed, Nov 24, 2021 at 09:10:40AM +0100, Jack Wang wrote: > The type of min_latency is ktime_t, so use KTIME_MAX to initialize > the initial value. > > Fixes: dc3b66a0ce70 ("RDMA/rtrs-clt: Add a minimum latency multipath policy") > Signed-off-by: Jack Wang <jinpu.wang@ionos.com> > Reviewed-by: Guoqing Jiang <Guoqing.Jiang@linux.dev> > --- > drivers/infiniband/ulp/rtrs/rtrs-clt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied to for-next, thanks Jason
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index 15c0077dd27e..e39709dee179 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -867,7 +867,7 @@ static struct rtrs_clt_sess *get_next_path_min_latency(struct path_it *it) struct rtrs_clt_sess *min_path = NULL; struct rtrs_clt *clt = it->clt; struct rtrs_clt_sess *sess; - ktime_t min_latency = INT_MAX; + ktime_t min_latency = KTIME_MAX; ktime_t latency; list_for_each_entry_rcu(sess, &clt->paths_list, s.entry) {
The type of min_latency is ktime_t, so use KTIME_MAX to initialize the initial value. Fixes: dc3b66a0ce70 ("RDMA/rtrs-clt: Add a minimum latency multipath policy") Signed-off-by: Jack Wang <jinpu.wang@ionos.com> --- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)