Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 7/9] Consolidate the xxx_evictor
From: David Miller @ 2007-10-15  9:40 UTC (permalink / raw)
  To: xemul; +Cc: kaber, netdev, devel
In-Reply-To: <470F758B.5090508@openvz.org>

From: Pavel Emelyanov <xemul@openvz.org>
Date: Fri, 12 Oct 2007 17:24:27 +0400

> The evictors collect some statistics for ipv4 and ipv6, 
> so make it return the number of evicted queues and account
> them all at once in the caller.
> 
> The XXX_ADD_STATS_BH() macros are just for this case, 
> but maybe there are places in code, that can make use of 
> them as well.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied, thanks!

^ permalink raw reply

* Re: [PATCH 8/9] Small cleanup for xxx_put after evictor consolidation
From: David Miller @ 2007-10-15  9:41 UTC (permalink / raw)
  To: xemul; +Cc: kaber, netdev, devel
In-Reply-To: <470F764C.2070305@openvz.org>

From: Pavel Emelyanov <xemul@openvz.org>
Date: Fri, 12 Oct 2007 17:27:40 +0400

> After the evictor code is consolidated there is no need in 
> passing the extra pointer to the xxx_put() functions.
> 
> The only place when it made sense was the evictor code itself.
> 
> Maybe this change must got with the previous (or with the 
> next) patch, but I try to make them shorter as much as 
> possible to simplify the review (but they are still large 
> anyway), so this change goes in a separate patch.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

^ permalink raw reply

* Re: [PATCH 9/9] Consolidate the xxx_put
From: David Miller @ 2007-10-15  9:42 UTC (permalink / raw)
  To: xemul; +Cc: kaber, netdev, devel
In-Reply-To: <470F769D.8000501@openvz.org>

From: Pavel Emelyanov <xemul@openvz.org>
Date: Fri, 12 Oct 2007 17:29:01 +0400

> These ones use the generic data types too, so move
> them in one place.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Also applied, thanks!

^ permalink raw reply

* Re: [PATCH 0/9] Consolidate IP fragment management
From: David Miller @ 2007-10-15  9:42 UTC (permalink / raw)
  To: xemul; +Cc: kaber, netdev, devel
In-Reply-To: <470F6EAE.60308@openvz.org>

From: Pavel Emelyanov <xemul@openvz.org>
Date: Fri, 12 Oct 2007 16:55:10 +0400

> Patrick recently pointed out, that there are three places that 
> perform IP fragments management. In ipv4, ipv6 and in ip6 
> conntracks. Looks like these places can be a bit consolidated.
> 
> The proposal is to create a common structure inet_frag_queue to 
> put common fields like list heads, refcounts etc in, and include
> it into the specific fragment queues. Then such objects like 
> hash tables, lists, locks etc are moved to common place (struct 
> inet_frags). At the end common code is moved to the 
> net/ipv4/inet_fragment.c.
> 
> The inet_ prefix in file names, data structures and functions, and
> the code place (net/ipv4) was proposed by Alexey, but the exact
> names were selectd by me, so maybe there can be a better ones.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Thank you for doing this work, I applied it all.

I had to decide whether to apply Herbert's recent patches
first or your's, because either way there would be some
conflicts to resolve.

I handled it the best I could, but it seems OK from here.

^ permalink raw reply

* [NET] Jazzsonic: Fix warning about unused variable.
From: Ralf Baechle @ 2007-10-15  9:58 UTC (permalink / raw)
  To: Andrew Morton, Jeff Garzik; +Cc: netdev, Thomas Bogendoerfer

Caused by "[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()"
aka 0795af5729b18218767fab27c44b1384f72dc9ad.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index d3825c8..5c154fe 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -208,7 +208,6 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
 	struct sonic_local *lp;
 	struct resource *res;
 	int err = 0;
-	int i;
 	DECLARE_MAC_BUF(mac);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

^ permalink raw reply related

* [PATCH]: SELINUX fixup for netfilter hook changes
From: David Miller @ 2007-10-15  9:59 UTC (permalink / raw)
  To: netdev


I just noticed a warning for this in my allmodconfig build,
so I checked in the obvious fix.

commit d0a23b19f552c4fd0126d903078ea5ceca968617
Author: David S. Miller <davem@sunset.davemloft.net>
Date:   Mon Oct 15 02:58:25 2007 -0700

    [SELINUX]: Update for netfilter ->hook() arg changes.
    
    They take a "struct sk_buff *" instead of a "struct sk_buff **" now.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 3c3fff3..cf76150 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3932,7 +3932,7 @@ out:
 }
 
 static unsigned int selinux_ip_postroute_last(unsigned int hooknum,
-                                              struct sk_buff **pskb,
+                                              struct sk_buff *skb,
                                               const struct net_device *in,
                                               const struct net_device *out,
                                               int (*okfn)(struct sk_buff *),
@@ -3941,7 +3941,6 @@ static unsigned int selinux_ip_postroute_last(unsigned int hooknum,
 	char *addrp;
 	int len, err = 0;
 	struct sock *sk;
-	struct sk_buff *skb = *pskb;
 	struct avc_audit_data ad;
 	struct net_device *dev = (struct net_device *)out;
 	struct sk_security_struct *sksec;
@@ -3977,23 +3976,23 @@ out:
 }
 
 static unsigned int selinux_ipv4_postroute_last(unsigned int hooknum,
-						struct sk_buff **pskb,
+						struct sk_buff *skb,
 						const struct net_device *in,
 						const struct net_device *out,
 						int (*okfn)(struct sk_buff *))
 {
-	return selinux_ip_postroute_last(hooknum, pskb, in, out, okfn, PF_INET);
+	return selinux_ip_postroute_last(hooknum, skb, in, out, okfn, PF_INET);
 }
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 
 static unsigned int selinux_ipv6_postroute_last(unsigned int hooknum,
-						struct sk_buff **pskb,
+						struct sk_buff *skb,
 						const struct net_device *in,
 						const struct net_device *out,
 						int (*okfn)(struct sk_buff *))
 {
-	return selinux_ip_postroute_last(hooknum, pskb, in, out, okfn, PF_INET6);
+	return selinux_ip_postroute_last(hooknum, skb, in, out, okfn, PF_INET6);
 }
 
 #endif	/* IPV6 */

^ permalink raw reply related

* Re: kernel BUG at net/core/dev.c:1383 skb_checksum_help: BUG_ON(offset > (int)skb->len)
From: Ilpo Järvinen @ 2007-10-15 10:08 UTC (permalink / raw)
  To: Guillaume Chazarain; +Cc: Netdev
In-Reply-To: <20071014192640.35065e73@inria.fr>

On Sun, 14 Oct 2007, Guillaume Chazarain wrote:

> > #0  skb_checksum_help (skb=0xc73c8cb0) at net/core/dev.c:1383
> > 1383            BUG_ON(offset > (int)skb->len);
> 
> This same crash
> (http://marc.info/?l=linux-netdev&m=119167366621392&w=2) happened
> again, this time with a recent git
> (d773b33972a663cfaf066e966f87922a74088a1e), here are some gdb info. I
> have the complete kdump image but I still lack a reliable way to
> reproduce the problem.
> 
> <2>kernel BUG at net/core/dev.c:1372!
> <0>invalid opcode: 0000 [#1]
> <0>PREEMPT 
> <4>Modules linked in: michael_mic arc4 ecb blkcipher ieee80211_crypt_tkip radeon drm acpi_cpufreq kqemu lm90 hwmon ipv6 binfmt_misc dm_mirror dm_mod snd_intel8x0m snd_seq_dummy snd_intel8x0 snd_ac97_codec ac97_bus snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss snd_pcm ohci1394 ieee1394 snd_timer sr_mod snd soundcore hci_usb firewire_ohci i2c_i801 sdhci mmc_core bluetooth snd_page_alloc serio_raw cdrom i2c_core firewire_core crc_itu_t usbhid hid rtc_cmos pcspkr button video irda rtc_core rtc_lib ipw2200 ieee80211 iTCO_wdt skge output battery ac asus_laptop led_class crc_ccitt ieee80211_crypt sg pata_acpi ehci_hcd ohci_hcd uhci_hcd
> <0>CPU:    0
> <0>EIP:    0060:[<c02c9d5e>]    Not tainted VLI
> <0>EFLAGS: 00010202   (2.6.23-taskstats #31)
> <0>EIP is at skb_checksum_help+0x66/0xcb
> <0>eax: 000000aa   ebx: e218dcb0   ecx: 00000072   edx: 001000cc
> <0>esi: 00002822   edi: d9d848b8   ebp: c0443c58   esp: c0443c4c
> <0>ds: 007b   es: 007b   fs: 0000  gs: 0000  ss: 0068
> <0>Process swapper (pid: 0, ti=c0443000 task=c03d6280 task.ti=c0404000)
> <0>Stack: 00000020 f7c80000 e218dcb0 c0443c74 c02cbf6c f5d28380 00000048 e218dcb0 
> <0>       f5de82a4 d9d848b8 c0443ca4 c02ea432 f5949400 c0443ca8 c0443d38 f2d8f028 
> <0>       0000000e f5de8280 e218dcb0 d9d848b8 f5180440 000015e0 c0443d14 c02e9ba9 
> <0>Call Trace:
> <0> [<c0107eee>] show_trace_log_lvl+0x1a/0x2f
> <0> [<c0107fa0>] show_stack_log_lvl+0x9d/0xa5
> <0> [<c0108175>] show_registers+0x1cd/0x2e3
> <0> [<c01083a8>] die+0x11d/0x218
> <0> [<c0328837>] do_trap+0x89/0xa2
> <0> [<c0108762>] do_invalid_op+0x88/0x92
> <0> [<c032860a>] error_code+0x6a/0x70
> <0> [<c02cbf6c>] dev_queue_xmit+0x11e/0x2da
> <0> [<c02ea432>] ip_output+0x239/0x273
> <0> [<c02e9ba9>] ip_queue_xmit+0x324/0x35c
> <0> [<c02f7a23>] tcp_transmit_skb+0x638/0x66b
> <0> [<c02f8852>] tcp_retransmit_skb+0x502/0x5f5
> <0> [<c02f89f7>] tcp_xmit_retransmit_queue+0xb2/0x252
> <0> [<c02f5747>] tcp_ack+0x15ae/0x1776
> <0> [<c02f6ba3>] tcp_rcv_established+0x521/0x5f2
> <0> [<c02fbc65>] tcp_v4_do_rcv+0x2b/0x31d
> <0> [<c02fdf58>] tcp_v4_rcv+0x858/0x8cc
> <0> [<c02e5a50>] ip_local_deliver+0x193/0x22b
> <0> [<c02e5890>] ip_rcv+0x478/0x4a5
> <0> [<c02c96b6>] netif_receive_skb+0x359/0x3da
> <0> [<c02cb523>] process_backlog+0x6d/0xc5
> <0> [<c02cb1b1>] net_rx_action+0x8b/0x16b
> <0> [<c0123a20>] __do_softirq+0x41/0x8c
> <0> [<c0108d63>] do_softirq+0x5e/0xb9
> <0> =======================
> <0>Code: 89 d8 c7 04 24 20 00 00 00 e8 57 ad ff ff 85 c0 75 79 0f b7 73 5c 8b 83 a4 00 00 00 2b 83 a0 00 00 00 8b 4b 50 29 c6 39 ce 7e 04 <0f> 0b eb fe 29 f1 89 f2 89 d8 c7 04 24 00 00 00 00 e8 e0 9e ff 
> <0>EIP: [<c02c9d5e>] skb_checksum_help+0x66/0xcb SS:ESP 0068:c0443c4c
> 
> 
> #0  0xc02c9d5e in skb_checksum_help (skb=0xe218dcb0) at net/core/dev.c:1372
> 1372            BUG_ON(offset > (int)skb->len);
> (gdb) bt full
> #0  0xc02c9d5e in skb_checksum_help (skb=0xe218dcb0) at net/core/dev.c:1372
>         csum = 1048780
>         ret = <value optimized out>
>         offset = 10274
> #1  0xc02cbf6c in dev_queue_xmit (skb=0xe218dcb0) at net/core/dev.c:1631
>         dev = (struct net_device *) 0xf7c80000
>         q = <value optimized out>
>         rc = <value optimized out>
> #2  0xc02ea432 in ip_output (skb=0xe218dcb0) at include/net/neighbour.h:319
>         __ret = <value optimized out>
>         dev = <value optimized out>
> #3  0xc02e9ba9 in ip_queue_xmit (skb=0xe218dcb0, ipfragok=0)
>     at include/net/dst.h:232
>         __ret = <value optimized out>
>         sk = (struct sock *) 0xf5180440
>         opt = (struct ip_options *) 0x0
>         rt = (struct rtable *) 0xed3db300
>         iph = (struct iphdr *) 0xd9d848b8
> #4  0xc02f7a23 in tcp_transmit_skb (sk=0xf5180440, skb=0xe218dcb0, 
>     clone_it=<value optimized out>, gfp_mask=32) at net/ipv4/tcp_output.c:609
>         tp = <value optimized out>
>         tcb = (struct tcp_skb_cb *) 0xe218dcd0
>         tcp_header_size = 60
>         th = <value optimized out>
>         sysctl_flags = 0
>         err = <value optimized out>
> #5  0xc02f8852 in tcp_retransmit_skb (sk=0xf5180440, skb=0xe218dc00)
>     at net/ipv4/tcp_output.c:1903
>         tp = <value optimized out>
>         cur_mss = <value optimized out>
>         err = -113
> #6  0xc02f89f7 in tcp_xmit_retransmit_queue (sk=0xf5180440)
>     at net/ipv4/tcp_output.c:1982
>         sacked = <value optimized out>
>         skb = <value optimized out>
>         packet_cnt = 0
> #7  0xc02f5747 in tcp_ack (sk=0xf5180440, skb=0xd3606b40, flag=1294)
>     at net/ipv4/tcp_input.c:2508
>         packets_acked = 1
>         sacked = 132 '\204'
>         tp = <value optimized out>
>         prior_snd_una = 4014267677
>         ack_seq = 3213368850
>         ack = 4014269059
>         prior_in_flight = 4111991984

This one doesn't look very sane number... But it may well be ok due to 
some compiler trick (dunno)... Just for completeness, could you print 
tcp_sock contents too so I could briefly have a look (though I suspect 
that the problem is elsewhere), thanks...

>         seq_rtt = -1
>         frto_cwnd = <value optimized out>
> #8  0xc02f6ba3 in tcp_rcv_established (sk=0xf5180440, skb=0xd3606b40, 

...snip...


-- 
 i.

^ permalink raw reply

* Re: kernel BUG at net/core/dev.c:1383 skb_checksum_help: BUG_ON(offset > (int)skb->len)
From: Ilpo Järvinen @ 2007-10-15 10:15 UTC (permalink / raw)
  To: Guillaume Chazarain; +Cc: Netdev
In-Reply-To: <Pine.LNX.4.64.0710151251090.3767@kivilampi-30.cs.helsinki.fi>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 402 bytes --]

On Mon, 15 Oct 2007, Ilpo Järvinen wrote:

> >         prior_in_flight = 4111991984
> 
> This one doesn't look very sane number... But it may well be ok due to 
> some compiler trick (dunno)... Just for completeness, could you print 
> tcp_sock contents too so I could briefly have a look (though I suspect 
> that the problem is elsewhere), thanks...

...Never mind, noticed the fix later on.

-- 
 i.

^ permalink raw reply

* Re: kernel BUG at net/core/dev.c:1383 skb_checksum_help: BUG_ON(offset > (int)skb->len)
From: Guillaume Chazarain @ 2007-10-15 10:18 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: Netdev
In-Reply-To: <Pine.LNX.4.64.0710151311540.3767@kivilampi-30.cs.helsinki.fi>

Le Mon, 15 Oct 2007 13:15:05 +0300 (EEST),
"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi> a écrit :
 
> ...Never mind, noticed the fix later on.

Yes, but here is it anyway, in case you see something fishy.

(gdb) p *(struct tcp_sock *)skb->sk
$4 = {inet_conn = {icsk_inet = {sk = {__sk_common = {skc_family = 2, 
          skc_state = 1 '\001', skc_reuse = 1 '\001', skc_bound_dev_if = 0, 
          skc_node = {next = 0x0, pprev = 0xc6179450}, skc_bind_node = {
            next = 0xf5227550, pprev = 0xeebd3110}, skc_refcnt = {
            counter = 4}, skc_hash = 710603402, skc_prot = 0xc03f8720, 
          skc_net = 0xc048ad60}, sk_shutdown = 0 '\0', sk_no_check = 0 '\0', 
        sk_userlocks = 0 '\0', sk_protocol = 6 '\006', sk_type = 1, 
        sk_rcvbuf = 87380, sk_lock = {slock = {raw_lock = {<No data fields>}}, 
          owned = 0, wq = {lock = {raw_lock = {<No data fields>}}, 
            task_list = {next = 0xf5180474, prev = 0xf5180474}}}, 
        sk_backlog = {head = 0x0, tail = 0x0}, sk_sleep = 0xf5770918, 
        sk_dst_cache = 0xed3db300, sk_policy = {0x0, 0x0}, sk_dst_lock = {
          raw_lock = {<No data fields>}}, sk_rmem_alloc = {counter = 63680}, 
        sk_wmem_alloc = {counter = 488}, sk_omem_alloc = {counter = 0}, 
        sk_sndbuf = 76188, sk_receive_queue = {next = 0xf51804a4, 
          prev = 0xf51804a4, qlen = 0, lock = {
            raw_lock = {<No data fields>}}}, sk_write_queue = {
          next = 0xe218dc00, prev = 0xf0fdba80, qlen = 25, lock = {
            raw_lock = {<No data fields>}}}, sk_async_wait_queue = {
          next = 0x0, prev = 0x0, qlen = 0, lock = {
            raw_lock = {<No data fields>}}}, sk_wmem_queued = 33896, 
        sk_forward_alloc = 4824, sk_allocation = 208, sk_route_caps = 0, 
        sk_gso_type = 1, sk_rcvlowat = 1, sk_flags = 17152, sk_lingertime = 0, 
        sk_error_queue = {next = 0xf51804e8, prev = 0xf51804e8, qlen = 0, 
          lock = {raw_lock = {<No data fields>}}}, 
        sk_prot_creator = 0xc03f8720, sk_callback_lock = {
          raw_lock = {<No data fields>}}, sk_err = 0, sk_err_soft = 0, 
        sk_ack_backlog = 0, sk_max_ack_backlog = 50, sk_priority = 2, 
        sk_peercred = {pid = 0, uid = 4294967295, gid = 4294967295}, 
        sk_rcvtimeo = 2147483647, sk_sndtimeo = 2147483647, sk_filter = 0x0, 
        sk_protinfo = 0x0, sk_timer = {entry = {next = 0x0, 
            prev = 0xc04768e8}, expires = 2104092, 
          function = 0xc02fa3b8 <tcp_keepalive_timer>, data = 4111991872, 
          base = 0xc0476800}, sk_stamp = {tv64 = 3294967295}, 
        sk_socket = 0xf5770900, sk_user_data = 0x0, sk_sndmsg_page = 0x0, 
        sk_send_head = 0xcc26cc00, sk_sndmsg_off = 0, sk_write_pending = 0, 
        sk_security = 0x0, sk_state_change = 0xc02c2737 <sock_def_wakeup>, 
        sk_data_ready = 0xc02c2f8c <sock_def_readable>, 
        sk_write_space = 0xc02c6dc7 <sk_stream_write_space>, 
        sk_error_report = 0xc02c2f22 <sock_def_error_report>, 
        sk_backlog_rcv = 0xc02fbc3a <tcp_v4_do_rcv>, 
        sk_destruct = 0xc0308062 <inet_sock_destruct>}, pinet6 = 0x0, 
      daddr = 1743516497, rcv_saddr = 50374848, dport = 11768, num = 6881, 
      saddr = 50374848, uc_ttl = -1, cmsg_flags = 0, opt = 0x0, sport = 57626, 
      id = 19592, tos = 8 '\b', mc_ttl = 47 '/', pmtudisc = 1 '\001', 
      recverr = 0 '\0', is_icsk = 1 '\001', freebind = 0 '\0', 
      hdrincl = 0 '\0', mc_loop = 1 '\001', mc_index = 3, mc_addr = 0, 
      mc_list = 0x0, cork = {flags = 0, fragsize = 0, opt = 0x0, rt = 0x0, 
        length = 0, addr = 0, fl = {oif = 0, iif = 0, mark = 0, nl_u = {
            ip4_u = {daddr = 0, saddr = 0, tos = 0 '\0', scope = 0 '\0'}, 
            ip6_u = {daddr = {in6_u = {u6_addr8 = {0 '\0' <repeats 16 times>}, 
                  u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, u6_addr32 = {0, 0, 0, 
                    0}}}, saddr = {in6_u = {u6_addr8 = {
                    0 '\0' <repeats 16 times>}, u6_addr16 = {0, 0, 0, 0, 0, 0, 
                    0, 0}, u6_addr32 = {0, 0, 0, 0}}}, flowlabel = 0}, dn_u = {
              daddr = 0, saddr = 0, scope = 0 '\0'}}, proto = 0 '\0', 
          flags = 0 '\0', uli_u = {ports = {sport = 0, dport = 0}, icmpt = {
              type = 0 '\0', code = 0 '\0'}, dnports = {sport = 0, dport = 0}, 
            spi = 0, mht = {type = 0 '\0'}}, secid = 0}}}, 
    icsk_accept_queue = {rskq_accept_head = 0x0, rskq_accept_tail = 0x0, 
      syn_wait_lock = {raw_lock = {<No data fields>}}, 
      rskq_defer_accept = 0 '\0', listen_opt = 0x0}, 
    icsk_bind_hash = 0xc639e820, icsk_timeout = 4955116, 
    icsk_retransmit_timer = {entry = {next = 0xc04770e0, prev = 0xc03e3e50}, 
      expires = 4955116, function = 0xc02fa6fc <tcp_write_timer>, 
      data = 4111991872, base = 0xc0476800}, icsk_delack_timer = {entry = {
        next = 0x0, prev = 0x200200}, expires = 4944512, 
      function = 0xc02fa57a <tcp_delack_timer>, data = 4111991872, 
      base = 0xc0476800}, icsk_rto = 5009, icsk_pmtu_cookie = 1500, 
    icsk_ca_ops = 0xc03fa3e0, icsk_af_ops = 0xc03f86e0, 
    icsk_sync_mss = 0xc02f6efd <tcp_sync_mss>, icsk_ca_state = 3 '\003', 
    icsk_retransmits = 0 '\0', icsk_pending = 1 '\001', icsk_backoff = 0 '\0', 
    icsk_syn_retries = 0 '\0', icsk_probes_out = 0 '\0', icsk_ext_hdr_len = 0, 
    icsk_ack = {pending = 0 '\0', quick = 0 '\0', pingpong = 0 '\0', 
      blocked = 0 '\0', ato = 40, timeout = 4944512, lrcvtime = 4944507, 
      last_seg_size = 0, rcv_mss = 1402}, icsk_mtup = {enabled = 0, 
      search_high = 1454, search_low = 564, probe_size = 0}, icsk_ca_priv = {
      6, 13, 13, 12, 4946610, 8, 0, 992, 0, 17, 13, 31, 0, 0, 0, 0}}, 
  tcp_header_len = 32, xmit_size_goal = 1374, pred_flags = 0, 
  rcv_nxt = 3213349733, copied_seq = 3213349733, rcv_wup = 3213349733, 
  snd_nxt = 4014280275, snd_una = 4014269059, snd_sml = 4014278893, 
  rcv_tstamp = 4950107, lsndtime = 4950107, ucopy = {prequeue = {
      next = 0xf51806ec, prev = 0xf51806ec, qlen = 0, lock = {
        raw_lock = {<No data fields>}}}, task = 0x0, iov = 0x0, memory = 0, 
    len = 0}, snd_wl1 = 3213368850, snd_wnd = 64512, max_window = 65535, 
  mss_cache = 1402, window_clamp = 64087, rcv_ssthresh = 64087, 
  frto_highmark = 0, reordering = 3 '\003', frto_counter = 0 '\0', 
  nonagle = 0 '\0', keepalive_probes = 0 '\0', srtt = 15439, mdev = 3080, 
  mdev_max = 3080, rttvar = 3080, rtt_seq = 4014273285, packets_out = 16, 
  retrans_out = 0, rx_opt = {ts_recent_stamp = 1192377268, 
    ts_recent = 1289741881, rcv_tsval = 1289741893, rcv_tsecr = 4946974, 
    saw_tstamp = 1, tstamp_ok = 1, dsack = 0, wscale_ok = 1, sack_ok = 3, 
    snd_wscale = 0, rcv_wscale = 7, eff_sacks = 3 '\003', 
    num_sacks = 4 '\004', user_mss = 0, mss_clamp = 1414}, snd_ssthresh = 10, 
  snd_cwnd = 1, snd_cwnd_cnt = 1, snd_cwnd_clamp = 4294967295, 
  snd_cwnd_used = 0, snd_cwnd_stamp = 4950107, out_of_order_queue = {
    next = 0xf7d18480, prev = 0xf68436c0, qlen = 20, lock = {
      raw_lock = {<No data fields>}}}, rcv_wnd = 63232, 
  write_seq = 4014290666, pushed_seq = 4014290666, duplicate_sack = {{
      start_seq = 3213316897, end_seq = 3213317373}}, selective_acks = {{
      start_seq = 3213363849, end_seq = 3213368850}, {start_seq = 3213361222, 
      end_seq = 3213362459}, {start_seq = 3213357313, end_seq = 3213359832}, {
      start_seq = 3213351135, end_seq = 3213357073}}, recv_sack_cache = {{
      start_seq = 1945650415, end_seq = 1393444335}, {start_seq = 0, 
      end_seq = 0}, {start_seq = 0, end_seq = 0}, {start_seq = 0, 
      end_seq = 0}}, highest_sack = 4014278893, lost_skb_hint = 0xf56d8480, 
  scoreboard_skb_hint = 0x0, retransmit_skb_hint = 0xe218dc00, 
  forward_skb_hint = 0x0, fastpath_skb_hint = 0x0, fastpath_cnt_hint = 15, 
  lost_cnt_hint = 13, retransmit_cnt_hint = 0, lost_retrans_low = 0, 
  advmss = 1448, prior_ssthresh = 9, lost_out = 8, sacked_out = 8, 
  fackets_out = 16, high_seq = 4014280275, retrans_stamp = 4946974, 
  undo_marker = 4014267677, undo_retrans = 17, urg_seq = 0, urg_data = 0, 
  urg_mode = 0 '\0', ecn_flags = 0 '\0', snd_up = 0, total_retrans = 224, 
  bytes_acked = 0, keepalive_time = 0, keepalive_intvl = 0, linger2 = 0, 
  last_synq_overflow = 0, tso_deferred = 0, rcv_rtt_est = {rtt = 11331, 
    seq = 3213382083, time = 4920502}, rcvq_space = {space = 31540, 
    seq = 3213346721, time = 4943716}, mtu_probe = {probe_seq_start = 0, 
    probe_seq_end = 0}}

Thanks.

-- 
Guillaume

^ permalink raw reply

* [NET] SAA9730: Fix build
From: Ralf Baechle @ 2007-10-14 13:13 UTC (permalink / raw)
  To: Andrew Morton, Jeff Garzik, netdev

Fix build breakage by the recent statistics cleanup in cset
09f75cd7bf13720738e6a196cc0107ce9a5bd5a0.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/drivers/net/saa9730.c b/drivers/net/saa9730.c
index 14361e8..c65199d 100644
--- a/drivers/net/saa9730.c
+++ b/drivers/net/saa9730.c
@@ -97,13 +97,16 @@ static void evm_saa9730_unblock_lan_int(struct lan_saa9730_private *lp)
 	       &lp->evm_saa9730_regs->InterruptBlock1);
 }
 
-static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp)
+static void __used show_saa9730_regs(struct net_device *dev)
 {
+	struct lan_saa9730_private *lp = netdev_priv(dev);
 	int i, j;
+
 	printk("TxmBufferA = %p\n", lp->TxmBuffer[0][0]);
 	printk("TxmBufferB = %p\n", lp->TxmBuffer[1][0]);
 	printk("RcvBufferA = %p\n", lp->RcvBuffer[0][0]);
 	printk("RcvBufferB = %p\n", lp->RcvBuffer[1][0]);
+
 	for (i = 0; i < LAN_SAA9730_BUFFERS; i++) {
 		for (j = 0; j < LAN_SAA9730_TXM_Q_SIZE; j++) {
 			printk("TxmBuffer[%d][%d] = %x\n", i, j,
@@ -146,11 +149,13 @@ static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp)
 	       readl(&lp->lan_saa9730_regs->RxCtl));
 	printk("lp->lan_saa9730_regs->RxStatus = %x\n",
 	       readl(&lp->lan_saa9730_regs->RxStatus));
+
 	for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) {
 		writel(i, &lp->lan_saa9730_regs->CamAddress);
 		printk("lp->lan_saa9730_regs->CamData = %x\n",
 		       readl(&lp->lan_saa9730_regs->CamData));
 	}
+
 	printk("dev->stats.tx_packets = %lx\n", dev->stats.tx_packets);
 	printk("dev->stats.tx_errors = %lx\n", dev->stats.tx_errors);
 	printk("dev->stats.tx_aborted_errors = %lx\n",
@@ -855,7 +860,7 @@ static void lan_saa9730_tx_timeout(struct net_device *dev)
 	/* Transmitter timeout, serious problems */
 	dev->stats.tx_errors++;
 	printk("%s: transmit timed out, reset\n", dev->name);
-	/*show_saa9730_regs(lp); */
+	/*show_saa9730_regs(dev); */
 	lan_saa9730_restart(lp);
 
 	dev->trans_start = jiffies;

^ permalink raw reply related

* [NET] TC35815: Fix build
From: Ralf Baechle @ 2007-10-14 13:40 UTC (permalink / raw)
  To: Andrew Morton, Jeff Garzik, netdev; +Cc: Stephen Hemminger, Atsushi Nemoto

bea3348eef27e6044b6161fd04c3152215f96411 broke the build of tc35815.c
for the non-NAPI case:

  CC      drivers/net/tc35815.o
drivers/net/tc35815.c: In function 'tc35815_interrupt':
drivers/net/tc35815.c:1464: error: redefinition of 'lp'
drivers/net/tc35815.c:1443: error: previous definition of 'lp' was here

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index a679f43..8038f28 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -1461,7 +1461,6 @@ static irqreturn_t tc35815_interrupt(int irq, void *dev_id)
 	}
 	return IRQ_NONE;
 #else
-	struct tc35815_local *lp = dev->priv;
 	int handled;
 	u32 status;
 

^ permalink raw reply related

* [PATCH][NETNS] Don't panic on creating the namespace's loopback
From: Pavel Emelyanov @ 2007-10-15 10:23 UTC (permalink / raw)
  To: David Miller; +Cc: Eric W. Biederman, Daniel Lezcano, Linux Netdev List, devel

When the loopback device is failed to initialize inside the new 
namespaces, panic() is called. Do not do it when the namespace 
in question is not the init_net.

Plus cleanup the error path a bit.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

 drivers/net/loopback.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index be25aa3..662b8d1 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -265,17 +265,16 @@ static __net_init int loopback_net_init(struct net *net)
 	if (err)
 		goto out_free_netdev;
 
-	err = 0;
 	net->loopback_dev = dev;
+	return 0;
 
-out:
-	if (err)
-		panic("loopback: Failed to register netdevice: %d\n", err);
-	return err;
 
 out_free_netdev:
 	free_netdev(dev);
-	goto out;
+out:
+	if (net == &init_net)
+		panic("loopback: Failed to register netdevice: %d\n", err);
+	return err;
 }
 
 static __net_exit void loopback_net_exit(struct net *net)

^ permalink raw reply related

* Re: [PATCH 4/4] UDP memory accounting and limitation(take 5): memory limitation
From: Herbert Xu @ 2007-10-15 10:43 UTC (permalink / raw)
  To: Satoshi OSHIMA
  Cc: David Miller, netdev, Hideo AOKI, Yumiko SUGITA,
	"青木@RedHat", Andi Kleen, Evgeniy Polyakov,
	Stephen Hemminger, 吉藤 英明
In-Reply-To: <470F646F.2030003@hitachi.com>

On Fri, Oct 12, 2007 at 09:11:27PM +0900, Satoshi OSHIMA wrote:
>
> +static inline int __ip_check_max_skb_pages(struct sock *sk, int size)
> +{
> +	switch(sk->sk_protocol) {
> +	case IPPROTO_UDP:
> +		if (sk->sk_prot->sysctl_mem[0] > UDP_MIN_SKB_PAGES)
> +			if (atomic_read(sk->sk_prot->memory_allocated)+size
> +			    >= sk->sk_prot->sysctl_mem[0])
> +				return -ENOBUFS;
> +		/* Fall through */	
> +	default:
> +		break;
> +	}
> +	return 0;
> +}

Since you're not doing a per-user limit, you must give each
socket a minimum even when the total exceeds your threshold.

Otherwise any local user can trivially DoS the whole system.

> +UDP variables:
> +
> +udp_mem - INTERGER
> +	Number of pages allowed for queueing by all UDP sockets.
> +	Minimal value is 4096. If 4096 is set, UDP memory will not
> +	be limited.
> +	Default: 4096

This seems to be a rather confusing setup.  We don't set a
minimum for TCP so is this really necessary?

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: kernel BUG at net/core/dev.c:1383 skb_checksum_help: BUG_ON(offset > (int)skb->len)
From: Ilpo Järvinen @ 2007-10-15 10:54 UTC (permalink / raw)
  To: Guillaume Chazarain; +Cc: Netdev
In-Reply-To: <20071015121829.15521102@inria.fr>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1167 bytes --]

On Mon, 15 Oct 2007, Guillaume Chazarain wrote:

> Le Mon, 15 Oct 2007 13:15:05 +0300 (EEST),
> "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi> a écrit :
>  
> > ...Never mind, noticed the fix later on.
> 
> Yes, but here is it anyway, in case you see something fishy.
>
> (gdb) p *(struct tcp_sock *)skb->sk
> $4 = {inet_conn = {icsk_inet = {sk = {__sk_common = {skc_family = 2, 

...snip...

>   mdev_max = 3080, rttvar = 3080, rtt_seq = 4014273285, packets_out = 16, 
>   retrans_out = 0, rx_opt = {ts_recent_stamp = 1192377268, 

...snip...

>   advmss = 1448, prior_ssthresh = 9, lost_out = 8, sacked_out = 8, 
>   fackets_out = 16, high_seq = 4014280275, retrans_stamp = 4946974, 
> 
> Thanks.

Hmm. Thanks.

Unlikely that there is something wrong. From values I counted that 
packets_out - (sacked_out + left_out) + retrans_out yields to zero,
so such large underflow is probably due to prior_inflight reused for 
something, though of course that particular state when prior_inflight
is collected is no longer available to us because tcp_clean_rtx_queue
was likely executed as packets_acked is 1. So I don't intend to do
further investigation on this one.

-- 
 i.

^ permalink raw reply

* Re: [PATCH v3 4/4] FEC mpc52xx: phy part of the driver\
From: Domen Puncer @ 2007-10-15 10:56 UTC (permalink / raw)
  To: Grant Likely; +Cc: galak, jgarzik, linuxppc-dev, tnt, netdev
In-Reply-To: <fa686aa40710141505w1787e7e1g6116185001561a4d@mail.gmail.com>

On 14/10/07 16:05 -0600, Grant Likely wrote:
> On 10/14/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> > PHY part of the driver for mpc5200(b) ethernet.
> 
> Assuming I understand correctly, this comment is not correct and this
> patch just adds an MDIO bus driver.  PHY drivers are in phylib and
> data transfer is setup via the core driver, correct?

Right.

> 
> It is conceivable that the PHY is connected to an alternate MDIO bus,
> or the MDIO bus is used for a PHY connected to an external Ethernet
> controller.
> 
> Speaking of which, is it possible to use this MDIO bus without the
> core FEC being initialized?

IIRC fec doesn't need any initialization for MDIO bus registers to work.

> 
> > +static struct of_device_id fec_mdio_match[] = {
> > +       {
> > +               .type = "mdio",
> > +               .compatible = "mpc5200b-fec-phy",
> 
> This is not a phy; it's an MDIO bus.  Also, shouldn't this be
> "mpc5200-..." instead of "mpc5200b-..."?

Didn't know if it's ok for mpc5200, guess it is?

> 
> > +       },
> > +       {},
> > +};
> > +
> > +struct of_platform_driver mpc52xx_fec_mdio_driver = {
> > +       .name = "mpc5200b-fec-phy",
> > +       .probe = fec_mdio_probe,
> > +       .remove = fec_mdio_remove,
> > +       .match_table = fec_mdio_match,
> 
> Inconsistent naming.  Please use the same prefix on all global/static
> symbols (ie. use "mpc52xx_mdio_" instead of the mix of
> "mpc52xx_fec_mdio_", "fec_mdio_", etc.)  I also thing that "fec_mdio_"
> is too generic because there are a number of different incompatible
> FEC devices.

OK.

> 
> > +};
> > +
> > +/* let fec driver call it, since this has to be registered before it */
> > +EXPORT_SYMBOL_GPL(mpc52xx_fec_mdio_driver);
> 
> Why not have a module_init()/module_exit() in this file?  I don't
> think the FEC driver calls this driver's functions directly anymore,
> and it's still dependent on the of_platform bus probe order anyway.

It was one way of making sure mdio driver is registered before fec.
(and of_platform bus probe order won't work for modules)
Nicer alternatives?

> 
> As an added bonus, it makes your Makefile much simpler.
> 
> > +
> > +
> > +MODULE_LICENSE("Dual BSD/GPL");
> > Index: linux.git/drivers/net/fec_mpc52xx/Makefile
> > ===================================================================
> > --- linux.git.orig/drivers/net/fec_mpc52xx/Makefile
> > +++ linux.git/drivers/net/fec_mpc52xx/Makefile
> > @@ -1,2 +1,7 @@
> >  obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx.o
> >  fec_mpc52xx-objs := fec.o
> > +
> > +ifeq ($(CONFIG_FEC_MPC52xx_MDIO),y)
> > +       obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx_phy.o
> > +       fec_mpc52xx_phy-objs := fec_phy.o
> > +endif
> > Index: linux.git/drivers/net/fec_mpc52xx/Kconfig
> > ===================================================================
> > --- linux.git.orig/drivers/net/fec_mpc52xx/Kconfig
> > +++ linux.git/drivers/net/fec_mpc52xx/Kconfig
> > @@ -11,5 +11,18 @@ config FEC_MPC52xx
> >         ---help---
> >           This option enables support for the MPC5200's on-chip
> >           Fast Ethernet Controller
> > +         If compiled as module, it will be called 'fec_mpc52xx.ko'.
> 
> Drop this line and make the help text the same format as the other eth
> drivers in drivers/net.

How exactly is it different now?
And most of them have the "Module will be called xxx" line.

> 
> > +
> > +config FEC_MPC52xx_MDIO
> > +       bool "FEC MII PHY driver"
> > +       depends on FEC_MPC52xx
> > +       default y
> > +       ---help---
> > +         The MPC5200's FEC can connect to the Ethernet either with
> > +         an external MII PHY chip or 10 Mbps 7-wire interface
> > +         (Motorola? industry standard).
> > +         If your board uses an external PHY, enable this.
> 
> Not strictly true.  This enables talking to a PHY using the internal
> MDIO controller.  PHY register access could just as easily be accessed
> via an alternate interface.

Not just that is also selects which mode will it use.
If you don't enable this, fec will be set up as 7-wire
( 696                 rcntrl |= FEC_RCNTRL_MII_MODE;)


> 
> > +         If not sure, enable.
> > +         If compiled as module, it will be called 'fec_mpc52xx_phy.ko'.
> 
> Drop the module name comment.
> 
> Cheers,
> g.
> 
> -- 
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
> grant.likely@secretlab.ca
> (403) 399-0195

-- 
Domen Puncer | Research & Development
.............................................................................................
Telargo d.o.o. | Zagrebška cesta 20 | 2000 Maribor | Slovenia
.............................................................................................
www.telargo.com

^ permalink raw reply

* RE: [PATCH] [POWERPC] ucc_geth: Fix build break introduced by commit 09f75cd7bf13720738e6a196cc0107ce9a5bd5a0
From: Li Yang-r58472 @ 2007-10-15 11:17 UTC (permalink / raw)
  To: Medve Emilian-EMMEDVE1, akpm, jgarzik, netdev, linuxppc-dev
In-Reply-To: <1192231588-17516-1-git-send-email-Emilian.Medve@Freescale.com>

> -----Original Message-----
> From: Medve Emilian-EMMEDVE1 
> Sent: Saturday, October 13, 2007 7:26 AM
> To: akpm@linux-foundation.org; jgarzik@pobox.com; Li 
> Yang-r58472; netdev@vger.kernel.org; linuxppc-dev@ozlabs.org
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH] [POWERPC] ucc_geth: Fix build break 
> introduced by commit 09f75cd7bf13720738e6a196cc0107ce9a5bd5a0
> 
> 
>   CC      drivers/net/ucc_geth.o
> drivers/net/ucc_geth.c: In function 'ucc_geth_startup':
> drivers/net/ucc_geth.c:2614: warning: assignment makes 
> integer from pointer without a cast
> drivers/net/ucc_geth.c:2651: warning: assignment makes 
> integer from pointer without a cast
> drivers/net/ucc_geth.c: In function 'ucc_geth_rx':
> drivers/net/ucc_geth.c:3483: error: 'dev' undeclared (first 
> use in this function)
> drivers/net/ucc_geth.c:3483: error: (Each undeclared 
> identifier is reported only once
> drivers/net/ucc_geth.c:3483: error: for each function it appears in.)
> make[2]: *** [drivers/net/ucc_geth.o] Error 1

Thanks for the patch.  Here are some comments.

The patch fixes the dev undeclared compile error not the warnings.  So
they shouldn't be listed here.

> 
> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> ---
> 
> Here is a convenient link for the culprit patch: 
> http://git.kernel.org/?p=linux/kernel/git/jgarzik/netdev-2.6.g
> it;a=commit;h=09f75cd7bf13720738e6a196cc0107ce9a5bd5a0
> 
> netdev-2.6> scripts/checkpatch.pl 
> 0001-POWERPC-ucc_geth-Fix-build-break-introduced-by-co.patch
> Your patch has no obvious style problems and is ready for submission.
> 
>  drivers/net/ucc_geth.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c 
> index d00e7d4..c43d4d1 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -63,7 +63,7 @@
>  #define UGETH_MSG_DEFAULT	(NETIF_MSG_IFUP << 1 ) - 1
>  
>  void uec_set_ethtool_ops(struct net_device *netdev);
> -	
> +
>  static DEFINE_SPINLOCK(ugeth_lock);
>  
>  static struct {

There are quite a few references to the dev structure.  I would prefer
to add a new variable dev here.

- Leo

> @@ -3480,9 +3480,9 @@ static int ucc_geth_rx(struct 
> ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
>  				dev_kfree_skb_any(skb);
>  
>  			
> ugeth->rx_skbuff[rxQ][ugeth->skb_currx[rxQ]] = NULL;
> -			dev->stats.rx_dropped++;
> +			ugeth->dev->stats.rx_dropped++;
>  		} else {
> -			dev->stats.rx_packets++;
> +			ugeth->dev->stats.rx_packets++;
>  			howmany++;
>  
>  			/* Prep the skb for the packet */
> @@ -3491,7 +3491,7 @@ static int ucc_geth_rx(struct 
> ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
>  			/* Tell the skb what kind of packet this is */
>  			skb->protocol = eth_type_trans(skb, ugeth->dev);
>  
> -			dev->stats.rx_bytes += length;
> +			ugeth->dev->stats.rx_bytes += length;
>  			/* Send the packet up the stack */
>  #ifdef CONFIG_UGETH_NAPI
>  			netif_receive_skb(skb);
> @@ -3506,7 +3506,7 @@ static int ucc_geth_rx(struct 
> ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
>  		if (!skb) {
>  			if (netif_msg_rx_err(ugeth))
>  				ugeth_warn("%s: No Rx Data 
> Buffer", __FUNCTION__);
> -			dev->stats.rx_dropped++;
> +			ugeth->dev->stats.rx_dropped++;
>  			break;
>  		}
>  
> --
> 1.5.3.GIT
> 
> 

^ permalink raw reply

* Re: Undocumented IPv6 options
From: Andi Kleen @ 2007-10-15 11:45 UTC (permalink / raw)
  To: Matti Aarnio
  Cc: Michael Kerrisk, netdev, linux-man, Andrew McDonald, linux-net
In-Reply-To: <20071015073903.GR6372@mea-ext.zmailer.org>

Matti Aarnio <matti.aarnio@zmailer.org> writes:
>
> Undocumented are also IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP (RFC 2553 / 3493)

The IPv6 man page was never complete when I wrote it long ago.

This 

BUGS
        ...
        This man page is not complete.

is still true.

> It really looks like time for major overhaul of that (and related) man-pages
> is needed...

IPv6 just needs finishing.

One option actually since the RFCs document IPv6 basic and extended
API very well would be to somehow pull them in similar to the POSIX
manpages and let them speak for themselves.

I don't know if that is possible with the RFC copyrights though (?)

-Andi

^ permalink raw reply

* [PATCH] Consolidate the ip6_pol_route_(input|output) pair
From: Pavel Emelyanov @ 2007-10-15 11:55 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

The difference in both functions is in the "id" passed to
the rt6_select, so just pass it as an extra argument from
two outer helpers.

This is minus 60 lines of code and 360 bytes of .text

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

 net/ipv6/route.c |   77 ++++++-------------------------------------------------
 1 files changed, 9 insertions(+), 68 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6ff19f9..cce9941 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -663,7 +663,7 @@ static struct rt6_info *rt6_alloc_clone(struct rt6_info *ort, struct in6_addr *d
 	return rt;
 }
 
-static struct rt6_info *ip6_pol_route_input(struct fib6_table *table,
+static struct rt6_info *ip6_pol_route(struct fib6_table *table, int oif,
 					    struct flowi *fl, int flags)
 {
 	struct fib6_node *fn;
@@ -682,7 +682,7 @@ restart_2:
 	fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
 
 restart:
-	rt = rt6_select(fn, fl->iif, strict | reachable);
+	rt = rt6_select(fn, oif, strict | reachable);
 	BACKTRACK(&fl->fl6_src);
 	if (rt == &ip6_null_entry ||
 	    rt->rt6i_flags & RTF_CACHE)
@@ -735,6 +735,12 @@ out2:
 	return rt;
 }
 
+static struct rt6_info *ip6_pol_route_input(struct fib6_table *table,
+					    struct flowi *fl, int flags)
+{
+	return ip6_pol_route(table, fl->iif, fl, flags);
+}
+
 void ip6_route_input(struct sk_buff *skb)
 {
 	struct ipv6hdr *iph = ipv6_hdr(skb);
@@ -761,72 +767,7 @@ void ip6_route_input(struct sk_buff *skb)
 static struct rt6_info *ip6_pol_route_output(struct fib6_table *table,
 					     struct flowi *fl, int flags)
 {
-	struct fib6_node *fn;
-	struct rt6_info *rt, *nrt;
-	int strict = 0;
-	int attempts = 3;
-	int err;
-	int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
-
-	strict |= flags & RT6_LOOKUP_F_IFACE;
-
-relookup:
-	read_lock_bh(&table->tb6_lock);
-
-restart_2:
-	fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
-
-restart:
-	rt = rt6_select(fn, fl->oif, strict | reachable);
-	BACKTRACK(&fl->fl6_src);
-	if (rt == &ip6_null_entry ||
-	    rt->rt6i_flags & RTF_CACHE)
-		goto out;
-
-	dst_hold(&rt->u.dst);
-	read_unlock_bh(&table->tb6_lock);
-
-	if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP))
-		nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src);
-	else {
-#if CLONE_OFFLINK_ROUTE
-		nrt = rt6_alloc_clone(rt, &fl->fl6_dst);
-#else
-		goto out2;
-#endif
-	}
-
-	dst_release(&rt->u.dst);
-	rt = nrt ? : &ip6_null_entry;
-
-	dst_hold(&rt->u.dst);
-	if (nrt) {
-		err = ip6_ins_rt(nrt);
-		if (!err)
-			goto out2;
-	}
-
-	if (--attempts <= 0)
-		goto out2;
-
-	/*
-	 * Race condition! In the gap, when table->tb6_lock was
-	 * released someone could insert this route.  Relookup.
-	 */
-	dst_release(&rt->u.dst);
-	goto relookup;
-
-out:
-	if (reachable) {
-		reachable = 0;
-		goto restart_2;
-	}
-	dst_hold(&rt->u.dst);
-	read_unlock_bh(&table->tb6_lock);
-out2:
-	rt->u.dst.lastuse = jiffies;
-	rt->u.dst.__use++;
-	return rt;
+	return ip6_pol_route(table, fl->oif, fl, flags);
 }
 
 struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)

^ permalink raw reply related

* Re: tcp bw in 2.6
From: Daniel Schaffrath @ 2007-10-15 12:40 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Larry McVoy, Herbert Xu, torvalds, davem, wscott, Linux NetDev
In-Reply-To: <20071002094726.154fc619@freepuppy.rosehill>

On 2007/10/02  , at 18:47, Stephen Hemminger wrote:

> On Tue, 2 Oct 2007 09:25:34 -0700
> lm@bitmover.com (Larry McVoy) wrote:
>
>>> If the server side is the source of the data, i.e, it's transfer  
>>> is a
>>> write loop, then I get the bad behaviour.
>>> ...
>>> So is this a bug or intentional?
>>
>> For whatever it is worth, I believed that we used to get better  
>> performance
>> from the same hardware.  My guess is that it changed somewhere  
>> between
>> 2.6.15-1-k7 and 2.6.18-5-k7.
>
> For the period from 2.6.15 to 2.6.18, the kernel by default enabled  
> TCP
> Appropriate Byte Counting. This caused bad performance on  
> applications that
> did small writes.
Stephen, maybe you can provide me with some specifics here?

Thanks a lot!!
Daniel


^ permalink raw reply

* Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes
From: Jarek Poplawski @ 2007-10-15 12:53 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: Andy Fleming, Andrew Morton, Jeff Garzik, netdev, linux-kernel
In-Reply-To: <Pine.LNX.4.64N.0709171750220.17606@blysk.ds.pg.gda.pl>

On 19-09-2007 16:38, Maciej W. Rozycki wrote:
...
> @@ -661,13 +664,22 @@ int phy_stop_interrupts(struct phy_devic
>  	if (err)
>  		phy_error(phydev);
>  
> +	free_irq(phydev->irq, phydev);
> +
>  	/*
> -	 * Finish any pending work; we might have been scheduled to be called
> -	 * from keventd ourselves, but cancel_work_sync() handles that.
> +	 * Cannot call flush_scheduled_work() here as desired because
> +	 * of rtnl_lock(), but we do not really care about what would
> +	 * be done, except from enable_irq(), so cancel any work
> +	 * possibly pending and take care of the matter below.
>  	 */
>  	cancel_work_sync(&phydev->phy_queue);

Hi,

Could you explain why cancel_work_sync() is better here than
flush_scheduled_work() wrt. rtnl_lock()?

Regards,
Jarek P.

^ permalink raw reply

* Re: [NOT VERY SAFE]     [TCP]: Set initial_ssthresh default to zero in Cubic and BIC.
From: Komuro @ 2007-10-15 12:59 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, linux-kernel
In-Reply-To: <20071014135356.19754635.komurojun-mbn@nifty.com>

Dear shemminger

>In which case it is zero because that is the default value.

The default value of snd_ssthresh is 0x7fffffff, isn't it?

[linux/net/ipv4/tcp_ipv4.c]
static int tcp_v4_init_sock(struct sock *sk)
...
        tp->snd_ssthresh = 0x7fffffff;  /* Infinity */
...

Best Regards
Komuro


> 
> Actually, tcp_sk(sk)->snd_ssthresh is not initialized,
> if initial_ssthresh is 0.
> 
> The patch should be
> 
>  static void bictcp_init(struct sock *sk)
>  {
>  	bictcp_reset(inet_csk_ca(sk));
> -	if (initial_ssthresh)
> -		tcp_sk(sk)->snd_ssthresh = initial_ssthresh;
> +
> +	tcp_sk(sk)->snd_ssthresh = initial_ssthresh;
>  }
>

^ permalink raw reply

* Re: [PATCH] tehuti: possible leak in bdx_probe
From: Andy Gospodarek @ 2007-10-15 13:33 UTC (permalink / raw)
  To: Florin Malita; +Cc: baum, andy, Andrew Morton, netdev
In-Reply-To: <4710FA6A.2070902@gmail.com>

On Sat, Oct 13, 2007 at 01:03:38PM -0400, Florin Malita wrote:
> If pci_enable_device fails, bdx_probe returns without freeing the 
> allocated pci_nic structure.
> 
> Coverity CID 1908.
> 
> Signed-off-by: Florin Malita <fmalita@gmail.com>
> ---
> 
> drivers/net/tehuti.c |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
> index 8d04654..4e1b84e 100644
> --- a/drivers/net/tehuti.c
> +++ b/drivers/net/tehuti.c
> @@ -1906,7 +1906,7 @@ bdx_probe(struct pci_dev *pdev, const struct 
> pci_device_id *ent)
> 
>     /************** pci *****************/
> 	if ((err = pci_enable_device(pdev)))	/* it trigers interrupt, 
> 	dunno why. */
> -		RET(err);			/* it's not a problem though 
> */
> +		goto err_pci;			/* it's not a problem though 
> */
> 
> 	if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) &&
> 	    !(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) {
> @@ -2076,6 +2076,7 @@ err_out_res:
> 	pci_release_regions(pdev);
> err_dma:
> 	pci_disable_device(pdev);
> +err_pci:
> 	vfree(nic);
> 
> 	RET(err);
> 

Good catch.  Thanks!

Acked-by: Andy Gospodarek <andy@greyhouse.net>


^ permalink raw reply

* [PATCH] Ensure that pneigh_lookup is protected with RTNL
From: Pavel Emelyanov @ 2007-10-15 13:38 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

The pnigh_lookup is used to lookup proxy entries and to 
create them in case lookup failed. 

However, the "creation" code does not perform the re-lookup
after GFP_KERNEL allocation. This is done because the code
is expected to be protected with the RTNL lock, so add the 
assertion (mainly to address future questions from new network 
developers like me :) ).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index c52df85..cd3af59 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -481,6 +481,8 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, const void *pkey,
 	if (!creat)
 		goto out;
 
+	ASSERT_RTNL();
+
 	n = kmalloc(sizeof(*n) + key_len, GFP_KERNEL);
 	if (!n)
 		goto out;


^ permalink raw reply related

* [PATCH v2] [POWERPC] ucc_geth: Fix build break introduced by commit 09f75cd7bf13720738e6a196cc0107ce9a5bd5a0
From: Emil Medve @ 2007-10-15 13:43 UTC (permalink / raw)
  To: akpm, jgarzik, leoli, netdev, linuxppc-dev; +Cc: Emil Medve

drivers/net/ucc_geth.c: In function 'ucc_geth_rx':
drivers/net/ucc_geth.c:3483: error: 'dev' undeclared (first use in this function)
drivers/net/ucc_geth.c:3483: error: (Each undeclared identifier is reported only once
drivers/net/ucc_geth.c:3483: error: for each function it appears in.)
make[2]: *** [drivers/net/ucc_geth.o] Error 1

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---

Here is a convenient link for the culprit patch: http://git.kernel.org/?p=linux/kernel/git/jgarzik/netdev-2.6.git;a=commit;h=09f75cd7bf13720738e6a196cc0107ce9a5bd5a0

netdev-2.6> scripts/checkpatch.pl 0001-POWERPC-ucc_geth-Fix-build-break-introduced-by-co.patch 
Your patch has no obvious style problems and is ready for submission.

 drivers/net/ucc_geth.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index d00e7d4..bec413b 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -63,7 +63,7 @@
 #define UGETH_MSG_DEFAULT	(NETIF_MSG_IFUP << 1 ) - 1
 
 void uec_set_ethtool_ops(struct net_device *netdev);
-	
+
 static DEFINE_SPINLOCK(ugeth_lock);
 
 static struct {
@@ -3454,9 +3454,12 @@ static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
 	u16 length, howmany = 0;
 	u32 bd_status;
 	u8 *bdBuffer;
+	struct net_device * dev;
 
 	ugeth_vdbg("%s: IN", __FUNCTION__);
 
+	dev = ugeth->dev;
+
 	/* collect received buffers */
 	bd = ugeth->rxBd[rxQ];
 
-- 
1.5.3.GIT

^ permalink raw reply related

* Re: [PATCH 5/10] [NET]: Avoid unnecessary cloning for ingress filtering
From: jamal @ 2007-10-15 13:57 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Patrick McHardy, David Miller, netdev, kuznet
In-Reply-To: <1192358991.4892.23.camel@localhost>

On Sun, 2007-14-10 at 06:49 -0400, jamal wrote:
> Once this patchset makes
> it into net-2.6.24 i can do testing on my laptop and provide you any
> further feedback. 

Works on all 4 tests i tried out on net-2.6[1]. GoodStuff Herbert.

Herbert, please look at the comment i sent on the clone vs copy. 

Also, iirc this started as a netfilter optimization thing starting with
tail-calls - can someone (Patrick?) clue me how it helps in that
optimization aspect? 

cheers,
jamal

[1] Didnt try any ipt action, will when i get the chance again. Heres
test 18b):

---
Window1) tc qdisc del dev lo ingress
Window1) tc qdisc add dev lo ingress
Window1) ifconfig dummy0 up
Window1) tcpdump -n -i lo -x -e -t &

Window2) tcpdump -n -i dummy0 -x -e -t &

Window1) tc filter add dev lo parent ffff: protocol ip prio 10 u32 \
match ip dst 127.0.0.1/32 flowid 1:2 \
action pedit munge offset 0 u32 clear pipe \
action mirred egress mirror dev dummy0

Window2) ping -c 1 127.0.0.1

Ping will fail since we are clearing first 4 byte of ip header.

Window1 will show the packet as seen on incoming by lo; the first few
bytes look like:

----
4500 0054 0000 4000 4001 3ca7 7f00 0001
----

Window2 will show the 4 bytes zeroed out as requested of pedit (and as
seen on dummy0)

---
0000 0000 0000 4000 4001 3ca7 7f00 0001
---------




^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox