mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: "David S. Miller" <davem@davemloft.net>,
	jgarzik@pobox.com, linux-kernel@vger.kernel.org,
	linux-net@vger.kernel.org
Subject: [PATCH] deinline netif_carrier_on/off
Date: Thu, 11 Aug 2005 13:53:30 +0300	[thread overview]
Message-ID: <200508111353.30359.vda@ilport.com.ua> (raw)

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

These functions are not called frequently, let's save some space.

# grep -r 'netif_carrier_o[nf]' linux-2.6.12 | wc -l
246

# size vmlinux.org vmlinux.carrier
text    data     bss     dec     hex filename
4339634 1054414  259296 5653344  564360 vmlinux.org
4337710 1054414  259296 5651420  563bdc vmlinux.carrier

And this ain't an allyesconfig kernel.

Attached to prevent mangling by MUA.
--
vda

[-- Attachment #2: carrier.patch --]
[-- Type: text/x-diff, Size: 2361 bytes --]

# grep -r 'netif_carrier_o[nf]' linux-2.6.12 | wc -l
246

# size vmlinux.org vmlinux.carrier
text    data     bss     dec     hex filename
4339634 1054414  259296 5653344  564360 vmlinux.org
4337710 1054414  259296 5651420  563bdc vmlinux.carrier

And this ain't an allyesconfig kernel!

diff -urpN linux-2.6.12.org/include/linux/netdevice.h linux-2.6.12.carrier/include/linux/netdevice.h
--- linux-2.6.12.org/include/linux/netdevice.h	Sun Jun 19 16:10:56 2005
+++ linux-2.6.12.carrier/include/linux/netdevice.h	Wed Aug 10 21:13:28 2005
@@ -706,19 +706,9 @@ static inline int netif_carrier_ok(const
 
 extern void __netdev_watchdog_up(struct net_device *dev);
 
-static inline void netif_carrier_on(struct net_device *dev)
-{
-	if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state))
-		linkwatch_fire_event(dev);
-	if (netif_running(dev))
-		__netdev_watchdog_up(dev);
-}
+extern void netif_carrier_on(struct net_device *dev);
 
-static inline void netif_carrier_off(struct net_device *dev)
-{
-	if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state))
-		linkwatch_fire_event(dev);
-}
+extern void netif_carrier_off(struct net_device *dev);
 
 /* Hot-plugging. */
 static inline int netif_device_present(struct net_device *dev)
diff -urpN linux-2.6.12.org/net/sched/sch_generic.c linux-2.6.12.carrier/net/sched/sch_generic.c
--- linux-2.6.12.org/net/sched/sch_generic.c	Wed Aug 10 21:15:26 2005
+++ linux-2.6.12.carrier/net/sched/sch_generic.c	Wed Aug 10 22:23:33 2005
@@ -238,6 +238,20 @@ static void dev_watchdog_down(struct net
 	spin_unlock_bh(&dev->xmit_lock);
 }
 
+void netif_carrier_on(struct net_device *dev)
+{
+	if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state))
+		linkwatch_fire_event(dev);
+	if (netif_running(dev))
+		__netdev_watchdog_up(dev);
+}
+
+void netif_carrier_off(struct net_device *dev)
+{
+	if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state))
+		linkwatch_fire_event(dev);
+}
+
 /* "NOOP" scheduler: the best scheduler, recommended for all interfaces
    under all circumstances. It is difficult to invent anything faster or
    cheaper.
@@ -604,6 +618,8 @@ void dev_shutdown(struct net_device *dev
 }
 
 EXPORT_SYMBOL(__netdev_watchdog_up);
+EXPORT_SYMBOL(netif_carrier_on);
+EXPORT_SYMBOL(netif_carrier_off);
 EXPORT_SYMBOL(noop_qdisc);
 EXPORT_SYMBOL(noop_qdisc_ops);
 EXPORT_SYMBOL(qdisc_create_dflt);

             reply	other threads:[~2005-08-11 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-11 10:53 Denis Vlasenko [this message]
2005-08-11 22:33 ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200508111353.30359.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®