* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-3-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/amd8111e.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 85f7276..a4ad2fb 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -113,7 +113,7 @@ MODULE_PARM_DESC(coalesce, "Enable or Disable interrupt coalescing, 1: Enable, 0
module_param_array(dynamic_ipg, bool, NULL, 0);
MODULE_PARM_DESC(dynamic_ipg, "Enable or Disable dynamic IPG, 1: Enable, 0: Disable");
-static struct pci_device_id amd8111e_pci_tbl[] = {
+static PCI_DEVICE_TABLE(amd8111e_pci_tbl) = {
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD8111E_7462,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-2-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/hamachi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index b53f6b6..d8056e9 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -1987,7 +1987,7 @@ static void __devexit hamachi_remove_one (struct pci_dev *pdev)
}
}
-static struct pci_device_id hamachi_pci_tbl[] = {
+static PCI_DEVICE_TABLE(hamachi_pci_tbl) = {
{ 0x1318, 0x0911, PCI_ANY_ID, PCI_ANY_ID, },
{ 0, }
};
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-6-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/starfire.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index c49214f..a67bac5 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -337,7 +337,7 @@ enum chipset {
CH_6915 = 0,
};
-static struct pci_device_id starfire_pci_tbl[] = {
+static PCI_DEVICE_TABLE(starfire_pci_tbl) = {
{ 0x9004, 0x6915, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_6915 },
{ 0, }
};
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-4-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/niu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index e98ce1e..ab8148a 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -62,7 +62,7 @@ static void writeq(u64 val, void __iomem *reg)
}
#endif
-static struct pci_device_id niu_pci_tbl[] = {
+static PCI_DEVICE_TABLE(niu_pci_tbl) = {
{PCI_DEVICE(PCI_VENDOR_ID_SUN, 0xabcd)},
{}
};
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-7-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/3c59x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 6f8e7d4..d2045d4 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -372,7 +372,7 @@ static struct vortex_chip_info {
};
-static struct pci_device_id vortex_pci_tbl[] = {
+static PCI_DEVICE_TABLE(vortex_pci_tbl) = {
{ 0x10B7, 0x5900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C590 },
{ 0x10B7, 0x5920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C592 },
{ 0x10B7, 0x5970, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C597 },
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-5-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/tlan.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 3af5b92..bea59c6 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -253,7 +253,7 @@ static struct board {
{ "Compaq NetFlex-3/E", TLAN_ADAPTER_ACTIVITY_LED, 0x83 }, /* EISA card */
};
-static struct pci_device_id tlan_pci_tbl[] = {
+static PCI_DEVICE_TABLE(tlan_pci_tbl) = {
{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL10,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100,
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-9-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/arcnet/com20020-pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index b8c0fa6..87ee0db 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -141,7 +141,7 @@ static void __devexit com20020pci_remove(struct pci_dev *pdev)
free_netdev(dev);
}
-static struct pci_device_id com20020pci_id_table[] = {
+static PCI_DEVICE_TABLE(com20020pci_id_table) = {
{ 0x1571, 0xa001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-8-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/defxx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index ddc30c4..84a3ce5 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -3630,7 +3630,7 @@ static int __devinit dfx_pci_register(struct pci_dev *,
const struct pci_device_id *);
static void __devexit dfx_pci_unregister(struct pci_dev *);
-static struct pci_device_id dfx_pci_table[] = {
+static PCI_DEVICE_TABLE(dfx_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI) },
{ }
};
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-11-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/wan/dscc4.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index c6f26e2..16d3a4c 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -2048,7 +2048,7 @@ static int __init dscc4_setup(char *str)
__setup("dscc4.setup=", dscc4_setup);
#endif
-static struct pci_device_id dscc4_pci_tbl[] = {
+static PCI_DEVICE_TABLE(dscc4_pci_tbl) = {
{ PCI_VENDOR_ID_SIEMENS, PCI_DEVICE_ID_SIEMENS_DSCC4,
PCI_ANY_ID, PCI_ANY_ID, },
{ 0,}
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-12-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/wan/lmc/lmc_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 6635ece..e85cfe7 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -82,7 +82,7 @@ static int lmc_first_load = 0;
static int LMC_PKT_BUF_SZ = 1542;
-static struct pci_device_id lmc_pci_tbl[] = {
+static PCI_DEVICE_TABLE(lmc_pci_tbl) = {
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST,
PCI_VENDOR_ID_LMC, PCI_ANY_ID },
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST,
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-13-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/sunhme.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index b4e7f30..beb0d27 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3247,7 +3247,7 @@ static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
dev_set_drvdata(&pdev->dev, NULL);
}
-static struct pci_device_id happymeal_pci_ids[] = {
+static PCI_DEVICE_TABLE(happymeal_pci_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
{ } /* Terminating entry */
};
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-14-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/pasemi_mac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 2e39e02..069fa7c 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -1648,7 +1648,7 @@ static void __devexit pasemi_mac_remove(struct pci_dev *pdev)
free_netdev(netdev);
}
-static struct pci_device_id pasemi_mac_pci_tbl[] = {
+static PCI_DEVICE_TABLE(pasemi_mac_pci_tbl) = {
{ PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa005) },
{ PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa006) },
{ },
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-10-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/sk98lin/skge.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 20890e4..eedcbeb 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -5166,7 +5166,7 @@ err_out:
#define skge_resume NULL
#endif
-static struct pci_device_id skge_pci_tbl[] = {
+static PCI_DEVICE_TABLE(skge_pci_tbl) = {
#ifdef SK98LIN_ALL_DEVICES
{ PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
In-Reply-To: <1203512031-14318-15-git-send-email-jonas@southpole.se>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/skfp/skfddi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 7cf9b9f..2a8386b 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -150,7 +150,7 @@ extern void mac_drv_rx_mode(struct s_smc *smc, int mode);
extern void mac_drv_clear_rx_queue(struct s_smc *smc);
extern void enable_tx_irq(struct s_smc *smc, u_short queue);
-static struct pci_device_id skfddi_pci_tbl[] = {
+static PCI_DEVICE_TABLE(skfddi_pci_tbl) = {
{ PCI_VENDOR_ID_SK, PCI_DEVICE_ID_SK_FP, PCI_ANY_ID, PCI_ANY_ID, },
{ } /* Terminating entry */
};
--
1.5.3.8
^ permalink raw reply related
* RE: Dealing with limited resources and DMA Engine copies
From: Sosnowski, Maciej @ 2008-02-20 13:01 UTC (permalink / raw)
To: olof; +Cc: netdev, Nelson, Shannon, Williams, Dan J
In-Reply-To: <f12847240802200440u3542c2a0vaf82312435ddafe9@mail.gmail.com>
>---------- Original message ----------
>From: Olof Johansson <olof@lixom.net>
>Date: Feb 14, 2008 3:38 AM
>Subject: Dealing with limited resources and DMA Engine copies
>To: shannon.nelson@intel.com, dan.j.williams@intel.com
>Cc: netdev@vger.kernel.org
>
>Hi,
>
>My DMA Engine has a limited resource: It's got a descriptor ring, so
>it's not always possible to add a new descriptor to it (i.e. it might
be
>full). While allocating a huge ring will help, eventually I'm sure I
>will hit a case where it'll overflow.
>
>I thought this was going to be taken care of automatically by the fact
>that you return your max(?) number of descriptors in the channel
>allocation function, but it looks like that value is discarded in
>dma_client_chan_alloc().
>
>So, I just got a couple of spurious:
>dma_cookie < 0
>dma_cookie < 0
>
>...on the console and the connection terminated. Looks like that came
>from tcp_recvmsg(). Ouch.
>
>How about falling back to the cpu-based copy in case of failure? Or
would
>you prefer that I sleep locally in my driver and wait on a descriptor
>slot to open up?
>
I have taken a closer look at this in the code. It seems to be a good
idea to withdraw for a while from ioat-dma copy in case of "dma_cookie <
0" error to let the ring free some descriptors.
I will be able to work on it next week probably. As soon as I have some
stable results, I will get back to you with it.
Maciej
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk
Sad Rejonowy Gdansk Polnoc w Gdansku,
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego,
numer KRS 101882
NIP 957-07-52-316
Kapital zakladowy 200.000 zl
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply
* Re: pci_device_id cleanups
From: Sam Ravnborg @ 2008-02-20 13:17 UTC (permalink / raw)
To: Jonas Bonn; +Cc: linux-kernel, netdev, greg
In-Reply-To: <1203512031-14318-1-git-send-email-jonas@southpole.se>
On Wed, Feb 20, 2008 at 01:53:36PM +0100, Jonas Bonn wrote:
>
> The PCI_DEVICE_TABLE patch I sent earlier doesn't necessarily make
> much sense by itself... here is a set of patches that apply
> this macro, in turn moving a lot of this data into __devinitconst
> which is discardable in certain situations.
> Hopefully the benefit of this approach is a bit clearer now.
[shorter lines please..]
Can you please confirm that this does not break powerpc (64 bit)
as they have troubles with the constification..
Sam
^ permalink raw reply
* Re: pci_device_id cleanups
From: Jonas Bonn @ 2008-02-20 13:27 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel, netdev, greg
In-Reply-To: <20080220131704.GB18790@uranus.ravnborg.org>
Sam Ravnborg wrote:
> On Wed, Feb 20, 2008 at 01:53:36PM +0100, Jonas Bonn wrote:
>> The PCI_DEVICE_TABLE patch I sent earlier doesn't necessarily make
>> much sense by itself... here is a set of patches that apply
>> this macro, in turn moving a lot of this data into __devinitconst
>> which is discardable in certain situations.
>> Hopefully the benefit of this approach is a bit clearer now.
> [shorter lines please..]
Sorry...
>
> Can you please confirm that this does not break powerpc (64 bit)
> as they have troubles with the constification..
I do not have access to any PowerPC machine... Olof Johansson built the
tree I posted earlier on PowerPC; there's nothing really new here except
the wrapping of the definition in a macro.
But of course, it would great if someone could confirm this...
>
> Sam
>
^ permalink raw reply
* [RFC PATCH 0/8]: uninline & uninline
From: Ilpo Järvinen @ 2008-02-20 13:35 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: David Miller, Arnaldo Carvalho de Melo
Hi all,
I run some lengthy tests to measure cost of inlines in headers under
include/, simple coverage calculations yields to 89% but most of the
failed compiles are due to preprocessor cutting the tested block away
anyway. Test setup: v2.6.24-mm1, make allyesconfig, 32-bit x86,
gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13). Because one inline was
tested (function uninlined) at a time, the actual benefits of removing
multiple inlines may well be below what the sum of those individually
is (especially when something calls __-func with equal name).
Ok, here's the top of the list (10000+ bytes):
-110805 869 f, 198 +, 111003 -, diff: -110805 skb_put
-41525 2066 f, 3370 +, 44895 -, diff: -41525 IS_ERR
-36290 42 f, 197 +, 36487 -, diff: -36290 cfi_build_cmd
-35698 1234 f, 2391 +, 38089 -, diff: -35698 atomic_dec_and_test
-28162 354 f, 3005 +, 31167 -, diff: -28162 skb_pull
-23668 392 f, 104 +, 23772 -, diff: -23668 dev_alloc_skb
-22212 415 f, 130 +, 22342 -, diff: -22212 __dev_alloc_skb
-21593 356 f, 2418 +, 24011 -, diff: -21593 skb_push
-19036 478 f, 259 +, 19295 -, diff: -19036 netif_wake_queue
-18409 396 f, 6447 +, 24856 -, diff: -18409 __skb_pull
-16420 187 f, 103 +, 16523 -, diff: -16420 dst_release
-16025 13 f, 280 +, 16305 -, diff: -16025 cfi_send_gen_cmd
-14925 486 f, 978 +, 15903 -, diff: -14925 add_timer
-14896 199 f, 558 +, 15454 -, diff: -14896 sg_page
-12870 36 f, 121 +, 12991 -, diff: -12870 le_key_k_type
-12310 692 f, 7215 +, 19525 -, diff: -12310 signal_pending
-11640 251 f, 118 +, 11758 -, diff: -11640 __skb_trim
-11059 111 f, 293 +, 11352 -, diff: -11059 __nlmsg_put
-10976 209 f, 123 +, 11099 -, diff: -10976 skb_trim
-10344 125 f, 462 +, 10806 -, diff: -10344 pskb_may_pull
-10061 300 f, 1163 +, 11224 -, diff: -10061 try_module_get
-10008 75 f, 341 +, 10349 -, diff: -10008 nlmsg_put
~250 are in 1000+ bytes category and ~440 in 500+. Full list
has some entries without number because given config doesn't
build them, and therefore nothing got uninlined, and the missing
entries consists solely of compile failures, available here:
http://www.cs.helsinki.fi/u/ijjarvin/inlines/sorted
I made some patches to uninline couple of them (picked mostly
net related) to stir up some discussion, however, some of them
are not ready for inclusion as is (see patch descriptions).
The cases don't represent all top 8 cases because some of the
cases require a bit more analysis (e.g., config dependant,
comments about gcc optimizations).
The tools I used are available here except the site-specific
distribute machinery (in addition one needs pretty late
codiff from Arnaldo's toolset because there were some inline
related bugs fixed lately):
http://www.cs.helsinki.fi/u/ijjarvin/inline-tools.git/
I'm planning to run similar tests also on inlines in headers that
are not under include/ but it requires minor modifications to
those tools.
--
i.
^ permalink raw reply
* [RFC PATCH 0/8]: uninline & uninline
From: Ilpo Järvinen @ 2008-02-20 13:47 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: David Miller, Arnaldo Carvalho de Melo
Hi all,
I run some lengthy tests to measure cost of inlines in headers under
include/, simple coverage calculations yields to 89% but most of the
failed compiles are due to preprocessor cutting the tested block away
anyway. Test setup: v2.6.24-mm1, make allyesconfig, 32-bit x86,
gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13). Because one inline was
tested (function uninlined) at a time, the actual benefits of removing
multiple inlines may well be below what the sum of those individually
is (especially when something calls __-func with equal name).
Ok, here's the top of the list (10000+ bytes):
-110805 869 f, 198 +, 111003 -, diff: -110805 skb_put
-41525 2066 f, 3370 +, 44895 -, diff: -41525 IS_ERR
-36290 42 f, 197 +, 36487 -, diff: -36290 cfi_build_cmd
-35698 1234 f, 2391 +, 38089 -, diff: -35698 atomic_dec_and_test
-28162 354 f, 3005 +, 31167 -, diff: -28162 skb_pull
-23668 392 f, 104 +, 23772 -, diff: -23668 dev_alloc_skb
-22212 415 f, 130 +, 22342 -, diff: -22212 __dev_alloc_skb
-21593 356 f, 2418 +, 24011 -, diff: -21593 skb_push
-19036 478 f, 259 +, 19295 -, diff: -19036 netif_wake_queue
-18409 396 f, 6447 +, 24856 -, diff: -18409 __skb_pull
-16420 187 f, 103 +, 16523 -, diff: -16420 dst_release
-16025 13 f, 280 +, 16305 -, diff: -16025 cfi_send_gen_cmd
-14925 486 f, 978 +, 15903 -, diff: -14925 add_timer
-14896 199 f, 558 +, 15454 -, diff: -14896 sg_page
-12870 36 f, 121 +, 12991 -, diff: -12870 le_key_k_type
-12310 692 f, 7215 +, 19525 -, diff: -12310 signal_pending
-11640 251 f, 118 +, 11758 -, diff: -11640 __skb_trim
-11059 111 f, 293 +, 11352 -, diff: -11059 __nlmsg_put
-10976 209 f, 123 +, 11099 -, diff: -10976 skb_trim
-10344 125 f, 462 +, 10806 -, diff: -10344 pskb_may_pull
-10061 300 f, 1163 +, 11224 -, diff: -10061 try_module_get
-10008 75 f, 341 +, 10349 -, diff: -10008 nlmsg_put
~250 are in 1000+ bytes category and ~440 in 500+. Full list
has some entries without number because given config doesn't
build them, and therefore nothing got uninlined, and the missing
entries consists solely of compile failures, available here:
http://www.cs.helsinki.fi/u/ijjarvin/inlines/sorted
I made some patches to uninline couple of them (picked mostly
net related) to stir up some discussion, however, some of them
are not ready for inclusion as is (see patch descriptions).
The cases don't represent all top 8 cases because some of the
cases require a bit more analysis (e.g., config dependant,
comments about gcc optimizations).
The tools I used are available here except the site-specific
distribute machinery (in addition one needs pretty late
codiff from Arnaldo's toolset because there were some inline
related bugs fixed lately):
http://www.cs.helsinki.fi/u/ijjarvin/inline-tools.git/
I'm planning to run similar tests also on inlines in headers that
are not under include/ but it requires minor modifications to
those tools.
--
i.
ps. I'm sorry about the duplicates, old git-send-email's
8-bit-header problem bit me again. :-(
^ permalink raw reply
* [RFC PATCH 1/8] [NET]: uninline skb_put, de-bloats a lot
From: Ilpo Järvinen @ 2008-02-20 13:47 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David Miller, Arnaldo Carvalho de Melo, Ilpo J�rvinen
In-Reply-To: <1203515238-22848-1-git-send-email-ilpo.jarvinen@helsinki.fi>
~500 files changed
...
kernel/uninlined.c:
skb_put | +104
1 function changed, 104 bytes added, diff: +104
vmlinux.o:
869 functions changed, 198 bytes added, 111003 bytes removed, diff: -110805
This change is INCOMPLETE, I think that the call to current_text_addr()
should be rethought but I don't have a clue how to do that.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/linux/skbuff.h | 20 +-------------------
net/core/skbuff.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 412672a..5925435 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -896,25 +896,7 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
return tmp;
}
-/**
- * skb_put - add data to a buffer
- * @skb: buffer to use
- * @len: amount of data to add
- *
- * This function extends the used data area of the buffer. If this would
- * exceed the total buffer size the kernel will panic. A pointer to the
- * first byte of the extra data is returned.
- */
-static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
-{
- unsigned char *tmp = skb_tail_pointer(skb);
- SKB_LINEAR_ASSERT(skb);
- skb->tail += len;
- skb->len += len;
- if (unlikely(skb->tail > skb->end))
- skb_over_panic(skb, len, current_text_addr());
- return tmp;
-}
+extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len);
static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
{
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 4e35422..661d439 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -857,6 +857,27 @@ free_skb:
return err;
}
+/**
+ * skb_put - add data to a buffer
+ * @skb: buffer to use
+ * @len: amount of data to add
+ *
+ * This function extends the used data area of the buffer. If this would
+ * exceed the total buffer size the kernel will panic. A pointer to the
+ * first byte of the extra data is returned.
+ */
+unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
+{
+ unsigned char *tmp = skb_tail_pointer(skb);
+ SKB_LINEAR_ASSERT(skb);
+ skb->tail += len;
+ skb->len += len;
+ if (unlikely(skb->tail > skb->end))
+ skb_over_panic(skb, len, current_text_addr());
+ return tmp;
+}
+EXPORT_SYMBOL(skb_put);
+
/* Trims skb to length len. It can change skb pointers.
*/
--
1.5.2.2
^ permalink raw reply related
* [RFC PATCH 4/8] [NET]: uninline skb_push, de-bloats a lot
From: Ilpo Järvinen @ 2008-02-20 13:47 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David Miller, Arnaldo Carvalho de Melo, Ilpo J�rvinen
In-Reply-To: <1203515238-22848-4-git-send-email-ilpo.jarvinen@helsinki.fi>
-21593 356 funcs, 2418 +, 24011 -, diff: -21593 --- skb_push
Again, current_text_addr() needs to addressed.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/linux/skbuff.h | 18 +-----------------
net/core/skbuff.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index df3cce2..c11f248 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -905,23 +905,7 @@ static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
return skb->data;
}
-/**
- * skb_push - add data to the start of a buffer
- * @skb: buffer to use
- * @len: amount of data to add
- *
- * This function extends the used data area of the buffer at the buffer
- * start. If this would exceed the total buffer headroom the kernel will
- * panic. A pointer to the first byte of the extra data is returned.
- */
-static inline unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
-{
- skb->data -= len;
- skb->len += len;
- if (unlikely(skb->data<skb->head))
- skb_under_panic(skb, len, current_text_addr());
- return skb->data;
-}
+extern unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
{
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 081bffb..05d43fd 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -897,6 +897,25 @@ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
EXPORT_SYMBOL(skb_put);
/**
+ * skb_push - add data to the start of a buffer
+ * @skb: buffer to use
+ * @len: amount of data to add
+ *
+ * This function extends the used data area of the buffer at the buffer
+ * start. If this would exceed the total buffer headroom the kernel will
+ * panic. A pointer to the first byte of the extra data is returned.
+ */
+unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
+{
+ skb->data -= len;
+ skb->len += len;
+ if (unlikely(skb->data<skb->head))
+ skb_under_panic(skb, len, current_text_addr());
+ return skb->data;
+}
+EXPORT_SYMBOL(skb_push);
+
+/**
* skb_pull - remove data from the start of a buffer
* @skb: buffer to use
* @len: amount of data to remove
--
1.5.2.2
^ permalink raw reply related
* [RFC PATCH 3/8] [NET]: uninline dev_alloc_skb, de-bloats a lot
From: Ilpo Järvinen @ 2008-02-20 13:47 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David Miller, Arnaldo Carvalho de Melo, Ilpo J�rvinen
In-Reply-To: <1203515238-22848-3-git-send-email-ilpo.jarvinen@helsinki.fi>
-23668 392 funcs, 104 +, 23772 -, diff: -23668 --- dev_alloc_skb
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/linux/skbuff.h | 17 +----------------
net/core/skbuff.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a9f8f15..df3cce2 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1269,22 +1269,7 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
return skb;
}
-/**
- * dev_alloc_skb - allocate an skbuff for receiving
- * @length: length to allocate
- *
- * Allocate a new &sk_buff and assign it a usage count of one. The
- * buffer has unspecified headroom built in. Users should allocate
- * the headroom they think they need without accounting for the
- * built in space. The built in space is used for optimisations.
- *
- * %NULL is returned if there is no free memory. Although this function
- * allocates memory it can be called from an interrupt.
- */
-static inline struct sk_buff *dev_alloc_skb(unsigned int length)
-{
- return __dev_alloc_skb(length, GFP_ATOMIC);
-}
+extern struct sk_buff *dev_alloc_skb(unsigned int length);
extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
unsigned int length, gfp_t gfp_mask);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 14f462b..081bffb 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -263,6 +263,24 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
return skb;
}
+/**
+ * dev_alloc_skb - allocate an skbuff for receiving
+ * @length: length to allocate
+ *
+ * Allocate a new &sk_buff and assign it a usage count of one. The
+ * buffer has unspecified headroom built in. Users should allocate
+ * the headroom they think they need without accounting for the
+ * built in space. The built in space is used for optimisations.
+ *
+ * %NULL is returned if there is no free memory. Although this function
+ * allocates memory it can be called from an interrupt.
+ */
+struct sk_buff *dev_alloc_skb(unsigned int length)
+{
+ return __dev_alloc_skb(length, GFP_ATOMIC);
+}
+EXPORT_SYMBOL(dev_alloc_skb);
+
static void skb_drop_list(struct sk_buff **listp)
{
struct sk_buff *list = *listp;
--
1.5.2.2
^ permalink raw reply related
* [RFC PATCH 6/8] [NET]: uninline skb_trim, de-bloats
From: Ilpo Järvinen @ 2008-02-20 13:47 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David Miller, Arnaldo Carvalho de Melo, Ilpo J�rvinen
In-Reply-To: <1203515238-22848-6-git-send-email-ilpo.jarvinen@helsinki.fi>
-10976 209 funcs, 123 +, 11099 -, diff: -10976 --- skb_trim
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/linux/skbuff.h | 16 +---------------
net/core/skbuff.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c11f248..75d8a66 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1156,21 +1156,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
skb_set_tail_pointer(skb, len);
}
-/**
- * skb_trim - remove end from a buffer
- * @skb: buffer to alter
- * @len: new length
- *
- * Cut the length of a buffer down by removing data from the tail. If
- * the buffer is already under the length specified it is not modified.
- * The skb must be linear.
- */
-static inline void skb_trim(struct sk_buff *skb, unsigned int len)
-{
- if (skb->len > len)
- __skb_trim(skb, len);
-}
-
+extern void skb_trim(struct sk_buff *skb, unsigned int len);
static inline int __pskb_trim(struct sk_buff *skb, unsigned int len)
{
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 05d43fd..b57cadb 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -931,6 +931,22 @@ unsigned char *skb_pull(struct sk_buff *skb, unsigned int len)
}
EXPORT_SYMBOL(skb_pull);
+/**
+ * skb_trim - remove end from a buffer
+ * @skb: buffer to alter
+ * @len: new length
+ *
+ * Cut the length of a buffer down by removing data from the tail. If
+ * the buffer is already under the length specified it is not modified.
+ * The skb must be linear.
+ */
+void skb_trim(struct sk_buff *skb, unsigned int len)
+{
+ if (skb->len > len)
+ __skb_trim(skb, len);
+}
+EXPORT_SYMBOL(skb_trim);
+
/* Trims skb to length len. It can change skb pointers.
*/
--
1.5.2.2
^ permalink raw reply related
* [RFC PATCH 2/8] [NET]: uninline skb_pull, de-bloats a lot
From: Ilpo Järvinen @ 2008-02-20 13:47 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David Miller, Arnaldo Carvalho de Melo, Ilpo J�rvinen
In-Reply-To: <1203515238-22848-2-git-send-email-ilpo.jarvinen@helsinki.fi>
-28162 354 funcs, 3005 +, 31167 -, diff: -28162 --- skb_pull
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/linux/skbuff.h | 15 +--------------
net/core/skbuff.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 5925435..a9f8f15 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -930,20 +930,7 @@ static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
return skb->data += len;
}
-/**
- * skb_pull - remove data from the start of a buffer
- * @skb: buffer to use
- * @len: amount of data to remove
- *
- * This function removes data from the start of a buffer, returning
- * the memory to the headroom. A pointer to the next data in the buffer
- * is returned. Once the data has been pulled future pushes will overwrite
- * the old data.
- */
-static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len)
-{
- return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len);
-}
+extern unsigned char *skb_pull(struct sk_buff *skb, unsigned int len);
extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 661d439..14f462b 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -878,6 +878,22 @@ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
}
EXPORT_SYMBOL(skb_put);
+/**
+ * skb_pull - remove data from the start of a buffer
+ * @skb: buffer to use
+ * @len: amount of data to remove
+ *
+ * This function removes data from the start of a buffer, returning
+ * the memory to the headroom. A pointer to the next data in the buffer
+ * is returned. Once the data has been pulled future pushes will overwrite
+ * the old data.
+ */
+unsigned char *skb_pull(struct sk_buff *skb, unsigned int len)
+{
+ return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len);
+}
+EXPORT_SYMBOL(skb_pull);
+
/* Trims skb to length len. It can change skb pointers.
*/
--
1.5.2.2
^ permalink raw reply related
* [RFC PATCH 7/8] [SCTP]: uninline sctp_add_cmd_sf
From: Ilpo Järvinen @ 2008-02-20 13:47 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David Miller, Arnaldo Carvalho de Melo, Ilpo J�rvinen,
Vlad Yasevich
In-Reply-To: <1203515238-22848-7-git-send-email-ilpo.jarvinen@helsinki.fi>
I added inline to sctp_add_cmd and appropriate comment there to
avoid adding another call into the call chain. This works at least
with "gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)". Alternatively,
__sctp_add_cmd could be introduced to .h.
net/sctp/sm_statefuns.c:
sctp_sf_cookie_wait_prm_abort | -125
sctp_sf_cookie_wait_prm_shutdown | -75
sctp_sf_do_9_1_prm_abort | -75
sctp_sf_shutdown_sent_prm_abort | -50
sctp_sf_pdiscard | -25
sctp_stop_t1_and_abort | -100
sctp_sf_do_9_2_start_shutdown | -154
__sctp_sf_do_9_1_abort | -50
sctp_send_stale_cookie_err | -29
sctp_sf_abort_violation | -181
sctp_sf_do_9_2_shutdown_ack | -154
sctp_sf_do_9_2_reshutack | -86
sctp_sf_tabort_8_4_8 | -28
sctp_sf_heartbeat | -52
sctp_sf_shut_8_4_5 | -27
sctp_eat_data | -246
sctp_sf_shutdown_sent_abort | -58
sctp_sf_check_restart_addrs | -50
sctp_sf_do_unexpected_init | -110
sctp_sf_sendbeat_8_3 | -107
sctp_sf_unk_chunk | -65
sctp_sf_do_prm_asoc | -129
sctp_sf_do_prm_send | -25
sctp_sf_do_9_2_prm_shutdown | -50
sctp_sf_error_closed | -25
sctp_sf_error_shutdown | -25
sctp_sf_shutdown_pending_prm_abort | -25
sctp_sf_do_prm_requestheartbeat | -28
sctp_sf_do_prm_asconf | -75
sctp_sf_do_6_3_3_rtx | -104
sctp_sf_do_6_2_sack | -25
sctp_sf_t1_init_timer_expire | -133
sctp_sf_t1_cookie_timer_expire | -104
sctp_sf_t2_timer_expire | -161
sctp_sf_t4_timer_expire | -175
sctp_sf_t5_timer_expire | -75
sctp_sf_autoclose_timer_expire | -50
sctp_sf_do_5_2_4_dupcook | -579
sctp_sf_do_4_C | -125
sctp_sf_shutdown_pending_abort | -32
sctp_sf_do_5_1E_ca | -186
sctp_sf_backbeat_8_3 | -27
sctp_sf_cookie_echoed_err | -300
sctp_sf_eat_data_6_2 | -146
sctp_sf_eat_data_fast_4_4 | -125
sctp_sf_eat_sack_6_2 | -29
sctp_sf_operr_notify | -25
sctp_sf_do_9_2_final | -152
sctp_sf_do_asconf | -64
sctp_sf_do_asconf_ack | -284
sctp_sf_eat_fwd_tsn_fast | -160
sctp_sf_eat_auth | -86
sctp_sf_do_5_1B_init | -110
sctp_sf_do_5_1C_ack | -204
sctp_sf_do_9_2_shutdown | -78
sctp_sf_do_ecn_cwr | -24
sctp_sf_do_ecne | -32
sctp_sf_eat_fwd_tsn | -135
sctp_sf_do_5_1D_ce | -197
sctp_sf_beat_8_3 | -28
60 functions changed, 6184 bytes removed, diff: -6184
net/sctp/sm_sideeffect.c:
sctp_side_effects | -3873
sctp_do_sm | +3429
2 functions changed, 3429 bytes added, 3873 bytes removed, diff: -444
kernel/uninlined.c:
sctp_add_cmd_sf | +35
1 function changed, 35 bytes added, diff: +35
vmlinux.o:
63 functions changed, 3464 bytes added, 10057 bytes removed, diff: -6593
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
---
include/net/sctp/sm.h | 8 ++------
net/sctp/command.c | 12 +++++++++++-
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index ef9e7ed..6740b11 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -385,13 +385,9 @@ static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t)
return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT));
}
-
/* Run sctp_add_cmd() generating a BUG() if there is a failure. */
-static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
-{
- if (unlikely(!sctp_add_cmd(seq, verb, obj)))
- BUG();
-}
+extern void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb,
+ sctp_arg_t obj);
/* Check VTAG of the packet matches the sender's own tag. */
static inline int
diff --git a/net/sctp/command.c b/net/sctp/command.c
index bb97733..187da2d 100644
--- a/net/sctp/command.c
+++ b/net/sctp/command.c
@@ -51,8 +51,11 @@ int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
/* Add a command to a sctp_cmd_seq_t.
* Return 0 if the command sequence is full.
+ *
+ * Inline here is not a mistake, this way sctp_add_cmd_sf doesn't need extra
+ * calls, size penalty is of insignificant magnitude here
*/
-int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
+inline int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
{
if (seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS)
goto fail;
@@ -66,6 +69,13 @@ fail:
return 0;
}
+/* Run sctp_add_cmd() generating a BUG() if there is a failure. */
+void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
+{
+ if (unlikely(!sctp_add_cmd(seq, verb, obj)))
+ BUG();
+}
+
/* Return the next command structure in a sctp_cmd_seq.
* Returns NULL at the end of the sequence.
*/
--
1.5.2.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox