[PATCH 3/4] [TCP]: Add unlikely() to sacktag out-of-mem in fragment case

2007-11-10 Thread Ilpo Järvinen
Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9fc9096..84bcdc9 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1400,7 +1400,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
/* DSACK info lost if out-of-mem, try SACK still */
if (in_sack = 0)
in_sack = tcp_match_skb_to_sack(sk, skb, 
start_seq, end_seq);
-   if (in_sack  0)
+   if (unlikely(in_sack  0))
break;
 
sacked = TCP_SKB_CB(skb)-sacked;
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-2.6 0/4] [TCP]: Bug fixes minor tweaks

2007-11-10 Thread Ilpo Järvinen
Hi,  
 
Here are some changes that should go to net-2.6. Boot  simple
transfer tested. I'll do future cleanups that are now possible
in a different series to a next kernel version.  
 
--   
 i.  


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] [TCP]: Consider GSO while counting reord in sacktag

2007-11-10 Thread Ilpo Järvinen
Reordering detection fails to take account that the reordered
skb may have pcount larger than 1. In such case the lowest of
them had the largest reordering, the old formula used the
highest of them which is pcount - 1 packets less reordered.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index ca9590f..0f75757 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1403,8 +1403,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
if (in_sack  0)
break;
 
-   fack_count += tcp_skb_pcount(skb);
-
sacked = TCP_SKB_CB(skb)-sacked;
 
/* Account D-SACK for retransmitted packet. */
@@ -1427,11 +1425,14 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
}
 
/* Nothing to do; acked frame is about to be 
dropped. */
+   fack_count += tcp_skb_pcount(skb);
continue;
}
 
-   if (!in_sack)
+   if (!in_sack) {
+   fack_count += tcp_skb_pcount(skb);
continue;
+   }
 
if (!(sackedTCPCB_SACKED_ACKED)) {
if (sacked  TCPCB_SACKED_RETRANS) {
@@ -1480,6 +1481,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
flag |= FLAG_DATA_SACKED;
tp-sacked_out += tcp_skb_pcount(skb);
 
+   fack_count += tcp_skb_pcount(skb);
if (fack_count  tp-fackets_out)
tp-fackets_out = fack_count;
 
@@ -1490,6 +1492,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
} else {
if (dup_sack  (sackedTCPCB_RETRANS))
reord = min(fack_count, reord);
+
+   fack_count += tcp_skb_pcount(skb);
}
 
/* D-SACK. We can detect redundant retransmission
@@ -1515,7 +1519,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
 
if ((reord  tp-fackets_out)  icsk-icsk_ca_state != TCP_CA_Loss 
(!tp-frto_highmark || after(tp-snd_una, tp-frto_highmark)))
-   tcp_update_reordering(sk, ((tp-fackets_out + 1) - reord), 0);
+   tcp_update_reordering(sk, tp-fackets_out - reord, 0);
 
 #if FASTRETRANS_DEBUG  0
BUG_TRAP((int)tp-sacked_out = 0);
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] [TCP]: Fix reord detection due to snd_una covered holes

2007-11-10 Thread Ilpo Järvinen
Fixes subtle bug like the one with fastpath_cnt_hint happening
due to the way the GSO and hints interact. Because hints are not
reset when just a GSOed skb is partially ACKed, there's no
guarantee that the relevant part of the write queue is going to
be processed in sacktag at all (skbs below snd_una) because
fastpath hint can fast forward the entrypoint.

This was also on the way of future reductions in sacktag's skb
processing. Also future cleanups in sacktag can be made after
this (in 2.6.25).

This may make reordering update in tcp_try_undo_partial
redundant but I'm not too sure so I left it there.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |   50 --
 1 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 0f75757..9fc9096 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1417,11 +1417,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
if ((dup_sack  in_sack) 
(sackedTCPCB_SACKED_ACKED))
reord = min(fack_count, reord);
-   } else {
-   /* If it was in a hole, we detected 
reordering. */
-   if (fack_count  prior_fackets 
-   !(sackedTCPCB_SACKED_ACKED))
-   reord = min(fack_count, reord);
}
 
/* Nothing to do; acked frame is about to be 
dropped. */
@@ -2634,7 +2629,8 @@ static u32 tcp_tso_acked(struct sock *sk, struct sk_buff 
*skb)
  * is before the ack sequence we can discard it as it's confirmed to have
  * arrived at the other end.
  */
-static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
+static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
+  int prior_fackets)
 {
struct tcp_sock *tp = tcp_sk(sk);
const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -2643,6 +2639,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 
*seq_rtt_p)
int fully_acked = 1;
int flag = 0;
int prior_packets = tp-packets_out;
+   u32 cnt = 0;
+   u32 reord = tp-packets_out;
s32 seq_rtt = -1;
ktime_t last_ackt = net_invalid_timestamp();
 
@@ -2683,10 +2681,14 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 
*seq_rtt_p)
if ((flag  FLAG_DATA_ACKED) ||
(packets_acked  1))
flag |= FLAG_NONHEAD_RETRANS_ACKED;
-   } else if (seq_rtt  0) {
-   seq_rtt = now - scb-when;
-   if (fully_acked)
-   last_ackt = skb-tstamp;
+   } else {
+   if (seq_rtt  0) {
+   seq_rtt = now - scb-when;
+   if (fully_acked)
+   last_ackt = skb-tstamp;
+   }
+   if (!(sacked  TCPCB_SACKED_ACKED))
+   reord = min(cnt, reord);
}
 
if (sacked  TCPCB_SACKED_ACKED)
@@ -2697,12 +2699,16 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 
*seq_rtt_p)
if ((sacked  TCPCB_URG)  tp-urg_mode 
!before(end_seq, tp-snd_up))
tp-urg_mode = 0;
-   } else if (seq_rtt  0) {
-   seq_rtt = now - scb-when;
-   if (fully_acked)
-   last_ackt = skb-tstamp;
+   } else {
+   if (seq_rtt  0) {
+   seq_rtt = now - scb-when;
+   if (fully_acked)
+   last_ackt = skb-tstamp;
+   }
+   reord = min(cnt, reord);
}
tp-packets_out -= packets_acked;
+   cnt += packets_acked;
 
/* Initial outgoing SYN's get put onto the write_queue
 * just like anything else we transmit.  It is not
@@ -2734,13 +2740,18 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 
*seq_rtt_p)
tcp_ack_update_rtt(sk, flag, seq_rtt);
tcp_rearm_rto(sk);
 
+   if (tcp_is_reno(tp)) {
+   tcp_remove_reno_sacks(sk, pkts_acked);
+   } else {
+   /* Non-retransmitted hole got filled? That's reordering 
*/
+   

[PATCH 4/4] [TCP]: Split SACK FRTO flag clearing (fixes FRTO corner case bug)

2007-11-10 Thread Ilpo Järvinen
In case we run out of mem when fragmenting, the clearing of
FLAG_ONLY_ORIG_SACKED might get missed which then feeds FRTO
with false information. Move clearing outside skb processing
loop so that it will get executed even if the skb loop
terminates prematurely due to out-of-mem.

Besides, now the core of the loop truly deals with a single
skb only, which also enables creation a more self-contained
of tcp_sacktag_one later on.

In addition, small reorganization of if branches was made.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |   35 +--
 1 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 84bcdc9..20c9440 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1444,12 +1444,17 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
tp-retransmit_skb_hint = NULL;
}
} else {
-   /* New sack for not retransmitted frame,
-* which was in hole. It is reordering.
-*/
-   if (!(sacked  TCPCB_RETRANS) 
-   fack_count  prior_fackets)
-   reord = min(fack_count, reord);
+   if (!(sacked  TCPCB_RETRANS)) {
+   /* New sack for not 
retransmitted frame,
+* which was in hole. It is 
reordering.
+*/
+   if (fack_count  prior_fackets)
+   reord = min(fack_count, 
reord);
+
+   /* SACK enhanced F-RTO 
(RFC4138; Appendix B) */
+   if 
(!after(TCP_SKB_CB(skb)-end_seq, tp-frto_highmark))
+   flag |= 
FLAG_ONLY_ORIG_SACKED;
+   }
 
if (sacked  TCPCB_LOST) {
TCP_SKB_CB(skb)-sacked = 
~TCPCB_LOST;
@@ -1458,18 +1463,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
/* clear lost hint */
tp-retransmit_skb_hint = NULL;
}
-   /* SACK enhanced F-RTO detection.
-* Set flag if and only if non-rexmitted
-* segments below frto_highmark are
-* SACKed (RFC4138; Appendix B).
-* Clearing correct due to in-order walk
-*/
-   if (after(end_seq, tp-frto_highmark)) {
-   flag = ~FLAG_ONLY_ORIG_SACKED;
-   } else {
-   if (!(sacked  TCPCB_RETRANS))
-   flag |= 
FLAG_ONLY_ORIG_SACKED;
-   }
}
 
TCP_SKB_CB(skb)-sacked |= TCPCB_SACKED_ACKED;
@@ -1503,6 +1496,12 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
tp-retransmit_skb_hint = NULL;
}
}
+
+   /* SACK enhanced FRTO (RFC4138, Appendix B): Clearing correct
+* due to in-order walk
+*/
+   if (after(end_seq, tp-frto_highmark))
+   flag = ~FLAG_ONLY_ORIG_SACKED;
}
 
if (tp-retrans_out 
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


IPSec in tunnel mode on ARM not working

2007-11-10 Thread Guennadi Liakhovetski
Hi

Got two setups: with an ARM-based router and with a PC, connecting to 
a remote site using IPSec in tunnel mode over ppp. Setup is identical, 
PC works, ARM router doesn't. Kernel 2.6.23.1.

The setup looks like

PCa --- routerA ==== routerB --- PCb

where routerA is our problematic router. We issue ping from PCa to PCb, we 
see ICMP packet coming to PCb, being answered, coming back to routerA, and 
there it doesn't get through to PCa. We see it with iptables LOG coming 
into the INPUT chain, and that's about it.

Does anyone haveexperiences with IPSec in tunnel mode on ARM? Or does 
anyone have debugging ideas? Is there a description somewhere how an 
incoming packet traverses the networking stack in such a setup?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.

DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


UDP-Lite and /proc/net/snmp

2007-11-10 Thread Herbert Xu
Hi Dave:

It looks like the addition of UDP-Lite has upset netstat:

$ netstat -s
Ip:
1257344 total packets received
6 with invalid addresses
0 forwarded
0 incoming packets discarded
1257338 incoming packets delivered
1257151 requests sent out
Icmp:
0 ICMP messages received
0 input ICMP message failed.
ICMP input histogram:
0 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
Tcp:
2 active connections openings
3 passive connection openings
0 failed connection attempts
0 connection resets received
1 connections established
1257288 segments received
1257134 segments send out
0 segments retransmited
0 bad segments received.
0 resets sent
Udp:
30 packets received
0 packets to unknown port received.
0 packet receive errors
17 packets sent
UdpLite:
error parsing /proc/net/snmp: Success
$

Should we remove it again or let it stay this time?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread YOSHIFUJI Hideaki / 吉藤英明
In article [EMAIL PROTECTED] (at Sat, 10 Nov 2007 21:14:29 +0800), Herbert Xu 
[EMAIL PROTECTED] says:

 It looks like the addition of UDP-Lite has upset netstat:
 
 $ netstat -s
 Ip:
:
 Udp:
 30 packets received
 0 packets to unknown port received.
 0 packet receive errors
 17 packets sent
 UdpLite:
 error parsing /proc/net/snmp: Success
 $
 
 Should we remove it again or let it stay this time?

Hmm?  netstat 1.42 (net-tools 1.60) seems fine.
Which netstat are you using?

--yoshfuji
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread Eric Dumazet

YOSHIFUJI Hideaki / 吉藤英明 a écrit :

In article [EMAIL PROTECTED] (at Sat, 10 Nov 2007 21:14:29 +0800), Herbert Xu 
[EMAIL PROTECTED] says:


It looks like the addition of UDP-Lite has upset netstat:

$ netstat -s
Ip:

:

Udp:
30 packets received
0 packets to unknown port received.
0 packet receive errors
17 packets sent
UdpLite:
error parsing /proc/net/snmp: Success
$

Should we remove it again or let it stay this time?


Hmm?  netstat 1.42 (net-tools 1.60) seems fine.
Which netstat are you using?



I have the same problem with a netstat 1.42 (debian x86_64 lenny/sid)



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH][IPV4] Remove bugus goto-s from ip_route_input_slow

2007-11-10 Thread Pavel Emelyanov
Both places look like

if (err == XXX) 
   goto yyy;
   done:

while both yyy targets look like

err = XXX;
goto done;

so this is ok to remove the above if-s.

yyy labels are used in other places and are not removed.

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

---

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 21b12de..c95b270 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1813,11 +1813,6 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
goto martian_destination;
 
err = ip_mkroute_input(skb, res, fl, in_dev, daddr, saddr, tos);
-   if (err == -ENOBUFS)
-   goto e_nobufs;
-   if (err == -EINVAL)
-   goto e_inval;
-
 done:
in_dev_put(in_dev);
if (free_res)
-- 
1.5.3.4

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Make helper to get dst entry and use is

2007-11-10 Thread Pavel Emelyanov
There are many places that get the dst entry, increase the
__use counter and set the lastuse time stamp.

Make a helper for this.

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

---

diff --git a/include/net/dst.h b/include/net/dst.h
index e9ff4a4..2f65e89 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -143,6 +143,13 @@ static inline void dst_hold(struct dst_entry * dst)
atomic_inc(dst-__refcnt);
 }
 
+static inline void dst_use(struct dst_entry *dst, unsigned long time)
+{
+   dst_hold(dst);
+   dst-__use++;
+   dst-lastuse = time;
+}
+
 static inline
 struct dst_entry * dst_clone(struct dst_entry * dst)
 {
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 97eee5e..3e5 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -293,9 +293,7 @@ static int dn_insert_route(struct dn_route *rt, unsigned 
hash, struct dn_route *
   dn_rt_hash_table[hash].chain);
rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth);
 
-   rth-u.dst.__use++;
-   dst_hold(rth-u.dst);
-   rth-u.dst.lastuse = now;
+   dst_use(rth-u.dst, now);
spin_unlock_bh(dn_rt_hash_table[hash].lock);
 
dnrt_drop(rt);
@@ -308,9 +306,7 @@ static int dn_insert_route(struct dn_route *rt, unsigned 
hash, struct dn_route *
rcu_assign_pointer(rt-u.dst.dn_next, dn_rt_hash_table[hash].chain);
rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt);
 
-   dst_hold(rt-u.dst);
-   rt-u.dst.__use++;
-   rt-u.dst.lastuse = now;
+   dst_use(rt-u.dst, now);
spin_unlock_bh(dn_rt_hash_table[hash].lock);
*rp = rt;
return 0;
@@ -1182,9 +1178,7 @@ static int __dn_route_output_key(struct dst_entry **pprt, 
const struct flowi *fl
(flp-mark == rt-fl.mark) 
(rt-fl.iif == 0) 
(rt-fl.oif == flp-oif)) {
-   rt-u.dst.lastuse = jiffies;
-   dst_hold(rt-u.dst);
-   rt-u.dst.__use++;
+   dst_use(rt-u.dst, jiffies);
rcu_read_unlock_bh();
*pprt = rt-u.dst;
return 0;
@@ -1456,9 +1450,7 @@ int dn_route_input(struct sk_buff *skb)
(rt-fl.oif == 0) 
(rt-fl.mark == skb-mark) 
(rt-fl.iif == cb-iif)) {
-   rt-u.dst.lastuse = jiffies;
-   dst_hold(rt-u.dst);
-   rt-u.dst.__use++;
+   dst_use(rt-u.dst, jiffies);
rcu_read_unlock();
skb-dst = (struct dst_entry *)rt;
return 0;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c95b270..4565183 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -851,9 +851,7 @@ restart:
 */
rcu_assign_pointer(rt_hash_table[hash].chain, rth);
 
-   rth-u.dst.__use++;
-   dst_hold(rth-u.dst);
-   rth-u.dst.lastuse = now;
+   dst_use(rth-u.dst, now);
spin_unlock_bh(rt_hash_lock_addr(hash));
 
rt_drop(rt);
@@ -1930,9 +1928,7 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, 
__be32 saddr,
rth-fl.oif == 0 
rth-fl.mark == skb-mark 
rth-fl.fl4_tos == tos) {
-   rth-u.dst.lastuse = jiffies;
-   dst_hold(rth-u.dst);
-   rth-u.dst.__use++;
+   dst_use(rth-u.dst, jiffies);
RT_CACHE_STAT_INC(in_hit);
rcu_read_unlock();
skb-dst = (struct dst_entry*)rth;
@@ -2326,9 +2322,7 @@ int __ip_route_output_key(struct rtable **rp, const 
struct flowi *flp)
rth-fl.mark == flp-mark 
!((rth-fl.fl4_tos ^ flp-fl4_tos) 
(IPTOS_RT_MASK | RTO_ONLINK))) {
-   rth-u.dst.lastuse = jiffies;
-   dst_hold(rth-u.dst);
-   rth-u.dst.__use++;
+   dst_use(rth-u.dst, jiffies);
RT_CACHE_STAT_INC(out_hit);
rcu_read_unlock_bh();
*rp = rth;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 973a97a..6ecb5e6 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -544,12 +544,8 @@ restart:
rt = rt6_device_match(rt, fl-oif, flags);
BACKTRACK(fl-fl6_src);
 out:
-   dst_hold(rt-u.dst);
+   dst_use(rt-u.dst, jiffies);
read_unlock_bh(table-tb6_lock);
-
-   

[PATCH] Use list_head-s in inetpeer.c

2007-11-10 Thread Pavel Emelyanov
The inetpeer.c tracks the LRU list of inet_perr-s, but makes
it by hands. Use the list_head-s for this.

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

---

diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index aa10a81..ad8404b 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -22,7 +22,7 @@ struct inet_peer
__be32  v4daddr;/* peer's address */
__u16   avl_height;
__u16   ip_id_count;/* IP ID for the next packet */
-   struct inet_peer*unused_next, **unused_prevp;
+   struct list_headunused;
__u32   dtime;  /* the time of last use of not
 * referenced entries */
atomic_trefcnt;
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 771031d..af99519 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -61,7 +61,7 @@
  *  4.  Global variable peer_total is modified under the pool lock.
  *  5.  struct inet_peer fields modification:
  * avl_left, avl_right, avl_parent, avl_height: pool lock
- * unused_next, unused_prevp: unused node list lock
+ * unused: unused node list lock
  * refcnt: atomically against modifications on other CPU;
  *usually under some other lock to prevent node disappearing
  * dtime: unused node list lock
@@ -94,8 +94,7 @@ int inet_peer_maxttl __read_mostly = 10 * 60 * HZ;/* 
usual time to live: 10 min
 int inet_peer_gc_mintime __read_mostly = 10 * HZ;
 int inet_peer_gc_maxtime __read_mostly = 120 * HZ;
 
-static struct inet_peer *inet_peer_unused_head;
-static struct inet_peer **inet_peer_unused_tailp = inet_peer_unused_head;
+static LIST_HEAD(unused_peers);
 static DEFINE_SPINLOCK(inet_peer_unused_lock);
 
 static void peer_check_expire(unsigned long dummy);
@@ -138,15 +137,7 @@ void __init inet_initpeers(void)
 static void unlink_from_unused(struct inet_peer *p)
 {
spin_lock_bh(inet_peer_unused_lock);
-   if (p-unused_prevp != NULL) {
-   /* On unused list. */
-   *p-unused_prevp = p-unused_next;
-   if (p-unused_next != NULL)
-   p-unused_next-unused_prevp = p-unused_prevp;
-   else
-   inet_peer_unused_tailp = p-unused_prevp;
-   p-unused_prevp = NULL; /* mark it as removed */
-   }
+   list_del_init(p-unused);
spin_unlock_bh(inet_peer_unused_lock);
 }
 
@@ -337,24 +328,24 @@ static void unlink_from_pool(struct inet_peer *p)
 /* May be called with local BH enabled. */
 static int cleanup_once(unsigned long ttl)
 {
-   struct inet_peer *p;
+   struct inet_peer *p = NULL;
 
/* Remove the first entry from the list of unused nodes. */
spin_lock_bh(inet_peer_unused_lock);
-   p = inet_peer_unused_head;
-   if (p != NULL) {
-   __u32 delta = (__u32)jiffies - p-dtime;
+   if (!list_empty(unused_peers)) {
+   __u32 delta;
+
+   p = list_first_entry(unused_peers, struct inet_peer, unused);
+   delta = (__u32)jiffies - p-dtime;
+
if (delta  ttl) {
/* Do not prune fresh entries. */
spin_unlock_bh(inet_peer_unused_lock);
return -1;
}
-   inet_peer_unused_head = p-unused_next;
-   if (p-unused_next != NULL)
-   p-unused_next-unused_prevp = p-unused_prevp;
-   else
-   inet_peer_unused_tailp = p-unused_prevp;
-   p-unused_prevp = NULL; /* mark as not on the list */
+
+   list_del_init(p-unused);
+
/* Grab an extra reference to prevent node disappearing
 * before unlink_from_pool() call. */
atomic_inc(p-refcnt);
@@ -412,7 +403,7 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create)
 
/* Link the node. */
link_to_pool(n);
-   n-unused_prevp = NULL; /* not on the list */
+   INIT_LIST_HEAD(n-unused);
peer_total++;
write_unlock_bh(peer_pool_lock);
 
@@ -467,10 +458,7 @@ void inet_putpeer(struct inet_peer *p)
 {
spin_lock_bh(inet_peer_unused_lock);
if (atomic_dec_and_test(p-refcnt)) {
-   p-unused_prevp = inet_peer_unused_tailp;
-   p-unused_next = NULL;
-   *inet_peer_unused_tailp = p;
-   inet_peer_unused_tailp = p-unused_next;
+   list_add_tail(p-unused, unused_peers);
p-dtime = (__u32)jiffies;
}
spin_unlock_bh(inet_peer_unused_lock);
-- 
1.5.3.4

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread Herbert Xu
On Sat, Nov 10, 2007 at 10:32:43PM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:

 Hmm?  netstat 1.42 (net-tools 1.60) seems fine.
 Which netstat are you using?

The one from Debian etch:

$ netstat -V
net-tools 1.60
netstat 1.42 (2001-04-15)
Fred Baumgarten, Alan Cox, Bernd Eckenfels, Phil Blundell, Tuan Hoang and others
+NEW_ADDRT +RTF_IRTT +RTF_REJECT +FW_MASQUERADE +I18N
AF: (inet) +UNIX +INET +INET6 +IPX +AX25 +NETROM +X25 +ATALK +ECONET +ROSE
HW:  +ETHER +ARC +SLIP +PPP +TUNNEL +TR +AX25 +NETROM +X25 +FR +ROSE +ASH +SIT 
+FDDI +HIPPI +HDLC/LAPB +EUI64
$

BTW, netstat only breaks if you run it with -s as otherwise
it doesn't look at /proc/net/snmp.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread YOSHIFUJI Hideaki / 吉藤英明
In article [EMAIL PROTECTED] (at Sat, 10 Nov 2007 22:33:25 +0800), Herbert Xu 
[EMAIL PROTECTED] says:

 On Sat, Nov 10, 2007 at 10:32:43PM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:
 
  Hmm?  netstat 1.42 (net-tools 1.60) seems fine.
  Which netstat are you using?
 
 The one from Debian etch:

Hmm. netstat -s from etch (i386) and etch (x86_64) work
fine for me.  Same version, same architecture.  Strange...

--yoshfuji
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread Herbert Xu
On Sat, Nov 10, 2007 at 11:48:54PM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:

 Hmm. netstat -s from etch (i386) and etch (x86_64) work
 fine for me.  Same version, same architecture.  Strange...

Interesting.  What does your /proc/net/snmp file look like?
And what does netstat -s actually produce?

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread Eric Dumazet

Herbert Xu a écrit :

On Sat, Nov 10, 2007 at 11:48:54PM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:

Hmm. netstat -s from etch (i386) and etch (x86_64) work
fine for me.  Same version, same architecture.  Strange...


Interesting.  What does your /proc/net/snmp file look like?
And what does netstat -s actually produce?

Thanks,


Quite easy :)

A failing one is  1024 bytes :

Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams 
InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes 
ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates
Ip: 2 64 6954137412 0 23489 0 125 0 6790615249 6423886499 2706 0 13881 
164999330 1503683 34165124 1219558 188 54871924
Icmp: InMsgs InErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs 
InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks 
InAddrMaskReps OutMsgs OutErrors OutDestUnreachs OutTimeExcds OutParmProbs 
OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps 
OutAddrMasks OutAddrMaskReps
Icmp: 6392743 1256162 3894707 401904 83 20702 172602 1415531 0 3 0 3 0 
106773069 0 3894707 401904 83 20702 172602 1415531 0 3 0 3 0
IcmpMsg: InType3 InType4 InType5 InType8 InType11 InType12 InType13 InType17 
OutType0 OutType3 OutType11 OutType14

IcmpMsg: 3894707 20702 172602 1415531 401904 83 3 3 1414557 105347007 11502 3
Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails 
EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts
Tcp: 1 200 12 -1 62967275 66063269 17969333 24912734 1278435 6041838336 
5717892916 279078174 361708 35913131

Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors
Udp: 640604836 101598293 193394 421746699 133903 0
UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors
UdpLite: 0 0 0 0 0 0


So netstat fails because line 344 in statistics.c :

buf1=TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts 
PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW 
TWRecycled TWKilled PAWSPassive PAWSActive PAWSEstab DelayedACKs 
DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPPrequeued 
TCPDirectCopyFromBacklog TCPDirectCopyFromPrequeue TCPPrequeueDropped 
TCPHPHits TCPHPHitsToUser TCPPureAcks TCPHPAcks TCPRenoRecovery 
TCPSackRecovery TCPSACKReneging TCPFACKReorder TCPSACKReorder TCPRenoReorder 
TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLoss 
TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures 
TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts 
TCPRenoRecoveryFail TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed 
TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnSyn 
TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout 
TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPSACKDiscard 
TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo buf2= TCPSpuriousRTOs



So this is an existing kernel bug, not related to UDPlite
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread Eric Dumazet

Eric Dumazet a écrit :

Herbert Xu a écrit :
On Sat, Nov 10, 2007 at 11:48:54PM +0900, YOSHIFUJI Hideaki / 吉藤英明 
wrote:

Hmm. netstat -s from etch (i386) and etch (x86_64) work
fine for me.  Same version, same architecture.  Strange...


Interesting.  What does your /proc/net/snmp file look like?
And what does netstat -s actually produce?

Thanks,


Quite easy :)

A failing one is  1024 bytes :

Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors 
ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests 
OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails 
FragOKs FragFails FragCreates
Ip: 2 64 6954137412 0 23489 0 125 0 6790615249 6423886499 2706 0 13881 
164999330 1503683 34165124 1219558 188 54871924
Icmp: InMsgs InErrors InDestUnreachs InTimeExcds InParmProbs 
InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps 
InAddrMasks InAddrMaskReps OutMsgs OutErrors OutDestUnreachs 
OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos 
OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps
Icmp: 6392743 1256162 3894707 401904 83 20702 172602 1415531 0 3 0 3 0 
106773069 0 3894707 401904 83 20702 172602 1415531 0 3 0 3 0
IcmpMsg: InType3 InType4 InType5 InType8 InType11 InType12 InType13 
InType17 OutType0 OutType3 OutType11 OutType14
IcmpMsg: 3894707 20702 172602 1415531 401904 83 3 3 1414557 105347007 
11502 3
Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens 
AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs 
OutRsts
Tcp: 1 200 12 -1 62967275 66063269 17969333 24912734 1278435 
6041838336 5717892916 279078174 361708 35913131

Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors
Udp: 640604836 101598293 193394 421746699 133903 0
UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors 
SndbufErrors

UdpLite: 0 0 0 0 0 0


So netstat fails because line 344 in statistics.c :

buf1=TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed 
EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps 
LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSPassive PAWSActive 
PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows 
ListenDrops TCPPrequeued TCPDirectCopyFromBacklog 
TCPDirectCopyFromPrequeue TCPPrequeueDropped TCPHPHits TCPHPHitsToUser 
TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging 
TCPFACKReorder TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo 
TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLoss TCPLostRetransmit 
TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans 
TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts TCPRenoRecoveryFail 
TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed TCPDSACKOldSent 
TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnSyn 
TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout 
TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPSACKDiscard 
TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo buf2= TCPSpuriousRTOs



So this is an existing kernel bug, not related to UDPlite


I meant a netstat bug of course, sorry :(

It fails to parse /proc/net/netstat , because TcpExt line is bigger than 1024 
chars.


To correct it, we might enlarge buf1[] and buf2[] from 1024 to 2048 in 
statistics.c, process_fd() function.



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread Herbert Xu
On Sat, Nov 10, 2007 at 04:16:41PM +0100, Eric Dumazet wrote:

 It fails to parse /proc/net/netstat , because TcpExt line is bigger than 
 1024 chars.

Good catch.  Perhaps it's time someone rewrote this in netlink
or add this to ss.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2]: e1000: avoid lockup durig error recovery

2007-11-10 Thread Stephen Hemminger
On Fri, 9 Nov 2007 16:40:05 -0600
[EMAIL PROTECTED] (Linas Vepstas) wrote:

 On Fri, Nov 09, 2007 at 06:02:34PM +0100, Ingo Oeser wrote:
  Linas Vepstas schrieb:
   + *   napi_enabled_p - return non-zero if napi enabled
   + * 
   + * Mnemonic: _p stands for predicate, returning a yes/no
   + * answer to the question.
  
  Call it is_napi_enabled() an nobody will ask :-)
 
 Heh. The suffix _p is standard coding style for lisp/scheme
 and first-order logic interpreters.  This was my lame attempt
 to introduce it to the kernel. I guess that lame duck won't fly.
 
 --linas
 

NO.  it reeks of hungarian notation.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH][RFC take 2] Add support for the RDC R6040 Fast Ethernet controller

2007-11-10 Thread Florian Fainelli
This patch adds support for the RDC R6040 MAC we can find in the RDC R-321x 
System-on-chips and some other devices.
You will need the RDC PCI identifiers if you want to test this driver :

RDC_PCI_VENDOR_ID = 0x17f3
RDC_PCI_DEVICE_ID_RDC_R6040 = 0x6040

Changes from first patch :
- use ioread/iowrite
- cleaned up NAPI
- suppressed wrong use of local_irq_enable/disable
- handle multicast cases
- notify when the carrier changes
- add ethtool routines
- rewrite IRQ handling with
- cleaned up PCI table
- make checkpatch happy
- documented registers
- 

(I do not mention everything you have been saying in your mails, but I have 
fixed them as well).

Thanks to Jeff and Stephen for their detailed comments.

Signed-off-by: Sten Wang [EMAIL PROTECTED]
Signed-off-by: Daniel Gimpelevich [EMAIL PROTECTED]
Signed-off-by: Florian Fainelli [EMAIL PROTECTED]
--
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index cb581eb..ab84303 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1645,6 +1645,18 @@ config 8139_OLD_RX_RESET
  experience problems, you can enable this option to restore the
  old RX-reset behavior.  If unsure, say N.
 
+config R6040
+   tristate RDC R6040 Fast Ethernet Adapter support (EXPERIMENTAL)
+   depends on NET_PCI  PCI
+   select CRC32
+   select MII
+   help
+ This is a driver for the R6040 Fast Ethernet MACs found in the
+ the RDC R-321x System-on-chips.
+ 
+ To compile this driver as a module, choose M here: the module
+ will be called r6040. This is recommended.
+
 config SIS900
tristate SiS 900/7016 PCI Fast Ethernet Adapter support
depends on NET_PCI  PCI
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 0e5fde4..afc60df 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -54,6 +54,7 @@ obj-$(CONFIG_TLAN) += tlan.o
 obj-$(CONFIG_EPIC100) += epic100.o
 obj-$(CONFIG_SIS190) += sis190.o
 obj-$(CONFIG_SIS900) += sis900.o
+obj-$(CONFIG_R6040) += r6040.o
 obj-$(CONFIG_YELLOWFIN) += yellowfin.o
 obj-$(CONFIG_ACENIC) += acenic.o
 obj-$(CONFIG_ISERIES_VETH) += iseries_veth.o
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
new file mode 100644
index 000..0cc47a6
--- /dev/null
+++ b/drivers/net/r6040.c
@@ -0,0 +1,1110 @@
+/*
+ * RDC R6040 Fast Ethernet MAC support
+ *
+ * Copyright (C) 2004 Sten Wang [EMAIL PROTECTED]
+ * Copyright (C) 2007
+ * Daniel Gimpelevich [EMAIL PROTECTED]
+ * Florian Fainelli [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+*/
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/version.h
+#include linux/moduleparam.h
+#include linux/string.h
+#include linux/timer.h
+#include linux/errno.h
+#include linux/ioport.h
+#include linux/slab.h
+#include linux/interrupt.h
+#include linux/pci.h
+#include linux/netdevice.h
+#include linux/etherdevice.h
+#include linux/skbuff.h
+#include linux/init.h
+#include linux/delay.h
+#include linux/mii.h
+#include linux/ethtool.h
+#include linux/crc32.h
+#include linux/spinlock.h
+
+#include asm/processor.h
+#include asm/bitops.h
+#include asm/io.h
+#include asm/irq.h
+#include asm/uaccess.h
+
+#define DRV_NAME   r6040
+#define DRV_VERSION0.16
+#define DRV_RELDATE10Nov2007
+
+/* PHY CHIP Address */
+#define PHY1_ADDR  1   /* For MAC1 */
+#define PHY2_ADDR  2   /* For MAC2 */
+#define PHY_MODE   0x3100  /* PHY CHIP Register 0 */
+#define PHY_CAP0x01E1  /* PHY CHIP Register 4 */
+
+/* Time in jiffies before concluding the transmitter is hung. */
+#define TX_TIMEOUT (6000 * HZ / 1000)
+#define TIMER_WUT  (jiffies + HZ * 1)/* timer wakeup time : 1 second */
+
+/* RDC MAC I/O Size */
+#define R6040_IO_SIZE  256
+
+/* MAX RDC MAC */
+#define MAX_MAC2
+
+/* MAC registers */
+#define MCR0   0x00/* Control register 0 */
+#define MCR1   0x04/* Control register 1 */
+#define  MAC_RST   0x0001  /* Reset the MAC */
+#define MBCR   0x08/* Bus control */
+#define MT_ICR 0x0C/* TX interrupt control */
+#define MR_ICR 0x10/* RX interrupt control */
+#define MTPR   0x14/* TX poll command register */
+#define MR_BSR 0x18/* RX buffer size */

Re: [PATCH][RFC take 2] Add support for the RDC R6040 Fast Ethernet controller

2007-11-10 Thread Stephen Hemminger

 +static int __devinit r6040_init_one(struct pci_dev *pdev,
 +  const struct pci_device_id *ent)
 +{
 + struct net_device *dev;
 + struct r6040_private *lp;
 + void __iomem *ioaddr;
 + int err, io_size = R6040_IO_SIZE;
 + static int card_idx = -1;
 + int bar = 0;
 + long pioaddr;
 +
 + printk(KERN_INFO %s\n, version);
 +
 + err = pci_enable_device(pdev);
 + if (err)
 + return err;
 +
 + /* this should always be supported */
 + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
 + printk(KERN_ERR DRV_NAME 32-bit PCI DMA addresses
 + not supported by the card\n);
 + return -ENODEV;
 + }
 +
 + /* IO Size check */
 + if (pci_resource_len(pdev, 0)  io_size) {
 + printk(KERN_ERR Insufficient PCI resources, aborting\n);
 + return -EIO;
 + }
 +
 + pioaddr = pci_resource_start(pdev, 0);  /* IO map base address */
 + pci_set_master(pdev);
 +
 + dev = alloc_etherdev(sizeof(struct r6040_private));
 + if (!dev) {
 + printk(KERN_ERR Failed to allocate etherdev\n);
 + return -ENOMEM;
 + }
 + SET_NETDEV_DEV(dev, pdev-dev);
 + lp = netdev_priv(dev);
 + lp-pdev = pdev;
 +
 + if (pci_request_regions(pdev, DRV_NAME)) {
 + printk(KERN_ERR DRV_NAME : Failed to request PCI regions\n);
 + err = -ENODEV;
 + goto err_out_disable;
 + }
 +
 + ioaddr = pci_iomap(pdev, bar, io_size);
 + if (!ioaddr) {
 + printk(KERN_ERR ioremap failed for device %s\n,
 + pci_name(pdev));
 + return -EIO;
 + }
 +
 + /* Init system  device */
 + dev-base_addr = (unsigned long)ioaddr;
 + lp-base = ioaddr;
 + dev-irq = pdev-irq;
 +
 + spin_lock_init(lp-lock);
 + pci_set_drvdata(pdev, dev);
 +
 + /* Set MAC address */
 + card_idx++;
 +
 + /* Check if the MAC address is 0x or 0 */
 + if (!is_valid_ether_addr(dev-dev_addr)) {
 + u16 *adrp;
 + adrp = (u16 *) dev-dev_addr;
 + adrp[0] = ioread16(ioaddr + MID_0L);
 + adrp[1] = ioread16(ioaddr + MID_0M);
 + adrp[2] = ioread16(ioaddr + MID_0H);
 + }


The is_valid_ether_addr is superflous.
 dev-dev_addr will always be zero (since it is part of just allocated 
structure).
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UDP-Lite and /proc/net/snmp

2007-11-10 Thread Andi Kleen
Eric Dumazet [EMAIL PROTECTED] writes:

 I meant a netstat bug of course, sorry :(

 It fails to parse /proc/net/netstat , because TcpExt line is bigger
 than 1024 chars.

guilty -- i wrote that code a long time ago.


 To correct it, we might enlarge buf1[] and buf2[] from 1024 to 2048 in
 statistics.c, process_fd() function.

Or just split TcpExt: into multiple lines, e.g. with a TcpExt2: 
No reason to have it all on a single line anyways.
I think that would be the better fix.

-Andi
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/05] ipv6: RFC4214 Support

2007-11-10 Thread Andi Kleen
Templin, Fred L [EMAIL PROTECTED] writes:
  
 +#if defined(CONFIG_IPV6_ISATAP)
 + /* ISATAP (RFC4214) - router address in daddr */
 + if (!strncmp(parms-name, isatap, 6)) {

Modern distributions tend to have daemons to automatically rename
network interfaces using SIOCSIFNAME. Not sure they would touch
isatap*, but they or someone else might. I would be likely safer to
not base your user interface on the name only, but use a flag
or number somewhere else.

-Andi

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] net driver fixes

2007-11-10 Thread Jeff Garzik
Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git 
upstream-linus

to receive the following updates:

 MAINTAINERS  |   10 ++-
 drivers/net/Kconfig  |2 +-
 drivers/net/bonding/bond_main.c  |1 +
 drivers/net/bonding/bond_sysfs.c |4 +-
 drivers/net/pasemi_mac.c |   18 -
 drivers/net/qla3xxx.c|   42 +--
 drivers/net/qla3xxx.h|1 +
 drivers/net/r8169.c  |   26 ++-
 drivers/net/sky2.c   |  116 ++
 drivers/net/sky2.h   |3 +-
 drivers/net/smc91x.h |   15 
 drivers/net/wireless/Kconfig |2 +-
 drivers/net/wireless/b43/Kconfig |   10 ++-
 drivers/net/wireless/b43/debugfs.c   |2 +-
 drivers/net/wireless/b43/main.c  |   19 +++---
 drivers/net/wireless/b43/pcmcia.c|   52 +-
 drivers/net/wireless/b43/rfkill.c|  115 +
 drivers/net/wireless/b43/rfkill.h|   14 +---
 drivers/net/wireless/b43legacy/debugfs.c |2 +-
 drivers/net/wireless/b43legacy/main.c|   21 +++---
 drivers/net/wireless/hostap/hostap_pci.c |6 +-
 drivers/net/wireless/ipw2100.c   |4 +-
 drivers/net/wireless/libertas/cmd.c  |   10 ++-
 drivers/net/wireless/libertas/if_cs.c|7 ++-
 drivers/net/wireless/libertas/if_sdio.c  |4 +-
 drivers/net/wireless/rt2x00/rt2x00mac.c  |8 ++
 26 files changed, 285 insertions(+), 229 deletions(-)

Ciaran McCreesh (1):
  r8169: add PCI ID for the 8168 in the Abit Fatal1ty F-190HD motherboard

Francois Romieu (2):
  r8169: do not enable the TBI for the 8168 and the 81x0
  r8169: prevent bit sign expansion error in mdio_write

Holger Schurig (1):
  libertas: fixes for slow hardware

Ivo van Doorn (1):
  rt2x00: Block adhoc  master mode

Jay Vosburgh (2):
  bonding: fix rtnl locking merge error
  bonding: don't validate address at device open

John W. Linville (1):
  hermes: clarify Intel reference in Kconfig help

Magnus Damm (1):
  ax88796: add superh to kconfig dependencies

Marcelo Tosatti (1):
  libertas: properly account for queue commands

Mark Lord (2):
  r8169: revert 7da97ec96a0934319c7fbedd3d38baf533e20640 (partly)
  r8169: revert 7da97ec96a0934319c7fbedd3d38baf533e20640 (bis repetita)

Michael Buesch (7):
  b43: pcmcia-host initialization bugfixes
  b43: Fix rfkill callback deadlock
  b43: debugfs SHM read buffer overrun fix
  b43: Rewrite and fix rfkill init
  b43: properly request pcmcia IRQ
  b43legacy: Fix sparse warning
  b43: Fix kconfig dependencies for rfkill and leds

Olof Johansson (2):
  pasemi_mac: Don't set replace-source-address descriptor bits
  pasemi_mac: Fix CRC checks

Pierre Ossman (1):
  libertas: make if_sdio align packets

Randy Dunlap (1):
  hostap: fix section mismatch warning

Roel Kluin (1):
  ipw2100: fix postfix decrement errors

Ron Mercer (2):
  qla3xxx: bugfix: Move link state machine into a worker thread
  qla3xxx: bugfix: Fix bad logical operation in link state machine.

Stefano Brivio (4):
  b43legacy: fix possible buffer overrun in debugfs
  b43legacy: add me as maintainer and fix URLs
  b43: fix shared IRQ race condition
  b43legacy: fix shared IRQ race condition

Stephen Hemminger (9):
  sky2: enable PCI config writes
  sky2: status ring race fix
  sky2: longer PHY delay
  sky2: dont change LED after autoneg
  sky2: remove unneeded mask update
  sky2: handle advanced error recovery config issues
  sky2: version 1.20
  sky2: netpoll on port 0 only
  sky2: new pci id's

eric miao (1):
  add support for smc91x ethernet interface on zylonite

diff --git a/MAINTAINERS b/MAINTAINERS
index 1c7c229..6a97027 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -787,23 +787,25 @@ B43 WIRELESS DRIVER
 P: Michael Buesch
 M: [EMAIL PROTECTED]
 P: Stefano Brivio
-M: [EMAIL PROTECTED]
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
-W: http://bcm43xx.berlios.de/
+W: http://linuxwireless.org/en/users/Drivers/b43
 S: Maintained
 
 B43LEGACY WIRELESS DRIVER
 P: Larry Finger
 M: [EMAIL PROTECTED]
+P: Stefano Brivio
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
-W: http://bcm43xx.berlios.de/
+W: http://linuxwireless.org/en/users/Drivers/b43
 S: Maintained
 
 BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION)
 P: Larry Finger
 M: [EMAIL PROTECTED]
 P: Stefano Brivio
-M: [EMAIL PROTECTED]
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 W: http://bcm43xx.berlios.de/
 S: Maintained
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index cb581eb..bf8890e 100644
--- a/drivers/net/Kconfig
+++ 

Re: Oops preceded by WARNING: at net/ipv4/tcp_input.c:1571 tcp_remove_reno_sacks()

2007-11-10 Thread Ilpo Järvinen
On Sat, 10 Nov 2007, Guillaume Chazarain wrote:

 Doing some bittorrent with linux-2.6.24-rc2, my box crashed with this
 in the log:
 
 4WARNING: at net/ipv4/tcp_input.c:1571 tcp_remove_reno_sacks()

This gets triggered when SACKED + LOST marked are more than packets_out.
sacked_out is dealt (bounded) in the tcp_check_reno_reordering(), so the 
failing one seems to be the lost_out, like this already informs...:

 3KERNEL: assertion ((int)tp-lost_out = 0) failed at
 net/ipv4/tcp_input.c (2761)

...I'll check if GSO can cause some nasty things to that one so that 
newreno's only head lost assumption get broken and lost_out
underflows somehow...

Do you have GSO enabled?

 4WARNING: at net/ipv4/tcp_input.c:2405 tcp_fastretrans_alert()

This is reporting the same as the first one in remove_reno_sacks.


 1BUG: unable to handle kernel NULL pointer dereference at virtual
 address 0045
 1printing eip: c02f7452 *pde = 
 0Oops:  [#1] PREEMPT

...snip...

 4
 4Pid: 0, comm: swapper Not tainted (2.6.24-rc2-gc #173)
 4EIP: 0060:[c02f7452] EFLAGS: 00010246 CPU: 0
 4EIP is at tcp_xmit_retransmit_queue+0x61/0x252
 4EAX: e43a04b0 EBX: e43a0440 ECX:  EDX: e43a04b0
 4ESI:  EDI:  EBP: c046dd80 ESP: c046dd70
 4 DS: 007b ES: 007b FS:  GS:  SS: 0068
 0Process swapper (pid: 0, ti=c046d000 task=c040a2e0 task.ti=c0439000)
 0Stack: e43a04b0 0002 e43a0440 040e c046de08 c02f298a
 c03b5888 c03f077d
 0   0965 c034e8bf c75720c0   0001
 781b775e f1185f51
 0   781b7767    0001 0006
 781b7767 8600
 0Call Trace:
 0 [c0104cb3] show_trace_log_lvl+0x1a/0x2f
 0 [c0104d65] show_stack_log_lvl+0x9d/0xa5
 0 [c0104e0f] show_registers+0xa2/0x1b8
 0 [c010501c] die+0xf7/0x1d3
 0 [c0328537] do_page_fault+0x520/0x60e
 0 [c0326d72] error_code+0x6a/0x70
 0 [c02f298a] tcp_ack+0x15a3/0x176b
 0 [c02f5208] tcp_rcv_established+0xdb/0x5f3
 0 [c02fa711] tcp_v4_do_rcv+0x2b/0x310
 0 [c02fc557] tcp_v4_rcv+0x82b/0x89d
 0 [c02e4961] ip_local_deliver_finish+0x124/0x1ba
 0 [c02e4d64] ip_local_deliver+0x72/0x7e
 0 [c02e481d] ip_rcv_finish+0x299/0x2b9
 0 [c02e4cd4] ip_rcv+0x1e1/0x1ff
 0 [c02c9062] netif_receive_skb+0x37d/0x401
 0 [c02cae8e] process_backlog+0x5b/0xa6
 0 [c02cab3f] net_rx_action+0x87/0x156
 0 [c0121d17] __do_softirq+0x38/0x7a
 0 [c0105975] do_softirq+0x41/0x92
 0 ===
 0Code: 00 00 e9 ff 00 00 00 c7 83 a0 03 00 00 00 00 00 00 e9 00 02
 00 00 c7 83 a4 03 00 00 00 00 00 00 e9 f1 01 00 00 3b b3 10 01 00 00
 8a 56 45 0f 84 d2 00 00 00 8b 83 fc 02 00 00 03 83 00 03 00 00
 0EIP: [c02f7452] tcp_xmit_retransmit_queue+0x61/0x252 SS:ESP 0068:c046dd70

This could be due to tcp_write_queue_head(sk) returning NULL to skb if 
write queue is empty. Then a corrupted lost_out would cause entry to the 
loop and boom it goes when accessing skb-next...

Meanwhile, I'm starting to be a bit skeptical whether tcp_write_queue_head 
should return NULL ever as that's incompatible with 
tcp_for_write_queue_from and would require explicit checking then... Dave?
(Yes, I know it's there for clean_rtx_queue but it could do the same check 
by other means). I think I actually hit this same feature in sacktag 
recode test today (just discovered that while thinking this one), 
probably a DSACK arriving when packets_out was zero... 

I rechecked the clean_rtx_queue changes, and they seemed to be in order
so that they shouldn't corrupt the queue... But it still remains open what 
caused the lost_out corruption in the first place, maybe I find something 
later...


Is this reproducable? You can try to provoke it by setting tcp_sack sysctl 
to 0 as this seems to be non-SACK related... If so, you could try the 
debug patch below (because I couldn't immediately see what could prevent 
tcp_is_reno from going to tcp_xmit_retransmit_queue when queue is empty), 
it should get rid of the crash and get the lost_out value for us as 
well...


 .config:

...snip...

 # CONFIG_DEBUG_LIST is not set

Could you please add this one too, as there could be some list corruption 
in this... I checked every place that is touching lost_out, and all seemed 
to be in order... Have you run memtest recently?


--
[PATCH] TCP DEBUG

- Check if empty queue is passed to xmit_retrans...
- Print lost_out underflow value

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index ca9590f..ac54517 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2521,6 +2521,12 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, 
int flag)
if (do_lost || tcp_head_timedout(sk))
tcp_update_scoreboard(sk);
tcp_cwnd_down(sk, flag);
+   
+   if (WARN_ON(tcp_write_queue_head(sk) == NULL))
+   return;
+   if (WARN_ON(!tp-packets_out))
+   return;
+   

[PATCH 1/2] [VLAN] Don't drop an unclassfied vlan packet as PACKET_OTHERHOST

2007-11-10 Thread Joonwoo Park
IMHO linux should not drop unclassified vlan packets to pass these to sniffers. 
isn't it?
But, since the __vlan_hwaccel_rx drops unclassified vlan packets, sniffers 
cannot see them.
This make the __vlan_hwaccel_rx receive and process an unclassified vlan packet 
as a PACKET_OTHERHOST.
Any check, comments will be appreciated.
Thanks.

Signed-off-by: Joonwoo Park [EMAIL PROTECTED] 
---
 include/linux/if_vlan.h |   61 ++
 1 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 976d4b1..e1db5bc 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -170,21 +170,26 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
unsigned short vlan_tag, int polling)
 {
struct net_device_stats *stats;
+   struct net_device *vlan_dev;
 
if (skb_bond_should_drop(skb)) {
dev_kfree_skb_any(skb);
return NET_RX_DROP;
}
 
-   skb-dev = vlan_group_get_device(grp, vlan_tag  VLAN_VID_MASK);
-   if (skb-dev == NULL) {
-   dev_kfree_skb_any(skb);
+   vlan_dev = vlan_group_get_device(grp, vlan_tag  VLAN_VID_MASK);
+   if (vlan_dev == NULL) {
+   if (skb-dev == NULL) {
+   dev_kfree_skb_any(skb);
 
-   /* Not NET_RX_DROP, this is not being dropped
-* due to congestion.
-*/
-   return 0;
-   }
+   /* Not NET_RX_DROP, this is not being dropped
+* due to congestion.
+*/
+   return 0;
+   }
+   skb-pkt_type = PACKET_OTHERHOST;
+   } else
+   skb-dev = vlan_dev;
 
skb-dev-last_rx = jiffies;
 
@@ -192,25 +197,27 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
stats-rx_packets++;
stats-rx_bytes += skb-len;
 
-   skb-priority = vlan_get_ingress_priority(skb-dev, vlan_tag);
-   switch (skb-pkt_type) {
-   case PACKET_BROADCAST:
-   break;
-
-   case PACKET_MULTICAST:
-   stats-multicast++;
-   break;
-
-   case PACKET_OTHERHOST:
-   /* Our lower layer thinks this is not local, let's make sure.
-* This allows the VLAN to have a different MAC than the 
underlying
-* device, and still route correctly.
-*/
-   if (!compare_ether_addr(eth_hdr(skb)-h_dest,
-   skb-dev-dev_addr))
-   skb-pkt_type = PACKET_HOST;
-   break;
-   };
+   if (vlan_dev) {
+   skb-priority = vlan_get_ingress_priority(skb-dev, vlan_tag);
+   switch (skb-pkt_type) {
+   case PACKET_BROADCAST:
+   break;
+
+   case PACKET_MULTICAST:
+   stats-multicast++;
+   break;
+
+   case PACKET_OTHERHOST:
+   /* Our lower layer thinks this is not local, let's make 
sure.
+* This allows the VLAN to have a different MAC than 
the underlying
+* device, and still route correctly.
+*/
+   if (!compare_ether_addr(eth_hdr(skb)-h_dest,
+   skb-dev-dev_addr))
+   skb-pkt_type = PACKET_HOST;
+   break;
+   };
+   }
 
return (polling ? netif_receive_skb(skb) : netif_rx(skb));
 }
---

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] [e1000 VLAN] Disable vlan hw accel when promiscuous mode

2007-11-10 Thread Joonwoo Park
IMHO even though netdevice is in the promiscuous mode, we should receive all of 
ingress packets.
This disable the vlan filtering feature when a vlan hw accel configured e1000 
device goes into promiscuous mode.
This make packets visible to sniffers though it's not vlan id of itself.
Any check, comments will be appreciated.
Thanks.

Signed-off-by: Joonwoo Park [EMAIL PROTECTED]
---
 drivers/net/e1000/e1000_main.c |   26 --
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c 
index 72deff0..cdd5c84 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2424,7 +2424,7 @@ e1000_set_multi(struct net_device *netdev)
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = adapter-hw;
struct dev_mc_list *mc_ptr;
-   uint32_t rctl;
+   uint32_t rctl, ctrl;
uint32_t hash_value;
int i, rar_entries = E1000_RAR_ENTRIES;
int mta_reg_count = (hw-mac_type == e1000_ich8lan) ?
@@ -2441,14 +2441,25 @@ e1000_set_multi(struct net_device *netdev)
/* Check for Promiscuous and All Multicast modes */
 
rctl = E1000_READ_REG(hw, RCTL);
+   ctrl = E1000_READ_REG(adapter-hw, CTRL);
 
if (netdev-flags  IFF_PROMISC) {
rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
-   } else if (netdev-flags  IFF_ALLMULTI) {
-   rctl |= E1000_RCTL_MPE;
-   rctl = ~E1000_RCTL_UPE;
+   if (adapter-hw.mac_type != e1000_ich8lan) {
+   if (ctrl  E1000_CTRL_VME)
+   rctl = ~E1000_RCTL_VFE;
+   }
} else {
-   rctl = ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
+   if (adapter-hw.mac_type != e1000_ich8lan) {
+   if (ctrl  E1000_CTRL_VME)
+   rctl |= E1000_RCTL_VFE;
+   }
+   if (netdev-flags  IFF_ALLMULTI) {
+   rctl |= E1000_RCTL_MPE;
+   rctl = ~E1000_RCTL_UPE;
+   } else {
+   rctl = ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
+   }
}
 
E1000_WRITE_REG(hw, RCTL, rctl);
@@ -4952,7 +4963,10 @@ e1000_vlan_rx_register(struct net_device *netdev, struct 
vlan_group *grp)
if (adapter-hw.mac_type != e1000_ich8lan) {
/* enable VLAN receive filtering */
rctl = E1000_READ_REG(adapter-hw, RCTL);
-   rctl |= E1000_RCTL_VFE;
+   if (netdev-flags  IFF_PROMISC)
+   rctl = ~E1000_RCTL_VFE;
+   else
+   rctl |= E1000_RCTL_VFE;
rctl = ~E1000_RCTL_CFIEN;
E1000_WRITE_REG(adapter-hw, RCTL, rctl);
e1000_update_mng_vlan(adapter);
---

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re : Oops preceded by WARNING: at net/ipv4/tcp_input.c:1571 tcp_remove_reno_sacks()

2007-11-10 Thread Chazarain Guillaume
Hello Ilpo, thanks a lot for your investigation

 Do you have GSO enabled?

According to ethtool -k, no.

 Is this reproducable?

Unfortunately not, I saw it only once.

 You can try to provoke it by setting tcp_sack
 sysctl 
  to 0 as this seems to be non-SACK related... If so, you could try the 
 debug patch below

 # CONFIG_DEBUG_LIST is not set

I'm currently running bittorrent with all of this, I just saw this (for the 
first time ever),
but otherwise it works fine:

WARNING: at net/ipv4/tcp_output.c:1807 tcp_simple_retransmit()
 [c0104cb3] show_trace_log_lvl+0x1a/0x2f
 [c0105563] show_trace+0x12/0x14
 [c0105668] dump_stack+0x15/0x17
 [c02f6a79] tcp_simple_retransmit+0xfa/0x185
 [c02fa072] tcp_v4_err+0x35d/0x4cb
 [c0301f7d] icmp_unreach+0x327/0x352
 [c030159d] icmp_rcv+0xe0/0xf7
 [c02e2d75] ip_local_deliver_finish+0x124/0x1ba
 [c02e3178] ip_local_deliver+0x72/0x7e
 [c02e2c31] ip_rcv_finish+0x299/0x2b9
 [c02e30e8] ip_rcv+0x1e1/0x1ff
 [c02c755c] netif_receive_skb+0x37d/0x401
 [c02c9372] process_backlog+0x5b/0x96
 [c02c9037] net_rx_action+0x87/0x152
 [c0121c9f] __do_softirq+0x38/0x7a
 [c0105975] do_softirq+0x41/0x92

 Have you run memtest recently?

Just ran it with no errors for 6 minutes 30. The box is otherwise stable though.

I forgot to say that I have a kdump image of the crash (I had to recompile this

2.6.24-rc2 kernel as I deleted its vmlinux), so I could check that you are
right on track with your assertions at the time of the crash.

 +if (WARN_ON(tcp_write_queue_head(sk) == NULL))
 +return;

(gdb) p sk-sk_write_queue.next
$11 = (struct sk_buff *) 0xe43a04b0
(gdb) p sk-sk_write_queue
$12 = (struct sk_buff_head *) 0xe43a04b0


 +if (WARN_ON(!tp-packets_out))
 +return;

(gdb) p ((struct tcp_sock *) sk)-packets_out
$13 = 0

 +if (tp-lost_out  tp-packets_out)
 +printk(KERN_ERR Lost underflowed to %u\n, tp-lost_out);

(gdb) p ((struct tcp_sock *) sk)-lost_out
$14 = 4294967295

Some more gdb output for information:

#0  tcp_xmit_retransmit_queue (sk=0xe43a0440) at net/ipv4/tcp_output.c:1962
1962__u8 sacked = TCP_SKB_CB(skb)-sacked;

(gdb) bt
#0  tcp_xmit_retransmit_queue (sk=0xe43a0440) at net/ipv4/tcp_output.c:1962
#1  0xc02f298a in tcp_ack (sk=0xe43a0440, skb=0xc75720c0, flag=1038) at 
net/ipv4/tcp_input.c:2524
#2  0xc02f5208 in tcp_rcv_established (sk=0xe43a0440, skb=0xc75720c0, 
th=0xeac35058, len=32) at net/ipv4/tcp_input.c:4502
#3  0xc02fa711 in tcp_v4_do_rcv (sk=0xe43a0440, skb=0xc75720c0) at 
net/ipv4/tcp_ipv4.c:1572
#4  0xc02fc557 in tcp_v4_rcv (skb=0xc75720c0) at net/ipv4/tcp_ipv4.c:1696
#5  0xc02e4961 in ip_local_deliver_finish (skb=0xc75720c0) at 
net/ipv4/ip_input.c:233
#6  0xc02e4d64 in ip_local_deliver (skb=0xc75720c0) at net/ipv4/ip_input.c:271
#7  0xc02e481d in ip_rcv_finish (skb=0xc75720c0) at include/net/dst.h:241
#8  0xc02e4cd4 in ip_rcv (skb=value optimized out, dev=0xc717c000, pt=value 
optimized out, orig_dev=0xc717c000) at net/ipv4/ip_input.c:445
#9  0xc02c9062 in netif_receive_skb (skb=0xc75720c0) at net/core/dev.c:2088
#10 0xc02cae8e in process_backlog (napi=0xc04b651c, quota=64) at 
net/core/dev.c:2125
#11 0xc02cab3f in net_rx_action (h=value optimized out) at net/core/dev.c:2195
#12 0xc0121d17 in __do_softirq () at kernel/softirq.c:232
#13 0xc0105975 in do_softirq () at arch/x86/kernel/irq_32.c:216
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

(gdb) bt full
#0  tcp_xmit_retransmit_queue (sk=0xe43a0440) at net/ipv4/tcp_output.c:1962
sacked = 176 '�'
skb = (struct sk_buff *) 0xe43a04b0
packet_cnt = 0
#1  0xc02f298a in tcp_ack (sk=0xe43a0440, skb=0xc75720c0, flag=1038) at 
net/ipv4/tcp_input.c:2524
packets_acked = 1
sacked = 134 '\206'
tp = value optimized out
prior_snd_una = 2015065950
ack_seq = 4044906321
ack = 2015065959
prior_in_flight = 2
seq_rtt = -1
frto_cwnd = value optimized out
#2  0xc02f5208 in tcp_rcv_established (sk=0xe43a0440, skb=0xc75720c0, 
th=0xeac35058, len=32) at net/ipv4/tcp_input.c:4502
tcp_header_len = value optimized out
tp = value optimized out
#3  0xc02fa711 in tcp_v4_do_rcv (sk=0xe43a0440, skb=0xc75720c0) at 
net/ipv4/tcp_ipv4.c:1572
rsk = value optimized out
#4  0xc02fc557 in tcp_v4_rcv (skb=0xc75720c0) at net/ipv4/tcp_ipv4.c:1696
err = -950591296
filter = value optimized out
iph = (const struct iphdr *) 0xeac35044
th = (struct tcphdr *) 0xeac35058
sk = (struct sock *) 0xe43a0440
ret = value optimized out
#5  0xc02e4961 in ip_local_deliver_finish (skb=0xc75720c0) at 
net/ipv4/ip_input.c:233
ret = value optimized out
protocol = value optimized out
hash = 0
raw_sk = (struct sock *) 0x0
#6  0xc02e4d64 in ip_local_deliver (skb=0xc75720c0) at net/ipv4/ip_input.c:271
__ret = -465959760
#7  0xc02e481d in ip_rcv_finish (skb=0xc75720c0) at include/net/dst.h:241
  

Re: [PATCH 01/01] iproute2-2.6.23: RFC4214 Support (3)

2007-11-10 Thread Patrick McHardy

Fred L. Templin wrote:

What do you suggest?


To remove them unless there's some justification
to keep them.



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] [TCP]: Consider GSO while counting reord in sacktag

2007-11-10 Thread David Miller
From: Ilpo_Järvinen [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 12:55:59 +0200

 Reordering detection fails to take account that the reordered
 skb may have pcount larger than 1. In such case the lowest of
 them had the largest reordering, the old formula used the
 highest of them which is pcount - 1 packets less reordered.
 
 Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]

Applied, thanks.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] [TCP]: Fix reord detection due to snd_una covered holes

2007-11-10 Thread David Miller
From: Ilpo_Järvinen [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 12:56:00 +0200

 Fixes subtle bug like the one with fastpath_cnt_hint happening
 due to the way the GSO and hints interact. Because hints are not
 reset when just a GSOed skb is partially ACKed, there's no
 guarantee that the relevant part of the write queue is going to
 be processed in sacktag at all (skbs below snd_una) because
 fastpath hint can fast forward the entrypoint.
 
 This was also on the way of future reductions in sacktag's skb
 processing. Also future cleanups in sacktag can be made after
 this (in 2.6.25).
 
 This may make reordering update in tcp_try_undo_partial
 redundant but I'm not too sure so I left it there.
 
 Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]

Thanks for discovering this.

Applied, thanks.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] [TCP]: Add unlikely() to sacktag out-of-mem in fragment case

2007-11-10 Thread David Miller
From: Ilpo_Järvinen [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 12:56:01 +0200

 Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]

Applied.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] [TCP]: Split SACK FRTO flag clearing (fixes FRTO corner case bug)

2007-11-10 Thread David Miller
From: Ilpo_Järvinen [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 12:56:02 +0200

 In case we run out of mem when fragmenting, the clearing of
 FLAG_ONLY_ORIG_SACKED might get missed which then feeds FRTO
 with false information. Move clearing outside skb processing
 loop so that it will get executed even if the skb loop
 terminates prematurely due to out-of-mem.
 
 Besides, now the core of the loop truly deals with a single
 skb only, which also enables creation a more self-contained
 of tcp_sacktag_one later on.
 
 In addition, small reorganization of if branches was made.
 
 Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]

Applied, thanks!
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][IPV4] Remove bugus goto-s from ip_route_input_slow

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 17:27:50 +0300

 Both places look like
 
 if (err == XXX) 
goto yyy;
done:
 
 while both yyy targets look like
 
 err = XXX;
 goto done;
 
 so this is ok to remove the above if-s.
 
 yyy labels are used in other places and are not removed.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

Applied, thanks.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Make helper to get dst entry and use is

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 17:29:52 +0300

 There are many places that get the dst entry, increase the
 __use counter and set the lastuse time stamp.
 
 Make a helper for this.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

Nice cleanup, applied.

Thanks!
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Use list_head-s in inetpeer.c

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 17:32:58 +0300

 The inetpeer.c tracks the LRU list of inet_perr-s, but makes
 it by hands. Use the list_head-s for this.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

This makes every inetpeer struct consume 8 more bytes, and on some
systems we have can have many of these objects active.  That space
savings is why this was done the way it was.

It would be nice to have tailq like interfaces in linux/list.h
for situations like this.

Please do not submit a patch implementing that until the 2.6.25
merge window, however, thanks.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Fix infinite loop on dev_mc_unsync()

2007-11-10 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED]
Date: Sat, 10 Nov 2007 01:13:42 +0100

 Joe Perches wrote:
  On Sat, 2007-11-10 at 00:12 +0100, Patrick McHardy wrote:

  This may cause a use-after-free since __dev_addr_delete frees the address
  when all references are gone.
  
 
  How about a comment then?  Perhaps:
 
  diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
  index ae35405..63576aa 100644
  --- a/net/core/dev_mcast.c
  +++ b/net/core/dev_mcast.c
  @@ -165,16 +165,23 @@ void dev_mc_unsync(struct net_device *to, struct 
  net_device *from)
  netif_tx_lock_bh(from);
  netif_tx_lock_bh(to);
   
  +   /*
  + This while loop can't be written as
  +   for (da = from-mc_list; da; da = da-next)
  + da = from-mc_list and __dev_addr_delete can kfree(from-mc_list)
  + which could cause a use-after-free of da-next
  +   */

 
 Seems unnecessary to me, we also don't comment each list_for_each_entry_safe
 iteration. I consider the use of a seperate next variable self-explanatory.

Agreed, this comment is pointless.

I'll apply Joe's patch without the comment.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][PACKET] Use existing sock refcnt debugging infrastructure

2007-11-10 Thread David Miller
From: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
Date: Fri, 9 Nov 2007 12:37:42 -0200

 Em Fri, Nov 09, 2007 at 04:39:41PM +0300, Pavel Emelyanov escreveu:
  The packet_socks_nr variable is used purely for debugging
  the number of sockets.
  
  As Arnaldo pointed out, there's already an infrastructure
  for this purposes, so switch to using it.
  
  Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]
 
 Acked-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

Applied.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][IPX] Use existing sock refcnt debugging infrastructure

2007-11-10 Thread David Miller
From: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
Date: Fri, 9 Nov 2007 12:39:08 -0200

 Em Fri, Nov 09, 2007 at 04:42:05PM +0300, Pavel Emelyanov escreveu:
  Just like in the af_packet.c, the ipx_sock_nr variable is used
  for debugging purposes.
  
  Switch to using existing infrastructure. Thanks to Arnaldo for
  pointing this out.
  
  Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]
 
 Acked-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

Also applied, thanks!
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] Un-define the IPTUNNEL_XMIT() macro

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Fri, 09 Nov 2007 16:09:58 +0300

 This one is used in all the smth-to-ip tunnels we have and
 looks ... not very good. Make this a regular function in the
 tunnel4.ko module.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

This breaks the build if NET_IPGRE is selected, and I don't think it's
wise to add the dependency on INET_TUNNEL just for this one function.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] Add missed tunnel64_err handler

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Fri, 09 Nov 2007 16:14:12 +0300

 The tunnel64_protocol uses the tunnel4_protocol's err_handler and
 thus calls the tunnel4_protocol's handlers.
 
 This is not very good, as in case of (icmp) error the wrong error
 handlers will be called (e.g. ipip ones instead of sit) and this
 won't be noticed at all, because the error is not reported.
 
 Was that made deliberately and I miss something?
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

This definitely was doing the wrong thing for the SIT
case, for example.  So this looks legitimate to me.

Patch applied, thanks!
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] Cleanup the xfrm4_tunnel_(un)register

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Fri, 09 Nov 2007 16:16:23 +0300

 Both check for the family to select an appropriate tunnel list.
 Consolidate this check and make the for() loop more readable.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

Applied, thanks.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] Consolidate equal handlers in tunnel4.c

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Fri, 09 Nov 2007 16:18:48 +0300

 Two sets - tunnel[6]4_rcv() and tunnel[6]4_err - do the same
 thing, but scan for different lists of tunnels, so this code
 is easily consolidated.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

This doesn't apply because I did not apply your
IPTUNNEL_RCV() change.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [VLAN]: Don't synchronize addresses while the vlan device is down

2007-11-10 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED]
Date: Thu, 08 Nov 2007 18:19:53 +0100

 [VLAN]: Don't synchronize addresses while the vlan device is down
 
 While the VLAN device is down, the unicast addresses are not configured
 on the underlying device, so we shouldn't attempt to sync them.
 
 Noticed by Dmitry Butskoy [EMAIL PROTECTED]
 
 Signed-off-by: Patrick McHardy [EMAIL PROTECTED]

Applied, thanks Patrick.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [VLAN]: Allow setting mac address while device is up

2007-11-10 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED]
Date: Thu, 08 Nov 2007 18:20:19 +0100

 This patch allows to change a VLAN device's MAC address while
 the device is up. Doesn't seem worth to hold back until
 2.6.25-rc since it can't break anything without actually
 getting used (and it does work :))

Agreed, and applied, thanks Patrick!

 
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NET: Fix skb_truesize_check() assertion

2007-11-10 Thread David Miller
From: Chuck Lever [EMAIL PROTECTED]
Date: Thu, 08 Nov 2007 11:59:19 -0500

 The intent of the assertion in skb_truesize_check() is to check
 for skb-truesize being decremented too much by other code,
 resulting in a wraparound below zero.
 
 The type of the right side of the comparison causes the compiler to
 promote the left side to an unsigned type, despite the presence of an
 explicit type cast.  This defeats the check for negativity.
 
 Ensure both sides of the comparison are a signed type to prevent the
 implicit type conversion.
 
 Signed-off-by: Chuck Lever [EMAIL PROTECTED]

Applied, thanks Chuck.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [PKT_SCHED] CLS_U32: Use ffs() instead of C code on hash mask to get first set bit.

2007-11-10 Thread David Miller
From: jamal [EMAIL PROTECTED]
Date: Thu, 08 Nov 2007 08:45:31 -0500

 On Thu, 2007-08-11 at 13:07 +0200, Radu Rendec wrote:
  Computing the rank of the first set bit in the hash mask (for using later
  in u32_hash_fold()) was done with plain C code. Using ffs() instead makes
  the code more readable and improves performance (since ffs() is better
  optimized in assembler).
  
  Using the conditional operator on hash mask before applying ntohl() also
  saves one ntohl() call if mask is 0.
  
  Signed-off-by: Radu Rendec [EMAIL PROTECTED]
 
 Acked-by: Jamal Hadi Salim [EMAIL PROTECTED]

Applied, thanks everyone.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Please pull 'fixes-davem' branch of wireless-2.6 (this time for real!)

2007-11-10 Thread David Miller
From: John W. Linville [EMAIL PROTECTED]
Date: Wed, 7 Nov 2007 21:11:19 -0500

 On Wed, Nov 07, 2007 at 04:32:00PM -0800, David Miller wrote:
  From: John W. Linville [EMAIL PROTECTED]
  Date: Wed, 7 Nov 2007 13:51:54 -0500
  
   Hold-off on this one for now if -- clearly Johannes and I need to
   brush-up on our Kconfig skills... :-(
   
   I'll post a new pull request soon.
  
  Ok.
 
 Dave,
 
 These fixes are additive on top of the previous request archived here:
 
   http://marc.info/?l=linux-wirelessm=119439453721827w=2
 
 I've been sending ssb patches to you, but I'm not sure if that is the
 right place to send them.  If you don't want them, can you suggest where
 else I should send them?
 
 Anyway, let me know if there are any problems!
 ...
 The entire series (i.e. both from yesterday and today) is available
 here:
 
   
 http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/fixes-davem

I applied all of these as patches, thanks John!
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded

2007-11-10 Thread David Miller
From: PJ Waskiewicz [EMAIL PROTECTED]
Date: Tue, 06 Nov 2007 07:25:47 -0800

 The socket option for packet sockets to return the original ifindex instead
 of the bonded ifindex will not match multicast traffic.  Since this socket
 option is the most useful for layer 2 traffic and multicast traffic, make
 the option multicast-aware.
 
 Signed-off-by: Peter P Waskiewicz Jr [EMAIL PROTECTED]

Applied, thanks Peter.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3][UNIX] Make unix_tot_inflight counter non-atomic

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Wed, 07 Nov 2007 16:52:36 +0300

 This counter is _always_ modified under the unix_gc_lock spinlock, 
 so its atomicity can be provided w/o additional efforts.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

Applied.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3][UNIX] Convert socks to unix_socks in scan_inflight, not in callbacks

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Wed, 07 Nov 2007 16:56:21 +0300

 The scan_inflight() routine scans through the unix sockets and calls
 some passed callback. The fact is that all these callbacks work with
 the unix_sock objects, not the sock ones, so make this conversion in
 the scan_inflight() before calling the callbacks.
 
 This removes one unneeded variable from the inc_inflight_move_tail().
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

Applied, thanks Pavel.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3][UNIX] The unix_nr_socks limit can be exceeded

2007-11-10 Thread David Miller
From: Pavel Emelyanov [EMAIL PROTECTED]
Date: Wed, 07 Nov 2007 17:01:17 +0300

 The unix_nr_socks value is limited with the 2 * get_max_files() value,
 as seen from the unix_create1(). However, the check and the actual
 increment are separated with the GFP_KERNEL allocation, so this limit
 can be exceeded under a memory pressure - task may go to sleep freeing
 the pages and some other task will be allowed to allocate a new sock
 and so on and so forth.
 
 So make the increment before the check (similar thing is done in the
 sock_kmalloc) and go to kmalloc after this.
 
 Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

Applied, good catch Pavel.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] netns: init dev_base_lock only once

2007-11-10 Thread David Miller
From: Alexey Dobriyan [EMAIL PROTECTED]
Date: Wed, 7 Nov 2007 15:51:33 +0300

 * it already statically initialized
 * reinitializing live global spinlock every time netns is
   setup is also wrong
 
 Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED]

Good catch.

Applied, thanks Alexey.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [RESEND] small possible memory leak in FIB rules

2007-11-10 Thread David Miller
From: Denis V. Lunev [EMAIL PROTECTED]
Date: Wed, 7 Nov 2007 16:36:36 +0300

 This patch fixes a small memory leak. Default fib rules can be deleted by
 the user if the rule does not carry FIB_RULE_PERMANENT flag, f.e. by
   ip rule flush
 
 Such a rule will not be freed as the ref-counter has 2 on start and becomes
 clearly unreachable after removal.
 
 Signed-off-by: Denis V. Lunev [EMAIL PROTECTED]
 Acked-by: Alexey Kuznetsov [EMAIL PROTECTED]

Applied, thanks Denis.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] unexport sysctl_{r,w}mem_max

2007-11-10 Thread Adrian Bunk
sysctl_{r,w}mem_max can now be unexported.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

---
d49d51e5f46615c30e0f96c5333733e0ab1c85e6 
diff --git a/net/core/sock.c b/net/core/sock.c
index 8fc2f84..c519b43 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2097,7 +2097,3 @@ EXPORT_SYMBOL(sock_wmalloc);
 EXPORT_SYMBOL(sock_i_uid);
 EXPORT_SYMBOL(sock_i_ino);
 EXPORT_SYMBOL(sysctl_optmem_max);
-#ifdef CONFIG_SYSCTL
-EXPORT_SYMBOL(sysctl_rmem_max);
-EXPORT_SYMBOL(sysctl_wmem_max);
-#endif

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] net/ipv4/ipvs/: remove unused exports

2007-11-10 Thread Adrian Bunk
This patch removes the following unused EXPORT_SYMBOL's:
- ip_vs_try_bind_dest
- ip_vs_find_dest

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

---

 net/ipv4/ipvs/ip_vs_conn.c |1 -
 net/ipv4/ipvs/ip_vs_ctl.c  |1 -
 2 files changed, 2 deletions(-)

ad9f400d4f66ea3423f97e609d6ef2572055c603 
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index b7eeae6..0a9f3c3 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -441,7 +441,6 @@ struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn 
*cp)
} else
return NULL;
 }
-EXPORT_SYMBOL(ip_vs_try_bind_dest);
 
 
 /*
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 3c4d22a..b64cf45 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -604,7 +604,6 @@ struct ip_vs_dest *ip_vs_find_dest(__be32 daddr, __be16 
dport,
ip_vs_service_put(svc);
return dest;
 }
-EXPORT_SYMBOL(ip_vs_find_dest);
 
 /*
  *  Lookup dest by {svc,addr,port} in the destination trash.

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html