Re: NAPI (aka RX Polling) for natsemi?

2005-07-22 Thread Patrick McHardy

Francois Romieu wrote:

Daniel Higgins <[EMAIL PROTECTED]> :
[napi for natsemi]

Can you please fill a bugzilla entry for it at bugzilla.kernel.org ?


It is bugzilla, not featurewishzilla. If some external patches
cause problem I suggest to contact their authors.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAPI (aka RX Polling) for natsemi?

2005-07-22 Thread Patrick McHardy

Francois Romieu wrote:

Daniel Higgins [EMAIL PROTECTED] :
[napi for natsemi]

Can you please fill a bugzilla entry for it at bugzilla.kernel.org ?


It is bugzilla, not featurewishzilla. If some external patches
cause problem I suggest to contact their authors.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Is this a bug in linux-2.6.12 ipsec code function xfrm4_rcv_encap ??

2005-07-22 Thread Patrick McHardy

k8 s wrote:

I AM SORRY FOR THE PREVIOUS MAIL.
I am correcting my previous mail. 
Infact I see only One race(not three as was wrongly pointed out).

I commented out the section once again where the race might be.

 /
 Race Here . The Check(x-props.mode) is without Lock. What if setkey
-F is done at the same time on another processor freeing what x points
to.
 /


   if (x-props.mode) {


We hold a reference to the state, so it can't be freed.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.12 netfilter: local packets marked as invalid

2005-07-12 Thread Patrick McHardy

Chris Wright wrote:

* David S. Miller ([EMAIL PROTECTED]) wrote:


Now the question is what to do about the 2.6.12.x stable
tree.  I think we put the offending change there, now we
need to revert it there too.  Patrick, could you push this
patch to [EMAIL PROTECTED] so we can resolve that too?


There's the first fix in the queue, I can either drop that one, or
patch on top of it.  Dropping what's in the queue[1] is fine for me.
Below's the backport that Daniel sent over this morning (which applies
if I drop what's in the queue).  Patrick, does that look ok?  I didn't
queue this change yet, as I'd prefer it came either from you or with you
Cc'd so you can ack it.

[1] 
http://www.kernel.org/git/?p=linux/kernel/git/chrisw/stable-queue.git;a=blob;h=77843604cf9af8cf5458d97eb56d5346e6d380b3;hb=9aaf5aa7c4e4b8309997d2b433bf7464280799eb;f=queue/netfilter-connection-tracking.patch


Daniel's patch is fine, thanks.

ACKed-by: Patrick McHardy <[EMAIL PROTECTED]>

Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.12 netfilter: local packets marked as invalid

2005-07-12 Thread Patrick McHardy

Daniel Drake wrote:

You'll have to forgive my lack of netfilter knowledge, I set up my firewall
ages ago and haven't really touched it since :)


We decided to revert the responsible change because it caused problems
in other areas as well. This patch should fix your problem.

[NETFILTER]: Revert nf_reset change

Revert the nf_reset change that caused so much trouble, drop conntrack
references manually before packets are queued to packet sockets.

Signed-off-by: Phil Oester <[EMAIL PROTECTED]>
Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

---
commit c64e9fafffd203886f6c57149803f1824febd9bb
tree 40a90ab1427c25f7a36109eabd1a53b0a8f144be
parent 9fd73bed06eb5cf309e0cb5cdf3249a54fd3ff22
author Phil Oester <[EMAIL PROTECTED]> Mon, 11 Jul 2005 02:04:08
committer Patrick McHardy <[EMAIL PROTECTED]> Mon, 11 Jul 2005 02:04:08

 net/ipv4/ip_output.c |9 -
 net/ipv4/netfilter/ip_conntrack_standalone.c |7 +++
 net/packet/af_packet.c   |6 ++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -107,7 +107,6 @@ static int ip_dev_loopback_xmit(struct s
newskb->pkt_type = PACKET_LOOPBACK;
newskb->ip_summed = CHECKSUM_UNNECESSARY;
BUG_TRAP(newskb->dst);
-   nf_reset(newskb);
netif_rx(newskb);
return 0;
 }
@@ -188,14 +187,6 @@ static inline int ip_finish_output2(stru
skb = skb2;
}
 
-#ifdef CONFIG_BRIDGE_NETFILTER
-   /* bridge-netfilter defers calling some IP hooks to the bridge layer
-* and still needs the conntrack reference.
-*/
-   if (skb->nf_bridge == NULL)
-#endif
-   nf_reset(skb);
-
if (hh) {
int hh_alen;
 
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c 
b/net/ipv4/netfilter/ip_conntrack_standalone.c
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -432,6 +432,13 @@ static unsigned int ip_conntrack_defrag(
const struct net_device *out,
int (*okfn)(struct sk_buff *))
 {
+#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
+   /* Previously seen (loopback)?  Ignore.  Do this before
+   fragment check. */
+   if ((*pskb)->nfct)
+   return NF_ACCEPT;
+#endif
+
/* Gather fragments. */
if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
*pskb = ip_ct_gather_frags(*pskb,
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buf
dst_release(skb->dst);
skb->dst = NULL;
 
+   /* drop conntrack reference */
+   nf_reset(skb);
+
spkt = (struct sockaddr_pkt*)skb->cb;
 
skb_push(skb, skb->data-skb->mac.raw);
@@ -517,6 +520,9 @@ static int packet_rcv(struct sk_buff *sk
dst_release(skb->dst);
skb->dst = NULL;
 
+   /* drop conntrack reference */
+   nf_reset(skb);
+
spin_lock(>sk_receive_queue.lock);
po->stats.tp_packets++;
__skb_queue_tail(>sk_receive_queue, skb);


Re: kernel guide to space

2005-07-12 Thread Patrick McHardy

Denis Vlasenko wrote:

text with 8-char tabs:

struct s {
int n;  /* comment */
unsigned int u; /* comment */
};

Same text viewed with tabs set to 4-char width:

struct s {
int n;  /* comment */
unsigned int u; /* comment */
};

Comments are not aligned anymore


Best rule IMO is to use tabs for indentation and spaces for alignment.
This way tab size can be changed without breaking alignment.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.12 netfilter: local packets marked as invalid

2005-07-12 Thread Patrick McHardy

Chris Wright wrote:

* David S. Miller ([EMAIL PROTECTED]) wrote:


Now the question is what to do about the 2.6.12.x stable
tree.  I think we put the offending change there, now we
need to revert it there too.  Patrick, could you push this
patch to [EMAIL PROTECTED] so we can resolve that too?


There's the first fix in the queue, I can either drop that one, or
patch on top of it.  Dropping what's in the queue[1] is fine for me.
Below's the backport that Daniel sent over this morning (which applies
if I drop what's in the queue).  Patrick, does that look ok?  I didn't
queue this change yet, as I'd prefer it came either from you or with you
Cc'd so you can ack it.

[1] 
http://www.kernel.org/git/?p=linux/kernel/git/chrisw/stable-queue.git;a=blob;h=77843604cf9af8cf5458d97eb56d5346e6d380b3;hb=9aaf5aa7c4e4b8309997d2b433bf7464280799eb;f=queue/netfilter-connection-tracking.patch


Daniel's patch is fine, thanks.

ACKed-by: Patrick McHardy [EMAIL PROTECTED]

Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: kernel guide to space

2005-07-12 Thread Patrick McHardy

Denis Vlasenko wrote:

text with 8-char tabs:

struct s {
int n;  /* comment */
unsigned int u; /* comment */
};

Same text viewed with tabs set to 4-char width:

struct s {
int n;  /* comment */
unsigned int u; /* comment */
};

Comments are not aligned anymore


Best rule IMO is to use tabs for indentation and spaces for alignment.
This way tab size can be changed without breaking alignment.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.12 netfilter: local packets marked as invalid

2005-07-12 Thread Patrick McHardy

Daniel Drake wrote:

You'll have to forgive my lack of netfilter knowledge, I set up my firewall
ages ago and haven't really touched it since :)


We decided to revert the responsible change because it caused problems
in other areas as well. This patch should fix your problem.

[NETFILTER]: Revert nf_reset change

Revert the nf_reset change that caused so much trouble, drop conntrack
references manually before packets are queued to packet sockets.

Signed-off-by: Phil Oester [EMAIL PROTECTED]
Signed-off-by: Patrick McHardy [EMAIL PROTECTED]

---
commit c64e9fafffd203886f6c57149803f1824febd9bb
tree 40a90ab1427c25f7a36109eabd1a53b0a8f144be
parent 9fd73bed06eb5cf309e0cb5cdf3249a54fd3ff22
author Phil Oester [EMAIL PROTECTED] Mon, 11 Jul 2005 02:04:08
committer Patrick McHardy [EMAIL PROTECTED] Mon, 11 Jul 2005 02:04:08

 net/ipv4/ip_output.c |9 -
 net/ipv4/netfilter/ip_conntrack_standalone.c |7 +++
 net/packet/af_packet.c   |6 ++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -107,7 +107,6 @@ static int ip_dev_loopback_xmit(struct s
newskb-pkt_type = PACKET_LOOPBACK;
newskb-ip_summed = CHECKSUM_UNNECESSARY;
BUG_TRAP(newskb-dst);
-   nf_reset(newskb);
netif_rx(newskb);
return 0;
 }
@@ -188,14 +187,6 @@ static inline int ip_finish_output2(stru
skb = skb2;
}
 
-#ifdef CONFIG_BRIDGE_NETFILTER
-   /* bridge-netfilter defers calling some IP hooks to the bridge layer
-* and still needs the conntrack reference.
-*/
-   if (skb-nf_bridge == NULL)
-#endif
-   nf_reset(skb);
-
if (hh) {
int hh_alen;
 
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c 
b/net/ipv4/netfilter/ip_conntrack_standalone.c
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -432,6 +432,13 @@ static unsigned int ip_conntrack_defrag(
const struct net_device *out,
int (*okfn)(struct sk_buff *))
 {
+#if !defined(CONFIG_IP_NF_NAT)  !defined(CONFIG_IP_NF_NAT_MODULE)
+   /* Previously seen (loopback)?  Ignore.  Do this before
+   fragment check. */
+   if ((*pskb)-nfct)
+   return NF_ACCEPT;
+#endif
+
/* Gather fragments. */
if ((*pskb)-nh.iph-frag_off  htons(IP_MF|IP_OFFSET)) {
*pskb = ip_ct_gather_frags(*pskb,
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buf
dst_release(skb-dst);
skb-dst = NULL;
 
+   /* drop conntrack reference */
+   nf_reset(skb);
+
spkt = (struct sockaddr_pkt*)skb-cb;
 
skb_push(skb, skb-data-skb-mac.raw);
@@ -517,6 +520,9 @@ static int packet_rcv(struct sk_buff *sk
dst_release(skb-dst);
skb-dst = NULL;
 
+   /* drop conntrack reference */
+   nf_reset(skb);
+
spin_lock(sk-sk_receive_queue.lock);
po-stats.tp_packets++;
__skb_queue_tail(sk-sk_receive_queue, skb);


Re: 2.6.12 netfilter: local packets marked as invalid

2005-07-08 Thread Patrick McHardy

Daniel Drake wrote:

When retrying the telnet test, this appears in the logs:

Jul  8 14:53:04 dsd inv IN=lo OUT=
MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.0.1
LEN=40 TOS=0x10 PREC=0x00 TTL=64 ID=15 DF PROTO=TCP SPT=80 DPT=58950 WINDOW=0
RES=0x00 ACK RST URGP=0

Does this mean that the kernel thinks its own ACK RST packet is invalid?


I think I know what happens. In 2.6.12 we started dropping the conntrack
reference when a packet leaves IP, so packets on loopback are tracked
twice (LOCAL_OUT/PRE_ROUTING). TCP connection tracking destroys a
conntrack entry when the only reply is an RST. So when the packet is
tracked for the second time in PRE_ROUTING, the conntrack entry can't
be found anymore and the packet is considered invalid.

You could confirm this theory by logging invalid packets in LOCAL_OUT
and in PRE_ROUTING - only PRE_ROUTING should trigger. I'm going to
think about a solution meanwhile.

Regards
Patrick

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.12 netfilter: local packets marked as invalid

2005-07-08 Thread Patrick McHardy

Daniel Drake wrote:

When retrying the telnet test, this appears in the logs:

Jul  8 14:53:04 dsd inv IN=lo OUT=
MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.0.1
LEN=40 TOS=0x10 PREC=0x00 TTL=64 ID=15 DF PROTO=TCP SPT=80 DPT=58950 WINDOW=0
RES=0x00 ACK RST URGP=0

Does this mean that the kernel thinks its own ACK RST packet is invalid?


I think I know what happens. In 2.6.12 we started dropping the conntrack
reference when a packet leaves IP, so packets on loopback are tracked
twice (LOCAL_OUT/PRE_ROUTING). TCP connection tracking destroys a
conntrack entry when the only reply is an RST. So when the packet is
tracked for the second time in PRE_ROUTING, the conntrack entry can't
be found anymore and the packet is considered invalid.

You could confirm this theory by logging invalid packets in LOCAL_OUT
and in PRE_ROUTING - only PRE_ROUTING should trigger. I'm going to
think about a solution meanwhile.

Regards
Patrick

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: fix for ISDN ippp filtering

2005-04-21 Thread Patrick McHardy
Karsten Keil wrote:
Hi,
We do not longer use DLT_LINUX_SLL for activ/pass filters but 
DLT_PPP_WITHDIRECTION
witch need 1 as outbound flag.
Please apply.
Won't this break compatibility with old ipppd binaries?
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: fix for ISDN ippp filtering

2005-04-21 Thread Patrick McHardy
Karsten Keil wrote:
Hi,
We do not longer use DLT_LINUX_SLL for activ/pass filters but 
DLT_PPP_WITHDIRECTION
witch need 1 as outbound flag.
Please apply.
Won't this break compatibility with old ipppd binaries?
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: ACPI/HT or Packet Scheduler BUG?

2005-04-17 Thread Patrick McHardy
Herbert Xu wrote:
On Sat, Apr 16, 2005 at 01:06:39PM +0200, Thomas Graf wrote:
qdisc_destroy can still be invoked without qdisc_tree_lock via the
deletion of a class when it calls qdisc_destroy to destroy its
leaf qdisc.
Indeed.  Fortuantely HTB seems to be safe as it calls sch_tree_lock
which is another name for qdisc_tree_lock.  CBQ on the other hand
needs to have a little tweak.
HTB also needs to be fixed. Destruction is usually defered by the
refcnt until ->put(), htb_put() doesn't lock the tree. Same for
HFSC and CBQ.
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: ACPI/HT or Packet Scheduler BUG?

2005-04-17 Thread Patrick McHardy
Herbert Xu wrote:
On Sat, Apr 16, 2005 at 01:06:39PM +0200, Thomas Graf wrote:
qdisc_destroy can still be invoked without qdisc_tree_lock via the
deletion of a class when it calls qdisc_destroy to destroy its
leaf qdisc.
Indeed.  Fortuantely HTB seems to be safe as it calls sch_tree_lock
which is another name for qdisc_tree_lock.  CBQ on the other hand
needs to have a little tweak.
HTB also needs to be fixed. Destruction is usually defered by the
refcnt until -put(), htb_put() doesn't lock the tree. Same for
HFSC and CBQ.
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [5/9] [TUN] Fix check for underflow

2005-03-16 Thread Patrick McHardy
Chris Wright wrote:
-stable review patch.  If anyone has any objections, please let us know.
I agree to both patches and additionally propose this one.
It fixes a crash when reading /proc/net/route (netstat -rn)
while routes are changed. I've seen two bugreports of users
beeing hit by this bug, one for 2.6.10, one for 2.6.11.
Regards
Patrick
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/10 18:20:44-08:00 [EMAIL PROTECTED] 
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
#   Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
# 
# net/ipv4/fib_hash.c
#   2005/03/10 18:20:30-08:00 [EMAIL PROTECTED] +11 -1
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
#   Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
# 
diff -Nru a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
--- a/net/ipv4/fib_hash.c   2005-03-17 00:58:42 +01:00
+++ b/net/ipv4/fib_hash.c   2005-03-17 00:58:42 +01:00
@@ -919,13 +919,23 @@
return fa;
 }
 
+static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
+{
+   struct fib_alias *fa = fib_get_first(seq);
+
+   if (fa)
+   while (pos && (fa = fib_get_next(seq)))
+   --pos;
+   return pos ? NULL : fa;
+}
+
 static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
 {
void *v = NULL;
 
read_lock(_hash_lock);
if (ip_fib_main_table)
-   v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN;
+   v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
return v;
 }
 


Re: [5/9] [TUN] Fix check for underflow

2005-03-16 Thread Patrick McHardy
Chris Wright wrote:
-stable review patch.  If anyone has any objections, please let us know.
I agree to both patches and additionally propose this one.
It fixes a crash when reading /proc/net/route (netstat -rn)
while routes are changed. I've seen two bugreports of users
beeing hit by this bug, one for 2.6.10, one for 2.6.11.
Regards
Patrick
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/10 18:20:44-08:00 [EMAIL PROTECTED] 
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
#   Signed-off-by: David S. Miller [EMAIL PROTECTED]
# 
# net/ipv4/fib_hash.c
#   2005/03/10 18:20:30-08:00 [EMAIL PROTECTED] +11 -1
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
#   Signed-off-by: David S. Miller [EMAIL PROTECTED]
# 
diff -Nru a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
--- a/net/ipv4/fib_hash.c   2005-03-17 00:58:42 +01:00
+++ b/net/ipv4/fib_hash.c   2005-03-17 00:58:42 +01:00
@@ -919,13 +919,23 @@
return fa;
 }
 
+static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
+{
+   struct fib_alias *fa = fib_get_first(seq);
+
+   if (fa)
+   while (pos  (fa = fib_get_next(seq)))
+   --pos;
+   return pos ? NULL : fa;
+}
+
 static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
 {
void *v = NULL;
 
read_lock(fib_hash_lock);
if (ip_fib_main_table)
-   v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN;
+   v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
return v;
 }
 


Re: [PATCH] Export dev_get_flags in net/core/dev.c to fix missing symbols

2005-03-15 Thread Patrick McHardy
Alex Tribble wrote:
[EMAIL PROTECTED], 2005-03-15 13:46:12-06:00, [EMAIL PROTECTED]
  Export dev_get_flags to fix missing symbols in ipv6.ko
The same patch is already in Linus' tree:
ChangeSet 1.2186, 2005/03/15 10:16:32-08:00, [EMAIL PROTECTED]
[NET]: Need to export dev_get_flags() to modules.

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Funny, you even hit the same ChangeSet number :)
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Export dev_get_flags in net/core/dev.c to fix missing symbols

2005-03-15 Thread Patrick McHardy
Alex Tribble wrote:
[EMAIL PROTECTED], 2005-03-15 13:46:12-06:00, [EMAIL PROTECTED]
  Export dev_get_flags to fix missing symbols in ipv6.ko
The same patch is already in Linus' tree:
ChangeSet 1.2186, 2005/03/15 10:16:32-08:00, [EMAIL PROTECTED]
[NET]: Need to export dev_get_flags() to modules.

Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
Funny, you even hit the same ChangeSet number :)
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Badness in local_bh_enable at kernel/softirq.c:140

2005-03-12 Thread Patrick McHardy
Kimmo Sundqvist wrote:
Mar 12 10:39:45 shadowgate Badness in local_bh_enable at kernel/softirq.c:140
Mar 12 10:39:45 shadowgate [] local_bh_enable+0x64/0x70
Mar 12 10:39:45 shadowgate [] isdn_ppp_xmit+0xf7/0x7e0 [isdn]
Mar 12 10:39:45 shadowgate [] isdn_net_xmit+0x186/0x1d0 [isdn]
Mar 12 10:39:45 shadowgate [] isdn_net_start_xmit+0x277/0x290 [isdn]
Herbert Xu fixed this in 2.6.11-rc3.
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Badness in local_bh_enable at kernel/softirq.c:140

2005-03-12 Thread Patrick McHardy
Kimmo Sundqvist wrote:
Mar 12 10:39:45 shadowgate Badness in local_bh_enable at kernel/softirq.c:140
Mar 12 10:39:45 shadowgate [c0114ca4] local_bh_enable+0x64/0x70
Mar 12 10:39:45 shadowgate [c486afd7] isdn_ppp_xmit+0xf7/0x7e0 [isdn]
Mar 12 10:39:45 shadowgate [c485d646] isdn_net_xmit+0x186/0x1d0 [isdn]
Mar 12 10:39:45 shadowgate [c485d9e7] isdn_net_start_xmit+0x277/0x290 [isdn]
Herbert Xu fixed this in 2.6.11-rc3.
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Last night Linus bk - netfilter busted?

2005-03-11 Thread Patrick McHardy
Herbert Xu wrote:
Patrick McHardy <[EMAIL PROTECTED]> wrote:
You're right, good catch. IPT_RETURN is interpreted internally by
ip_tables, but since the value changed it isn't recognized by ip_tables
anymore and returned to nf_iterate() as NF_REPEAT. This patch restores
the old value.

Please fix netfilter_arp while you're at it since it does exactly
the same thing.
New patch attached, thanks.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/11 23:54:54+01:00 [EMAIL PROTECTED] 
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
# include/linux/netfilter_ipv6/ip6_tables.h
#   2005/03/11 23:54:44+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
# include/linux/netfilter_ipv4/ip_tables.h
#   2005/03/11 23:54:44+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
# include/linux/netfilter_arp/arp_tables.h
#   2005/03/11 23:54:44+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
diff -Nru a/include/linux/netfilter_arp/arp_tables.h 
b/include/linux/netfilter_arp/arp_tables.h
--- a/include/linux/netfilter_arp/arp_tables.h  2005-03-11 23:55:09 +01:00
+++ b/include/linux/netfilter_arp/arp_tables.h  2005-03-11 23:55:09 +01:00
@@ -154,7 +154,7 @@
 #define ARPT_CONTINUE 0x
 
 /* For standard target */
-#define ARPT_RETURN (-NF_MAX_VERDICT - 1)
+#define ARPT_RETURN (-NF_REPEAT - 1)
 
 /* The argument to ARPT_SO_GET_INFO */
 struct arpt_getinfo
diff -Nru a/include/linux/netfilter_ipv4/ip_tables.h 
b/include/linux/netfilter_ipv4/ip_tables.h
--- a/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 23:55:09 +01:00
+++ b/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 23:55:09 +01:00
@@ -166,7 +166,7 @@
 #define IPT_CONTINUE 0x
 
 /* For standard target */
-#define IPT_RETURN (-NF_MAX_VERDICT - 1)
+#define IPT_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ipt_tcp
diff -Nru a/include/linux/netfilter_ipv6/ip6_tables.h 
b/include/linux/netfilter_ipv6/ip6_tables.h
--- a/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 23:55:09 +01:00
+++ b/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 23:55:09 +01:00
@@ -166,7 +166,7 @@
 #define IP6T_CONTINUE 0x
 
 /* For standard target */
-#define IP6T_RETURN (-NF_MAX_VERDICT - 1)
+#define IP6T_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ip6t_tcp


Re: Last night Linus bk - netfilter busted?

2005-03-11 Thread Patrick McHardy
David S. Miller wrote:
Damn, wait, Patrick, I think I know what's happening.  The iptables
IPT_* verdicts are dependant upon the NF_* values, and they don't
cope with Bart's changes I bet.  Can you figure out what the exact
error would be?  This kind of issue would explain the looping inside
of ipt_do_table(), wouldn't it?
You're right, good catch. IPT_RETURN is interpreted internally by
ip_tables, but since the value changed it isn't recognized by ip_tables
anymore and returned to nf_iterate() as NF_REPEAT. This patch restores
the old value.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/11 21:41:01+01:00 [EMAIL PROTECTED] 
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
# include/linux/netfilter_ipv6/ip6_tables.h
#   2005/03/11 21:40:52+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
# include/linux/netfilter_ipv4/ip_tables.h
#   2005/03/11 21:40:52+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
diff -Nru a/include/linux/netfilter_ipv4/ip_tables.h 
b/include/linux/netfilter_ipv4/ip_tables.h
--- a/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 21:41:32 +01:00
+++ b/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 21:41:32 +01:00
@@ -166,7 +166,7 @@
 #define IPT_CONTINUE 0x
 
 /* For standard target */
-#define IPT_RETURN (-NF_MAX_VERDICT - 1)
+#define IPT_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ipt_tcp
diff -Nru a/include/linux/netfilter_ipv6/ip6_tables.h 
b/include/linux/netfilter_ipv6/ip6_tables.h
--- a/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 21:41:32 +01:00
+++ b/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 21:41:32 +01:00
@@ -166,7 +166,7 @@
 #define IP6T_CONTINUE 0x
 
 /* For standard target */
-#define IP6T_RETURN (-NF_MAX_VERDICT - 1)
+#define IP6T_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ip6t_tcp


Re: Last night Linus bk - netfilter busted?

2005-03-11 Thread Patrick McHardy
Dmitry Torokhov wrote:
My box gets stuck while booting (actually starting ntpd) whith tonight
pull from Linus. It looks like it is spinning in ipt_do_table when I do
SysRq-P. No call trace though.
Please post your ruleset and .config. A backtrace would also be
useful.
Anyone else seeing it? Any ideas?
Works fine here. You could try if reverting one of these two patches
helps (second one only if its a SMP box).
[EMAIL PROTECTED], 2005-03-09 20:28:17-08:00, [EMAIL PROTECTED]
  [NETFILTER]: Reduce call chain length in netfilter (take 2)
[EMAIL PROTECTED], 2005-03-03 23:15:48+01:00, [EMAIL PROTECTED]
  [NETFILTER]: Reduce netfilter memory use on MP systems
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Last night Linus bk - netfilter busted?

2005-03-11 Thread Patrick McHardy
Dmitry Torokhov wrote:
My box gets stuck while booting (actually starting ntpd) whith tonight
pull from Linus. It looks like it is spinning in ipt_do_table when I do
SysRq-P. No call trace though.
Please post your ruleset and .config. A backtrace would also be
useful.
Anyone else seeing it? Any ideas?
Works fine here. You could try if reverting one of these two patches
helps (second one only if its a SMP box).
[EMAIL PROTECTED], 2005-03-09 20:28:17-08:00, [EMAIL PROTECTED]
  [NETFILTER]: Reduce call chain length in netfilter (take 2)
[EMAIL PROTECTED], 2005-03-03 23:15:48+01:00, [EMAIL PROTECTED]
  [NETFILTER]: Reduce netfilter memory use on MP systems
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Last night Linus bk - netfilter busted?

2005-03-11 Thread Patrick McHardy
David S. Miller wrote:
Damn, wait, Patrick, I think I know what's happening.  The iptables
IPT_* verdicts are dependant upon the NF_* values, and they don't
cope with Bart's changes I bet.  Can you figure out what the exact
error would be?  This kind of issue would explain the looping inside
of ipt_do_table(), wouldn't it?
You're right, good catch. IPT_RETURN is interpreted internally by
ip_tables, but since the value changed it isn't recognized by ip_tables
anymore and returned to nf_iterate() as NF_REPEAT. This patch restores
the old value.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/11 21:41:01+01:00 [EMAIL PROTECTED] 
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
# include/linux/netfilter_ipv6/ip6_tables.h
#   2005/03/11 21:40:52+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
# include/linux/netfilter_ipv4/ip_tables.h
#   2005/03/11 21:40:52+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
diff -Nru a/include/linux/netfilter_ipv4/ip_tables.h 
b/include/linux/netfilter_ipv4/ip_tables.h
--- a/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 21:41:32 +01:00
+++ b/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 21:41:32 +01:00
@@ -166,7 +166,7 @@
 #define IPT_CONTINUE 0x
 
 /* For standard target */
-#define IPT_RETURN (-NF_MAX_VERDICT - 1)
+#define IPT_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ipt_tcp
diff -Nru a/include/linux/netfilter_ipv6/ip6_tables.h 
b/include/linux/netfilter_ipv6/ip6_tables.h
--- a/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 21:41:32 +01:00
+++ b/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 21:41:32 +01:00
@@ -166,7 +166,7 @@
 #define IP6T_CONTINUE 0x
 
 /* For standard target */
-#define IP6T_RETURN (-NF_MAX_VERDICT - 1)
+#define IP6T_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ip6t_tcp


Re: Last night Linus bk - netfilter busted?

2005-03-11 Thread Patrick McHardy
Herbert Xu wrote:
Patrick McHardy [EMAIL PROTECTED] wrote:
You're right, good catch. IPT_RETURN is interpreted internally by
ip_tables, but since the value changed it isn't recognized by ip_tables
anymore and returned to nf_iterate() as NF_REPEAT. This patch restores
the old value.

Please fix netfilter_arp while you're at it since it does exactly
the same thing.
New patch attached, thanks.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/11 23:54:54+01:00 [EMAIL PROTECTED] 
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
# include/linux/netfilter_ipv6/ip6_tables.h
#   2005/03/11 23:54:44+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
# include/linux/netfilter_ipv4/ip_tables.h
#   2005/03/11 23:54:44+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
# include/linux/netfilter_arp/arp_tables.h
#   2005/03/11 23:54:44+01:00 [EMAIL PROTECTED] +1 -1
#   [NETFILTER]: Fix iptables userspace compatibility breakage
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
diff -Nru a/include/linux/netfilter_arp/arp_tables.h 
b/include/linux/netfilter_arp/arp_tables.h
--- a/include/linux/netfilter_arp/arp_tables.h  2005-03-11 23:55:09 +01:00
+++ b/include/linux/netfilter_arp/arp_tables.h  2005-03-11 23:55:09 +01:00
@@ -154,7 +154,7 @@
 #define ARPT_CONTINUE 0x
 
 /* For standard target */
-#define ARPT_RETURN (-NF_MAX_VERDICT - 1)
+#define ARPT_RETURN (-NF_REPEAT - 1)
 
 /* The argument to ARPT_SO_GET_INFO */
 struct arpt_getinfo
diff -Nru a/include/linux/netfilter_ipv4/ip_tables.h 
b/include/linux/netfilter_ipv4/ip_tables.h
--- a/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 23:55:09 +01:00
+++ b/include/linux/netfilter_ipv4/ip_tables.h  2005-03-11 23:55:09 +01:00
@@ -166,7 +166,7 @@
 #define IPT_CONTINUE 0x
 
 /* For standard target */
-#define IPT_RETURN (-NF_MAX_VERDICT - 1)
+#define IPT_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ipt_tcp
diff -Nru a/include/linux/netfilter_ipv6/ip6_tables.h 
b/include/linux/netfilter_ipv6/ip6_tables.h
--- a/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 23:55:09 +01:00
+++ b/include/linux/netfilter_ipv6/ip6_tables.h 2005-03-11 23:55:09 +01:00
@@ -166,7 +166,7 @@
 #define IP6T_CONTINUE 0x
 
 /* For standard target */
-#define IP6T_RETURN (-NF_MAX_VERDICT - 1)
+#define IP6T_RETURN (-NF_REPEAT - 1)
 
 /* TCP matching stuff */
 struct ip6t_tcp


Re: 2.6.11 on AMD64 traps

2005-03-09 Thread Patrick McHardy
Michal Vanco wrote:
On Wednesday 09 March 2005 20:45, Patrick McHardy wrote:
This patch should fix it. The crash is caused by stale pointers,
the pointers in fib_iter_state are not reloaded after seq->stop()
followed by seq->start(pos > 0).
Well. Trap vanished after applying this patch, but another weird thing 
occurs:
# ip route show | wc -l
156033
# date; time ip route show > /dev/null; date; time netstat -rn > /dev/null
Wed Mar  9 22:15:21 CET 2005
real0m0.656s
user0m0.415s
sys 0m0.242s
Wed Mar  9 22:15:22 CET 2005
real6m41.472s
user0m1.261s
sys 6m40.143s
Yes, I know it is totally inefficient. Just use ip route, which doesn't
suffer from this problem.
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11 on AMD64 traps

2005-03-09 Thread Patrick McHardy
Michal Vanco wrote:
I see this problem running 2.6.11 on dual AMD64:
Running quagga routing daemon (ospf+bgp) and issuing "netstat -rn |wc 
-l" command
while quagga tries to load more than 154000 routes from its bgp 
neighbours causes this trap:
This patch should fix it. The crash is caused by stale pointers,
the pointers in fib_iter_state are not reloaded after seq->stop()
followed by seq->start(pos > 0).
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/09 20:41:46+01:00 [EMAIL PROTECTED] 
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
# net/ipv4/fib_hash.c
#   2005/03/09 20:41:37+01:00 [EMAIL PROTECTED] +11 -1
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
# 
diff -Nru a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
--- a/net/ipv4/fib_hash.c   2005-03-09 20:43:55 +01:00
+++ b/net/ipv4/fib_hash.c   2005-03-09 20:43:55 +01:00
@@ -919,13 +919,23 @@
return fa;
 }
 
+static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
+{
+   struct fib_alias *fa = fib_get_first(seq);
+
+   if (fa)
+   while (pos && (fa = fib_get_next(seq)))
+   --pos;
+   return pos ? NULL : fa;
+}
+
 static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
 {
void *v = NULL;
 
read_lock(_hash_lock);
if (ip_fib_main_table)
-   v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN;
+   v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
return v;
 }
 


Re: 2.6.11 on AMD64 traps

2005-03-09 Thread Patrick McHardy
Michal Vanco wrote:
I see this problem running 2.6.11 on dual AMD64:
Running quagga routing daemon (ospf+bgp) and issuing netstat -rn |wc 
-l command
while quagga tries to load more than 154000 routes from its bgp 
neighbours causes this trap:
This patch should fix it. The crash is caused by stale pointers,
the pointers in fib_iter_state are not reloaded after seq-stop()
followed by seq-start(pos  0).
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/09 20:41:46+01:00 [EMAIL PROTECTED] 
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
# net/ipv4/fib_hash.c
#   2005/03/09 20:41:37+01:00 [EMAIL PROTECTED] +11 -1
#   [IPV4]: Fix crash while reading /proc/net/route caused by stale pointers
#   
#   Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
# 
diff -Nru a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
--- a/net/ipv4/fib_hash.c   2005-03-09 20:43:55 +01:00
+++ b/net/ipv4/fib_hash.c   2005-03-09 20:43:55 +01:00
@@ -919,13 +919,23 @@
return fa;
 }
 
+static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
+{
+   struct fib_alias *fa = fib_get_first(seq);
+
+   if (fa)
+   while (pos  (fa = fib_get_next(seq)))
+   --pos;
+   return pos ? NULL : fa;
+}
+
 static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
 {
void *v = NULL;
 
read_lock(fib_hash_lock);
if (ip_fib_main_table)
-   v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN;
+   v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
return v;
 }
 


Re: 2.6.11 on AMD64 traps

2005-03-09 Thread Patrick McHardy
Michal Vanco wrote:
On Wednesday 09 March 2005 20:45, Patrick McHardy wrote:
This patch should fix it. The crash is caused by stale pointers,
the pointers in fib_iter_state are not reloaded after seq-stop()
followed by seq-start(pos  0).
Well. Trap vanished after applying this patch, but another weird thing 
occurs:
# ip route show | wc -l
156033
# date; time ip route show  /dev/null; date; time netstat -rn  /dev/null
Wed Mar  9 22:15:21 CET 2005
real0m0.656s
user0m0.415s
sys 0m0.242s
Wed Mar  9 22:15:22 CET 2005
real6m41.472s
user0m1.261s
sys 6m40.143s
Yes, I know it is totally inefficient. Just use ip route, which doesn't
suffer from this problem.
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Insmod error ip_nat_ftp

2005-03-05 Thread Patrick McHardy
govind raj wrote:
/lib/modules/2.4.29/kernel/net/ipv4/netfilter/ip_nat_ftp.o: init_module: 
Device or resource busy
You probably already have in already statically linked in. Check your
.config.
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Insmod error ip_nat_ftp

2005-03-05 Thread Patrick McHardy
govind raj wrote:
/lib/modules/2.4.29/kernel/net/ipv4/netfilter/ip_nat_ftp.o: init_module: 
Device or resource busy
You probably already have in already statically linked in. Check your
.config.
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [netfilter-core] [PATCH 2.6.10 1/1] netfilter: fix crash on nat+icmp packets

2005-03-02 Thread Patrick McHardy
mukesh agrawal wrote:
The cause of the crash is that udp_manip_pkt reads *pskb into iph before 
calling skb_ip_make_writable, and fails to update iph after the call. 
Since skb_ip_make_writable may delete the original skb when it makes a 
copy, a page fault may occur when udp_manip_pkt later dereferences iph.
This bug has already been fixed in 2.6.11-rc.
Regards
Patrick
diff -uprN linux-2.6.10.orig/net/ipv4/netfilter/ip_nat_proto_udp.c 
linux-2.6.10.fixed/net/ipv4/netfilter/ip_nat_proto_udp.c
--- linux-2.6.10.orig/net/ipv4/netfilter/ip_nat_proto_udp.c
2004-12-24 16:34:01.0 -0500
+++ linux-2.6.10.fixed/net/ipv4/netfilter/ip_nat_proto_udp.c
2005-03-01 19:32:21.0 -0500
@@ -95,6 +95,9 @@ udp_manip_pkt(struct sk_buff **pskb,

 if (!skb_ip_make_writable(pskb, hdroff + sizeof(hdr)))
 return 0;
+/* skb_ip_make_writable may have copied the skb, and deleted
+   the original */
+iph = (struct iphdr *)((*pskb)->data + iphdroff);
 hdr = (void *)(*pskb)->data + hdroff;
 if (maniptype == IP_NAT_MANIP_SRC) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [netfilter-core] [PATCH 2.6.10 1/1] netfilter: fix crash on nat+icmp packets

2005-03-02 Thread Patrick McHardy
mukesh agrawal wrote:
The cause of the crash is that udp_manip_pkt reads *pskb into iph before 
calling skb_ip_make_writable, and fails to update iph after the call. 
Since skb_ip_make_writable may delete the original skb when it makes a 
copy, a page fault may occur when udp_manip_pkt later dereferences iph.
This bug has already been fixed in 2.6.11-rc.
Regards
Patrick
diff -uprN linux-2.6.10.orig/net/ipv4/netfilter/ip_nat_proto_udp.c 
linux-2.6.10.fixed/net/ipv4/netfilter/ip_nat_proto_udp.c
--- linux-2.6.10.orig/net/ipv4/netfilter/ip_nat_proto_udp.c
2004-12-24 16:34:01.0 -0500
+++ linux-2.6.10.fixed/net/ipv4/netfilter/ip_nat_proto_udp.c
2005-03-01 19:32:21.0 -0500
@@ -95,6 +95,9 @@ udp_manip_pkt(struct sk_buff **pskb,

 if (!skb_ip_make_writable(pskb, hdroff + sizeof(hdr)))
 return 0;
+/* skb_ip_make_writable may have copied the skb, and deleted
+   the original */
+iph = (struct iphdr *)((*pskb)-data + iphdroff);
 hdr = (void *)(*pskb)-data + hdroff;
 if (maniptype == IP_NAT_MANIP_SRC) {
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: iptables and ip_conntrack_tuple.h compile fix

2005-02-01 Thread Patrick McHardy
Tompa Septimius Paul wrote:
Hi,
I try to recompile iptables iptables-1.2.11 with kernel 2.6.11-rc2
(and mm2) running and I don't succeed. It complains about
/usr/src/linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
after this small changes iptables is compiling again.
 

I just added a similar patch from Pablo Neira to my tree.
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: iptables and ip_conntrack_tuple.h compile fix

2005-02-01 Thread Patrick McHardy
Tompa Septimius Paul wrote:
Hi,
I try to recompile iptables iptables-1.2.11 with kernel 2.6.11-rc2
(and mm2) running and I don't succeed. It complains about
/usr/src/linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
after this small changes iptables is compiling again.
 

I just added a similar patch from Pablo Neira to my tree.
Regards
Patrick
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Memory leak in 2.6.11-rc1?

2005-01-30 Thread Patrick McHardy
YOSHIFUJI Hideaki / [EMAIL PROTECTED] wrote:
In article <[EMAIL PROTECTED]> (at Mon, 31 Jan 2005 15:11:32 +1100), Herbert Xu 
<[EMAIL PROTECTED]> says:

Patrick McHardy <[EMAIL PROTECTED]> wrote:
Ok, final decision: you are right :) conntrack also defragments locally
generated packets before they hit ip_fragment. In this case the fragments
have skb->dst set.
Well caught.  The same thing is needed for IPv6, right?
(not yet confirmed, but) yes, please.
We don't need this for IPv6 yet. Once we get nf_conntrack in we
might need this, but its IPv6 fragment handling is different from
ip_conntrack, I need to check first.
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Memory leak in 2.6.11-rc1?

2005-01-30 Thread Patrick McHardy
Patrick McHardy wrote:
Russell King wrote:
I don't know if the code is using fragment lists in ip_fragment(), but
on reading the code a question comes to mind: if we have a list of
fragments, does each fragment skb have a valid (and refcounted) dst
pointer before ip_fragment() does it's job?  If yes, then isn't the
first ip_copy_metadata() in ip_fragment() going to overwrite this
pointer without dropping the refcount?
Nice spotting. If conntrack isn't loaded defragmentation happens after
routing, so this is likely the cause.

OTOH, if conntrack isn't loaded forwarded packet are never defragmented,
so frag_list should be empty. So probably false alarm, sorry.
Ok, final decision: you are right :) conntrack also defragments locally
generated packets before they hit ip_fragment. In this case the fragments
have skb->dst set.
Regards
Patrick
= net/ipv4/ip_output.c 1.74 vs edited =
--- 1.74/net/ipv4/ip_output.c   2005-01-25 01:40:10 +01:00
+++ edited/net/ipv4/ip_output.c 2005-01-30 18:54:43 +01:00
@@ -389,6 +389,7 @@
to->priority = from->priority;
to->protocol = from->protocol;
to->security = from->security;
+   dst_release(to->dst);
to->dst = dst_clone(from->dst);
to->dev = from->dev;
 


Re: Memory leak in 2.6.11-rc1?

2005-01-30 Thread Patrick McHardy
Patrick McHardy wrote:
Russell King wrote:
I don't know if the code is using fragment lists in ip_fragment(), but
on reading the code a question comes to mind: if we have a list of
fragments, does each fragment skb have a valid (and refcounted) dst
pointer before ip_fragment() does it's job?  If yes, then isn't the
first ip_copy_metadata() in ip_fragment() going to overwrite this
pointer without dropping the refcount?
Nice spotting. If conntrack isn't loaded defragmentation happens after
routing, so this is likely the cause.
OTOH, if conntrack isn't loaded forwarded packet are never defragmented,
so frag_list should be empty. So probably false alarm, sorry.
Regards
Patrick

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Memory leak in 2.6.11-rc1?

2005-01-30 Thread Patrick McHardy
Russell King wrote:
I don't know if the code is using fragment lists in ip_fragment(), but
on reading the code a question comes to mind: if we have a list of
fragments, does each fragment skb have a valid (and refcounted) dst
pointer before ip_fragment() does it's job?  If yes, then isn't the
first ip_copy_metadata() in ip_fragment() going to overwrite this
pointer without dropping the refcount?
Nice spotting. If conntrack isn't loaded defragmentation happens after
routing, so this is likely the cause.
Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2)

2005-01-27 Thread Patrick McHardy
David S. Miller wrote:
I've forwarded this to netfilter-devel for inspection.
Thanks for collecting all the data points so well.
Here is the fix for everyone. Please report back if it doesn't
solve the problem. Thanks.

= net/ipv4/netfilter/ip_nat_proto_tcp.c 1.10 vs edited =
--- 1.10/net/ipv4/netfilter/ip_nat_proto_tcp.c  2005-01-17 23:00:55 +01:00
+++ edited/net/ipv4/netfilter/ip_nat_proto_tcp.c2005-01-28 02:13:06 
+01:00
@@ -105,7 +105,7 @@
return 0;
 
iph = (struct iphdr *)((*pskb)->data + iphdroff);
-   hdr = (struct tcphdr *)((*pskb)->data + iph->ihl*4);
+   hdr = (struct tcphdr *)((*pskb)->data + hdroff);
 
if (maniptype == IP_NAT_MANIP_SRC) {
/* Get rid of src ip and src pt */


Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2)

2005-01-27 Thread Patrick McHardy
David S. Miller wrote:
I've forwarded this to netfilter-devel for inspection.
Thanks for collecting all the data points so well.
Here is the fix for everyone. Please report back if it doesn't
solve the problem. Thanks.

= net/ipv4/netfilter/ip_nat_proto_tcp.c 1.10 vs edited =
--- 1.10/net/ipv4/netfilter/ip_nat_proto_tcp.c  2005-01-17 23:00:55 +01:00
+++ edited/net/ipv4/netfilter/ip_nat_proto_tcp.c2005-01-28 02:13:06 
+01:00
@@ -105,7 +105,7 @@
return 0;
 
iph = (struct iphdr *)((*pskb)-data + iphdroff);
-   hdr = (struct tcphdr *)((*pskb)-data + iph-ihl*4);
+   hdr = (struct tcphdr *)((*pskb)-data + hdroff);
 
if (maniptype == IP_NAT_MANIP_SRC) {
/* Get rid of src ip and src pt */


Re: 2.6.11-rc2 complains badly aboud badness in local_bh_enable

2005-01-23 Thread Patrick McHardy
Jasper Spaans wrote:
I'm seeing a similar problem on my machine - one that does not know what ppp
is. Main suspect is the network bridging code in combination with iptables;
the first lines of the message:
The patch which caused this has already been reverted.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/01/20 13:24:38-08:00 [EMAIL PROTECTED] 
#   Cset exclude: [EMAIL PROTECTED]|ChangeSet|20050120063740|10274
# 
# net/sched/sch_teql.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/sched/sch_generic.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/dev_mcast.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/dev.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/atm/clip.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# include/linux/netdevice.h
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/infiniband/ulp/ipoib/ipoib_main.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# Documentation/networking/netdevices.txt
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/pktgen.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/netpoll.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/tg3.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/tg3.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/sungem.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/sungem.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/e1000/e1000_main.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/e1000/e1000.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/infiniband/ulp/ipoib/ipoib_ib.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/infiniband/ulp/ipoib/ipoib.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
diff -Nru a/Documentation/networking/netdevices.txt 
b/Documentation/networking/netdevices.txt
--- a/Documentation/networking/netdevices.txt   2005-01-24 01:38:51 +01:00
+++ b/Documentation/networking/netdevices.txt   2005-01-24 01:38:51 +01:00
@@ -45,9 +45,10 @@
Synchronization: dev->xmit_lock spinlock.
When the driver sets NETIF_F_LLTX in dev->features this will be
called without holding xmit_lock. In this case the driver 
-   has to execute it's transmission routine in a completely lockless
-   manner.  It is recommended only for queueless devices such
-   loopback and tunnels.
+   has to lock by itself when needed. It is recommended to use a try lock
+   for this and return -1 when the spin lock fails. 
+   The locking there should also properly protect against 
+   set_multicast_list
Context: BHs disabled
Notes: netif_queue_stopped() is guaranteed false
Return codes: 
@@ -55,6 +56,8 @@
o NETDEV_TX_BUSY Cannot transmit packet, try later 
  Usually a bug, means queue start/stop flow control is broken in
  the driver. Note: the driver must NOT put the skb in its DMA ring.
+   o NETDEV_TX_LOCKED Locking failed, please retry quickly.
+ Only valid when NETIF_F_LLTX is set.
 
 dev->tx_timeout:
Synchronization: dev->xmit_lock spinlock.
diff -Nru a/drivers/infiniband/ulp/ipoib/ipoib.h 
b/drivers/infiniband/ulp/ipoib/ipoib.h
--- a/drivers/infiniband/ulp/ipoib/ipoib.h  2005-01-24 01:38:50 +01:00
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h  2005-01-24 01:38:51 +01:00
@@ -104,10 +104,10 @@
 };
 
 /*
- * Device private locking: netdev->xmit_lock protects members used
- * in TX fast path.
- * lock protects everything else.  lock nests inside of xmit_lock (ie
- * xmit_lock must be acquired first if needed).
+ * Device private locking: tx_lock protects members used in TX fast
+ * path (and we use LLTX so upper layers don't do extra locking).
+ * lock protects everything else.  lock nests inside of tx_lock (ie
+ * tx_lock must be acquired first if needed).
  */
 struct ipoib_dev_priv {
spinlock_t lock;
@@ -150,6 +150,7 @@
 
struct ipoib_buf *rx_ring;
 
+   spinlock_ttx_lock;
struct ipoib_buf *tx_ring;
unsigned  tx_head;
unsigned  tx_tail;
diff -Nru a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 
b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c   2005-01-24 01:38:51 +01:00
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c   2005-01-24 01:38:51 +01:00
@@ -247,12 +247,12 @@
 
dev_kfree_skb_any(tx_req->skb);
 
-   spin_lock_irqsave(>xmit_lock, flags);
+   spin_lock_irqsave(>tx_lock, flags);
++priv->tx_tail;
 

Re: 2.6.11-rc2 complains badly aboud badness in local_bh_enable

2005-01-23 Thread Patrick McHardy
Jasper Spaans wrote:
I'm seeing a similar problem on my machine - one that does not know what ppp
is. Main suspect is the network bridging code in combination with iptables;
the first lines of the message:
The patch which caused this has already been reverted.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/01/20 13:24:38-08:00 [EMAIL PROTECTED] 
#   Cset exclude: [EMAIL PROTECTED]|ChangeSet|20050120063740|10274
# 
# net/sched/sch_teql.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/sched/sch_generic.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/dev_mcast.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/dev.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/atm/clip.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# include/linux/netdevice.h
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/infiniband/ulp/ipoib/ipoib_main.c
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# Documentation/networking/netdevices.txt
#   2005/01/20 13:24:32-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/pktgen.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# net/core/netpoll.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/tg3.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/tg3.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/sungem.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/sungem.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/e1000/e1000_main.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/net/e1000/e1000.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/infiniband/ulp/ipoib/ipoib_ib.c
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
# drivers/infiniband/ulp/ipoib/ipoib.h
#   2005/01/20 13:24:31-08:00 [EMAIL PROTECTED] +0 -0
#   Exclude
# 
diff -Nru a/Documentation/networking/netdevices.txt 
b/Documentation/networking/netdevices.txt
--- a/Documentation/networking/netdevices.txt   2005-01-24 01:38:51 +01:00
+++ b/Documentation/networking/netdevices.txt   2005-01-24 01:38:51 +01:00
@@ -45,9 +45,10 @@
Synchronization: dev-xmit_lock spinlock.
When the driver sets NETIF_F_LLTX in dev-features this will be
called without holding xmit_lock. In this case the driver 
-   has to execute it's transmission routine in a completely lockless
-   manner.  It is recommended only for queueless devices such
-   loopback and tunnels.
+   has to lock by itself when needed. It is recommended to use a try lock
+   for this and return -1 when the spin lock fails. 
+   The locking there should also properly protect against 
+   set_multicast_list
Context: BHs disabled
Notes: netif_queue_stopped() is guaranteed false
Return codes: 
@@ -55,6 +56,8 @@
o NETDEV_TX_BUSY Cannot transmit packet, try later 
  Usually a bug, means queue start/stop flow control is broken in
  the driver. Note: the driver must NOT put the skb in its DMA ring.
+   o NETDEV_TX_LOCKED Locking failed, please retry quickly.
+ Only valid when NETIF_F_LLTX is set.
 
 dev-tx_timeout:
Synchronization: dev-xmit_lock spinlock.
diff -Nru a/drivers/infiniband/ulp/ipoib/ipoib.h 
b/drivers/infiniband/ulp/ipoib/ipoib.h
--- a/drivers/infiniband/ulp/ipoib/ipoib.h  2005-01-24 01:38:50 +01:00
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h  2005-01-24 01:38:51 +01:00
@@ -104,10 +104,10 @@
 };
 
 /*
- * Device private locking: netdev-xmit_lock protects members used
- * in TX fast path.
- * lock protects everything else.  lock nests inside of xmit_lock (ie
- * xmit_lock must be acquired first if needed).
+ * Device private locking: tx_lock protects members used in TX fast
+ * path (and we use LLTX so upper layers don't do extra locking).
+ * lock protects everything else.  lock nests inside of tx_lock (ie
+ * tx_lock must be acquired first if needed).
  */
 struct ipoib_dev_priv {
spinlock_t lock;
@@ -150,6 +150,7 @@
 
struct ipoib_buf *rx_ring;
 
+   spinlock_ttx_lock;
struct ipoib_buf *tx_ring;
unsigned  tx_head;
unsigned  tx_tail;
diff -Nru a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 
b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c   2005-01-24 01:38:51 +01:00
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c   2005-01-24 01:38:51 +01:00
@@ -247,12 +247,12 @@
 
dev_kfree_skb_any(tx_req-skb);
 
-   spin_lock_irqsave(dev-xmit_lock, flags);
+   spin_lock_irqsave(priv-tx_lock, flags);
++priv-tx_tail;
 

<    1   2   3   4   5   6