Skip to content

Commit 78b43da

Browse files
author
Mukesh Kacker
committed
RDS/IP: RDS takes 10 seconds to plumb the second IP back
RDS netdev event handler code effectively waits for 10 seconds when event indicates and interface coming back up from all-interfaces-were-down condition OR initial state for the first interface to be revived. (It is checking for address to be plumbed, something that is done after this wait in case where RDS active bonding code is doing the address plumbing!) That code is based on assumptions about delays in plumbing interface IP address on which were likely present due to bugs in legacy code. With the current code, there is no need for such checks before failing back interfaces when an interface is brought back up. Orabug: 20231857 Signed-off-by: Mukesh Kacker <[email protected]> Acked-by: Ajaykumar Hotchandani <[email protected]>
1 parent df82dc2 commit 78b43da

File tree

1 file changed

+2
-72
lines changed

1 file changed

+2
-72
lines changed

net/rds/ib.c

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ static struct rds_ib_excl_ips excl_ips_tbl[RDS_IB_MAX_EXCL_IPS];
143143
static u8 excl_ips_cnt = 0;
144144

145145
static int ip_config_init_phase_flag; /* = 0 */
146-
static int initial_failovers_all_ports_deactivated_flag; /* = 0 */
147146
static int initial_failovers_iterations; /* = 0 */
148147

149148
/*
@@ -1325,39 +1324,6 @@ static void rds_ib_failback(struct work_struct *_work)
13251324
kfree(work);
13261325
}
13271326

1328-
static int rds_ib_ip_config_down(void)
1329-
{
1330-
u8 i;
1331-
1332-
for (i = 1; i <= ip_port_cnt; i++) {
1333-
if (ip_config[i].port_state == RDS_IB_PORT_UP)
1334-
return 0;
1335-
}
1336-
1337-
return 1;
1338-
}
1339-
1340-
static void rds_ib_net_failback(struct work_struct *_work)
1341-
{
1342-
struct rds_ib_port_ud_work *work =
1343-
container_of(_work, struct rds_ib_port_ud_work, work.work);
1344-
struct in_device *in_dev;
1345-
1346-
in_dev = in_dev_get(ip_config[work->port].dev);
1347-
if (in_dev && !in_dev->ifa_list &&
1348-
ip_config[work->port].ip_addr &&
1349-
work->timeout > 0) {
1350-
INIT_DELAYED_WORK(&work->work, rds_ib_net_failback);
1351-
work->timeout -= msecs_to_jiffies(100);
1352-
queue_delayed_work(rds_wq, &work->work,
1353-
msecs_to_jiffies(100));
1354-
} else {
1355-
rds_ib_failback((struct work_struct *)&work->work);
1356-
}
1357-
1358-
if (in_dev)
1359-
in_dev_put(in_dev);
1360-
}
13611327

13621328
static void rds_ib_event_handler(struct ib_event_handler *handler,
13631329
struct ib_event *event)
@@ -1644,9 +1610,6 @@ rds_ib_do_initial_failovers(struct work_struct *workarg)
16441610
}
16451611
}
16461612

1647-
if (ports_deactivated == ip_port_cnt)
1648-
initial_failovers_all_ports_deactivated_flag = 1;
1649-
16501613
ip_config_init_phase_flag = 0; /* done with initial phase! */
16511614
kfree(riif_work);
16521615
}
@@ -2374,8 +2337,6 @@ static int rds_ib_netdev_callback(struct notifier_block *self, unsigned long eve
23742337
u8 i;
23752338
struct rds_ib_port_ud_work *work = NULL;
23762339
int port_transition = RDSIBP_TRANSITION_NOOP;
2377-
int port_state_was_init = 0;
2378-
int all_ports_were_down = 0;
23792340

23802341
if (!rds_ib_active_bonding_enabled)
23812342
return NOTIFY_DONE;
@@ -2503,15 +2464,11 @@ static int rds_ib_netdev_callback(struct notifier_block *self, unsigned long eve
25032464
RDSIBP_STATUS_NETDEVUP) ? "UP" : "DOWN"));
25042465
}
25052466

2506-
/* save for special case before we change port_state */
2507-
all_ports_were_down = rds_ib_ip_config_down();
2508-
25092467
/*
25102468
* Do state transitions now
25112469
*/
25122470
switch (ip_config[port].port_state) {
25132471
case RDS_IB_PORT_INIT:
2514-
port_state_was_init = 1; /* tracking for special case! */
25152472

25162473
if (ip_config_init_phase_flag) {
25172474
/*
@@ -2629,37 +2586,10 @@ static int rds_ib_netdev_callback(struct notifier_block *self, unsigned long eve
26292586
switch (port_transition) {
26302587
case RDSIBP_TRANSITION_UP:
26312588
if (rds_ib_active_bonding_fallback) {
2632-
/*
2633-
* Special case:
2634-
* If all interfaces were down
2635-
* (but NOT deactivated during initial failovers) OR
2636-
* transitioning port_state was in INIT
2637-
* use a larger timeout.
2638-
*/
2639-
if ((all_ports_were_down &&
2640-
!initial_failovers_all_ports_deactivated_flag)
2641-
|| port_state_was_init) {
2642-
INIT_DELAYED_WORK(&work->work,
2643-
rds_ib_net_failback);
2644-
work->timeout = msecs_to_jiffies(10000);
2645-
} else {
2646-
INIT_DELAYED_WORK(&work->work,
2647-
rds_ib_net_failback);
2648-
work->timeout = msecs_to_jiffies(1000);
2649-
}
2650-
queue_delayed_work(rds_wq, &work->work,
2651-
msecs_to_jiffies(100));
2589+
INIT_DELAYED_WORK(&work->work, rds_ib_failback);
2590+
queue_delayed_work(rds_wq, &work->work, 0);
26522591
} else
26532592
kfree(work);
2654-
2655-
/*
2656-
* clear this state - onetime use only to
2657-
* exclude the deactivation of ports
2658-
* during initial failovers from the
2659-
* 'special case' logic above!
2660-
*/
2661-
initial_failovers_all_ports_deactivated_flag = 0;
2662-
26632593
break;
26642594

26652595
case RDSIBP_TRANSITION_DOWN:

0 commit comments

Comments
 (0)