* Re: [RFC PATCH 1/4] PHY Abstraction Layer III (now with more splitiness)
From: Andy Fleming @ 2005-07-27 18:46 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Netdev, linuxppc-embedded, Francois Romieu
In-Reply-To: <1122487708.20267@shark.he.net>
On Jul 27, 2005, at 13:08, Randy Dunlap wrote:
>
>
>> On Jul 25, 2005, at 16:06, Francois Romieu wrote:
>>
>>
>>
>>>> +int mdiobus_register(struct mii_bus *bus)
>>>> +{
>>>> + int i;
>>>> + int err = 0;
>>>> +
>>>> + spin_lock_init(&bus->mdio_lock);
>>>> +
>>>> + if (NULL == bus || NULL == bus->name ||
>>>> + NULL == bus->read ||
>>>> + NULL == bus->write)
>>>>
>>>>
>>>
>>> Be spartan:
>>> if (!bus || !bus->name || !bus->read || !bus->write)
>>>
>>
>>
>> I think we have to agree to disagree here. I could be convinced, but
>> I'm partial to using NULL explicitly.
>>
>
> But there are 2 issues here (at least). One is to use NULL or
> not. The other is using (constant == var) or (var == constant).
>
> It's not described in CodingStlye afaik, but most recent email
> on the subject strongly prefers (var == constant) [in my
> unscientific survey -- of bits in my head].
>
> So using the suggested style will fix both of these. :)
Ok, here I won't agree to disagree with you. !foo as a check for
NULL is a reasonable idea, but not my style. If that's the preferred
style for the kernel, I will do that.
But (var == constant) is a style that asks for errors. By putting
the constant first in these checks, you never run the risk of leaving
a bug like this:
if (dev = NULL)
...
This kind of error is quite frustrating to detect, and the eye will
often miss it when scanning for errors. If you follow constant ==
var, though, then the bug looks like this:
if (NULL = dev)
which is instantly caught by the compiler.
Just my 32 cents
>
>
>>>> + /* Otherwise, we allocate the device, and initialize the
>>>> + * default values */
>>>> + dev = kmalloc(sizeof(*dev), GFP_KERNEL);
>>>> +
>>>> + if (NULL == dev) {
>>>> + errno = -ENOMEM;
>>>> + return NULL;
>>>> + }
>>>> +
>>>> + memset(dev, 0, sizeof(*dev));
>>>>
>>>>
>>>
>>> The kernel provides kcalloc.
>>>
>>
>>
>> I went looking for it, and found it in fs/cifs/misc.c. I'm hesitant
>> to link to a function defined in the filesystem code just to save 1
>> line of code
>>
>
> It's more global than that.
Should we move the function, then, to include/linux/slab.h? Or
somewhere else?
^ permalink raw reply
* [-mm patch] include/net/ieee80211.h must #include <linux/wireless.h>
From: Adrian Bunk @ 2005-07-27 19:51 UTC (permalink / raw)
To: Andrew Morton; +Cc: jgarzik, jkmaline, hostap, netdev, linux-kernel
gcc found an (although perhaps harmless) bug:
<-- snip -->
...
CC net/ieee80211/ieee80211_crypt.o
In file included from net/ieee80211/ieee80211_crypt.c:21:
include/net/ieee80211.h:26:5: warning: "WIRELESS_EXT" is not defined
CC net/ieee80211/ieee80211_crypt_wep.o
In file included from net/ieee80211/ieee80211_crypt_wep.c:20:
include/net/ieee80211.h:26:5: warning: "WIRELESS_EXT" is not defined
CC net/ieee80211/ieee80211_crypt_ccmp.o
CC net/ieee80211/ieee80211_crypt_tkip.o
In file included from net/ieee80211/ieee80211_crypt_tkip.c:23:
include/net/ieee80211.h:26:5: warning: "WIRELESS_EXT" is not defined
...
<-- snip -->
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 22 Jul 2005
--- linux-2.6.13-rc3-mm1-full/include/net/ieee80211.h.old 2005-07-22 18:37:57.000000000 +0200
+++ linux-2.6.13-rc3-mm1-full/include/net/ieee80211.h 2005-07-22 18:38:10.000000000 +0200
@@ -22,6 +22,7 @@
#define IEEE80211_H
#include <linux/if_ether.h> /* ETH_ALEN */
#include <linux/kernel.h> /* ARRAY_SIZE */
+#include <linux/wireless.h>
#if WIRELESS_EXT < 17
#define IW_QUAL_QUAL_INVALID 0x10
^ permalink raw reply
* Re: [RFC PATCH 1/4] PHY Abstraction Layer III (now with more splitiness)
From: Francois Romieu @ 2005-07-27 19:56 UTC (permalink / raw)
To: Andy Fleming; +Cc: Netdev, Randy Dunlap, linuxppc-embedded
In-Reply-To: <EDA214E7-5655-4900-AF1A-FC736681DC74@freescale.com>
Andy Fleming <afleming@freescale.com> :
[kcalloc]
> Should we move the function, then, to include/linux/slab.h? Or
> somewhere else?
It is already in mm/slab.c
[rc = request_irq(...)]
It appears in drivers/net/*c. Jeff Garzik used to suggest something
similar but it does not matter as long as you do not need to return
an error status (KERN_ERR is probably a bit too strong then).
[initialization of struct phy_setting settings]
#define NITZ(d,t,s) { .speed = s, .duplex = d, .setting = t }
static struct phy_setting settings[] = {
NITZ(DUPLEX_FULL, SUPPORTED_10000baseT_Full, 10000),
NITZ(DUPLEX_FULL, SUPPORTED_1000baseT_Full, SPEED_1000),
NITZ(DUPLEX_HALF, SUPPORTED_1000baseT_Half, SPEED_1000),
NITZ(DUPLEX_FULL, SUPPORTED_100baseT_Full, SPEED_100),
NITZ(DUPLEX_HALF, SUPPORTED_100baseT_Half, SPEED_100),
NITZ(DUPLEX_FULL, SUPPORTED_10baseT_Full, SPEED_10),
NITZ(DUPLEX_HALF, SUPPORTED_10baseT_Half, SPEED_10),
};
#undef NITZ
--
Ueimor
^ permalink raw reply
* Re: [2.6 patch] NETCONSOLE must depend on INET
From: David S. Miller @ 2005-07-27 20:19 UTC (permalink / raw)
To: mpm; +Cc: bunk, jgarzik, netdev, linux-kernel, shemminger
In-Reply-To: <20050727023636.GP12006@waste.org>
From: Matt Mackall <mpm@selenic.com>
Date: Tue, 26 Jul 2005 19:36:37 -0700
> # HG changeset patch
> # User mpm@selenic.com
> # Node ID 6cdd6f36d53678a016cfbf5ce667cbd91504d538
> # Parent 75716ae25f9d87ee2a5ef7c4df2d8f86e0f3f762
> Move in_aton from net/ipv4/utils.c to net/core/utils.c
This patch doesn't apply, in the current 2.6.x GIT tree
NETCONSOLE does not depend on NETDEVICES.
Please fix up this patch so that I can apply it.
Thanks.
^ permalink raw reply
* Re: [2.6 patch] NETCONSOLE must depend on INET
From: Matt Mackall @ 2005-07-27 20:46 UTC (permalink / raw)
To: David S. Miller; +Cc: bunk, jgarzik, netdev, linux-kernel, shemminger
In-Reply-To: <20050727.131900.59654701.davem@davemloft.net>
On Wed, Jul 27, 2005 at 01:19:00PM -0700, David S. Miller wrote:
> From: Matt Mackall <mpm@selenic.com>
> Date: Tue, 26 Jul 2005 19:36:37 -0700
>
> > # HG changeset patch
> > # User mpm@selenic.com
> > # Node ID 6cdd6f36d53678a016cfbf5ce667cbd91504d538
> > # Parent 75716ae25f9d87ee2a5ef7c4df2d8f86e0f3f762
> > Move in_aton from net/ipv4/utils.c to net/core/utils.c
>
> This patch doesn't apply, in the current 2.6.x GIT tree
> NETCONSOLE does not depend on NETDEVICES.
Odd, gitweb of Linus' tree seems to disagree. I see it depends on
NETDEVICES && INET && EXPERIMENTAL. NETDEVICES has been there since
the beginning of git history and according to my Mercurial import from
BKCVS, it's been dependent on NETDEVICES since I first submitted it.
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply
* Re: 2.6.13-rc3-mm2
From: Andrew Morton @ 2005-07-27 21:11 UTC (permalink / raw)
To: Andrew James Wade; +Cc: linux-kernel, netdev, David S. Miller
In-Reply-To: <200507271648.52745.ajwade@cpe00095b3131a0-cm0011ae8cd564.cpe.net.cable.rogers.com>
Andrew James Wade <andrew.j.wade@gmail.com> wrote:
>
> Hello, my kernel crashes on boot with the following BUG():
Indeed it will.
> ENABLING IO-APIC IRQs
> ..TIMER: vector=0x31 pin1=2 pin2=-1
> softlockup thread 0 started up.
> NET: Registered protocol family 16
> ------------[ cut here ]------------
> kernel BUG at kernel/sched.c:2888!
> invalid operand: 0000 [#1]
> PREEMPT
> last sysfs file:
> CPU: 0
> EIP: 0060:[<c0116745>] Not tainted VLI
> EFLAGS: 00010202 (2.6.13-rc3-mm2)
> EIP is at sub_preempt_count+0x35/0x40
> eax: dff80000 ebx: 00000000 ecx: 00000001 edx: 00000001
> esi: dffc3d18 edi: 00000000 ebp: dff81f50 esp: dff81f50
> ds: 007b es: 007b ss: 0068
> Process swapper (pid: 1, threadinfo=dff80000 task=c14d9a10)
> Stack: 00000000 c038a5fe 00000000 00000000 00000003 c048f5e0 c048f780 c048f780
> 00000000 dff8d544 c038bcaa 00000000 00000000 c0386d30 dffc3d18 0000000f
> 0000000f dff8d544 00000000 c04f2bf3 00000021 00000021 c04f2e8d 00000000
> Call Trace:
> [<c038a5fe>] netlink_create+0x5e/0x120
> [<c038bcaa>] netlink_kernel_create+0x13a/0x240
> [<c0386d30>] rtnetlink_rcv+0x0/0x390
> [<c04f2bf3>] rtnetlink_init+0x53/0xa0
> [<c04f2e8d>] netlink_proto_init+0x18d/0x200
> [<c04d87db>] do_initcalls+0x2b/0xc0
> [<c015aee5>] kern_mount+0x15/0x19
> [<c01002b0>] init+0x0/0x110
> [<c01002df>] init+0x2f/0x110
> [<c0100f28>] kernel_thread_helper+0x0/0x18
> [<c0100f2d>] kernel_thread_helper+0x5/0x18
> Code: 89 e5 3b 50 14 7f 24 81 fa fe 00 00 00 76 0c b8 00 e0 ff ff 21 e0 29 50 14 c9 c3 80 78 14 00 75 ee 0f 0b 4c 0b 66 50 41 c0 eb e4
> <0f> 0b 48 0b 66 50 41 c0 eb d2 90 55 8b 40 04 89 e5 c9 e9 54 f5
> <0>Kernel panic - not syncing: Attempted to kill init!
>
Unbalanced netlink_table_ungrab() in the netlink stuff in git-net.patch.
--- devel/net/netlink/af_netlink.c~netlink-locking-fix 2005-07-27 14:10:07.000000000 -0700
+++ devel-akpm/net/netlink/af_netlink.c 2005-07-27 14:10:16.000000000 -0700
@@ -349,12 +349,12 @@ static int netlink_create(struct socket
netlink_table_grab();
if (!nl_table[protocol].hash.entries) {
- netlink_table_ungrab();
#ifdef CONFIG_KMOD
/* We do 'best effort'. If we find a matching module,
* it is loaded. If not, we don't return an error to
* allow pure userspace<->userspace communication. -HW
*/
+ netlink_table_ungrab();
request_module("net-pf-%d-proto-%d", PF_NETLINK, protocol);
netlink_table_grab();
#endif
_
^ permalink raw reply
* Re: [2.6 patch] NETCONSOLE must depend on INET
From: David S. Miller @ 2005-07-27 21:13 UTC (permalink / raw)
To: mpm; +Cc: bunk, jgarzik, netdev, linux-kernel, shemminger
In-Reply-To: <20050727204622.GI12006@waste.org>
From: Matt Mackall <mpm@selenic.com>
Date: Wed, 27 Jul 2005 13:46:22 -0700
> Odd, gitweb of Linus' tree seems to disagree. I see it depends on
> NETDEVICES && INET && EXPERIMENTAL. NETDEVICES has been there since
> the beginning of git history and according to my Mercurial import from
> BKCVS, it's been dependent on NETDEVICES since I first submitted it.
Sorry, that's a result of a local change I just added
to fix up presentation the net device family Kconfig's.
^ permalink raw reply
* Re: 2.6.13-rc3-mm2
From: David S. Miller @ 2005-07-27 21:27 UTC (permalink / raw)
To: akpm; +Cc: andrew.j.wade, linux-kernel, netdev
In-Reply-To: <20050727141151.4a97843f.akpm@osdl.org>
From: Andrew Morton <akpm@osdl.org>
Date: Wed, 27 Jul 2005 14:11:51 -0700
> Unbalanced netlink_table_ungrab() in the netlink stuff in git-net.patch.
Applied to net-2.6.14, thanks Andrew.
^ permalink raw reply
* Re: [RFC PATCH 1/4] PHY Abstraction Layer III (now with more splitiness)
From: Randy Dunlap @ 2005-07-27 21:34 UTC (permalink / raw)
To: Andy Fleming, Randy Dunlap, Francois Romieu, Netdev,
linuxppc-embedded
> On Jul 27, 2005, at 13:08, Randy Dunlap wrote:
>
> >
> >
> >> On Jul 25, 2005, at 16:06, Francois Romieu wrote:
> >>
> >>
> >>
> >>>> +int mdiobus_register(struct mii_bus *bus)
> >>>> +{
> >>>> + int i;
> >>>> + int err = 0;
> >>>> +
> >>>> + spin_lock_init(&bus->mdio_lock);
> >>>> +
> >>>> + if (NULL == bus || NULL == bus->name ||
> >>>> + NULL == bus->read ||
> >>>> + NULL == bus->write)
> >>>>
> >>>>
> >>>
> >>> Be spartan:
> >>> if (!bus || !bus->name || !bus->read || !bus->write)
> >>>
> >>
> >>
> >> I think we have to agree to disagree here. I could be convinced, but
> >> I'm partial to using NULL explicitly.
> >>
> >
> > But there are 2 issues here (at least). One is to use NULL or
> > not. The other is using (constant == var) or (var == constant).
> >
> > It's not described in CodingStlye afaik, but most recent email
> > on the subject strongly prefers (var == constant) [in my
> > unscientific survey -- of bits in my head].
> >
> > So using the suggested style will fix both of these. :)
>
>
> Ok, here I won't agree to disagree with you. !foo as a check for
> NULL is a reasonable idea, but not my style. If that's the preferred
> style for the kernel, I will do that.
>
> But (var == constant) is a style that asks for errors. By putting
> the constant first in these checks, you never run the risk of leaving
> a bug like this:
>
> if (dev = NULL)
> ...
>
> This kind of error is quite frustrating to detect, and the eye will
> often miss it when scanning for errors. If you follow constant ==
> var, though, then the bug looks like this:
>
> if (NULL = dev)
>
> which is instantly caught by the compiler.
>
> Just my 32 cents
Yes, we know about that argument. :)
> >>>> + /* Otherwise, we allocate the device, and initialize the
> >>>> + * default values */
> >>>> + dev = kmalloc(sizeof(*dev), GFP_KERNEL);
> >>>> +
> >>>> + if (NULL == dev) {
> >>>> + errno = -ENOMEM;
> >>>> + return NULL;
> >>>> + }
> >>>> +
> >>>> + memset(dev, 0, sizeof(*dev));
> >>>>
> >>>>
> >>>
> >>> The kernel provides kcalloc.
> >>>
> >>
> >>
> >> I went looking for it, and found it in fs/cifs/misc.c. I'm hesitant
> >> to link to a function defined in the filesystem code just to save 1
> >> line of code
> >>
> >
> > It's more global than that.
>
>
> Should we move the function, then, to include/linux/slab.h? Or
> somewhere else?
It's there, like Francois said. Get use a current tree.
---
~Randy
^ permalink raw reply
* Re: [PATCH 2.6.13rc3] IPv6: Check interface bindings on IPv6 raw socket reception
From: David S. Miller @ 2005-07-27 21:38 UTC (permalink / raw)
To: andrew; +Cc: netdev, yoshfuji, linux-kernel
In-Reply-To: <20050723180442.GB6731@mcdonald.org.uk>
From: Andrew McDonald <andrew@mcdonald.org.uk>
Date: Sat, 23 Jul 2005 19:04:43 +0100
> Take account of whether a socket is bound to a particular device when
> selecting an IPv6 raw socket to receive a packet. Also perform this
> check when receiving IPv6 packets with router alert options.
>
> Signed-off-by: Andrew McDonald <andrew@mcdonald.org.uk>
Applied, thanks Andrew.
^ permalink raw reply
* Re: [PATCH 2.6.13rc3] IPv6: Check interface bindings on IPv6 raw socket reception
From: David S. Miller @ 2005-07-27 21:38 UTC (permalink / raw)
To: kaber; +Cc: andrew, netdev, yoshfuji, linux-kernel
In-Reply-To: <42E32980.2090604@trash.net>
From: Patrick McHardy <kaber@trash.net>
Date: Sun, 24 Jul 2005 07:39:12 +0200
> [IPV4/6]: Check if packet was actually delivered to a raw socket to decide whether to send an ICMP unreachable
>
> Signed-off-by: Patrick McHardy <kaber@trash.net>
Applied, thanks Patrick.
^ permalink raw reply
* Re: [PATCH] emac: add bamboo support
From: Eugene Surovegin @ 2005-07-28 6:59 UTC (permalink / raw)
To: Matt Porter; +Cc: jgarzik, netdev, wfarnsworth
In-Reply-To: <20050727104247.C1114@cox.net>
On Wed, Jul 27, 2005 at 10:42:47AM -0700, Matt Porter wrote:
> Adds support for the Bamboo board phys in the EMAC driver.
> Please apply.
>
> Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
> Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
>
[snip]
> +#ifdef CONFIG_BAMBOO
> +static int ac104_init(struct mii_phy *phy)
> +{
> + /*
> + * SW2 on the Bamboo is used for ethernet configuration and is accessed
> + * via the CONFIG2 register in the FPGA. If the ANEG pin is set,
> + * overwrite the supported features with the settings in SW2.
> + */
I wonder, how this SW2 works. Is it just a way to tell software not to
use autoneg and force some settings, or it disables autoneg on hw
level (I'm kinda doubt that)?
If this is just some board specific configuration option which doesn't
affect this PHY directly, let's drop this stuff completely and always
use autoneg, if user wants to force something - he should ethtool.
--
Eugene
^ permalink raw reply
* Re: [RFC PATCH 1/4] PHY Abstraction Layer III (now with more splitiness)
From: Jörn Engel @ 2005-07-28 9:18 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Netdev, linuxppc-embedded, Francois Romieu
In-Reply-To: <1122500059.28777@shark.he.net>
On Wed, 27 July 2005 14:34:19 -0700, Randy Dunlap wrote:
> >
> > Ok, here I won't agree to disagree with you. !foo as a check for
> > NULL is a reasonable idea, but not my style. If that's the preferred
> > style for the kernel, I will do that.
> >
> > But (var == constant) is a style that asks for errors. By putting
> > the constant first in these checks, you never run the risk of leaving
> > a bug like this:
> >
> > if (dev = NULL)
> > ...
> >
> > This kind of error is quite frustrating to detect, and the eye will
> > often miss it when scanning for errors. If you follow constant ==
> > var, though, then the bug looks like this:
> >
> > if (NULL = dev)
> >
> > which is instantly caught by the compiler.
> >
> > Just my 32 cents
>
> Yes, we know about that argument. :)
The counter-argument basically goes like this:
1. All relevant compilers (GCC) warn on "if (dev = NULL)", so you will
only miss the bug if you ignore compiler warnings. Ignoring compiler
warnings is not generally endorsed by the kernel crowd.
2. Very hard to read, "if (NULL = dev)" is. Reversing the order is a
fun thing to do for small green characters in fantasy and scifi
stories and fairly popular in peotry as well. But understanding the
meaning of reverse order sentences takes more time. In the kernel,
peer review is an important aspect and making the code hard to read
hurts peer review.
And maybe you can add another one:
3. Im my personal experience, reverse order comparisons were a good
indicator of buggy code.
Jörn
--
Schrödinger's cat is <BLINK>not</BLINK> dead.
-- Illiad
^ permalink raw reply
* Re: [PATCH 2.6.12.2] XFRM: BEET IPsec mode for Linux
From: Herbert Xu @ 2005-07-28 11:36 UTC (permalink / raw)
To: diego.beltrami
Cc: netdev, infrahip, gurtov, jeffrey.m.ahrenholz, kristian.slavov,
hipl-users, hipsec
In-Reply-To: <1122295307.14873.37.camel@odysse>
Diego Beltrami <diego.beltrami@hiit.fi> wrote:
>
> we have been working for three months to implement a new IPsec mode,
> the "BEET" mode, for Linux. Below is a link to the BEET specification
> and
> the abstract:
>
> http://www.ietf.org/internet-drafts/draft-nikander-esp-beet-mode-03.txt
Thanks for the patch guys, this is really interesting.
> extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type);
> diff -urN linux-2.6.12.2/net/ipv4/esp4.c
> linux-beet-2.6.12.2/net/ipv4/esp4.c
> --- linux-2.6.12.2/net/ipv4/esp4.c 2005-06-30 02:00:53.000000000 +0300
> +++ linux-beet-2.6.12.2/net/ipv4/esp4.c 2005-07-25 14:39:11.000000000
Although the document only talks about ESP, as far as I can see
the encapsulation can be applied to AH/IPComp just as well.
So how about moving this stuff to the generic xfrm_input/xfrm_output
functions?
Also, if you're going to do cross-family transforms, it should be
done for both BEET and plain tunnel-mode.
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
* [PATCH] Add prefetches in net/ipv4/route.c
From: Eric Dumazet @ 2005-07-28 15:52 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <42CA390C.9000801@cosmosbay.com>
[-- Attachment #1: Type: text/plain, Size: 219 bytes --]
[NET] : Adds prefetches in route hash list traversals.
The actual code doesnt use a prefetch enabled macro like list_for_each_rcu(), so manually
add prefetch() hints.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
[-- Attachment #2: route.prefetches --]
[-- Type: text/plain, Size: 1606 bytes --]
diff -Nru linux-2.6.13-rc3/net/ipv4/route.c linux-2.6.13-rc3-ed/net/ipv4/route.c
--- linux-2.6.13-rc3/net/ipv4/route.c 2005-07-13 06:46:46.000000000 +0200
+++ linux-2.6.13-rc3-ed/net/ipv4/route.c 2005-07-28 17:20:21.000000000 +0200
@@ -1148,6 +1148,7 @@
while ((rth = rcu_dereference(*rthp)) != NULL) {
struct rtable *rt;
+ prefetch(rth->u.rt_next);
if (rth->fl.fl4_dst != daddr ||
rth->fl.fl4_src != skeys[i] ||
rth->fl.fl4_tos != tos ||
@@ -1401,6 +1402,7 @@
rcu_read_lock();
for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
rth = rcu_dereference(rth->u.rt_next)) {
+ prefetch(rth->u.rt_next);
if (rth->fl.fl4_dst == daddr &&
rth->fl.fl4_src == skeys[i] &&
rth->rt_dst == daddr &&
@@ -2094,6 +2096,7 @@
rcu_read_lock();
for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
rth = rcu_dereference(rth->u.rt_next)) {
+ prefetch(rth->u.rt_next);
if (rth->fl.fl4_dst == daddr &&
rth->fl.fl4_src == saddr &&
rth->fl.iif == iif &&
@@ -2565,6 +2568,7 @@
rcu_read_lock_bh();
for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
rth = rcu_dereference(rth->u.rt_next)) {
+ prefetch(rth->u.rt_next);
if (rth->fl.fl4_dst == flp->fl4_dst &&
rth->fl.fl4_src == flp->fl4_src &&
rth->fl.iif == 0 &&
@@ -2819,6 +2823,7 @@
rcu_read_lock_bh();
for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt;
rt = rcu_dereference(rt->u.rt_next), idx++) {
+ prefetch(rt->u.rt_next);
if (idx < s_idx)
continue;
skb->dst = dst_clone(&rt->u.dst);
^ permalink raw reply
* Re: Upcoming 2.6.13 and hostap driver
From: Jeff Garzik @ 2005-07-28 16:15 UTC (permalink / raw)
To: Jar; +Cc: linux-kernel, Netdev List
In-Reply-To: <1958.192.168.0.150.1122549325.squirrel@kone>
Jar wrote:
> Hostap driver has been in the -mm tree for a long time. Any plans to merge it to
> upcoming 2.6.13?
It needs to be merged with the ieee80211 generic layer, before it can go
upstream.
Jeff
^ permalink raw reply
* Re: [PATCH] emac: add bamboo support
From: Wade Farnsworth @ 2005-07-28 17:25 UTC (permalink / raw)
To: Eugene Surovegin; +Cc: Matt Porter, jgarzik, netdev
In-Reply-To: <20050728065943.GA16041@gate.ebshome.net>
On Wed, 2005-07-27 at 23:59, Eugene Surovegin wrote:
> On Wed, Jul 27, 2005 at 10:42:47AM -0700, Matt Porter wrote:
> > Adds support for the Bamboo board phys in the EMAC driver.
> > Please apply.
> >
> > Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
> > Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
> >
>
> [snip]
>
> > +#ifdef CONFIG_BAMBOO
> > +static int ac104_init(struct mii_phy *phy)
> > +{
> > + /*
> > + * SW2 on the Bamboo is used for ethernet configuration and is accessed
> > + * via the CONFIG2 register in the FPGA. If the ANEG pin is set,
> > + * overwrite the supported features with the settings in SW2.
> > + */
>
> I wonder, how this SW2 works. Is it just a way to tell software not to
> use autoneg and force some settings, or it disables autoneg on hw
> level (I'm kinda doubt that)?
Yes, SW2 is completely ignored by the PHY.
>
> If this is just some board specific configuration option which doesn't
> affect this PHY directly, let's drop this stuff completely and always
> use autoneg, if user wants to force something - he should ethtool.
I guess my comment does not explain the real reason for this function.
The Rev. 0 Bamboo has improperly biased RJ45 sockets. This causes the
PHY to only work at 10 Mbps. One can remove the inductors L17 and L18
from the board to enable 100Mbps, but this also disables 10Mbps.
Attempting to bring up ethernet in one of the unavailable speeds causes
ethernet to hang until the board is reset. AMCC has no plans to replace
the Rev. 0, so there are users that will need some reliable way to
determine which speed is available and select that speed at boot.
A previous version of the patch did this by attempting to determine the
board rev. If a rev 0 was found, then keep the speed determined by the
firmware, since we know that works. Rev 1's would be allowed to use
both speeds. The board rev was determined by reading the cpu rev from
the PVR. This assumes that all rev 0 boards have rev A cpu's and rev 1
boards have rev B cpu's. I believe you had some reservations about this
method.
PIBS uses a similar method to what this patch does. In order to
tftpboot using a 10Mbps-enabled rev. 0 the ANEG pin and the Force
100Mbps pin must be disabled. Similarly, the patch will read those same
pins and only allow the speed selected. Additionally, the patch reads
the Duplex pin and determines which duplex mode is available. The
duplex has no bearing on the above bug, so this can be safely removed.
However, since we're already determining phy speed using SW2, I think
users would expect us to determine the duplex mode in the same manner.
I realize that this departs from what the other boards/phys do in this
driver, but we do need some way for the appropriate speed to be selected
on the rev. 0 boards. If you know of a better way of doing this please
let me know.
-Wade Farnsworth
^ permalink raw reply
* Re: [PATCH] emac: add bamboo support
From: Eugene Surovegin @ 2005-07-28 17:31 UTC (permalink / raw)
To: Wade Farnsworth; +Cc: Matt Porter, jgarzik, netdev
In-Reply-To: <1122571506.22059.146.camel@rhino.az.mvista.com>
On Thu, Jul 28, 2005 at 10:25:07AM -0700, Wade Farnsworth wrote:
> If you know of a better way of doing this please let me know.
Yes, I do and IIRC told you last time. Make it generic - move all
board specific stuff where it belongs - board support files. Add
additional field(s) to ocp_func_emac_data which will allow EMAC driver
to override PHY modes, the same way we specify PHY id now, for
example.
With this approach, we won't have to add another board specific crap
to the driver next time hw vendor fuck ups their hw.
--
Eugene
^ permalink raw reply
* Re: [PATCH] Add prefetches in net/ipv4/route.c
From: David S. Miller @ 2005-07-28 19:39 UTC (permalink / raw)
To: dada1; +Cc: netdev
In-Reply-To: <42E8FF24.9070009@cosmosbay.com>
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Thu, 28 Jul 2005 17:52:04 +0200
> [NET] : Adds prefetches in route hash list traversals.
>
> The actual code doesnt use a prefetch enabled macro like
> list_for_each_rcu(), so manually add prefetch() hints.
and the measured performance improvement is?
^ permalink raw reply
* [PATCH] update to the nf_log logging api
From: Harald Welte @ 2005-07-28 20:04 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist
[-- Attachment #1.1: Type: text/plain, Size: 761 bytes --]
Hi Dave, please apply to your net-2.6.14 tree.
I'm still working out some glitches with nfnetlink_log, but will submit
it fairly soon, too. I've also already some patch to make ebt_ulog.c
use the nfnetlink_log core. Stay tuned...
[oh yes, I didn't forget my 'virtual ethernet device' code, either. It
is just sitting in a lower priority queue at this time]
Thanks,
Harald
--
- Harald Welte <laforge@netfilter.org> http://netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #1.2: 16-nf_logger.patch --]
[-- Type: text/plain, Size: 30957 bytes --]
[NETFILTER] Extend netfilter logging API
This patch is in preparation to nfnetlink_log:
- loggers now have to register struct nf_logger instead of nf_logfn
- nf_log_unregister() replaced by nf_log_unregister_pf() and
nf_log_unregister_logger()
- add comment to ip[6]t_LOG.h to assure nobody redefines flags
- add /proc/net/netfilter/nf_log to tell user which logger is currently
registered for which address family
- if user has configured logging, but no logging backend (logger) is
available, always spit a message to syslog, not just the first time.
- split ip[6]t_LOG.c into two parts:
Backend: Always try to register as logger for the respective address family
Frontend: Always log via nf_log_packet() API
- modify all users of nf_log_packet() to accomodate additional argument
Signed-off-by: Harald Welte <laforge@netfilter.org>
---
commit 3770e25a01055bfa8bee52ed16666db1f3a5141f
tree bb6232f07be1a0ec617f99d0e479964ac2d66119
parent 70715270f9cedc76099ed628b5444a11127912ca
author laforge <laforge@netfilter.org> Do, 28 Jul 2005 21:27:14 +0200
committer laforge <laforge@netfilter.org> Do, 28 Jul 2005 21:27:14 +0200
include/linux/netfilter.h | 48 +++++++++-
include/linux/netfilter_ipv4/ipt_LOG.h | 1
include/linux/netfilter_ipv6/ip6t_LOG.h | 1
net/core/netfilter.c | 127 +++++++++++++++++++++++---
net/ipv4/netfilter/ip_conntrack_proto_icmp.c | 8 +-
net/ipv4/netfilter/ip_conntrack_proto_tcp.c | 21 ++--
net/ipv4/netfilter/ip_conntrack_proto_udp.c | 6 +
net/ipv4/netfilter/ipt_LOG.c | 84 +++++++++--------
net/ipv4/netfilter/ipt_ULOG.c | 33 +++++--
net/ipv6/netfilter/ip6t_LOG.c | 91 ++++++++++---------
10 files changed, 295 insertions(+), 125 deletions(-)
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -114,15 +114,51 @@ void nf_unregister_sockopt(struct nf_soc
extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS];
-typedef void nf_logfn(unsigned int hooknum,
+/* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will
+ * disappear once iptables is replaced with pkttables. Please DO NOT use them
+ * for any new code! */
+#define NF_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
+#define NF_LOG_TCPOPT 0x02 /* Log TCP options */
+#define NF_LOG_IPOPT 0x04 /* Log IP options */
+#define NF_LOG_UID 0x08 /* Log UID owning local socket */
+#define NF_LOG_MASK 0x0f
+
+#define NF_LOG_TYPE_LOG 0x01
+#define NF_LOG_TYPE_ULOG 0x02
+
+struct nf_loginfo {
+ u_int8_t type;
+ union {
+ struct {
+ u_int32_t copy_len;
+ u_int16_t group;
+ u_int16_t qthreshold;
+ } ulog;
+ struct {
+ u_int8_t level;
+ u_int8_t logflags;
+ } log;
+ } u;
+};
+
+typedef void nf_logfn(unsigned int pf,
+ unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
+ const struct nf_loginfo *li,
const char *prefix);
+struct nf_logger {
+ struct module *me;
+ nf_logfn *logfn;
+ char *name;
+};
+
/* Function to register/unregister log function. */
-int nf_log_register(int pf, nf_logfn *logfn);
-void nf_log_unregister(int pf, nf_logfn *logfn);
+int nf_log_register(int pf, struct nf_logger *logger);
+void nf_log_unregister_pf(int pf);
+void nf_log_unregister_logger(struct nf_logger *logger);
/* Calls the registered backend logging function */
void nf_log_packet(int pf,
@@ -130,6 +166,7 @@ void nf_log_packet(int pf,
const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
+ struct nf_loginfo *li,
const char *fmt, ...);
/* Activate hook; either okfn or kfree_skb called, unless a hook
@@ -221,6 +258,11 @@ struct nf_queue_rerouter {
extern int nf_register_queue_rerouter(int pf, struct nf_queue_rerouter *rer);
extern int nf_unregister_queue_rerouter(int pf);
+#ifdef CONFIG_PROC_FS
+#include <linux/proc_fs.h>
+extern struct proc_dir_entry *proc_net_netfilter;
+#endif
+
#else /* !CONFIG_NETFILTER */
#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ b/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -1,6 +1,7 @@
#ifndef _IPT_LOG_H
#define _IPT_LOG_H
+/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
#define IPT_LOG_IPOPT 0x04 /* Log IP options */
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h
+++ b/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -1,6 +1,7 @@
#ifndef _IP6T_LOG_H
#define _IP6T_LOG_H
+/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
#define IP6T_LOG_IPOPT 0x04 /* Log IP options */
diff --git a/net/core/netfilter.c b/net/core/netfilter.c
--- a/net/core/netfilter.c
+++ b/net/core/netfilter.c
@@ -22,6 +22,7 @@
#include <linux/if.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
+#include <linux/proc_fs.h>
#include <net/sock.h>
/* In this code, we can be waiting indefinitely for userspace to
@@ -535,11 +536,10 @@ EXPORT_SYMBOL(skb_make_writable);
#define NF_LOG_PREFIXLEN 128
-static nf_logfn *nf_logging[NPROTO]; /* = NULL */
-static int reported = 0;
+static struct nf_logger *nf_logging[NPROTO]; /* = NULL */
static DEFINE_SPINLOCK(nf_log_lock);
-int nf_log_register(int pf, nf_logfn *logfn)
+int nf_log_register(int pf, struct nf_logger *logger)
{
int ret = -EBUSY;
@@ -547,54 +547,134 @@ int nf_log_register(int pf, nf_logfn *lo
* substituting pointer. */
spin_lock(&nf_log_lock);
if (!nf_logging[pf]) {
- rcu_assign_pointer(nf_logging[pf], logfn);
+ rcu_assign_pointer(nf_logging[pf], logger);
ret = 0;
}
spin_unlock(&nf_log_lock);
return ret;
}
-void nf_log_unregister(int pf, nf_logfn *logfn)
+void nf_log_unregister_pf(int pf)
{
spin_lock(&nf_log_lock);
- if (nf_logging[pf] == logfn)
- nf_logging[pf] = NULL;
+ nf_logging[pf] = NULL;
spin_unlock(&nf_log_lock);
/* Give time to concurrent readers. */
synchronize_net();
-}
+}
+
+void nf_log_unregister_logger(struct nf_logger *logger)
+{
+ int i;
+
+ spin_lock(&nf_log_lock);
+ for (i = 0; i < NPROTO; i++) {
+ if (nf_logging[i] == logger)
+ nf_logging[i] = NULL;
+ }
+ spin_unlock(&nf_log_lock);
+
+ synchronize_net();
+}
void nf_log_packet(int pf,
unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
+ struct nf_loginfo *loginfo,
const char *fmt, ...)
{
va_list args;
char prefix[NF_LOG_PREFIXLEN];
- nf_logfn *logfn;
+ struct nf_logger *logger;
rcu_read_lock();
- logfn = rcu_dereference(nf_logging[pf]);
- if (logfn) {
+ logger = rcu_dereference(nf_logging[pf]);
+ if (logger) {
va_start(args, fmt);
vsnprintf(prefix, sizeof(prefix), fmt, args);
va_end(args);
/* We must read logging before nf_logfn[pf] */
- logfn(hooknum, skb, in, out, prefix);
- } else if (!reported) {
- printk(KERN_WARNING "nf_log_packet: can\'t log yet, "
- "no backend logging module loaded in!\n");
- reported++;
+ logger->logfn(pf, hooknum, skb, in, out, loginfo, prefix);
+ } else if (net_ratelimit()) {
+ printk(KERN_WARNING "nf_log_packet: can\'t log since "
+ "no backend logging module loaded in! Please either "
+ "load one, or disable logging explicitly\n");
}
rcu_read_unlock();
}
EXPORT_SYMBOL(nf_log_register);
-EXPORT_SYMBOL(nf_log_unregister);
+EXPORT_SYMBOL(nf_log_unregister_pf);
+EXPORT_SYMBOL(nf_log_unregister_logger);
EXPORT_SYMBOL(nf_log_packet);
+#ifdef CONFIG_PROC_FS
+struct proc_dir_entry *proc_net_netfilter;
+EXPORT_SYMBOL(proc_net_netfilter);
+
+static void *seq_start(struct seq_file *seq, loff_t *pos)
+{
+ rcu_read_lock();
+
+ if (*pos >= NPROTO)
+ return NULL;
+
+ return pos;
+}
+
+static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
+{
+ (*pos)++;
+
+ if (*pos >= NPROTO)
+ return NULL;
+
+ return pos;
+}
+
+static void seq_stop(struct seq_file *s, void *v)
+{
+ rcu_read_unlock();
+}
+
+static int seq_show(struct seq_file *s, void *v)
+{
+ loff_t *pos = v;
+ const struct nf_logger *logger;
+
+ logger = rcu_dereference(nf_logging[*pos]);
+
+ if (!logger)
+ return seq_printf(s, "%2lld NONE\n", *pos);
+
+ return seq_printf(s, "%2lld %s\n", *pos, logger->name);
+}
+
+static struct seq_operations nflog_seq_ops = {
+ .start = seq_start,
+ .next = seq_next,
+ .stop = seq_stop,
+ .show = seq_show,
+};
+
+static int nflog_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &nflog_seq_ops);
+}
+
+static struct file_operations nflog_file_ops = {
+ .owner = THIS_MODULE,
+ .open = nflog_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
+#endif /* PROC_FS */
+
+
/* This does not belong here, but locally generated errors need it if connection
tracking in use: without this, connection may not be in hash table, and hence
manufactured ICMP or RST packets will not be associated with it. */
@@ -613,6 +693,9 @@ void nf_ct_attach(struct sk_buff *new, s
void __init netfilter_init(void)
{
int i, h;
+#ifdef CONFIG_PROC_FS
+ struct proc_dir_entry *pde;
+#endif
queue_rerouter = kmalloc(NPROTO * sizeof(struct nf_queue_rerouter),
GFP_KERNEL);
@@ -624,6 +707,16 @@ void __init netfilter_init(void)
for (h = 0; h < NF_MAX_HOOKS; h++)
INIT_LIST_HEAD(&nf_hooks[i][h]);
}
+
+#ifdef CONFIG_PROC_FS
+ proc_net_netfilter = proc_mkdir("netfilter", proc_net);
+ if (!proc_net_netfilter)
+ panic("cannot create netfilter proc entry");
+ pde = create_proc_entry("nf_log", S_IRUGO, proc_net_netfilter);
+ if (!pde)
+ panic("cannot create /proc/net/netfilter/nf_log");
+ pde->proc_fops = &nflog_file_ops;
+#endif
}
EXPORT_SYMBOL(ip_ct_attach);
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
--- a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
@@ -217,7 +217,7 @@ icmp_error(struct sk_buff *skb, enum ip_
icmph = skb_header_pointer(skb, skb->nh.iph->ihl*4, sizeof(_ih), &_ih);
if (icmph == NULL) {
if (LOG_INVALID(IPPROTO_ICMP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_icmp: short packet ");
return -NF_ACCEPT;
}
@@ -231,13 +231,13 @@ icmp_error(struct sk_buff *skb, enum ip_
if (!(u16)csum_fold(skb->csum))
break;
if (LOG_INVALID(IPPROTO_ICMP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_icmp: bad HW ICMP checksum ");
return -NF_ACCEPT;
case CHECKSUM_NONE:
if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) {
if (LOG_INVALID(IPPROTO_ICMP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_icmp: bad ICMP checksum ");
return -NF_ACCEPT;
}
@@ -254,7 +254,7 @@ checksum_skipped:
*/
if (icmph->type > NR_ICMP_TYPES) {
if (LOG_INVALID(IPPROTO_ICMP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_icmp: invalid ICMP type ");
return -NF_ACCEPT;
}
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -716,7 +716,7 @@ static int tcp_in_window(struct ip_ct_tc
res = 1;
} else {
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_tcp: %s ",
before(seq, sender->td_maxend + 1) ?
after(end, sender->td_end - receiver->td_maxwin - 1) ?
@@ -815,7 +815,7 @@ static int tcp_error(struct sk_buff *skb
sizeof(_tcph), &_tcph);
if (th == NULL) {
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_tcp: short packet ");
return -NF_ACCEPT;
}
@@ -823,7 +823,7 @@ static int tcp_error(struct sk_buff *skb
/* Not whole TCP header or malformed packet */
if (th->doff*4 < sizeof(struct tcphdr) || tcplen < th->doff*4) {
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_tcp: truncated/malformed packet ");
return -NF_ACCEPT;
}
@@ -840,7 +840,7 @@ static int tcp_error(struct sk_buff *skb
skb->ip_summed == CHECKSUM_HW ? skb->csum
: skb_checksum(skb, iph->ihl*4, tcplen, 0))) {
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_tcp: bad TCP checksum ");
return -NF_ACCEPT;
}
@@ -849,7 +849,7 @@ static int tcp_error(struct sk_buff *skb
tcpflags = (((u_int8_t *)th)[13] & ~(TH_ECE|TH_CWR));
if (!tcp_valid_flags[tcpflags]) {
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_tcp: invalid TCP flag combination ");
return -NF_ACCEPT;
}
@@ -897,8 +897,9 @@ static int tcp_packet(struct ip_conntrac
*/
write_unlock_bh(&tcp_lock);
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
- "ip_ct_tcp: killing out of sync session ");
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ NULL, "ip_ct_tcp: "
+ "killing out of sync session ");
if (del_timer(&conntrack->timeout))
conntrack->timeout.function((unsigned long)
conntrack);
@@ -912,7 +913,7 @@ static int tcp_packet(struct ip_conntrac
write_unlock_bh(&tcp_lock);
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_tcp: invalid packet ignored ");
return NF_ACCEPT;
case TCP_CONNTRACK_MAX:
@@ -922,7 +923,7 @@ static int tcp_packet(struct ip_conntrac
old_state);
write_unlock_bh(&tcp_lock);
if (LOG_INVALID(IPPROTO_TCP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_tcp: invalid state ");
return -NF_ACCEPT;
case TCP_CONNTRACK_SYN_SENT:
@@ -943,7 +944,7 @@ static int tcp_packet(struct ip_conntrac
write_unlock_bh(&tcp_lock);
if (LOG_INVALID(IPPROTO_TCP))
nf_log_packet(PF_INET, 0, skb, NULL, NULL,
- "ip_ct_tcp: invalid SYN");
+ NULL, "ip_ct_tcp: invalid SYN");
return -NF_ACCEPT;
}
case TCP_CONNTRACK_CLOSE:
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_udp.c b/net/ipv4/netfilter/ip_conntrack_proto_udp.c
--- a/net/ipv4/netfilter/ip_conntrack_proto_udp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_udp.c
@@ -98,7 +98,7 @@ static int udp_error(struct sk_buff *skb
hdr = skb_header_pointer(skb, iph->ihl*4, sizeof(_hdr), &_hdr);
if (hdr == NULL) {
if (LOG_INVALID(IPPROTO_UDP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_udp: short packet ");
return -NF_ACCEPT;
}
@@ -106,7 +106,7 @@ static int udp_error(struct sk_buff *skb
/* Truncated/malformed packets */
if (ntohs(hdr->len) > udplen || ntohs(hdr->len) < sizeof(*hdr)) {
if (LOG_INVALID(IPPROTO_UDP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_udp: truncated/malformed packet ");
return -NF_ACCEPT;
}
@@ -126,7 +126,7 @@ static int udp_error(struct sk_buff *skb
skb->ip_summed == CHECKSUM_HW ? skb->csum
: skb_checksum(skb, iph->ihl*4, udplen, 0))) {
if (LOG_INVALID(IPPROTO_UDP))
- nf_log_packet(PF_INET, 0, skb, NULL, NULL,
+ nf_log_packet(PF_INET, 0, skb, NULL, NULL, NULL,
"ip_ct_udp: bad UDP checksum ");
return -NF_ACCEPT;
}
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -27,10 +27,6 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
MODULE_DESCRIPTION("iptables syslog logging module");
-static unsigned int nflog = 1;
-module_param(nflog, int, 0400);
-MODULE_PARM_DESC(nflog, "register as internal netfilter logging module");
-
#if 0
#define DEBUGP printk
#else
@@ -41,11 +37,17 @@ MODULE_PARM_DESC(nflog, "register as int
static DEFINE_SPINLOCK(log_lock);
/* One level of recursion won't kill us */
-static void dump_packet(const struct ipt_log_info *info,
+static void dump_packet(const struct nf_loginfo *info,
const struct sk_buff *skb,
unsigned int iphoff)
{
struct iphdr _iph, *ih;
+ unsigned int logflags;
+
+ if (info->type == NF_LOG_TYPE_LOG)
+ logflags = info->u.log.logflags;
+ else
+ logflags = NF_LOG_MASK;
ih = skb_header_pointer(skb, iphoff, sizeof(_iph), &_iph);
if (ih == NULL) {
@@ -76,7 +78,7 @@ static void dump_packet(const struct ipt
if (ntohs(ih->frag_off) & IP_OFFSET)
printk("FRAG:%u ", ntohs(ih->frag_off) & IP_OFFSET);
- if ((info->logflags & IPT_LOG_IPOPT)
+ if ((logflags & IPT_LOG_IPOPT)
&& ih->ihl * 4 > sizeof(struct iphdr)) {
unsigned char _opt[4 * 15 - sizeof(struct iphdr)], *op;
unsigned int i, optsize;
@@ -119,7 +121,7 @@ static void dump_packet(const struct ipt
printk("SPT=%u DPT=%u ",
ntohs(th->source), ntohs(th->dest));
/* Max length: 30 "SEQ=4294967295 ACK=4294967295 " */
- if (info->logflags & IPT_LOG_TCPSEQ)
+ if (logflags & IPT_LOG_TCPSEQ)
printk("SEQ=%u ACK=%u ",
ntohl(th->seq), ntohl(th->ack_seq));
/* Max length: 13 "WINDOW=65535 " */
@@ -146,7 +148,7 @@ static void dump_packet(const struct ipt
/* Max length: 11 "URGP=65535 " */
printk("URGP=%u ", ntohs(th->urg_ptr));
- if ((info->logflags & IPT_LOG_TCPOPT)
+ if ((logflags & IPT_LOG_TCPOPT)
&& th->doff * 4 > sizeof(struct tcphdr)) {
unsigned char _opt[4 * 15 - sizeof(struct tcphdr)];
unsigned char *op;
@@ -328,7 +330,7 @@ static void dump_packet(const struct ipt
}
/* Max length: 15 "UID=4294967295 " */
- if ((info->logflags & IPT_LOG_UID) && !iphoff && skb->sk) {
+ if ((logflags & IPT_LOG_UID) && !iphoff && skb->sk) {
read_lock_bh(&skb->sk->sk_callback_lock);
if (skb->sk->sk_socket && skb->sk->sk_socket->file)
printk("UID=%u ", skb->sk->sk_socket->file->f_uid);
@@ -349,19 +351,29 @@ static void dump_packet(const struct ipt
/* maxlen = 230+ 91 + 230 + 252 = 803 */
}
+struct nf_loginfo default_loginfo = {
+ .type = NF_LOG_TYPE_LOG,
+ .u.log = {
+ .level = 0,
+ .logflags = NF_LOG_MASK,
+ },
+};
+
static void
-ipt_log_packet(unsigned int hooknum,
+ipt_log_packet(unsigned int pf,
+ unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
- const struct ipt_log_info *loginfo,
- const char *level_string,
+ const struct nf_loginfo *loginfo,
const char *prefix)
{
+ if (!loginfo)
+ loginfo = &default_loginfo;
+
spin_lock_bh(&log_lock);
- printk(level_string);
- printk("%sIN=%s OUT=%s ",
- prefix == NULL ? loginfo->prefix : prefix,
+ printk("<%d>%sIN=%s OUT=%s ", loginfo->u.log.level,
+ prefix,
in ? in->name : "",
out ? out->name : "");
#ifdef CONFIG_BRIDGE_NETFILTER
@@ -405,28 +417,15 @@ ipt_log_target(struct sk_buff **pskb,
void *userinfo)
{
const struct ipt_log_info *loginfo = targinfo;
- char level_string[4] = "< >";
+ struct nf_loginfo li;
- level_string[1] = '0' + (loginfo->level % 8);
- ipt_log_packet(hooknum, *pskb, in, out, loginfo, level_string, NULL);
+ li.type = NF_LOG_TYPE_LOG;
+ li.u.log.level = loginfo->level;
+ li.u.log.logflags = loginfo->logflags;
- return IPT_CONTINUE;
-}
+ nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, loginfo->prefix);
-static void
-ipt_logfn(unsigned int hooknum,
- const struct sk_buff *skb,
- const struct net_device *in,
- const struct net_device *out,
- const char *prefix)
-{
- struct ipt_log_info loginfo = {
- .level = 0,
- .logflags = IPT_LOG_MASK,
- .prefix = ""
- };
-
- ipt_log_packet(hooknum, skb, in, out, &loginfo, KERN_WARNING, prefix);
+ return IPT_CONTINUE;
}
static int ipt_log_checkentry(const char *tablename,
@@ -464,20 +463,29 @@ static struct ipt_target ipt_log_reg = {
.me = THIS_MODULE,
};
+static struct nf_logger ipt_log_logger ={
+ .name = "ipt_LOG",
+ .logfn = &ipt_log_packet,
+ .me = THIS_MODULE,
+};
+
static int __init init(void)
{
if (ipt_register_target(&ipt_log_reg))
return -EINVAL;
- if (nflog)
- nf_log_register(PF_INET, &ipt_logfn);
+ if (nf_log_register(PF_INET, &ipt_log_logger) < 0) {
+ printk(KERN_WARNING "ipt_LOG: not logging via system console "
+ "since somebody else already registered for PF_INET\n");
+ /* we cannot make module load fail here, since otherwise
+ * iptables userspace would abort */
+ }
return 0;
}
static void __exit fini(void)
{
- if (nflog)
- nf_log_unregister(PF_INET, &ipt_logfn);
+ nf_log_unregister_logger(&ipt_log_logger);
ipt_unregister_target(&ipt_log_reg);
}
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -304,18 +304,27 @@ static unsigned int ipt_ulog_target(stru
return IPT_CONTINUE;
}
-static void ipt_logfn(unsigned int hooknum,
+static void ipt_logfn(unsigned int pf,
+ unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
+ const struct nf_loginfo *li,
const char *prefix)
{
- struct ipt_ulog_info loginfo = {
- .nl_group = ULOG_DEFAULT_NLGROUP,
- .copy_range = 0,
- .qthreshold = ULOG_DEFAULT_QTHRESHOLD,
- .prefix = ""
- };
+ struct ipt_ulog_info loginfo;
+
+ if (!li || li->type != NF_LOG_TYPE_ULOG) {
+ loginfo.nl_group = ULOG_DEFAULT_NLGROUP;
+ loginfo.copy_range = 0;
+ loginfo.qthreshold = ULOG_DEFAULT_QTHRESHOLD;
+ loginfo.prefix[0] = '\0';
+ } else {
+ loginfo.nl_group = li->u.ulog.group;
+ loginfo.copy_range = li->u.ulog.copy_len;
+ loginfo.qthreshold = li->u.ulog.qthreshold;
+ strlcpy(loginfo.prefix, prefix, sizeof(loginfo.prefix));
+ }
ipt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
}
@@ -355,6 +364,12 @@ static struct ipt_target ipt_ulog_reg =
.me = THIS_MODULE,
};
+static struct nf_logger ipt_ulog_logger = {
+ .name = "ipt_ULOG",
+ .logfn = &ipt_logfn,
+ .me = THIS_MODULE,
+};
+
static int __init init(void)
{
int i;
@@ -382,7 +397,7 @@ static int __init init(void)
return -EINVAL;
}
if (nflog)
- nf_log_register(PF_INET, &ipt_logfn);
+ nf_log_register(PF_INET, &ipt_ulog_logger);
return 0;
}
@@ -395,7 +410,7 @@ static void __exit fini(void)
DEBUGP("ipt_ULOG: cleanup_module\n");
if (nflog)
- nf_log_unregister(PF_INET, &ipt_logfn);
+ nf_log_unregister_logger(&ipt_ulog_logger);
ipt_unregister_target(&ipt_ulog_reg);
sock_release(nflognl->sk_socket);
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -26,10 +26,6 @@ MODULE_AUTHOR("Jan Rekorajski <baggins@p
MODULE_DESCRIPTION("IP6 tables LOG target module");
MODULE_LICENSE("GPL");
-static unsigned int nflog = 1;
-module_param(nflog, int, 0400);
-MODULE_PARM_DESC(nflog, "register as internal netfilter logging module");
-
struct in_device;
#include <net/route.h>
#include <linux/netfilter_ipv6/ip6t_LOG.h>
@@ -44,7 +40,7 @@ struct in_device;
static DEFINE_SPINLOCK(log_lock);
/* One level of recursion won't kill us */
-static void dump_packet(const struct ip6t_log_info *info,
+static void dump_packet(const struct nf_loginfo *info,
const struct sk_buff *skb, unsigned int ip6hoff,
int recurse)
{
@@ -53,6 +49,12 @@ static void dump_packet(const struct ip6
struct ipv6hdr _ip6h, *ih;
unsigned int ptr;
unsigned int hdrlen = 0;
+ unsigned int logflags;
+
+ if (info->type == NF_LOG_TYPE_LOG)
+ logflags = info->u.log.logflags;
+ else
+ logflags = NF_LOG_MASK;
ih = skb_header_pointer(skb, ip6hoff, sizeof(_ip6h), &_ip6h);
if (ih == NULL) {
@@ -84,7 +86,7 @@ static void dump_packet(const struct ip6
}
/* Max length: 48 "OPT (...) " */
- if (info->logflags & IP6T_LOG_IPOPT)
+ if (logflags & IP6T_LOG_IPOPT)
printk("OPT ( ");
switch (currenthdr) {
@@ -119,7 +121,7 @@ static void dump_packet(const struct ip6
case IPPROTO_ROUTING:
case IPPROTO_HOPOPTS:
if (fragment) {
- if (info->logflags & IP6T_LOG_IPOPT)
+ if (logflags & IP6T_LOG_IPOPT)
printk(")");
return;
}
@@ -127,7 +129,7 @@ static void dump_packet(const struct ip6
break;
/* Max Length */
case IPPROTO_AH:
- if (info->logflags & IP6T_LOG_IPOPT) {
+ if (logflags & IP6T_LOG_IPOPT) {
struct ip_auth_hdr _ahdr, *ah;
/* Max length: 3 "AH " */
@@ -158,7 +160,7 @@ static void dump_packet(const struct ip6
hdrlen = (hp->hdrlen+2)<<2;
break;
case IPPROTO_ESP:
- if (info->logflags & IP6T_LOG_IPOPT) {
+ if (logflags & IP6T_LOG_IPOPT) {
struct ip_esp_hdr _esph, *eh;
/* Max length: 4 "ESP " */
@@ -190,7 +192,7 @@ static void dump_packet(const struct ip6
printk("Unknown Ext Hdr %u", currenthdr);
return;
}
- if (info->logflags & IP6T_LOG_IPOPT)
+ if (logflags & IP6T_LOG_IPOPT)
printk(") ");
currenthdr = hp->nexthdr;
@@ -218,7 +220,7 @@ static void dump_packet(const struct ip6
printk("SPT=%u DPT=%u ",
ntohs(th->source), ntohs(th->dest));
/* Max length: 30 "SEQ=4294967295 ACK=4294967295 " */
- if (info->logflags & IP6T_LOG_TCPSEQ)
+ if (logflags & IP6T_LOG_TCPSEQ)
printk("SEQ=%u ACK=%u ",
ntohl(th->seq), ntohl(th->ack_seq));
/* Max length: 13 "WINDOW=65535 " */
@@ -245,7 +247,7 @@ static void dump_packet(const struct ip6
/* Max length: 11 "URGP=65535 " */
printk("URGP=%u ", ntohs(th->urg_ptr));
- if ((info->logflags & IP6T_LOG_TCPOPT)
+ if ((logflags & IP6T_LOG_TCPOPT)
&& th->doff * 4 > sizeof(struct tcphdr)) {
u_int8_t _opt[60 - sizeof(struct tcphdr)], *op;
unsigned int i;
@@ -349,7 +351,7 @@ static void dump_packet(const struct ip6
}
/* Max length: 15 "UID=4294967295 " */
- if ((info->logflags & IP6T_LOG_UID) && recurse && skb->sk) {
+ if ((logflags & IP6T_LOG_UID) && recurse && skb->sk) {
read_lock_bh(&skb->sk->sk_callback_lock);
if (skb->sk->sk_socket && skb->sk->sk_socket->file)
printk("UID=%u ", skb->sk->sk_socket->file->f_uid);
@@ -357,19 +359,29 @@ static void dump_packet(const struct ip6
}
}
+static struct nf_loginfo default_loginfo = {
+ .type = NF_LOG_TYPE_LOG,
+ .u.log = {
+ .level = 0,
+ .logflags = NF_LOG_MASK,
+ },
+};
+
static void
-ip6t_log_packet(unsigned int hooknum,
+ip6t_log_packet(unsigned int pf,
+ unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
- const struct ip6t_log_info *loginfo,
- const char *level_string,
+ const struct nf_loginfo *loginfo,
const char *prefix)
{
+ if (!loginfo)
+ loginfo = &default_loginfo;
+
spin_lock_bh(&log_lock);
- printk(level_string);
- printk("%sIN=%s OUT=%s ",
- prefix == NULL ? loginfo->prefix : prefix,
+ printk("<%d>%sIN=%s OUT=%s ", loginfo->u.log.level,
+ prefix,
in ? in->name : "",
out ? out->name : "");
if (in && !out) {
@@ -416,29 +428,17 @@ ip6t_log_target(struct sk_buff **pskb,
void *userinfo)
{
const struct ip6t_log_info *loginfo = targinfo;
- char level_string[4] = "< >";
+ struct nf_loginfo li;
+
+ li.type = NF_LOG_TYPE_LOG;
+ li.u.log.level = loginfo->level;
+ li.u.log.logflags = loginfo->logflags;
- level_string[1] = '0' + (loginfo->level % 8);
- ip6t_log_packet(hooknum, *pskb, in, out, loginfo, level_string, NULL);
+ nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, loginfo->prefix);
return IP6T_CONTINUE;
}
-static void
-ip6t_logfn(unsigned int hooknum,
- const struct sk_buff *skb,
- const struct net_device *in,
- const struct net_device *out,
- const char *prefix)
-{
- struct ip6t_log_info loginfo = {
- .level = 0,
- .logflags = IP6T_LOG_MASK,
- .prefix = ""
- };
-
- ip6t_log_packet(hooknum, skb, in, out, &loginfo, KERN_WARNING, prefix);
-}
static int ip6t_log_checkentry(const char *tablename,
const struct ip6t_entry *e,
@@ -475,20 +475,29 @@ static struct ip6t_target ip6t_log_reg =
.me = THIS_MODULE,
};
+static struct nf_logger ip6t_logger = {
+ .name = "ip6t_LOG",
+ .logfn = &ip6t_log_packet,
+ .me = THIS_MODULE,
+};
+
static int __init init(void)
{
if (ip6t_register_target(&ip6t_log_reg))
return -EINVAL;
- if (nflog)
- nf_log_register(PF_INET6, &ip6t_logfn);
+ if (nf_log_register(PF_INET6, &ip6t_logger) < 0) {
+ printk(KERN_WARNING "ip6t_LOG: not logging via system console "
+ "since somebody else already registered for PF_INET6\n");
+ /* we cannot make module load fail here, since otherwise
+ * ip6tables userspace would abort */
+ }
return 0;
}
static void __exit fini(void)
{
- if (nflog)
- nf_log_unregister(PF_INET6, &ip6t_logfn);
+ nf_log_unregister_logger(&ip6t_logger);
ip6t_unregister_target(&ip6t_log_reg);
}
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] Add prefetches in net/ipv4/route.c
From: Eric Dumazet @ 2005-07-28 20:56 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20050728.123922.126777020.davem@davemloft.net>
David S. Miller a écrit :
> From: Eric Dumazet <dada1@cosmosbay.com>
> Date: Thu, 28 Jul 2005 17:52:04 +0200
>
>
>>[NET] : Adds prefetches in route hash list traversals.
>>
>>The actual code doesnt use a prefetch enabled macro like
>>list_for_each_rcu(), so manually add prefetch() hints.
>
>
> and the measured performance improvement is?
>
>
Half the improvement we could get if only fl.fl4_dst, and other fields were not so far away from the u.rt_next field. (0xE8 on x86_64)
For good performance, one should of course choose a big route cache hash size, and in this case, prefetchs are useless, and even cost an
extra load : prefetch(rth->u.rt_next) imply the load of the rt_next pointer at the start of rth structure, while the fl fields are on a
different cache line)
But in case of DDOS, prefetches are a win.
I did not test a solution using two prefetches...
Other patches using prefetches will follow.
Eric
^ permalink raw reply
* Re: [PATCH] Add prefetches in net/ipv4/route.c
From: David S. Miller @ 2005-07-28 20:58 UTC (permalink / raw)
To: dada1; +Cc: netdev
In-Reply-To: <42E94680.8060309@cosmosbay.com>
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Thu, 28 Jul 2005 22:56:32 +0200
> But in case of DDOS, prefetches are a win.
Numbers please, I'm simply curious.
^ permalink raw reply
* Re: [PATCH] Add prefetches in net/ipv4/route.c
From: Eric Dumazet @ 2005-07-28 21:24 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20050728.135826.63129319.davem@davemloft.net>
David S. Miller a écrit :
> From: Eric Dumazet <dada1@cosmosbay.com>
> Date: Thu, 28 Jul 2005 22:56:32 +0200
>
>
>>But in case of DDOS, prefetches are a win.
>
>
> Numbers please, I'm simply curious.
>
>
I have no profiling info for this exact patch, I'm sorry David.
On a dual opteron machine, this thing from ip_route_input() is very expensive :
RT_CACHE_STAT_INC(in_hlist_search);
ip_route_input() use a total of 3.4563 % of one cpu, but this 'increment' takes 1.20 % !!!
0.0047 mov 2123529(%rip),%rax # ffffffff804b4a60 <rt_cache_stat>
1.1898 not %rax
mov %gs:0x34,%edx
0.0042 movslq %edx,%rdx
mov (%rax,%rdx,8),%rax
incl 0x38(%rax)
Sometime I wonder if oprofile can be trusted :(
Maybe we should increment a counter on the stack and do a final
if (counter != 0)
RT_CACHE_STAT_ADD(in_hlist_search, counter);
Eric
^ permalink raw reply
* [2.6 patch] net: Spelling mistakes threshoulds -> thresholds
From: Adrian Bunk @ 2005-07-28 22:04 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, Baruch Even
Just simple spelling mistake fixes.
From: aruch Even <baruch@ev-en.org>
Signed-Off-By: Baruch Even <baruch@ev-en.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 12 Jul 2005
This patch was sent by Baruch Even on:
- 05 Apr 2005
--- 2.6.11.orig/include/net/tcp.h 2005-03-16 00:09:00.000000000 +0000
+++ 2.6.11/include/net/tcp.h 2005-04-05 14:33:13.473828484 +0100
@@ -1351,7 +1351,7 @@ static inline void tcp_cwnd_validate(str
}
}
-/* Set slow start threshould and cwnd not falling to slow start */
+/* Set slow start threshold and cwnd not falling to slow start */
static inline void __tcp_enter_cwr(struct tcp_sock *tp)
{
tp->undo_marker = 0;
diff -Nurp -X dontdiff 2.6.11.orig/net/ipv4/ipmr.c 2.6.11/net/ipv4/ipmr.c
--- 2.6.11.orig/net/ipv4/ipmr.c 2005-03-16 00:09:06.000000000 +0000
+++ 2.6.11/net/ipv4/ipmr.c 2005-04-05 14:33:13.541817170 +0100
@@ -359,7 +359,7 @@ out:
/* Fill oifs list. It is called under write locked mrt_lock. */
-static void ipmr_update_threshoulds(struct mfc_cache *cache, unsigned char *ttls)
+static void ipmr_update_thresholds(struct mfc_cache *cache, unsigned char *ttls)
{
int vifi;
@@ -721,7 +721,7 @@ static int ipmr_mfc_add(struct mfcctl *m
if (c != NULL) {
write_lock_bh(&mrt_lock);
c->mfc_parent = mfc->mfcc_parent;
- ipmr_update_threshoulds(c, mfc->mfcc_ttls);
+ ipmr_update_thresholds(c, mfc->mfcc_ttls);
if (!mrtsock)
c->mfc_flags |= MFC_STATIC;
write_unlock_bh(&mrt_lock);
@@ -738,7 +738,7 @@ static int ipmr_mfc_add(struct mfcctl *m
c->mfc_origin=mfc->mfcc_origin.s_addr;
c->mfc_mcastgrp=mfc->mfcc_mcastgrp.s_addr;
c->mfc_parent=mfc->mfcc_parent;
- ipmr_update_threshoulds(c, mfc->mfcc_ttls);
+ ipmr_update_thresholds(c, mfc->mfcc_ttls);
if (!mrtsock)
c->mfc_flags |= MFC_STATIC;
^ permalink raw reply
* Re: [PATCH] Add prefetches in net/ipv4/route.c
From: David S. Miller @ 2005-07-28 22:44 UTC (permalink / raw)
To: dada1; +Cc: netdev
In-Reply-To: <42E94D11.4090002@cosmosbay.com>
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Thu, 28 Jul 2005 23:24:33 +0200
> On a dual opteron machine, this thing from ip_route_input() is very expensive :
>
> RT_CACHE_STAT_INC(in_hlist_search);
That's amazing since it's per-cpu. I don't have any suggestions
besides your idea to increment it once using an accumulation local
variable.
^ permalink raw reply
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