* [PATCH] (1/4) Support for lots of netdev's -- dev_base move
@ 2004-02-06 18:03 Stephen Hemminger
2004-02-06 21:39 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-02-06 18:03 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
The first patch moves the device list and locks from drivers/net/Space.c
to net/core/dev.c. The list used to be in Space.c because we initialized it
in 2.4, but now it makes more sense to put it over with the management
routines.
Resend of the patchset to support a large number of network
devices efficiently with feedback applied, and rediff'd against 2.6.2
diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c
--- a/drivers/net/Space.c Thu Feb 5 15:16:58 2004
+++ b/drivers/net/Space.c Thu Feb 5 15:16:58 2004
@@ -430,28 +430,3 @@
}
device_initcall(net_olddevs_init);
-
-/*
- * The @dev_base list is protected by @dev_base_lock and the rtln
- * semaphore.
- *
- * Pure readers hold dev_base_lock for reading.
- *
- * Writers must hold the rtnl semaphore while they loop through the
- * dev_base list, and hold dev_base_lock for writing when they do the
- * actual updates. This allows pure readers to access the list even
- * while a writer is preparing to update it.
- *
- * To put it another way, dev_base_lock is held for writing only to
- * protect against pure readers; the rtnl semaphore provides the
- * protection against other writers.
- *
- * See, for example usages, register_netdevice() and
- * unregister_netdevice(), which must be called with the rtnl
- * semaphore held.
- */
-struct net_device *dev_base;
-rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
-
-EXPORT_SYMBOL(dev_base);
-EXPORT_SYMBOL(dev_base_lock);
diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c Thu Feb 5 15:16:58 2004
+++ b/net/core/dev.c Thu Feb 5 15:16:58 2004
@@ -161,6 +161,31 @@
#endif
/*
+ * The @dev_base list is protected by @dev_base_lock and the rtln
+ * semaphore.
+ *
+ * Pure readers hold dev_base_lock for reading.
+ *
+ * Writers must hold the rtnl semaphore while they loop through the
+ * dev_base list, and hold dev_base_lock for writing when they do the
+ * actual updates. This allows pure readers to access the list even
+ * while a writer is preparing to update it.
+ *
+ * To put it another way, dev_base_lock is held for writing only to
+ * protect against pure readers; the rtnl semaphore provides the
+ * protection against other writers.
+ *
+ * See, for example usages, register_netdevice() and
+ * unregister_netdevice(), which must be called with the rtnl
+ * semaphore held.
+ */
+struct net_device *dev_base;
+rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
+
+EXPORT_SYMBOL(dev_base);
+EXPORT_SYMBOL(dev_base_lock);
+
+/*
* Our notifier list
*/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] (1/4) Support for lots of netdev's -- dev_base move
2004-02-06 18:03 [PATCH] (1/4) Support for lots of netdev's -- dev_base move Stephen Hemminger
@ 2004-02-06 21:39 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-02-06 21:39 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
On Fri, 6 Feb 2004 10:03:10 -0800
Stephen Hemminger <shemminger@osdl.org> wrote:
> The first patch moves the device list and locks from drivers/net/Space.c
> to net/core/dev.c. The list used to be in Space.c because we initialized it
> in 2.4, but now it makes more sense to put it over with the management
> routines.
Applied.
I hope we can eventually mark these two things static somehow. I know
there's a lot needed to do that, so not now just eventually.
Thanks Stephen.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-02-06 21:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-06 18:03 [PATCH] (1/4) Support for lots of netdev's -- dev_base move Stephen Hemminger
2004-02-06 21:39 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).