BNX2X: timer->alarm
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 17 Feb 2015 23:05:01 +0000 (18:05 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 2 Mar 2015 16:59:10 +0000 (11:59 -0500)
RKM alarm, for now.

kern/drivers/net/bnx2x/bnx2x.h
kern/drivers/net/bnx2x/bnx2x_cmn.c
kern/drivers/net/bnx2x/bnx2x_main.c

index c7df6f6..55817b8 100644 (file)
@@ -1639,7 +1639,7 @@ struct bnx2x {
        struct delayed_work     sp_rtnl_task;
 
        struct delayed_work     period_task;
-       struct timer_list       timer;
+       struct alarm_waiter timer;
        int                     current_interval;
 
        uint16_t                        fw_seq;
index 5be8100..423d355 100644 (file)
@@ -2950,7 +2950,8 @@ panic("Not implemented");
                bnx2x__link_status_update(bp);
 
        /* start the timer */
-       mod_timer(&bp->timer, jiffies + bp->current_interval);
+       set_awaiter_rel(&bp->timer, bp->current_interval * 1000); // fudge
+       set_alarm(&per_cpu_info[0].tchain, &bp->timer);
 
        if (CNIC_ENABLED(bp))
                bnx2x_load_cnic(bp);
index 561d96a..82bd5f5 100644 (file)
@@ -5793,10 +5793,18 @@ panic("Not implemented");
        if (IS_VF(bp))
                bnx2x_timer_sriov(bp);
 
-       mod_timer(&bp->timer, jiffies + bp->current_interval);
 #endif
 }
 
+/* RKM style, set_alarm directly */
+static void bnx2x_timer_wrapper(struct alarm_waiter *waiter)
+{
+       struct bnx2x *bp = container_of(waiter, struct bnx2x, timer);
+       bnx2x_timer((unsigned long)bp);
+       set_awaiter_rel(waiter, bp->current_interval * 1000); // fudge
+       set_alarm(&per_cpu_info[0].tchain, waiter);
+}
+
 /* end of Statistics */
 
 /* nic init */
@@ -12181,10 +12189,7 @@ panic("Not implemented");
 
        bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ;
 
-       init_timer(&bp->timer);
-       bp->timer.expires = jiffies + bp->current_interval;
-       bp->timer.data = (unsigned long) bp;
-       bp->timer.function = bnx2x_timer;
+       init_awaiter(&bp->timer, bnx2x_timer_wrapper);
 
        if (SHMEM2_HAS(bp, dcbx_lldp_params_offset) &&
            SHMEM2_HAS(bp, dcbx_lldp_dcbx_stat_offset) &&