Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ATM]: [lec] use work queue instead of timer for lec arp expiry

Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Chas Williams and committed by
David S. Miller
987e46bd edbc9b01

+8 -11
+7 -10
net/atm/lec.c
··· 1442 1442 1443 1443 #define LEC_ARP_REFRESH_INTERVAL (3*HZ) 1444 1444 1445 - static void lec_arp_check_expire(unsigned long data); 1445 + static void lec_arp_check_expire(void *data); 1446 1446 static void lec_arp_expire_arp(unsigned long data); 1447 1447 1448 1448 /* ··· 1465 1465 INIT_HLIST_HEAD(&priv->lec_no_forward); 1466 1466 INIT_HLIST_HEAD(&priv->mcast_fwds); 1467 1467 spin_lock_init(&priv->lec_arp_lock); 1468 - init_timer(&priv->lec_arp_timer); 1469 - priv->lec_arp_timer.expires = jiffies + LEC_ARP_REFRESH_INTERVAL; 1470 - priv->lec_arp_timer.data = (unsigned long)priv; 1471 - priv->lec_arp_timer.function = lec_arp_check_expire; 1472 - add_timer(&priv->lec_arp_timer); 1468 + INIT_WORK(&priv->lec_arp_work, lec_arp_check_expire, priv); 1469 + schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); 1473 1470 } 1474 1471 1475 1472 static void lec_arp_clear_vccs(struct lec_arp_table *entry) ··· 1716 1719 struct lec_arp_table *entry; 1717 1720 int i; 1718 1721 1719 - del_timer_sync(&priv->lec_arp_timer); 1722 + cancel_rearming_delayed_work(&priv->lec_arp_work); 1720 1723 1721 1724 /* 1722 1725 * Remove all entries ··· 1862 1865 * to ESI_FORWARD_DIRECT. This causes the flush period to end 1863 1866 * regardless of the progress of the flush protocol. 1864 1867 */ 1865 - static void lec_arp_check_expire(unsigned long data) 1868 + static void lec_arp_check_expire(void *data) 1866 1869 { 1867 1870 unsigned long flags; 1868 - struct lec_priv *priv = (struct lec_priv *)data; 1871 + struct lec_priv *priv = data; 1869 1872 struct hlist_node *node, *next; 1870 1873 struct lec_arp_table *entry; 1871 1874 unsigned long now; ··· 1927 1930 } 1928 1931 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); 1929 1932 1930 - mod_timer(&priv->lec_arp_timer, jiffies + LEC_ARP_REFRESH_INTERVAL); 1933 + schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); 1931 1934 } 1932 1935 1933 1936 /*
+1 -1
net/atm/lec.h
··· 93 93 spinlock_t lec_arp_lock; 94 94 struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */ 95 95 struct atm_vcc *lecd; 96 - struct timer_list lec_arp_timer; /* C10 */ 96 + struct work_struct lec_arp_work; /* C10 */ 97 97 unsigned int maximum_unknown_frame_count; 98 98 /* 99 99 * Within the period of time defined by this variable, the client will send