]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS/IP: RDS takes 10 seconds to plumb the second IP back
authorMukesh Kacker <mukesh.kacker@oracle.com>
Mon, 12 Jan 2015 01:23:10 +0000 (17:23 -0800)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 21:00:14 +0000 (14:00 -0700)
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 <mukesh.kacker@oracle.com>
Acked-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
net/rds/ib.c

index f40d5fa2fcb6900a6d0230aa86c36586de03a925..3034308c69c3a85a6b793cf9f71e3fc3ed432636 100644 (file)
@@ -143,7 +143,6 @@ static struct rds_ib_excl_ips excl_ips_tbl[RDS_IB_MAX_EXCL_IPS];
 static u8       excl_ips_cnt = 0;
 
 static int ip_config_init_phase_flag; /* = 0 */
-static int initial_failovers_all_ports_deactivated_flag; /* = 0 */
 static int initial_failovers_iterations; /* = 0 */
 
 /*
@@ -1325,39 +1324,6 @@ out:
        kfree(work);
 }
 
-static int rds_ib_ip_config_down(void)
-{
-       u8      i;
-
-       for (i = 1; i <= ip_port_cnt; i++) {
-               if (ip_config[i].port_state == RDS_IB_PORT_UP)
-                       return 0;
-       }
-
-       return 1;
-}
-
-static void rds_ib_net_failback(struct work_struct *_work)
-{
-       struct rds_ib_port_ud_work      *work =
-               container_of(_work, struct rds_ib_port_ud_work, work.work);
-       struct in_device                *in_dev;
-
-       in_dev = in_dev_get(ip_config[work->port].dev);
-       if (in_dev && !in_dev->ifa_list &&
-               ip_config[work->port].ip_addr &&
-               work->timeout > 0) {
-               INIT_DELAYED_WORK(&work->work, rds_ib_net_failback);
-               work->timeout -= msecs_to_jiffies(100);
-               queue_delayed_work(rds_wq, &work->work,
-                       msecs_to_jiffies(100));
-       } else {
-               rds_ib_failback((struct work_struct *)&work->work);
-       }
-
-       if (in_dev)
-               in_dev_put(in_dev);
-}
 
 static void rds_ib_event_handler(struct ib_event_handler *handler,
                                struct ib_event *event)
@@ -1644,9 +1610,6 @@ rds_ib_do_initial_failovers(struct work_struct *workarg)
                }
        }
 
-       if (ports_deactivated == ip_port_cnt)
-               initial_failovers_all_ports_deactivated_flag = 1;
-
        ip_config_init_phase_flag = 0; /* done with initial phase! */
        kfree(riif_work);
 }
@@ -2374,8 +2337,6 @@ static int rds_ib_netdev_callback(struct notifier_block *self, unsigned long eve
        u8 i;
        struct rds_ib_port_ud_work *work = NULL;
        int port_transition = RDSIBP_TRANSITION_NOOP;
-       int port_state_was_init = 0;
-       int all_ports_were_down = 0;
 
        if (!rds_ib_active_bonding_enabled)
                return NOTIFY_DONE;
@@ -2503,15 +2464,11 @@ static int rds_ib_netdev_callback(struct notifier_block *self, unsigned long eve
                         RDSIBP_STATUS_NETDEVUP) ? "UP" : "DOWN"));
        }
 
-       /* save for special case before we change port_state */
-       all_ports_were_down = rds_ib_ip_config_down();
-
        /*
         * Do state transitions now
         */
        switch (ip_config[port].port_state) {
        case RDS_IB_PORT_INIT:
-               port_state_was_init = 1; /* tracking for special case! */
 
                if (ip_config_init_phase_flag) {
                        /*
@@ -2629,37 +2586,10 @@ static int rds_ib_netdev_callback(struct notifier_block *self, unsigned long eve
        switch (port_transition) {
        case RDSIBP_TRANSITION_UP:
                if (rds_ib_active_bonding_fallback) {
-                       /*
-                        * Special case:
-                        * If all interfaces were down
-                        * (but NOT deactivated during initial failovers) OR
-                        * transitioning port_state was in INIT
-                        * use a larger timeout.
-                        */
-                       if ((all_ports_were_down &&
-                            !initial_failovers_all_ports_deactivated_flag)
-                           || port_state_was_init) {
-                               INIT_DELAYED_WORK(&work->work,
-                                       rds_ib_net_failback);
-                               work->timeout = msecs_to_jiffies(10000);
-                       } else {
-                               INIT_DELAYED_WORK(&work->work,
-                                       rds_ib_net_failback);
-                               work->timeout = msecs_to_jiffies(1000);
-                       }
-                       queue_delayed_work(rds_wq, &work->work,
-                                       msecs_to_jiffies(100));
+                       INIT_DELAYED_WORK(&work->work, rds_ib_failback);
+                       queue_delayed_work(rds_wq, &work->work, 0);
                } else
                        kfree(work);
-
-               /*
-                * clear this state - onetime use only to
-                * exclude the deactivation of ports
-                * during initial failovers from the
-                * 'special case' logic above!
-                */
-               initial_failovers_all_ports_deactivated_flag = 0;
-
                break;
 
        case RDSIBP_TRANSITION_DOWN: