]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/rds: Fix bug in failover_group parsing
authorHåkon Bugge <Haakon.Bugge@oracle.com>
Mon, 18 Jun 2018 11:39:14 +0000 (13:39 +0200)
committerBrian Maly <brian.maly@oracle.com>
Tue, 26 Jun 2018 18:29:09 +0000 (14:29 -0400)
When supplying a module parameter value for the fail-over group as:

ib0,ib1;ib2,ib3;ib4,ib5;ib6,ib7;ib8,ib9

rdmaip / rds_rdma is unable to parse it correctly. Based on debug
prints, it does:

lab38 kernel: RDS/IB: ib0 is designated group  1
lab38 kernel: RDS/IB: ib1 is designated group  1
lab38 kernel: RDS/IB: ib2 is designated group  2
(no more prints).

This implies, that for Xn-8 systems, fail-over will not be distributed
correctly. We see:

lab38 kernel: RDS/IP: IP 192.2.23.100 migrated from ib0 to ib1:P01
lab38 kernel: RDS/IP: IP 192.2.23.102 migrated from ib2 to ib1:P03
lab38 kernel: RDS/IP: IP 192.2.23.104 migrated from ib4 to ib3:P05
lab38 kernel: RDS/IP: IP 192.2.23.106 migrated from ib6 to ib3:P07
lab38 kernel: RDS/IP: IP 192.2.23.108 migrated from ib8 to ib3:P09

That is, all fail-overs except for ib0 are migrated to ib3.

This commit fixes this. The following values for the module parameter
have been tested (in user space):

ib0
ib0,ib1
ib0,ib1,ib2
ib0,ib1,ib2,ib3
ib0;ib1
ib0,ib1;ib2,ib3
ib0,ib1,ib2;ib3,ib4,ib5
ib0,ib1,ib2,ib3;ib4,ib5,ib6,ib7
ib0;ib1;ib2
ib0,ib1;ib2,ib3;ib4,ib5
ib0,ib1,ib2;ib3,ib4,ib5;ib6,ib7,ib8
ib0,ib1,ib2,ib3;ib4,ib5,ib6,ib7;ib8,ib9,ib10,ib11
ib0;ib1;ib2;ib3
ib0,ib1;ib2,ib3;ib4,ib5;ib6,ib7
ib0,ib1,ib2;ib3,ib4,ib5;ib6,ib7,ib8;ib9,ib10,ib11
ib0,ib1,ib2,ib3;ib4,ib5,ib6,ib7;ib8,ib9,ib10,ib11;ib12,ib13,ib14,ib15

Orabug: 28198749

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Avinash Repaka <avinash.repaka@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com>
(inspired by uek-5-next commit bf8cd0080482fa23ee859cc6118c964693cb3a72)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/rds/ib.c

index 19496cf5c08f9c3af56e60bba7c0a1095c937d7f..afe267e0dbfa29430d2c8dce1f267daff5430f3b 100644 (file)
@@ -2333,7 +2333,8 @@ void rds_ib_ip_failover_groups_init(void)
                                }
                        }
                        tok = nxt_tok;
-                       nxt_tok = strchr(str, ',');
+                       if (nxt_tok)
+                               nxt_tok = strchr(nxt_tok, ',');
                        if (nxt_tok) {
                                *nxt_tok = '\0';
                                nxt_tok++;
@@ -2341,7 +2342,8 @@ void rds_ib_ip_failover_groups_init(void)
                }
 
                grp = nxt_grp;
-               nxt_grp = strchr(str, ';');
+               if (nxt_grp)
+                       nxt_grp = strchr(nxt_grp, ';');
                if (nxt_grp) {
                        *nxt_grp = '\0';
                        nxt_grp++;