Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 297071 Details for
Bug 436102
Fake ARP dropped after migration leading to loss of network connectivity
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Patch to net/core/linux_watch.c
link_watch.patch (text/x-patch), 4.56 KB, created by
Don Dutile (Red Hat)
on 2008-03-06 17:00:14 UTC
(
hide
)
Description:
Patch to net/core/linux_watch.c
Filename:
MIME Type:
Creator:
Don Dutile (Red Hat)
Created:
2008-03-06 17:00:14 UTC
Size:
4.56 KB
patch
obsolete
>--- linux-2.6.9/net/core/link_watch.c.orig 2008-01-14 19:50:18.000000000 -0500 >+++ linux-2.6.9/net/core/link_watch.c 2008-01-17 16:43:10.000000000 -0500 >@@ -31,7 +31,7 @@ extern void dev_activate(struct net_devi > extern void dev_deactivate(struct net_device *dev); > > enum lw_bits { >- LW_RUNNING = 0, >+ LW_URGENT = 0, > LW_SE_USED > }; > >@@ -52,12 +52,80 @@ struct lw_event { > /* Avoid kmalloc() for most systems */ > static struct lw_event singleevent; > >-/* Must be called with the rtnl semaphore held */ >-void linkwatch_run_queue(void) >+static int linkwatch_urgent_event(struct net_device *dev) >+{ >+ return netif_running(dev) && netif_carrier_ok(dev) && >+ dev->qdisc != dev->qdisc_sleeping; >+} >+ >+ >+static void linkwatch_add_event(struct lw_event *event) >+{ >+ unsigned long flags; >+ >+ spin_lock_irqsave(&lweventlist_lock, flags); >+ list_add_tail(&event->list, &lweventlist); >+ spin_unlock_irqrestore(&lweventlist_lock, flags); >+} >+ >+ >+static void linkwatch_schedule_work(int urgent) > { >+ unsigned long delay = linkwatch_nextevent - jiffies; >+ >+ if (test_bit(LW_URGENT, &linkwatch_flags)) >+ return; >+ >+ /* Minimise down-time: drop delay for up event. */ >+ if (urgent) { >+ if (test_and_set_bit(LW_URGENT, &linkwatch_flags)) >+ return; >+ delay = 0; >+ } >+ >+ /* If we wrap around we'll delay it by at most HZ. */ >+ if (delay > HZ) >+ delay = 0; >+ >+ /* >+ * This is true if we've scheduled it immeditately or if we don't >+ * need an immediate execution and it's already pending. >+ */ >+ if (schedule_delayed_work(&linkwatch_work, delay) == !delay) >+ return; >+ >+ /* Don't bother if there is nothing urgent. */ >+ if (!test_bit(LW_URGENT, &linkwatch_flags)) >+ return; >+ >+ /* It's already running which is good enough. */ >+ if (!cancel_delayed_work(&linkwatch_work)) >+ return; >+ >+ /* Otherwise we reschedule it again for immediate exection. */ >+ schedule_delayed_work(&linkwatch_work, 0); >+} >+ >+ >+static void __linkwatch_run_queue(int urgent_only){ > LIST_HEAD(head); > struct list_head *n, *next; > >+ /* >+ * Limit the number of linkwatch events to one >+ * per second so that a runaway driver does not >+ * cause a storm of messages on the netlink >+ * socket. This limit does not apply to up events >+ * while the device qdisc is down. >+ */ >+ if (!urgent_only) >+ linkwatch_nextevent = jiffies + HZ; >+ /* Limit wrap-around effect on delay. */ >+ else if (time_after(linkwatch_nextevent, jiffies + HZ)) >+ linkwatch_nextevent = jiffies; >+ >+ clear_bit(LW_URGENT, &linkwatch_flags); >+ > spin_lock_irq(&lweventlist_lock); > list_splice_init(&lweventlist, &head); > spin_unlock_irq(&lweventlist_lock); >@@ -66,6 +134,11 @@ void linkwatch_run_queue(void) > struct lw_event *event = list_entry(n, struct lw_event, list); > struct net_device *dev = event->dev; > >+ if (urgent_only && !linkwatch_urgent_event(dev)) { >+ linkwatch_add_event(event); >+ continue; >+ } >+ > if (event == &singleevent) { > clear_bit(LW_SE_USED, &linkwatch_flags); > } else { >@@ -89,29 +162,31 @@ void linkwatch_run_queue(void) > > dev_put(dev); > } >-} > >+ if (!list_empty(&lweventlist)) >+ linkwatch_schedule_work(0); >+} > >-static void linkwatch_event(void *dummy) >+ >+/* Must be called with the rtnl semaphore held */ >+void linkwatch_run_queue(void) > { >- /* Limit the number of linkwatch events to one >- * per second so that a runaway driver does not >- * cause a storm of messages on the netlink >- * socket >- */ >- linkwatch_nextevent = jiffies + HZ; >- clear_bit(LW_RUNNING, &linkwatch_flags); >+ __linkwatch_run_queue(0); >+} > >+static void linkwatch_event(void *dummy) >+{ > rtnl_shlock(); >- linkwatch_run_queue(); >+ __linkwatch_run_queue(time_after(linkwatch_nextevent, jiffies)); > rtnl_shunlock(); > } > > > void linkwatch_fire_event(struct net_device *dev) > { >+ int urgent = linkwatch_urgent_event(dev); >+ > if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { >- unsigned long flags; > struct lw_event *event; > > if (test_and_set_bit(LW_SE_USED, &linkwatch_flags)) { >@@ -128,20 +203,11 @@ void linkwatch_fire_event(struct net_dev > dev_hold(dev); > event->dev = dev; > >- spin_lock_irqsave(&lweventlist_lock, flags); >- list_add_tail(&event->list, &lweventlist); >- spin_unlock_irqrestore(&lweventlist_lock, flags); >- >- if (!test_and_set_bit(LW_RUNNING, &linkwatch_flags)) { >- unsigned long thisevent = jiffies; >- >- if (thisevent >= linkwatch_nextevent) { >- schedule_work(&linkwatch_work); >- } else { >- schedule_delayed_work(&linkwatch_work, linkwatch_nextevent - thisevent); >- } >- } >- } >+ linkwatch_add_event(event); >+ } else if (!urgent) >+ return; >+ >+ linkwatch_schedule_work(urgent); > } > > EXPORT_SYMBOL(linkwatch_fire_event);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 436102
:
296956
| 297071