* [PATCH 1/2] [NET] core/utils.c: digit2bin is dead static inline
From: Ilpo Järvinen @ 2008-01-12 11:53 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/core/utils.c | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/net/core/utils.c b/net/core/utils.c
index 34459c4..8031eb5 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -91,17 +91,6 @@ EXPORT_SYMBOL(in_aton);
#define IN6PTON_NULL 0x20000000 /* first/tail */
#define IN6PTON_UNKNOWN 0x40000000
-static inline int digit2bin(char c, int delim)
-{
- if (c == delim || c == '\0')
- return IN6PTON_DELIM;
- if (c == '.')
- return IN6PTON_DOT;
- if (c >= '0' && c <= '9')
- return (IN6PTON_DIGIT | (c - '0'));
- return IN6PTON_UNKNOWN;
-}
-
static inline int xdigit2bin(char c, int delim)
{
if (c == delim || c == '\0')
--
1.5.0.6
^ permalink raw reply related
* [PATCH 2/2] [HTB]: htb_classid is dead static inline
From: Ilpo Järvinen @ 2008-01-12 11:53 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1200138816244-git-send-email-ilpo.jarvinen@helsinki.fi>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/sched/sch_htb.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 72beb66..6a2352c 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -214,10 +214,6 @@ static inline struct htb_class *htb_find(u32 handle, struct Qdisc *sch)
* then finish and return direct queue.
*/
#define HTB_DIRECT (struct htb_class*)-1
-static inline u32 htb_classid(struct htb_class *cl)
-{
- return (cl && cl != HTB_DIRECT) ? cl->classid : TC_H_UNSPEC;
-}
static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch,
int *qerr)
--
1.5.0.6
^ permalink raw reply related
* [PATCH net-2.6.25] [XFRM] Remove unused XFRM_STATE_VOID and typos (net/xfrm.h)
From: Rami Rosen @ 2008-01-12 11:37 UTC (permalink / raw)
To: David Miller, netdev
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
Hi,
In net/xfrm.h:
- remove XFRM_STATE_VOID (not in use)
- correct 3 typos
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 896 bytes --]
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 860fe4a..432c5c8 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -84,10 +84,10 @@ extern struct mutex xfrm_cfg_mutex;
|---. child .-> dst -. xfrm .-> xfrm_state #3
|---. child .-> NULL
- Bundles are cached at xrfm_policy struct (field ->bundles).
+ Bundles are cached at xfrm_policy struct (field ->bundles).
- Resolution of xrfm_tmpl
+ Resolution of xfrm_tmpl
-----------------------
Template contains:
1. ->mode Mode: transport or tunnel
@@ -133,7 +133,7 @@ struct xfrm_state
u32 genid;
- /* Key manger bits */
+ /* Key manager bits */
struct {
u8 state;
u8 dying;
@@ -217,7 +217,6 @@ struct xfrm_state
#define XFRM_TIME_DEFER 1
enum {
- XFRM_STATE_VOID,
XFRM_STATE_ACQ,
XFRM_STATE_VALID,
XFRM_STATE_ERROR,
^ permalink raw reply related
* net-2.6.25 rebased...
From: David Miller @ 2008-01-12 11:31 UTC (permalink / raw)
To: netdev
I fixed up some utf-8 encoding issues in changelog messages,
got rid of superfluous patches ("X" then "revert X" cases)
and combined bug fixes into the patches which introduced
them.
We are just over 700 patches, keep them coming :-)
^ permalink raw reply
* Re: [PATCH 9/9] fix sparse warnings
From: David Miller @ 2008-01-12 11:28 UTC (permalink / raw)
To: dada1; +Cc: stephen.hemminger, robert.olsson, netdev
In-Reply-To: <4788A17D.5070903@cosmosbay.com>
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Sat, 12 Jan 2008 12:16:13 +0100
> We could use a better scheme with an extra indirection.
Unfortunately, indirection will likely have a negative
impact upon performance. We go only as fast as the
number of memory references made by this code.
> 3) 'pos' and 'bits' fields of 'struct tnode' might be converted to
> plain uchar, instead of 5-bits fields, to reduce complexity for
> generated code.
This seems reasonable, I'll likely apply this.
^ permalink raw reply
* Re: [RFC PATCH 8/8] [PKTGEN]: uninline getCurUs
From: David Miller @ 2008-01-12 11:25 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <12001304701901-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:29 +0200
> net/core/pktgen.c:
> pktgen_stop_device | -50
> pktgen_run | -105
> pktgen_if_show | -37
> pktgen_thread_worker | -702
> 4 functions changed, 894 bytes removed, diff: -894
>
> net/core/pktgen.c:
> getCurUs | +36
> 1 function changed, 36 bytes added, diff: +36
>
> net/core/pktgen.o:
> 5 functions changed, 36 bytes added, 894 bytes removed, diff: -858
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
I think this is the right thing to do, applied.
^ permalink raw reply
* Re: [PATCH 7/8] [PKTGEN]: Kill dead static inlines
From: David Miller @ 2008-01-12 11:24 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <12001304701053-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:28 +0200
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
These were leftovers from the ktime_t conversion of pktgen.
Applied, th anks!
^ permalink raw reply
* Re: [PATCH 001/001] ipv4: enable use of 240/4 address space
From: Jan Engelhardt @ 2008-01-12 11:23 UTC (permalink / raw)
To: David Miller; +Cc: vaf, andi, netdev, linux-kernel
In-Reply-To: <20080111.174958.258783771.davem@davemloft.net>
On Jan 11 2008 17:49, David Miller wrote:
>From: Vince Fuller <vaf@cisco.com>
>Date: Fri, 11 Jan 2008 09:29:15 -0800
>
>> I leave it up to you, the developers, to decide if you want to use these
>> patches.
>
>Vince, please just ignore these turkeys who are dismissing
>your patch and respin it against current sources as I asked
>of you.
>
>I'll apply it, immediately, because it is the only correct
>course of action.
I strongly agree. Linux should set standards, or at least help them
become one.
^ permalink raw reply
* Re: [PATCH 6/8] [NETFILTER] xt_policy.c: kill some bloat
From: David Miller @ 2008-01-12 11:23 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev, kaber, netfilter-devel
In-Reply-To: <12001304703789-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:27 +0200
Ilpo, please post netfilter patches to netfilter-devel,
CC:'ing Patrick McHardy.
Patrick, please review, thanks.
> net/netfilter/xt_policy.c:
> policy_mt | -906
> 1 function changed, 906 bytes removed, diff: -906
>
> net/netfilter/xt_policy.c:
> match_xfrm_state | +427
> 1 function changed, 427 bytes added, diff: +427
>
> net/netfilter/xt_policy.o:
> 2 functions changed, 427 bytes added, 906 bytes removed, diff: -479
>
> Alternatively, this could be done by combining identical
> parts of the match_policy_in/out()
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
> net/netfilter/xt_policy.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c
> index 46ee7e8..45731ca 100644
> --- a/net/netfilter/xt_policy.c
> +++ b/net/netfilter/xt_policy.c
> @@ -33,7 +33,7 @@ xt_addr_cmp(const union xt_policy_addr *a1, const union xt_policy_addr *m,
> return false;
> }
>
> -static inline bool
> +static bool
> match_xfrm_state(const struct xfrm_state *x, const struct xt_policy_elem *e,
> unsigned short family)
> {
> --
> 1.5.0.6
>
^ permalink raw reply
* Re: [PATCH 5/8] [NETLINK] af_netlink: kill some bloat
From: David Miller @ 2008-01-12 11:22 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <12001304703302-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:26 +0200
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Applied.
^ permalink raw reply
* Re: [PATCH 4/8] [IPV6] route: kill some bloat
From: David Miller @ 2008-01-12 11:21 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <12001304703362-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:25 +0200
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Applied.
^ permalink raw reply
* Re: [PATCH 3/8] [XFRM] xfrm_policy: kill some bloat
From: David Miller @ 2008-01-12 11:20 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <12001304693917-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:24 +0200
> net/xfrm/xfrm_policy.c:
> xfrm_audit_policy_delete | -692
> xfrm_audit_policy_add | -692
> 2 functions changed, 1384 bytes removed, diff: -1384
>
> net/xfrm/xfrm_policy.c:
> xfrm_audit_common_policyinfo | +704
> 1 function changed, 704 bytes added, diff: +704
>
> net/xfrm/xfrm_policy.o:
> 3 functions changed, 704 bytes added, 1384 bytes removed, diff: -680
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Applied.
^ permalink raw reply
* Re: [PATCH 2/8] [TCP]: Uninline tcp_is_cwnd_limited
From: David Miller @ 2008-01-12 11:19 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <1200130469783-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:23 +0200
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Applied.
^ permalink raw reply
* Re: [PATCH 1/8] [TCP]: Uninline tcp_set_state
From: David Miller @ 2008-01-12 11:18 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <12001304691978-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:22 +0200
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Applied, thanks.
> +#endif
> +}
> +EXPORT_SYMBOL_GPL(tcp_set_state);
I fixed up the trailing whitespace on the "#endif" line.
^ permalink raw reply
* Re: What is XFRM_POLICY_LOCALOK for?
From: Herbert Xu @ 2008-01-12 11:16 UTC (permalink / raw)
To: Ian Brown; +Cc: netdev
In-Reply-To: <d0383f90801120031r142b2be1taee5efd190768407@mail.gmail.com>
Ian Brown <ianbrn@gmail.com> wrote:
>
> I tried to understand what XFRM_POLICY_LOCALOK is for. (include/linux/xfrm.h)
> It is defined thus:
> #define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */
It isn't used anywhere.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH 9/9] fix sparse warnings
From: Eric Dumazet @ 2008-01-12 11:16 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, Robert Olsson, netdev
In-Reply-To: <20080112064646.659443238@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]
Stephen Hemminger a écrit :
> Make FIB TRIE go through sparse checker without warnings.
>
> Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
Hi Stephen
While reviewing your patches (and fib code) I had some questions :
1) I was wondering isn't trie_collect_stats() a potential cpu hog
(big latency) ?
2) struct tnode layout
If tnode->bits is large enough, we allocate a big area
of memory but roughly use only first half of it.
We could use a better scheme with an extra indirection. For small
nodes, we use space right after tnode, but for big nodes, we allocate
a power of two set of pages, to exactly match the memory need.
3) 'pos' and 'bits' fields of 'struct tnode' might be converted to
plain uchar, instead of 5-bits fields, to reduce complexity for
generated code.
4) full_children & empty_children being 'unsigned short',
we probably are limited to 2^15 elements, but I could not
find this limit enforced somewhere.
[FIB]: Reduce text size of net/ipv4/fib_trie.o
In struct tnode, we use two fields of 5 bits for 'pos' and 'bits'.
Switching to plain 'unsigned char' (8 bits) take the same space
because of compiler alignments, and reduce text size by 435 bytes
on i386.
On i386 :
$ size net/ipv4/fib_trie.o.before_patch net/ipv4/fib_trie.o
text data bss dec hex filename
13714 4 64 13782 35d6 net/ipv4/fib_trie.o.before
13279 4 64 13347 3423 net/ipv4/fib_trie.o
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
[-- Attachment #2: fib_trie.patch --]
[-- Type: text/plain, Size: 605 bytes --]
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 2832610..4e91532 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -119,8 +119,8 @@ struct leaf_info {
struct tnode {
t_key key;
unsigned long parent;
- unsigned short pos:5; /* 2log(KEYLENGTH) bits needed */
- unsigned short bits:5; /* 2log(KEYLENGTH) bits needed */
+ unsigned char pos; /* 2log(KEYLENGTH) bits needed */
+ unsigned char bits; /* 2log(KEYLENGTH) bits needed */
unsigned short full_children; /* KEYLENGTH bits needed */
unsigned short empty_children; /* KEYLENGTH bits needed */
struct rcu_head rcu;
^ permalink raw reply related
* Re: [PATCH net-2.6.25 0/8] [NET]: More uninlining & related
From: David Miller @ 2008-01-12 11:16 UTC (permalink / raw)
To: ilpo.jarvinen; +Cc: netdev
In-Reply-To: <12001304691600-git-send-email-ilpo.jarvinen@helsinki.fi>
From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 12 Jan 2008 11:34:21 +0200
> First of all, I changed output encoding of git to utf-8, so I
> guess the encoding should not cause the same trouble for you.
I worked on a rebase of net-2.6.25 today and was able to
use emacs to fixup the encoding for all existing net-2.6.25
commits.
I've also put some things in place to avoid this problem in
the future.
Thanks.
> Here are couple of more to uninline things. Pretty
> straightforward except the EXPORT_SYMBOLs, I've no idea which
> is the right variant (feel free to fix them while applying :-)).
> Also pktgen uninlining is somewhat questionable because it's
> just a testing tool so feel free to drop it if it feels
> unnecessary (I could have asked first but it's just as easy to
> do it this way if not easier)...
>
> There were more dead static inlines found after inlines removed
> (gcc didn't report them otherwise) than in pktgen now included,
> but I'm not sure if I should send "by default" patches removing
> or #if 0'ing them?
Unless there is some pressing reason to keep the code around
it should be removed.
Anyways, I'll take a look.
^ permalink raw reply
* Re: [PATCH 0/3] bonding: 3 fixes for 2.6.24
From: Krzysztof Oledzki @ 2008-01-12 10:53 UTC (permalink / raw)
To: Andy Gospodarek
Cc: Jay Vosburgh, netdev, Jeff Garzik, David Miller, Herbert Xu
In-Reply-To: <20080109201709.GF8728@gospo.usersys.redhat.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 947 bytes --]
On Wed, 9 Jan 2008, Andy Gospodarek wrote:
> On Wed, Jan 09, 2008 at 09:54:56AM -0800, Jay Vosburgh wrote:
<CUT>
>> This should silence the lockdep (if I'm understanding what
>> everybody's saying), and keep the change set to a minimum. This might
>
> The lockdep problem is easy to trigger. The lockdep code does a good
> job of noticing problems quickly regardless of how easy the deadlocks
> are to create.
Exactly. All I need to do is to reboot my server, I have 100% probability
to get the warning.
>> not even be worth pushing for 2.6.24; I'm not exactly sure how difficult
>> the lockdep problem would be to trigger.
>>
>
> I'd like to see it go in there (for correct-ness) and to avoid hearing
> about these lockdep issues for the next few months until it makes it
> into 2.4.25.
Right. So, what is the final patch? I would like to test it if that's
possible. ;)
Best regards,
Krzysztof Olędzki
^ permalink raw reply
* [PATCH 6/8] [NETFILTER] xt_policy.c: kill some bloat
From: Ilpo Järvinen @ 2008-01-12 9:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1200130817405-git-send-email-ilpo.jarvinen@helsinki.fi>
net/netfilter/xt_policy.c:
policy_mt | -906
1 function changed, 906 bytes removed, diff: -906
net/netfilter/xt_policy.c:
match_xfrm_state | +427
1 function changed, 427 bytes added, diff: +427
net/netfilter/xt_policy.o:
2 functions changed, 427 bytes added, 906 bytes removed, diff: -479
Alternatively, this could be done by combining identical
parts of the match_policy_in/out()
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/netfilter/xt_policy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c
index 46ee7e8..45731ca 100644
--- a/net/netfilter/xt_policy.c
+++ b/net/netfilter/xt_policy.c
@@ -33,7 +33,7 @@ xt_addr_cmp(const union xt_policy_addr *a1, const union xt_policy_addr *m,
return false;
}
-static inline bool
+static bool
match_xfrm_state(const struct xfrm_state *x, const struct xt_policy_elem *e,
unsigned short family)
{
--
1.5.0.6
^ permalink raw reply related
* [PATCH 3/8] [XFRM] xfrm_policy: kill some bloat
From: Ilpo Järvinen @ 2008-01-12 9:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <12001308173014-git-send-email-ilpo.jarvinen@helsinki.fi>
net/xfrm/xfrm_policy.c:
xfrm_audit_policy_delete | -692
xfrm_audit_policy_add | -692
2 functions changed, 1384 bytes removed, diff: -1384
net/xfrm/xfrm_policy.c:
xfrm_audit_common_policyinfo | +704
1 function changed, 704 bytes added, diff: +704
net/xfrm/xfrm_policy.o:
3 functions changed, 704 bytes added, 1384 bytes removed, diff: -680
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/xfrm/xfrm_policy.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 534b29e..47219f9 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2367,8 +2367,8 @@ void __init xfrm_init(void)
}
#ifdef CONFIG_AUDITSYSCALL
-static inline void xfrm_audit_common_policyinfo(struct xfrm_policy *xp,
- struct audit_buffer *audit_buf)
+static void xfrm_audit_common_policyinfo(struct xfrm_policy *xp,
+ struct audit_buffer *audit_buf)
{
struct xfrm_sec_ctx *ctx = xp->security;
struct xfrm_selector *sel = &xp->selector;
--
1.5.0.6
^ permalink raw reply related
* [PATCH 7/8] [PKTGEN]: Kill dead static inlines
From: Ilpo Järvinen @ 2008-01-12 9:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <12001308172525-git-send-email-ilpo.jarvinen@helsinki.fi>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/core/pktgen.c | 94 -----------------------------------------------------
1 files changed, 0 insertions(+), 94 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index ede1fea..ebfb126 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -397,62 +397,6 @@ struct pktgen_thread {
#define REMOVE 1
#define FIND 0
-/* This code works around the fact that do_div cannot handle two 64-bit
- numbers, and regular 64-bit division doesn't work on x86 kernels.
- --Ben
-*/
-
-#define PG_DIV 0
-
-/* This was emailed to LMKL by: Chris Caputo <ccaputo@alt.net>
- * Function copied/adapted/optimized from:
- *
- * nemesis.sourceforge.net/browse/lib/static/intmath/ix86/intmath.c.html
- *
- * Copyright 1994, University of Cambridge Computer Laboratory
- * All Rights Reserved.
- *
- */
-static inline s64 divremdi3(s64 x, s64 y, int type)
-{
- u64 a = (x < 0) ? -x : x;
- u64 b = (y < 0) ? -y : y;
- u64 res = 0, d = 1;
-
- if (b > 0) {
- while (b < a) {
- b <<= 1;
- d <<= 1;
- }
- }
-
- do {
- if (a >= b) {
- a -= b;
- res += d;
- }
- b >>= 1;
- d >>= 1;
- }
- while (d);
-
- if (PG_DIV == type) {
- return (((x ^ y) & (1ll << 63)) == 0) ? res : -(s64) res;
- } else {
- return ((x & (1ll << 63)) == 0) ? a : -(s64) a;
- }
-}
-
-/* End of hacks to deal with 64-bit math on x86 */
-
-/** Convert to milliseconds */
-static inline __u64 tv_to_ms(const struct timeval *tv)
-{
- __u64 ms = tv->tv_usec / 1000;
- ms += (__u64) tv->tv_sec * (__u64) 1000;
- return ms;
-}
-
/** Convert to micro-seconds */
static inline __u64 tv_to_us(const struct timeval *tv)
{
@@ -461,39 +405,6 @@ static inline __u64 tv_to_us(const struct timeval *tv)
return us;
}
-static inline __u64 pg_div(__u64 n, __u32 base)
-{
- __u64 tmp = n;
- do_div(tmp, base);
- /* printk("pktgen: pg_div, n: %llu base: %d rv: %llu\n",
- n, base, tmp); */
- return tmp;
-}
-
-static inline __u64 pg_div64(__u64 n, __u64 base)
-{
- __u64 tmp = n;
-/*
- * How do we know if the architecture we are running on
- * supports division with 64 bit base?
- *
- */
-#if defined(__sparc_v9__) || defined(__powerpc64__) || defined(__alpha__) || defined(__x86_64__) || defined(__ia64__)
-
- do_div(tmp, base);
-#else
- tmp = divremdi3(n, base, PG_DIV);
-#endif
- return tmp;
-}
-
-static inline __u64 getCurMs(void)
-{
- struct timeval tv;
- do_gettimeofday(&tv);
- return tv_to_ms(&tv);
-}
-
static inline __u64 getCurUs(void)
{
struct timeval tv;
@@ -501,11 +412,6 @@ static inline __u64 getCurUs(void)
return tv_to_us(&tv);
}
-static inline __u64 tv_diff(const struct timeval *a, const struct timeval *b)
-{
- return tv_to_us(a) - tv_to_us(b);
-}
-
/* old include end */
static char version[] __initdata = VERSION;
--
1.5.0.6
^ permalink raw reply related
* [PATCH 4/8] [IPV6] route: kill some bloat
From: Ilpo Järvinen @ 2008-01-12 9:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1200130817664-git-send-email-ilpo.jarvinen@helsinki.fi>
net/ipv6/route.c:
ip6_pkt_prohibit_out | -130
ip6_pkt_discard | -261
ip6_pkt_discard_out | -130
ip6_pkt_prohibit | -261
4 functions changed, 782 bytes removed, diff: -782
net/ipv6/route.c:
ip6_pkt_drop | +300
1 function changed, 300 bytes added, diff: +300
net/ipv6/route.o:
5 functions changed, 300 bytes added, 782 bytes removed, diff: -482
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/ipv6/route.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 02354a7..d3b5811 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1762,8 +1762,7 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
* Drop the packet on the floor
*/
-static inline int ip6_pkt_drop(struct sk_buff *skb, int code,
- int ipstats_mib_noroutes)
+static int ip6_pkt_drop(struct sk_buff *skb, int code, int ipstats_mib_noroutes)
{
int type;
switch (ipstats_mib_noroutes) {
--
1.5.0.6
^ permalink raw reply related
* [PATCH 5/8] [NETLINK] af_netlink: kill some bloat
From: Ilpo Järvinen @ 2008-01-12 9:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <12001308171814-git-send-email-ilpo.jarvinen@helsinki.fi>
net/netlink/af_netlink.c:
netlink_realloc_groups | -46
netlink_insert | -49
netlink_autobind | -94
netlink_clear_multicast_users | -48
netlink_bind | -55
netlink_setsockopt | -54
netlink_release | -86
netlink_kernel_create | -47
netlink_change_ngroups | -56
9 functions changed, 535 bytes removed, diff: -535
net/netlink/af_netlink.c:
netlink_table_ungrab | +53
1 function changed, 53 bytes added, diff: +53
net/netlink/af_netlink.o:
10 functions changed, 53 bytes added, 535 bytes removed, diff: -482
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/netlink/af_netlink.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index be07f1b..21f9e30 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -193,7 +193,7 @@ static void netlink_table_grab(void)
}
}
-static inline void netlink_table_ungrab(void)
+static void netlink_table_ungrab(void)
__releases(nl_table_lock)
{
write_unlock_irq(&nl_table_lock);
--
1.5.0.6
^ permalink raw reply related
* [PATCH 1/8] [TCP]: Uninline tcp_set_state
From: Ilpo Järvinen @ 2008-01-12 9:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <12001308173969-git-send-email-ilpo.jarvinen@helsinki.fi>
net/ipv4/tcp.c:
tcp_close_state | -226
tcp_done | -145
tcp_close | -564
tcp_disconnect | -141
4 functions changed, 1076 bytes removed, diff: -1076
net/ipv4/tcp_input.c:
tcp_fin | -86
tcp_rcv_state_process | -164
2 functions changed, 250 bytes removed, diff: -250
net/ipv4/tcp_ipv4.c:
tcp_v4_connect | -209
1 function changed, 209 bytes removed, diff: -209
net/ipv4/arp.c:
arp_ignore | +5
1 function changed, 5 bytes added, diff: +5
net/ipv6/tcp_ipv6.c:
tcp_v6_connect | -158
1 function changed, 158 bytes removed, diff: -158
net/sunrpc/xprtsock.c:
xs_sendpages | -2
1 function changed, 2 bytes removed, diff: -2
net/dccp/ccids/ccid3.c:
ccid3_update_send_interval | +7
1 function changed, 7 bytes added, diff: +7
net/ipv4/tcp.c:
tcp_set_state | +238
1 function changed, 238 bytes added, diff: +238
built-in.o:
12 functions changed, 250 bytes added, 1695 bytes removed, diff: -1445
I've no explanation why some unrelated changes seem to occur
consistently as well (arp_ignore, ccid3_update_send_interval;
I checked the arp_ignore asm and it seems to be due to some
reordered of operation order causing some extra opcodes to be
generated). Still, the benefits are pretty obvious from the
codiff's results.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Andi Kleen <andi@firstfloor.org>
---
include/net/tcp.h | 35 +----------------------------------
net/ipv4/tcp.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 48081ad..306580c 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -926,40 +926,7 @@ static const char *statename[]={
"Close Wait","Last ACK","Listen","Closing"
};
#endif
-
-static inline void tcp_set_state(struct sock *sk, int state)
-{
- int oldstate = sk->sk_state;
-
- switch (state) {
- case TCP_ESTABLISHED:
- if (oldstate != TCP_ESTABLISHED)
- TCP_INC_STATS(TCP_MIB_CURRESTAB);
- break;
-
- case TCP_CLOSE:
- if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
- TCP_INC_STATS(TCP_MIB_ESTABRESETS);
-
- sk->sk_prot->unhash(sk);
- if (inet_csk(sk)->icsk_bind_hash &&
- !(sk->sk_userlocks & SOCK_BINDPORT_LOCK))
- inet_put_port(&tcp_hashinfo, sk);
- /* fall through */
- default:
- if (oldstate==TCP_ESTABLISHED)
- TCP_DEC_STATS(TCP_MIB_CURRESTAB);
- }
-
- /* Change state AFTER socket is unhashed to avoid closed
- * socket sitting in hash tables.
- */
- sk->sk_state = state;
-
-#ifdef STATE_TRACE
- SOCK_DEBUG(sk, "TCP sk=%p, State %s -> %s\n",sk, statename[oldstate],statename[state]);
-#endif
-}
+extern void tcp_set_state(struct sock *sk, int state);
extern void tcp_done(struct sock *sk);
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 34085e3..7d7b958 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1652,6 +1652,41 @@ recv_urg:
goto out;
}
+void tcp_set_state(struct sock *sk, int state)
+{
+ int oldstate = sk->sk_state;
+
+ switch (state) {
+ case TCP_ESTABLISHED:
+ if (oldstate != TCP_ESTABLISHED)
+ TCP_INC_STATS(TCP_MIB_CURRESTAB);
+ break;
+
+ case TCP_CLOSE:
+ if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
+ TCP_INC_STATS(TCP_MIB_ESTABRESETS);
+
+ sk->sk_prot->unhash(sk);
+ if (inet_csk(sk)->icsk_bind_hash &&
+ !(sk->sk_userlocks & SOCK_BINDPORT_LOCK))
+ inet_put_port(&tcp_hashinfo, sk);
+ /* fall through */
+ default:
+ if (oldstate==TCP_ESTABLISHED)
+ TCP_DEC_STATS(TCP_MIB_CURRESTAB);
+ }
+
+ /* Change state AFTER socket is unhashed to avoid closed
+ * socket sitting in hash tables.
+ */
+ sk->sk_state = state;
+
+#ifdef STATE_TRACE
+ SOCK_DEBUG(sk, "TCP sk=%p, State %s -> %s\n",sk, statename[oldstate],statename[state]);
+#endif
+}
+EXPORT_SYMBOL_GPL(tcp_set_state);
+
/*
* State processing on a close. This implements the state shift for
* sending our FIN frame. Note that we only send a FIN for some
--
1.5.0.6
^ permalink raw reply related
* [PATCH 2/8] [TCP]: Uninline tcp_is_cwnd_limited
From: Ilpo Järvinen @ 2008-01-12 9:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <12001308171262-git-send-email-ilpo.jarvinen@helsinki.fi>
net/ipv4/tcp_cong.c:
tcp_reno_cong_avoid | -65
1 function changed, 65 bytes removed, diff: -65
net/ipv4/arp.c:
arp_ignore | -5
1 function changed, 5 bytes removed, diff: -5
net/ipv4/tcp_bic.c:
bictcp_cong_avoid | -57
1 function changed, 57 bytes removed, diff: -57
net/ipv4/tcp_cubic.c:
bictcp_cong_avoid | -61
1 function changed, 61 bytes removed, diff: -61
net/ipv4/tcp_highspeed.c:
hstcp_cong_avoid | -63
1 function changed, 63 bytes removed, diff: -63
net/ipv4/tcp_hybla.c:
hybla_cong_avoid | -85
1 function changed, 85 bytes removed, diff: -85
net/ipv4/tcp_htcp.c:
htcp_cong_avoid | -57
1 function changed, 57 bytes removed, diff: -57
net/ipv4/tcp_veno.c:
tcp_veno_cong_avoid | -52
1 function changed, 52 bytes removed, diff: -52
net/ipv4/tcp_scalable.c:
tcp_scalable_cong_avoid | -61
1 function changed, 61 bytes removed, diff: -61
net/ipv4/tcp_yeah.c:
tcp_yeah_cong_avoid | -75
1 function changed, 75 bytes removed, diff: -75
net/ipv4/tcp_illinois.c:
tcp_illinois_cong_avoid | -54
1 function changed, 54 bytes removed, diff: -54
net/dccp/ccids/ccid3.c:
ccid3_update_send_interval | -7
ccid3_hc_tx_packet_recv | +7
2 functions changed, 7 bytes added, 7 bytes removed, diff: +0
net/ipv4/tcp_cong.c:
tcp_is_cwnd_limited | +88
1 function changed, 88 bytes added, diff: +88
built-in.o:
14 functions changed, 95 bytes added, 642 bytes removed, diff: -547
...Again some gcc artifacts visible as well.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/net/tcp.h | 22 +---------------------
net/ipv4/tcp_cong.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 306580c..7de4ea3 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -786,27 +786,7 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp)
{
return tp->snd_una + tp->snd_wnd;
}
-
-/* RFC2861 Check whether we are limited by application or congestion window
- * This is the inverse of cwnd check in tcp_tso_should_defer
- */
-static inline int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
-{
- const struct tcp_sock *tp = tcp_sk(sk);
- u32 left;
-
- if (in_flight >= tp->snd_cwnd)
- return 1;
-
- if (!sk_can_gso(sk))
- return 0;
-
- left = tp->snd_cwnd - in_flight;
- if (sysctl_tcp_tso_win_divisor)
- return left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd;
- else
- return left <= tcp_max_burst(tp);
-}
+extern int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight);
static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss,
const struct sk_buff *skb)
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 4451750..3a6be23 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -274,6 +274,27 @@ int tcp_set_congestion_control(struct sock *sk, const char *name)
return err;
}
+/* RFC2861 Check whether we are limited by application or congestion window
+ * This is the inverse of cwnd check in tcp_tso_should_defer
+ */
+int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
+{
+ const struct tcp_sock *tp = tcp_sk(sk);
+ u32 left;
+
+ if (in_flight >= tp->snd_cwnd)
+ return 1;
+
+ if (!sk_can_gso(sk))
+ return 0;
+
+ left = tp->snd_cwnd - in_flight;
+ if (sysctl_tcp_tso_win_divisor)
+ return left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd;
+ else
+ return left <= tcp_max_burst(tp);
+}
+EXPORT_SYMBOL_GPL(tcp_is_cwnd_limited);
/*
* Slow start is used when congestion window is less than slow start
--
1.5.0.6
^ 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