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 313197 Details for
Bug 441716
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]
[BRIDGE]: eliminate workqueue for carrier check
p (text/plain), 4.47 KB, created by
Herbert Xu
on 2008-08-01 13:30:16 UTC
(
hide
)
Description:
[BRIDGE]: eliminate workqueue for carrier check
Filename:
MIME Type:
Creator:
Herbert Xu
Created:
2008-08-01 13:30:16 UTC
Size:
4.47 KB
patch
obsolete
>diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c >index 1426b59..c80eced 100644 >--- a/net/bridge/br_if.c >+++ b/net/bridge/br_if.c >@@ -77,22 +77,15 @@ static int port_cost(struct net_device *dev) > * Called from work queue to allow for calling functions that > * might sleep (such as speed check), and to debounce. > */ >-static void port_carrier_check(void *arg) >+void br_port_carrier_check(struct net_bridge_port *p) > { >- struct net_device *dev = arg; >- struct net_bridge_port *p; >- struct net_bridge *br; >- >- rtnl_lock(); >- p = dev->br_port; >- if (!p) >- goto done; >- br = p->br; >+ struct net_device *dev = p->dev; >+ struct net_bridge *br = p->br; > > if (netif_carrier_ok(dev)) > p->path_cost = port_cost(dev); > >- if (br->dev->flags & IFF_UP) { >+ if (netif_running(br->dev)) { > spin_lock_bh(&br->lock); > if (netif_carrier_ok(dev)) { > if (p->state == BR_STATE_DISABLED) >@@ -103,9 +96,6 @@ static void port_carrier_check(void *arg) > } > spin_unlock_bh(&br->lock); > } >-done: >- dev_put(dev); >- rtnl_unlock(); > } > > static void release_nbp(struct kobject *kobj) >@@ -158,9 +148,6 @@ static void del_nbp(struct net_bridge_port *p) > > dev_set_promiscuity(dev, -1); > >- if (cancel_delayed_work(&p->carrier_check)) >- dev_put(dev); >- > spin_lock_bh(&br->lock); > br_stp_disable_port(p); > spin_unlock_bh(&br->lock); >@@ -278,7 +265,6 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, > p->port_no = index; > br_init_port(p); > p->state = BR_STATE_DISABLED; >- INIT_WORK(&p->carrier_check, port_carrier_check, dev); > br_stp_port_timer_init(p); > > kobject_init(&p->kobj); >@@ -442,12 +428,14 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) > spin_lock_bh(&br->lock); > br_stp_recalculate_bridge_id(br); > br_features_recompute(br); >- if (schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE)) >- dev_hold(dev); > >+ if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) && >+ (br->dev->flags & IFF_UP)) >+ br_stp_enable_port(p); > spin_unlock_bh(&br->lock); > > dev_set_mtu(br->dev, br_min_mtu(br)); >+ > kobject_uevent(&p->kobj, KOBJ_ADD); > > return 0; >diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c >index c64742c..c9a4da7 100644 >--- a/net/bridge/br_notify.c >+++ b/net/bridge/br_notify.c >@@ -42,28 +42,28 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v > > br = p->br; > >- spin_lock_bh(&br->lock); > switch (event) { > case NETDEV_CHANGEMTU: > dev_set_mtu(br->dev, br_min_mtu(br)); > break; > > case NETDEV_CHANGEADDR: >+ spin_lock_bh(&br->lock); > br_fdb_changeaddr(p, dev->dev_addr); > br_ifinfo_notify(RTM_NEWLINK, p); > br_stp_recalculate_bridge_id(br); >+ spin_unlock_bh(&br->lock); > break; > > case NETDEV_CHANGE: >- if (br->dev->flags & IFF_UP) >- if (schedule_delayed_work(&p->carrier_check, >- BR_PORT_DEBOUNCE)) >- dev_hold(dev); >+ br_port_carrier_check(p); > break; > > case NETDEV_FEAT_CHANGE: >+ spin_lock_bh(&br->lock); > if (br->dev->flags & IFF_UP) > br_features_recompute(br); >+ spin_unlock_bh(&br->lock); > > /* could do recursive feature change notification > * but who would care?? >@@ -71,22 +71,23 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v > break; > > case NETDEV_DOWN: >+ spin_lock_bh(&br->lock); > if (br->dev->flags & IFF_UP) > br_stp_disable_port(p); >+ spin_unlock_bh(&br->lock); > break; > > case NETDEV_UP: >+ spin_lock_bh(&br->lock); > if (netif_carrier_ok(dev) && (br->dev->flags & IFF_UP)) > br_stp_enable_port(p); >+ spin_unlock_bh(&br->lock); > break; > > case NETDEV_UNREGISTER: >- spin_unlock_bh(&br->lock); > br_del_if(br, dev); >- goto done; >+ break; > } >- spin_unlock_bh(&br->lock); > >- done: > return NOTIFY_DONE; > } >diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h >index c491fb2..0687e36 100644 >--- a/net/bridge/br_private.h >+++ b/net/bridge/br_private.h >@@ -27,8 +27,6 @@ > #define BR_PORT_BITS 10 > #define BR_MAX_PORTS (1<<BR_PORT_BITS) > >-#define BR_PORT_DEBOUNCE (HZ/10) >- > #define BR_VERSION "2.2" > > typedef struct bridge_id bridge_id; >@@ -82,7 +80,6 @@ struct net_bridge_port > struct timer_list hold_timer; > struct timer_list message_age_timer; > struct kobject kobj; >- struct work_struct carrier_check; > struct rcu_head rcu; > }; > >@@ -173,6 +170,7 @@ extern void br_flood_forward(struct net_bridge *br, > int clone); > > /* br_if.c */ >+extern void br_port_carrier_check(struct net_bridge_port *p); > extern int br_add_bridge(const char *name); > extern int br_del_bridge(const char *name); > extern void br_cleanup_bridges(void);
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 441716
:
302697
|
303426
|
310783
|
310792
|
312200
|
313096
|
313197