Re: malformed captured packets

2007-08-31 Thread Toralf Förster
@wireshark-devs:

The topic is related to
http://www.wireshark.org/lists/wireshark-users/200707/msg00187.html
and http://bugzilla.kernel.org/show_bug.cgi?id=8793

@all:
Hi,

Am Donnerstag, 30. August 2007 schrieb James Chapman:
 Toralf Förster wrote:
  Am Mittwoch, 29. August 2007 schrieb James Chapman:
  
  Can you provide more information about the problem, please? Are you 
  using a simple DSL modem with PPPoE, such that the ppp0 interface is 
  that of the pppd started by a local PPPoE server? Is this a problem only 
  with packet capture or are you seeing actual data corruption? Did this 
  work with previous kernels? What is the network topology related to the 
  DSL interface?
 
  
  I use a ThinkPad T41 with this Ethernet controller:
  
  n22 ~ # lspci | grep Eth
  02:01.0 Ethernet controller: Intel Corporation 82540EP Gigabit Ethernet 
  Controller (Mobile) (rev 03)
  02:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg 
  NIC (rev 01)
  
  My DSL provider is Alice DSL (formerly Hansenet) in Hamburg. The T41 is 
  connected
  with an Ethernet cable to a Siemens DSL modem. The modem (just a modem, not 
  a
  router) itself is connected to the DSL splitter which itself is plugged 
  into socket.
  
  The current ppp version I'm using is net-dialup/ppp-2.4.4-r9
  
  Here are my kernel config settings:
  
  n22 ~ # zgrep PPP /proc/config.gz
  CONFIG_PPP=m
  # CONFIG_PPP_MULTILINK is not set
  CONFIG_PPP_FILTER=y
  # CONFIG_PPP_ASYNC is not set
  # CONFIG_PPP_SYNC_TTY is not set
  CONFIG_PPP_DEFLATE=m
  # CONFIG_PPP_BSDCOMP is not set
  # CONFIG_PPP_MPPE is not set
  CONFIG_PPPOE=m
  
  I observed this problem since a long time with different kernel versions 
  (Gentoo,
  plain vanilla kernel, git sources) while playing with ethereal - currently 
  known
  as wireshark.
  
  I'm wondering b/c for kscd eg. it is always the IP packet containing the 
  content
  information of a CD (or even a CD is unknown message) with is struggled.
  This packets prevents me from using the Follow TCP Strem feature of 
  wireshark
  for an easy look into the plain text of all TCP packets of this HTTP stream
  (which was in fact the trigger for me to have a deeper look into the sniffed
  stream from ppp0 and eth0).
  
  For other apps I observed similar things which cannot fully be explained by
  terms like TCP checksum offloading. 
  
  I didn't observed any malfunction at application level so it might be an 
  issue
  with the capturing itself.
  
  Why is the ppp stream always ok in opposite to the eth0 stream ?
 
 Toralf, thanks for providing more info about your setup.
 
 Are you using kernel-mode PPPoE? I know some PPPoE servers do the PPPoE 
 datapath in userspace...
 
 The captured PPPoE stream seems to show incorrect data lengths in the 
 PPPoE header for some captured PPPoE packets. The kernel's PPPoE 
 datapath uses this length to extract the PPP frame and send it through 
 to the ppp interface. Since your ppp stream is fine, the actual PPPoE 
 header contents must be correct when it is parsed by the kernel PPPoE 
 code. It seems more likely that this is a wireshark bug to me.
 
 Is it possible to get captures from ppp0 and eth0 simultaneously such 
 that they show the same ppp instance? This might give more clues.
 

Hi,

yes, I'm using kernel-mode PPPoE. I sniffed at both interfaces the same network 
stream with the commands:

$tcpdump -i eth0 -p -s 0 -w tcpdump_eth0.pcap
$tcpdump -i eth0 -p -s 0 -w tcpdump_eth0.pcap

After that I made an
$rm -rf .cddb/; kscd
at the 3rd konsole and attached the 2 pcap streams onto this mail.

Thanks for your help.


-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3


tcpdump_ppp0.pcap
Description: Binary data


tcpdump_eth0.pcap
Description: Binary data


signature.asc
Description: This is a digitally signed message part.


tcp user timeout option

2007-08-31 Thread Joakim Koskela
Hi,

Does anybody know of any effort put into implementing support for the TCP user 
timeout option in Linux?

The related draft:
http://www.ietf.org/internet-drafts/draft-ietf-tcpm-tcp-uto-06.txt

Basically its a per-connection parameter which says how long data can remain 
unacknowledged before the connection is closed.

br, j
-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Jarek Poplawski
On Fri, Aug 31, 2007 at 12:25:22PM +0400, Badalian Vyacheslav wrote:
 i not have testing mashine.
 we have 2 mashine and dynamic routing. if 1 mashine down - all traffic 
 go to second mashine.
 I can test is on this mashines but i need that testing mashine will 
 reboot on kernel panic (sysctl message). No freezes =)
 
 Ok. i try 2.6.23-rc4.
 
 On Fri, Aug 31, 2007 at 11:04:21AM +0400, Badalian Vyacheslav wrote:
   
 I try you patch. Also i try add more debug options to kernel. I catch 
 (BUG: spinlock lockup on CPU#3, tc/6403, f742e200)

BTW, I think after this BUG could be something more about other CPUs.
Could you check this?

Jarek P.

PS: If it's possible try to not cut too much: if there is something
confidential mask this with some XXX or mark the cut with... There
could matter what else is run at the same time (including other
driver's warnings). If you think it's too much for a list you can
send it to me only.
-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Jarek Poplawski
On Fri, Aug 31, 2007 at 12:25:22PM +0400, Badalian Vyacheslav wrote:
 i not have testing mashine.
 we have 2 mashine and dynamic routing. if 1 mashine down - all traffic 
 go to second mashine.
 I can test is on this mashines but i need that testing mashine will 
 reboot on kernel panic (sysctl message). No freezes =)
 
 Ok. i try 2.6.23-rc4.

...but without testing machine it can be too much risk! New versions
of kernel can break your applications (sometimes they should be at
least rebuilded).

So, maybe you would better try this, 'less testing', version of my patch:

Jarek P.

---

diff -Nurp linux-2.6.22.5-/net/sched/sch_htb.c 
linux-2.6.22.5/net/sched/sch_htb.c
--- linux-2.6.22.5-/net/sched/sch_htb.c 2007-07-09 01:32:17.0 +0200
+++ linux-2.6.22.5/net/sched/sch_htb.c  2007-08-31 08:43:45.0 +0200
@@ -688,7 +688,11 @@ static void htb_rate_timer(unsigned long
 
 
/* lock queue so that we can muck with it */
-   spin_lock_bh(sch-dev-queue_lock);
+   if (!spin_trylock_bh(sch-dev-queue_lock)) {
+   q-rttim.expires = jiffies + 1;
+   add_timer(q-rttim);
+   return;
+   }
 
q-rttim.expires = jiffies + HZ;
add_timer(q-rttim);
@@ -1306,7 +1310,8 @@ static void htb_destroy(struct Qdisc *sc
 
qdisc_watchdog_cancel(q-watchdog);
 #ifdef HTB_RATECM
-   del_timer_sync(q-rttim);
+   if (!del_timer_sync(q-rttim))
+   del_timer(q-rttim);
 #endif
/* This line used to be after htb_destroy_class call below
   and surprisingly it worked in 2.4. But it must precede it
-
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


[0/7] [PPP]: Fix shared/cloned/non-linear skb bugs (was: malformed captured packets)

2007-08-31 Thread Herbert Xu
On Thu, Aug 30, 2007 at 09:51:31AM +, James Chapman wrote:

 The captured PPPoE stream seems to show incorrect data lengths in the
 PPPoE header for some captured PPPoE packets. The kernel's PPPoE
 datapath uses this length to extract the PPP frame and send it through
 to the ppp interface. Since your ppp stream is fine, the actual PPPoE
 header contents must be correct when it is parsed by the kernel PPPoE
 code. It seems more likely that this is a wireshark bug to me.

If he were using the kernel pppoe driver, then this is because
PPP filtering is writing over a cloned skb without copying it.

In fact, there seems to be quite a few bugs of this kind in
the various ppp*.c files.

Please try the following patches to see if they make a
difference.

I've audited ppp_generic.c and pppoe.c.  I'll do pppol2tp
tomorrow.

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


[PATCH 2/7] [PPP] pppoe: Fix data clobbering in __pppoe_xmit and return value

2007-08-31 Thread Herbert Xu
[PPP] pppoe: Fix data clobbering in __pppoe_xmit and return value

The function __pppoe_xmit modifies the skb data and therefore it needs
to copy and skb data if it's cloned.

In fact, it currently allocates a new skb so that it can return 0 in
case of error without freeing the original skb.  This is totally wrong
because returning zero is meant to indicate congestion whereupon pppoe
is supposed to wake up the upper layer once the congestion subsides.

This makes sense for ppp_async and ppp_sync but is out-of-place for
pppoe.  This patch makes it always return 1 and free the skb.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 drivers/net/pppoe.c |   50 +-
 1 files changed, 13 insertions(+), 37 deletions(-)

diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 5ac3eff..8818253 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -850,9 +850,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff 
*skb)
struct net_device *dev = po-pppoe_dev;
struct pppoe_hdr hdr;
struct pppoe_hdr *ph;
-   int headroom = skb_headroom(skb);
int data_len = skb-len;
-   struct sk_buff *skb2;
 
if (sock_flag(sk, SOCK_DEAD) || !(sk-sk_state  PPPOX_CONNECTED))
goto abort;
@@ -866,53 +864,31 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff 
*skb)
if (!dev)
goto abort;
 
-   /* Copy the skb if there is no space for the header. */
-   if (headroom  (sizeof(struct pppoe_hdr) + dev-hard_header_len)) {
-   skb2 = dev_alloc_skb(32+skb-len +
-sizeof(struct pppoe_hdr) +
-dev-hard_header_len);
-
-   if (skb2 == NULL)
-   goto abort;
-
-   skb_reserve(skb2, dev-hard_header_len + sizeof(struct 
pppoe_hdr));
-   skb_copy_from_linear_data(skb, skb_put(skb2, skb-len),
- skb-len);
-   } else {
-   /* Make a clone so as to not disturb the original skb,
-* give dev_queue_xmit something it can free.
-*/
-   skb2 = skb_clone(skb, GFP_ATOMIC);
-
-   if (skb2 == NULL)
-   goto abort;
-   }
+   /* Copy the data if there is no space for the header or if it's
+* read-only.
+*/
+   if (skb_cow(skb, sizeof(*ph) + dev-hard_header_len))
+   goto abort;
 
-   ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr));
+   ph = (struct pppoe_hdr *) skb_push(skb, sizeof(struct pppoe_hdr));
memcpy(ph, hdr, sizeof(struct pppoe_hdr));
-   skb2-protocol = __constant_htons(ETH_P_PPP_SES);
+   skb-protocol = __constant_htons(ETH_P_PPP_SES);
 
-   skb_reset_network_header(skb2);
+   skb_reset_network_header(skb);
 
-   skb2-dev = dev;
+   skb-dev = dev;
 
-   dev-hard_header(skb2, dev, ETH_P_PPP_SES,
+   dev-hard_header(skb, dev, ETH_P_PPP_SES,
 po-pppoe_pa.remote, NULL, data_len);
 
-   /* We're transmitting skb2, and assuming that dev_queue_xmit
-* will free it.  The generic ppp layer however, is expecting
-* that we give back 'skb' (not 'skb2') in case of failure,
-* but free it in case of success.
-*/
-
-   if (dev_queue_xmit(skb2)  0)
+   if (dev_queue_xmit(skb)  0)
goto abort;
 
-   kfree_skb(skb);
return 1;
 
 abort:
-   return 0;
+   kfree_skb(skb);
+   return 1;
 }
 
 
-
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 3/7] [PPP] pppoe: Fill in header directly in __pppoe_xmit

2007-08-31 Thread Herbert Xu
[PPP] pppoe: Fill in header directly in __pppoe_xmit

This patch removes the hdr variable (which is copied into the skb)
and instead sets the header directly in the skb.

It also uses __skb_push instead of skb_push since we've just checked
using skb_cow for enough head room.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 drivers/net/pppoe.c |   20 +---
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 8818253..bac3654 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -848,19 +848,12 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff 
*skb)
 {
struct pppox_sock *po = pppox_sk(sk);
struct net_device *dev = po-pppoe_dev;
-   struct pppoe_hdr hdr;
struct pppoe_hdr *ph;
int data_len = skb-len;
 
if (sock_flag(sk, SOCK_DEAD) || !(sk-sk_state  PPPOX_CONNECTED))
goto abort;
 
-   hdr.ver = 1;
-   hdr.type = 1;
-   hdr.code = 0;
-   hdr.sid = po-num;
-   hdr.length = htons(skb-len);
-
if (!dev)
goto abort;
 
@@ -870,12 +863,17 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff 
*skb)
if (skb_cow(skb, sizeof(*ph) + dev-hard_header_len))
goto abort;
 
-   ph = (struct pppoe_hdr *) skb_push(skb, sizeof(struct pppoe_hdr));
-   memcpy(ph, hdr, sizeof(struct pppoe_hdr));
-   skb-protocol = __constant_htons(ETH_P_PPP_SES);
-
+   __skb_push(skb, sizeof(*ph));
skb_reset_network_header(skb);
 
+   ph = pppoe_hdr(skb);
+   ph-ver = 1;
+   ph-type = 1;
+   ph-code = 0;
+   ph-sid = po-num;
+   ph-length = htons(data_len);
+
+   skb-protocol = __constant_htons(ETH_P_PPP_SES);
skb-dev = dev;
 
dev-hard_header(skb, dev, ETH_P_PPP_SES,
-
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: [ANNOUNCE] iproute2-2.6.23-rc3

2007-08-31 Thread Patrick McHardy

On Wed, 22 Aug 2007, Stephen Hemminger wrote:


There have been a lot of changes for 2.6.23, so here is a test release
of iproute2 that should capture all the submitted patches

Patrick McHardy (6):
 TC action parsing bug fix
 Bug fix tc action drop
 IPROUTE2: RTNETLINK nested attributes
 Use FRA_* attributes for routing rules
 iplink: use netlink for link configuration
 Fix meta ematch usage of 0 values



I just noticed the iplink_vlan stuff is missing. Do you want me
to resend?

-
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 4/7] [BRIDGE]: Kill clone argument to br_flood_*

2007-08-31 Thread Herbert Xu
[BRIDGE]: Kill clone argument to br_flood_*

The clone argument is only used by one caller and that caller can clone
the packet itself.  This patch moves the clone call into the caller and
kills the clone argument.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 net/bridge/br_device.c  |4 ++--
 net/bridge/br_forward.c |   21 +
 net/bridge/br_input.c   |   48 ++--
 net/bridge/br_private.h |8 ++--
 4 files changed, 31 insertions(+), 50 deletions(-)

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 0eded17..99292e8 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -41,11 +41,11 @@ int br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
skb_pull(skb, ETH_HLEN);
 
if (dest[0]  1)
-   br_flood_deliver(br, skb, 0);
+   br_flood_deliver(br, skb);
else if ((dst = __br_fdb_get(br, dest)) != NULL)
br_deliver(dst-dst, skb);
else
-   br_flood_deliver(br, skb, 0);
+   br_flood_deliver(br, skb);
 
return 0;
 }
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index ada7f49..bdd7c35 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -100,24 +100,13 @@ void br_forward(const struct net_bridge_port *to, struct 
sk_buff *skb)
 }
 
 /* called under bridge lock */
-static void br_flood(struct net_bridge *br, struct sk_buff *skb, int clone,
+static void br_flood(struct net_bridge *br, struct sk_buff *skb,
void (*__packet_hook)(const struct net_bridge_port *p,
  struct sk_buff *skb))
 {
struct net_bridge_port *p;
struct net_bridge_port *prev;
 
-   if (clone) {
-   struct sk_buff *skb2;
-
-   if ((skb2 = skb_clone(skb, GFP_ATOMIC)) == NULL) {
-   br-statistics.tx_dropped++;
-   return;
-   }
-
-   skb = skb2;
-   }
-
prev = NULL;
 
list_for_each_entry_rcu(p, br-port_list, list) {
@@ -148,13 +137,13 @@ static void br_flood(struct net_bridge *br, struct 
sk_buff *skb, int clone,
 
 
 /* called with rcu_read_lock */
-void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb, int clone)
+void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb)
 {
-   br_flood(br, skb, clone, __br_deliver);
+   br_flood(br, skb, __br_deliver);
 }
 
 /* called under bridge lock */
-void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, int clone)
+void br_flood_forward(struct net_bridge *br, struct sk_buff *skb)
 {
-   br_flood(br, skb, clone, __br_forward);
+   br_flood(br, skb, __br_forward);
 }
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 5c18595..069a4e1 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -43,7 +43,7 @@ int br_handle_frame_finish(struct sk_buff *skb)
struct net_bridge_port *p = rcu_dereference(skb-dev-br_port);
struct net_bridge *br;
struct net_bridge_fdb_entry *dst;
-   int passedup = 0;
+   struct sk_buff *skb2;
 
if (!p || p-state == BR_STATE_DISABLED)
goto drop;
@@ -55,39 +55,35 @@ int br_handle_frame_finish(struct sk_buff *skb)
if (p-state == BR_STATE_LEARNING)
goto drop;
 
-   if (br-dev-flags  IFF_PROMISC) {
-   struct sk_buff *skb2;
+   /* The packet skb2 goes to the local host (NULL to skip). */
+   skb2 = NULL;
 
-   skb2 = skb_clone(skb, GFP_ATOMIC);
-   if (skb2 != NULL) {
-   passedup = 1;
-   br_pass_frame_up(br, skb2);
-   }
-   }
+   if (br-dev-flags  IFF_PROMISC)
+   skb2 = skb;
+
+   dst = NULL;
 
if (is_multicast_ether_addr(dest)) {
br-statistics.multicast++;
-   br_flood_forward(br, skb, !passedup);
-   if (!passedup)
-   br_pass_frame_up(br, skb);
-   goto out;
+   skb2 = skb;
+   } else if ((dst = __br_fdb_get(br, dest))  dst-is_local) {
+   skb2 = skb;
+   /* Do not forward the packet since it's local. */
+   skb = NULL;
}
 
-   dst = __br_fdb_get(br, dest);
-   if (dst != NULL  dst-is_local) {
-   if (!passedup)
-   br_pass_frame_up(br, skb);
-   else
-   kfree_skb(skb);
-   goto out;
-   }
+   if (skb2 == skb)
+   skb2 = skb_clone(skb, GFP_ATOMIC);
 
-   if (dst != NULL) {
-   br_forward(dst-dst, skb);
-   goto out;
-   }
+   if (skb2)
+   br_pass_frame_up(br, skb2);
 
-   br_flood_forward(br, skb, 0);
+   if (skb) {
+   if (dst)
+   br_forward(dst-dst, skb);
+   else
+ 

[PATCH 1/7] [PPP] pppoe: Fix skb_unshare_check call position

2007-08-31 Thread Herbert Xu
[PPP] pppoe: Fix skb_unshare_check call position

The skb_unshare_check call needs to be made before pskb_may_pull,
not after.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 drivers/net/pppoe.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 68631a5..5ac3eff 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -385,12 +385,12 @@ static int pppoe_rcv(struct sk_buff *skb,
struct pppoe_hdr *ph;
struct pppox_sock *po;
 
-   if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
-   goto drop;
-
if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out;
 
+   if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
+   goto drop;
+
ph = pppoe_hdr(skb);
 
po = get_item((unsigned long) ph-sid, eth_hdr(skb)-h_source, 
dev-ifindex);
-
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 7/7] [PPP] generic: Fix receive path data clobbering non-linear handling

2007-08-31 Thread Herbert Xu
[PPP] generic: Fix receive path data clobbering  non-linear handling

This patch adds missing pskb_may_pull calls to deal with non-linear
packets that may arrive from pppoe or pppol2tp.

It also copies cloned packets before writing over them.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 drivers/net/ppp_generic.c |   44 +---
 1 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 7e21342..4b49d0e 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1525,7 +1525,7 @@ ppp_input_error(struct ppp_channel *chan, int code)
 static void
 ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 {
-   if (skb-len = 2) {
+   if (pskb_may_pull(skb, 2)) {
 #ifdef CONFIG_PPP_MULTILINK
/* XXX do channel-level decompression here */
if (PPP_PROTO(skb) == PPP_MP)
@@ -1577,7 +1577,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff 
*skb)
if (ppp-vj == 0 || (ppp-flags  SC_REJ_COMP_TCP))
goto err;
 
-   if (skb_tailroom(skb)  124) {
+   if (skb_tailroom(skb)  124 || skb_cloned(skb)) {
/* copy to a new sk_buff with more tailroom */
ns = dev_alloc_skb(skb-len + 128);
if (ns == 0) {
@@ -1648,23 +1648,29 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff 
*skb)
/* check if the packet passes the pass and active filters */
/* the filter instructions are constructed assuming
   a four-byte PPP header on each packet */
-   *skb_push(skb, 2) = 0;
-   if (ppp-pass_filter
-sk_run_filter(skb, ppp-pass_filter,
-ppp-pass_len) == 0) {
-   if (ppp-debug  1)
-   printk(KERN_DEBUG PPP: inbound frame not 
passed\n);
-   kfree_skb(skb);
-   return;
-   }
-   if (!(ppp-active_filter
-  sk_run_filter(skb, ppp-active_filter,
-  ppp-active_len) == 0))
-   ppp-last_recv = jiffies;
-   skb_pull(skb, 2);
-#else
-   ppp-last_recv = jiffies;
+   if (ppp-pass_filter || ppp-active_filter) {
+   if (skb_cloned(skb) 
+   pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+   goto err;
+
+   *skb_push(skb, 2) = 0;
+   if (ppp-pass_filter
+sk_run_filter(skb, ppp-pass_filter,
+ppp-pass_len) == 0) {
+   if (ppp-debug  1)
+   printk(KERN_DEBUG PPP: inbound frame 
+  not passed\n);
+   kfree_skb(skb);
+   return;
+   }
+   if (!(ppp-active_filter
+  sk_run_filter(skb, ppp-active_filter,
+  ppp-active_len) == 0))
+   ppp-last_recv = jiffies;
+   __skb_pull(skb, 2);
+   } else
 #endif /* CONFIG_PPP_FILTER */
+   ppp-last_recv = jiffies;
 
if ((ppp-dev-flags  IFF_UP) == 0
|| ppp-npmode[npi] != NPMODE_PASS) {
@@ -1762,7 +1768,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff 
*skb, struct channel *pch)
struct channel *ch;
int mphdrlen = (ppp-flags  SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
 
-   if (!pskb_may_pull(skb, mphdrlen) || ppp-mrru == 0)
+   if (!pskb_may_pull(skb, mphdrlen + 1) || ppp-mrru == 0)
goto err;   /* no good, throw it away */
 
/* Decode sequence number and begin/end bits */
-
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 6/7] [PPP] generic: Call skb_cow_head before scribbling over skb

2007-08-31 Thread Herbert Xu
[PPP] generic: Call skb_cow_head before scribbling over skb

It's rude to write over data that other people are still using.  So call
skb_cow_head before PPP proceeds to modify the skb data.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 drivers/net/ppp_generic.c |   14 +++---
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 9293c82..7e21342 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -899,17 +899,9 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
/* Put the 2-byte PPP protocol number on the front,
   making sure there is room for the address and control fields. */
-   if (skb_headroom(skb)  PPP_HDRLEN) {
-   struct sk_buff *ns;
-
-   ns = alloc_skb(skb-len + dev-hard_header_len, GFP_ATOMIC);
-   if (ns == 0)
-   goto outf;
-   skb_reserve(ns, dev-hard_header_len);
-   skb_copy_bits(skb, 0, skb_put(ns, skb-len), skb-len);
-   kfree_skb(skb);
-   skb = ns;
-   }
+   if (skb_cow_head(skb, PPP_HDRLEN))
+   goto outf;
+
pp = skb_push(skb, 2);
proto = npindex_to_proto[npi];
pp[0] = proto  8;
-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Jarek Poplawski
On Fri, Aug 31, 2007 at 11:05:09AM +0200, Jarek Poplawski wrote:
...
 So, maybe you would better try this, 'less testing', version of my patch:

Of course, the previous patch should be reverted (patch -p1 -R) or
clean 2.6.22.5 used for this.
 
Jarek P.
-
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: [ANNOUNCE] iproute2-2.6.23-rc3

2007-08-31 Thread Patrick McHardy

On Wed, 22 Aug 2007, Stephen Hemminger wrote:


There have been a lot of changes for 2.6.23, so here is a test release
of iproute2 that should capture all the submitted patches

Pavel Emelianov (1):
 Make ip utility veth driver aware



Why does this add a new ip subcommand instead and uses genetlink
instead of the rtnl_link API, which was introduced exactly for
this stuff?
-
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 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver

2007-08-31 Thread Herbert Xu
Jesper Juhl [EMAIL PROTECTED] wrote:
 On 30/08/2007, Daniel Drake [EMAIL PROTECTED] wrote:
 Jesper Juhl wrote:
  Since kmalloc() returns a void pointer there is no reason to cast
  its return value.
  This patch also removes a pointless initialization of a variable.

 NAK: adds a sparse warning
 zd_chip.c:116:15: warning: implicit cast to nocast type

 Ok, I must admit I didn't check with sparse since it seemed pointless
 - we usually never cast void pointers to other pointer types,
 specifically because the C language nicely guarantees that the right
 thing will happen without the cast.  Sometimes we have to cast them to
 integer types, su sure we need the cast there.   But what on earth
 makes a zd_addr_t * so special that we have to explicitly cast a
 void * to that type?
 
 I see it's defined as
  typedef u32 __nocast zd_addr_t;
 in drivers/net/wireless/zd1211rw/zd_types.h , but why the __nocast ?

Nevermind the __nocast, this looks like a bug in sparse.  Just
because a base type is __nocast, sparse shouldn't infer that a
pointer to it should also be __nocast.

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] [NET_SCHED] sch_prio.c: remove duplicate call of tc_classify()

2007-08-31 Thread Patrick McHardy

On Thu, 30 Aug 2007, Lucas Nussbaum wrote:


When CONFIG_NET_CLS_ACT is enabled, tc_classify() is called twice in
prio_classify(). This causes interesting behaviour: with the setup
below, packets are duplicated, sent twice to ifb0, and then loop in and
out of ifb0.

The patch uses the previously calculated return value in the switch,
which is probably what Patrick had in mind in commit
bdba91ec70fb5ccbdeb1c7068319adc6ea9e1a7d -- maybe Patrick can
double-check this?



Thanks for catching this, this is indeed what I had in mind.
-
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: [ANNOUNCE] iproute2-2.6.23-rc3

2007-08-31 Thread Pavel Emelyanov
Patrick McHardy wrote:
 On Wed, 22 Aug 2007, Stephen Hemminger wrote:
 
 There have been a lot of changes for 2.6.23, so here is a test release
 of iproute2 that should capture all the submitted patches

 Pavel Emelianov (1):
  Make ip utility veth driver aware
 
 
 Why does this add a new ip subcommand instead and uses genetlink
 instead of the rtnl_link API, which was introduced exactly for
 this stuff?
 

Hm... It does not, it just adds a parser for veth commands that
generic layer isn't aware of.
-
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: [ANNOUNCE] iproute2-2.6.23-rc3

2007-08-31 Thread Patrick McHardy

On Fri, 31 Aug 2007, Pavel Emelyanov wrote:


Patrick McHardy wrote:

On Wed, 22 Aug 2007, Stephen Hemminger wrote:


There have been a lot of changes for 2.6.23, so here is a test release
of iproute2 that should capture all the submitted patches

Pavel Emelianov (1):
 Make ip utility veth driver aware



Why does this add a new ip subcommand instead and uses genetlink
instead of the rtnl_link API, which was introduced exactly for
this stuff?



Hm... It does not, it just adds a parser for veth commands that
generic layer isn't aware of.



It does, you have ip veth add, ip veth del, ...

Didn't you already sent a patch that used ip link add ...?

In any case this should be replaced by proper use of the rtnl_link
stuff.
-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Badalian Vyacheslav



i not have testing mashine.
we have 2 mashine and dynamic routing. if 1 mashine down - all traffic 
go to second mashine.
I can test is on this mashines but i need that testing mashine will 
reboot on kernel panic (sysctl message). No freezes =)


Ok. i try 2.6.23-rc4.



...but without testing machine it can be too much risk! New versions
of kernel can break your applications (sometimes they should be at
least rebuilded).

So, maybe you would better try this, 'less testing', version of my patch:

  
I risk only if RC kernel broke hardware. Mashines use only iptables and 
TC. All Scrips backuped.
But if i need to reboot PC by hand (if it freeze) i need drive to 
servers-room =)


 BTW, I think after this BUG could be something more about other CPUs.
 Could you check this?

I send to you all info that catch NETCONSOLE. i don't cut any info...

Now 1 mashine work at *2.6.23-rc4-git2 
http://kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.23-rc4-git2.bz2 
Backup mashine use 2.6.18*


-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Jarek Poplawski
On Fri, Aug 31, 2007 at 01:33:04PM +0400, Badalian Vyacheslav wrote:
 
 i not have testing mashine.
 we have 2 mashine and dynamic routing. if 1 mashine down - all traffic 
 go to second mashine.
 I can test is on this mashines but i need that testing mashine will 
 reboot on kernel panic (sysctl message). No freezes =)
 
 Ok. i try 2.6.23-rc4.
 
 
 ...but without testing machine it can be too much risk! New versions
 of kernel can break your applications (sometimes they should be at
 least rebuilded).
 
 So, maybe you would better try this, 'less testing', version of my patch:
 
   
 I risk only if RC kernel broke hardware. Mashines use only iptables and 
 TC. All Scrips backuped.

But sometime a new kernel can break binary compatibility with previous
one (e.g. after data structures change) and e.g. iptables or iproute
tools stop working or work in an unpredictable way. There were a few
such changes before 2.6.20 - I don't track current changes too much.
And I'm sure your system uses much more than iptables or TC, even
without your knowledge.

 But if i need to reboot PC by hand (if it freeze) i need drive to 
 servers-room =)

Of course, if previous kernel always boots by default, or even there
is a possibility to use for testing different partition with a copy
of main system this risk should be much smaller.

 
  BTW, I think after this BUG could be something more about other CPUs.
  Could you check this?
 
 I send to you all info that catch NETCONSOLE. i don't cut any info...

So, it seems something was broken. But, I meant, there can be sometimes
interesting things a few lines before or after the infos too.

 
 Now 1 mashine work at *2.6.23-rc4-git2 
 http://kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.23-rc4-git2.bz2
  
 Backup mashine use 2.6.18*
 

BTW, -git versions are usually more risky than -rc. And, maybe, let
this 2.6.18 better stay away from this testing...

Thanks,
Jarek P.
-
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: [Lksctp-developers] SCTP: Fix dead loop while received unexpected chunk with length set to zero

2007-08-31 Thread Wei Yongjun

Vlad Yasevich wrote:

Wei Yongjun wrote:
  

Vlad Yasevich wrote:


Wei Yongjun wrote:
 
  

Vlad Yasevich wrote:
   


NACK

Section 8.4:

   An SCTP packet is called an out of the blue (OOTB) packet if it is
   correctly formed (i.e., passed the receiver's CRC32c check; see
   Section 6.8), but the receiver is not able to identify the
   association to which this packet belongs.


I would argue that the packet is not correctly formed in this case
and deserves a protocol violation ABORT in return.

-vlad

  

As your comment, patch has been changed.
Patch has been split to two, one is resolve this dead loop problem in
this mail.
And the other is come in another mail to discard partial chunk which
chunk length is set to zero.



I am starting to question the entire OOTB packet handling.  There are way
too many function that do almost the same thing and all handle OOTB a
little
different.

sctp_sf_do_9_2_reshutack() is also called during sctp_sf_do_dupcook_a()
processing, so checking for INIT chunk is wrong.  Checking for just the
chunkhdr_t should be enough.
  
  

This has been changed.


sctp_sf_tabort_8_4_8 is used directly as well (not just through the state
machine).  Not sure if the header verification is appropriate.
  
  

It is needed. Because sctp_sf_tabort_8_4_8() is called to handle OOTB
packet before check the header length.



But now we are doing the same thing twice (and this is not the only place).
I know I am being really picky here, but I am starting to thing the ootb 
handling\
is a mess and I really don't want to add to the mess.

Until I (or someone else) prove that it's not a mess or fix it, I am going
to hold off on these patches.

Feel free to go through the spec and fix all the OOTB handling.

Thanks
-vlad
  

Packet changed:
1. Used sctp_sf_ootb() to handle OOTB packet
2. Remove length check from sctp_sf_tabort_8_4_8() in last patch
3. Add length check to sctp_sf_ootb()
4. Changed validity check order in sctp_sf_do_5_1B_init() and other functions 
to fix possible attack.

This patch may be correct.


Signed-off-by: Wei Yongjun [EMAIL PROTECTED]

diff -Nurp a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
--- a/net/sctp/sm_statefuns.c   2007-08-17 06:17:14.0 -0400
+++ b/net/sctp/sm_statefuns.c   2007-08-19 07:52:17.0 -0400
@@ -98,6 +98,7 @@ static sctp_disposition_t sctp_stop_t1_a
   struct sctp_transport *transport);

static sctp_disposition_t sctp_sf_abort_violation(
+const struct sctp_endpoint *ep,
 const struct sctp_association *asoc,
 void *arg,
 sctp_cmd_seq_t *commands,
@@ -181,6 +182,14 @@ sctp_disposition_t sctp_sf_do_4_C(const 
	struct sctp_chunk *chunk = arg;

struct sctp_ulpevent *ev;

+   if (!sctp_vtag_verify_either(chunk, asoc))
+   return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+
+   /* Make sure that the SHUTDOWN_COMPLETE chunk has a valid length. */
+   if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
+   return sctp_sf_violation_chunklen(ep, asoc, type, arg,
+ commands);
+
/* RFC 2960 6.10 Bundling
 *
 * An endpoint MUST NOT bundle INIT, INIT ACK or
@@ -189,9 +198,6 @@ sctp_disposition_t sctp_sf_do_4_C(const 
	if (!chunk-singleton)

return SCTP_DISPOSITION_VIOLATION;

-   if (!sctp_vtag_verify_either(chunk, asoc))
-   return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
-
/* RFC 2960 10.2 SCTP-to-ULP
 *
 * H) SHUTDOWN COMPLETE notification
@@ -267,6 +273,20 @@ sctp_disposition_t sctp_sf_do_5_1B_init(
struct sock *sk;
int len;

+   /* Make sure that the INIT chunk has a valid length.
+* Normally, this would cause an ABORT with a Protocol Violation
+* error, but since we don't have an association, we'll
+* just discard the packet.
+*/
+   if (!sctp_chunk_length_valid(chunk, sizeof(sctp_init_chunk_t)))
+   return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+
+   /* 3.1 A packet containing an INIT chunk MUST have a zero Verification
+* Tag.
+*/
+   if (chunk-sctp_hdr-vtag != 0)
+   return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
+
/* 6.10 Bundling
 * An endpoint MUST NOT bundle INIT, INIT ACK or
 * SHUTDOWN COMPLETE with any other chunks.
@@ -295,20 +315,6 @@ sctp_disposition_t sctp_sf_do_5_1B_init(
 sk_acceptq_is_full(sk)))
return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);

-   /* 3.1 A packet containing an INIT chunk MUST have a zero Verification
-* Tag.
-*/
-   if (chunk-sctp_hdr-vtag != 0)
-   

Re: Tc bug (kernel crash) more info

2007-08-31 Thread Badalian Vyacheslav

I get kernel panic on 2.6.23-rc4-git2
This is netconsole log!

[ 3931.002707] BUG: unable to handle kernel NULL pointer dereference at 
virtual address 0008

[ 3931.002846]  printing eip:
[ 3931.002906] c01c8973
[ 3931.002967] *pde = 
[ 3931.003031] Oops:  [#1]
[ 3931.003093] SMP
[ 3931.003160] Modules linked in: cls_u32 sch_sfq sch_htb netconsole 
xt_tcpudp iptable_filter ip_tables x_tables i2c_i801 i2c_core

[ 3931.003327] CPU:2
[ 3931.003327] EIP:0060:[c01c8973]Not tainted VLI
[ 3931.003328] EFLAGS: 00010246   (2.6.23-rc4-testing #1)
[ 3931.003526] EIP is at rb_insert_color+0x13/0xad
[ 3931.003594] eax:    ebx: e9570324   ecx: e9570324   edx: f6deac48
[ 3931.003663] esi:    edi: ef5c4124   ebp: f6dea8a0   esp: e25f5d6c
[ 3931.003731] ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
[ 3931.003796] Process sh (pid: 6146, ti=e25f4000 task=c268b290 
task.ti=e25f4000)
[ 3931.003866] Stack: f6deac48 0569  ef5c4000 f6dea8a0 
f8862a9d f881c5db e1fda780
[ 3931.004016]0003 f6db6dc0 f6deac48 f6dea800  
 dfc3e9b2 
[ 3931.004161]e25f5dd8  c02a774b 0002 e25f5e70 
f6dea930 f6dea930 

[ 3931.004307] Call Trace:
[ 3931.004434]  [f8862a9d] htb_dequeue+0x195/0x6d2 [sch_htb]
[ 3931.004510]  [f881c5db] ipt_do_table+0x41f/0x47c [ip_tables]
[ 3931.004584]  [c02a774b] tc_classify+0x17/0x7c
[ 3931.004658]  [f8861925] htb_activate_prios+0x9b/0xa5 [sch_htb]
[ 3931.004730]  [c02a71af] __qdisc_run+0x2a/0x16b
[ 3931.004798]  [c029cfc1] dev_queue_xmit+0x18b/0x2a6
[ 3931.004874]  [c02b94e3] ip_output+0x281/0x2ba
[ 3931.004947]  [c02b571c] ip_forward_finish+0x0/0x2e
[ 3931.005012]  [c02b59b5] ip_forward+0x26b/0x2c6
[ 3931.005081]  [c02b571c] ip_forward_finish+0x0/0x2e
[ 3931.005150]  [c02b4729] ip_rcv+0x484/0x4bd
[ 3931.005216]  [c013dcc5] file_read_actor+0x0/0xdb
[ 3931.005293]  [c029ab9c] netif_receive_skb+0x2cd/0x340
[ 3931.005362]  [c0234ef1] e1000_clean_rx_irq+0x379/0x448
[ 3931.005437]  [c0234b78] e1000_clean_rx_irq+0x0/0x448
[ 3931.005506]  [c0233f8f] e1000_clean+0x7a/0x249
[ 3931.005574]  [c029ccad] net_rx_action+0x91/0x17f
[ 3931.005642]  [c01225e2] __do_softirq+0x5d/0xc1
[ 3931.005714]  [c0122678] do_softirq+0x32/0x36
[ 3931.005779]  [c010488a] do_IRQ+0x7e/0x90
[ 3931.005849]  [c01032eb] common_interrupt+0x23/0x28
[ 3931.005923]  ===
[ 3931.005986] Code: 56 04 eb 07 89 56 08 eb 02 89 17 8b 03 83 e0 03 09 
d0 89 03 5b 5e 5f c3 55 57 89 c7 56 53 83 ec 04 89 14 24 eb 7e 89 c6 83 
e6 fc 8b 56 08 39 d3 75 34 8b 56 04 85 d2 74 06 8b 02 a8 01 74 31 8b
[ 3931.006386] EIP: [c01c8973] rb_insert_color+0x13/0xad SS:ESP 
0068:e25f5d6c

[ 3931.006757] Kernel panic - not syncing: Fatal exception in interrupt
[ 3931.006863] Rebooting in 3 seconds..


BTW, -git versions are usually more risky than -rc. And, maybe, let
this 2.6.18 better stay away from this testing...

Thanks,
Jarek P.

  


-
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] netxen: ethtool fixes

2007-08-31 Thread Jeff Garzik

[EMAIL PROTECTED] wrote:

+static int netxen_nic_set_rx_csum(struct net_device *dev, u32 data)
+{
+   struct netxen_adapter *adapter = netdev_priv(dev);
+   adapter-rx_csum = 0;
+   return 0;
+}


Bug:  'data' ignored

-
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/7] s390: ungrouping a device must not be interruptible

2007-08-31 Thread Jeff Garzik

Applied patches 1-7, after changing the prefix back to qeth: 

s390:  prefix should be applied to changes that affect S/390 
architecture platform in general.


This was a patchset specific to a single driver, thus the qeth:  
prefix is more informative when looking at a long list of one-line 
change summaries.



-
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/2] PS3: improve tx throughput for gelic driver

2007-08-31 Thread Jeff Garzik

Masakazu Mokuno wrote:
Improve tx throughputs.   
netperf score gained approximately 20%


This is a useless patch description.  It does not adequately summarize 
the changes contained within the patch.


Please resubmit patch with a useful patch description


-
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] netxen: Avoid firmware load in PCI probe

2007-08-31 Thread Jeff Garzik

applied patches 1-2


-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Badalian Vyacheslav



But sometime a new kernel can break binary compatibility with previous
one (e.g. after data structures change) and e.g. iptables or iproute
tools stop working or work in an unpredictable way. There were a few
such changes before 2.6.20 - I don't track current changes too much.
And I'm sure your system uses much more than iptables or TC, even
without your knowledge.
  
I can rollback =)  Backup system get all functions. I can risk for one 
system of two for get and fix all bugs.
Dynamic routing work fine and automatic switch between systems = 1-4 
seconds.



I send to you all info that catch NETCONSOLE. i don't cut any info...



So, it seems something was broken. But, I meant, there can be sometimes
interesting things a few lines before or after the infos too.
  
I can only see that say netconsole. If i look to monitor i look last 
lines. last line is  Scrolling not work
netconsole run as module and start after system do full load. Then 
netconsole is up - i run generator of tc scripts.

BTW, -git versions are usually more risky than -rc. And, maybe, let
this 2.6.18 better stay away from this testing...
  
I look changes between 2.6.23-rc4 and 2.6.23-rc4-git2 and think that 
paches look good and no do any critical things =)


Now i do many script runs to simulate bug. if i get it on 2.6.23-rc4 - i 
post it here. 2.6.23-rc4 not have htb_timer function.


Badalian Vyacheslav
-
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] spidernet: fix interrupt reason recognition

2007-08-31 Thread Jeff Garzik

Ishizaki Kou wrote:

This patch solves a problem that the spidernet driver sometimes fails
to handle IRQ.

The problem happens because,
- In Cell architecture, interrupts may arrive at an interrupt
  controller, even if they are masked by the setting on registers of
  devices. It happens when interrupt packets are sent just before 
  the interrupts are masked.

- spidernet interrupt handler compares interrupt reasons with
  interrupt masks, so when such interrupts occurs, spidernet interrupt
  handler returns IRQ_NONE.
- When all of interrupt handler return IRQ_NONE, linux kernel disables
  the IRQ and it no longer delivers interrupts to the interrupt handlers.

spidernet doesn't work after above sequence, because it can't receive
interrupts.
 
This patch changes spidernet interrupt handler that it compares

interrupt reason with SPIDER_NET_INTX_MASK_VALUE.

Signed-off-by: Kou Ishizaki [EMAIL PROTECTED]
---

Linas-san,

Please apply this to 2.6.23. Because this problem is sometimes happens
and we cannot use the ethernet port any more.

And also, please apply the following Arnd-san's patch to fix a problem
that spidernet driver sometimes causes a BUG_ON at open.


Linas?  ACK?  Alive?  :)

Jeff



-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Badalian Vyacheslav
May be this bug eq [PATCH] [NET_SCHED] sch_prio.c: remove duplicate 
call of tc_classify()?



I get kernel panic on 2.6.23-rc4-git2
This is netconsole log!

...
-
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 0/1][RFC] add a private field to the sock structure

2007-08-31 Thread Arnaldo Carvalho de Melo
Em Thu, Aug 30, 2007 at 10:40:49PM -0700, David Miller escreveu:
 From: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
 Date: Wed, 29 Aug 2007 16:18:31 -0300
 
  Nah, it still there, sk_protinfo, its just ax25 that uses it
  (nudge(Ralf)). How do we state that a struct field is deprecated and
  will be removed soon(tm)?
 
 You get rid of all the in-tree users and then just kill it :)
 
 More seriously, I don't think we need a deprecation schedule
 for a struct member, either it's not used in-tree anymore or
 it isn't.  We'll go crazy with any other policy and it's
 difficult enough shrinking these things :-)

OK, I think its enough to say to dlezcano that he should avoid using
sk_protinfo, as soon as we do the work on AX.25 sk_protinfo will be
removed.

- Arnaldo
-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Jarek Poplawski
On Fri, Aug 31, 2007 at 02:59:55PM +0400, Badalian Vyacheslav wrote:
 May be this bug eq [PATCH] [NET_SCHED] sch_prio.c: remove duplicate 
 call of tc_classify()?
 
 I get kernel panic on 2.6.23-rc4-git2
 This is netconsole log!
 ...
 

So, it looks like you have found a really new (unknown) HTB bug,
congratulations! We've only to find where is it hidden now...

I don't think tc_classify could do such a harm to HTB, and can't
see similar double calling as in sch_prio.

Jarek P.
-
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.6.23 1/2] cxgb3 - Fix dev-priv usage

2007-08-31 Thread Jeff Garzik

Divy Le Ray wrote:

From: Divy Le Ray [EMAIL PROTECTED]

cxgb3 used netdev_priv() and dev-priv for different purposes.
In 2.6.23, netdev_priv() == dev-priv, cxgb3 needs a fix.
This patch is a partial backport of Dave Miller's changes in the 
net-2.6.24 git branch. 


Without this fix, cxgb3 crashes on 2.6.23.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/infiniband/hw/cxgb3/cxio_hal.c |2 -
 drivers/net/cxgb3/adapter.h|2 +
 drivers/net/cxgb3/cxgb3_main.c |  126 ++--
 drivers/net/cxgb3/cxgb3_offload.c  |   16 +++-
 drivers/net/cxgb3/cxgb3_offload.h  |2 +
 drivers/net/cxgb3/sge.c|   23 --
 drivers/net/cxgb3/t3cdev.h |3 -
 7 files changed, 105 insertions(+), 69 deletions(-)


applied 1-2


-
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: [ANNOUNCE] iproute2-2.6.23-rc3

2007-08-31 Thread Pavel Emelyanov
Patrick McHardy wrote:
 On Fri, 31 Aug 2007, Pavel Emelyanov wrote:
 
 Patrick McHardy wrote:
 On Wed, 22 Aug 2007, Stephen Hemminger wrote:

 There have been a lot of changes for 2.6.23, so here is a test release
 of iproute2 that should capture all the submitted patches

 Pavel Emelianov (1):
  Make ip utility veth driver aware

 Why does this add a new ip subcommand instead and uses genetlink
 instead of the rtnl_link API, which was introduced exactly for
 this stuff?

 Hm... It does not, it just adds a parser for veth commands that
 generic layer isn't aware of.
 
 
 It does, you have ip veth add, ip veth del, ...
 
 Didn't you already sent a patch that used ip link add ...?

The patch I sent last used ip link add and ip link del.
The link_veth.c file only parses all the extra arguments.

 In any case this should be replaced by proper use of the rtnl_link
 stuff.
 

-
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/2] PS3: improve tx throughput for gelic driver

2007-08-31 Thread Masakazu Mokuno

On Fri, 31 Aug 2007 06:57:03 -0400
Jeff Garzik [EMAIL PROTECTED] wrote:

 Masakazu Mokuno wrote:
  Improve tx throughputs.   
  netperf score gained approximately 20%
 
 This is a useless patch description.  It does not adequately summarize 
 the changes contained within the patch.
 
 Please resubmit patch with a useful patch description

OK, I'll rewrite and resubmit.


-- 
Masakazu MOKUNO

-
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


[NETLINK]: Avoid pointer in netlink_run_queue

2007-08-31 Thread Herbert Xu
Hi Dave:

[NETLINK]: Avoid pointer in netlink_run_queue

I was looking at Patrick's fix to inet_diag and it occured
to me that we're using a pointer argument to return values
unnecessarily in netlink_run_queue.  Changing it to return
the value will allow the compiler to generate better code
since the value won't have to be memory-backed.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]

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
--
diff --git a/include/net/netlink.h b/include/net/netlink.h
index d7b824b..48071fa 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -220,7 +220,7 @@ struct nl_info {
u32 pid;
 };
 
-extern voidnetlink_run_queue(struct sock *sk, unsigned int *qlen,
+extern unsigned intnetlink_run_queue(struct sock *sk, unsigned int qlen,
  int (*cb)(struct sk_buff *,
struct nlmsghdr *));
 extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 4756d58..15d13d9 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1261,7 +1261,7 @@ static void rtnetlink_rcv(struct sock *sk, int len)
 
do {
mutex_lock(rtnl_mutex);
-   netlink_run_queue(sk, qlen, rtnetlink_rcv_msg);
+   qlen = netlink_run_queue(sk, qlen, rtnetlink_rcv_msg);
mutex_unlock(rtnl_mutex);
 
netdev_run_todo();
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index dbeacd8..9cbc45e 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -841,7 +841,7 @@ static void inet_diag_rcv(struct sock *sk, int len)
unsigned int qlen = 0;
 
do {
-   netlink_run_queue(sk, qlen, inet_diag_rcv_msg);
+   qlen = netlink_run_queue(sk, qlen, inet_diag_rcv_msg);
} while (qlen);
 }
 
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 8797e69..25cb779 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -248,7 +248,7 @@ static void nfnetlink_rcv(struct sock *sk, int len)
do {
if (nfnl_trylock())
return;
-   netlink_run_queue(sk, qlen, nfnetlink_rcv_msg);
+   qlen = netlink_run_queue(sk, qlen, nfnetlink_rcv_msg);
__nfnl_unlock();
} while (qlen);
 }
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 5681ce3..a9d1557 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1609,7 +1609,7 @@ skip:
 /**
  * nelink_run_queue - Process netlink receive queue.
  * @sk: Netlink socket containing the queue
- * @qlen: Place to store queue length upon entry
+ * @qlen: Initial queue length
  * @cb: Callback function invoked for each netlink message found
  *
  * Processes as much as there was in the queue upon entry and invokes
@@ -1619,35 +1619,37 @@ skip:
  * returns with a qlen != 0.
  *
  * qlen must be initialized to 0 before the initial entry, afterwards
- * the function may be called repeatedly until qlen reaches 0.
+ * the function may be called repeatedly until the returned qlen is 0.
  *
  * The callback function may return -EINTR to signal that processing
  * of netlink messages shall be interrupted. In this case the message
  * currently being processed will NOT be requeued onto the receive
  * queue.
  */
-void netlink_run_queue(struct sock *sk, unsigned int *qlen,
-  int (*cb)(struct sk_buff *, struct nlmsghdr *))
+unsigned int netlink_run_queue(struct sock *sk, unsigned int qlen,
+  int (*cb)(struct sk_buff *, struct nlmsghdr *))
 {
struct sk_buff *skb;
 
-   if (!*qlen || *qlen  skb_queue_len(sk-sk_receive_queue))
-   *qlen = skb_queue_len(sk-sk_receive_queue);
+   if (!qlen || qlen  skb_queue_len(sk-sk_receive_queue))
+   qlen = skb_queue_len(sk-sk_receive_queue);
 
-   for (; *qlen; (*qlen)--) {
+   for (; qlen; qlen--) {
skb = skb_dequeue(sk-sk_receive_queue);
if (netlink_rcv_skb(skb, cb)) {
if (skb-len)
skb_queue_head(sk-sk_receive_queue, skb);
else {
kfree_skb(skb);
-   (*qlen)--;
+   qlen--;
}
break;
}
 
kfree_skb(skb);
}
+
+   return qlen;
 }
 
 /**
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 8c11ca4..d70d10d 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -485,7 +485,7 @@ static void genl_rcv(struct sock *sk, int len)

Re: [PATCH 3/3] netxen: ethtool fixes

2007-08-31 Thread Dhananjay Phadke
oops, ok regenerating patch 3 only.

On Fri, 31 Aug 2007, Jeff Garzik wrote:

 [EMAIL PROTECTED] wrote:
  +static int netxen_nic_set_rx_csum(struct net_device *dev, u32 data)
  +{
  +   struct netxen_adapter *adapter = netdev_priv(dev);
  +   adapter-rx_csum = 0;
  +   return 0;
  +}
 
 Bug:  'data' ignored
 
 
 
-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Badalian Vyacheslav

Jarek Poplawski пишет:

On Fri, Aug 31, 2007 at 02:59:55PM +0400, Badalian Vyacheslav wrote:
  
May be this bug eq [PATCH] [NET_SCHED] sch_prio.c: remove duplicate 
call of tc_classify()?




I get kernel panic on 2.6.23-rc4-git2
This is netconsole log!
  

...




So, it looks like you have found a really new (unknown) HTB bug,
congratulations! We've only to find where is it hidden now...

I don't think tc_classify could do such a harm to HTB, and can't
see similar double calling as in sch_prio.

Jarek P.

  


Great! +)
I ready for patching and testing anything patches to find and fix problem =)
Also i remember that bug up only if i delete HTB class and mashine have 
lot of traffic.

I get statistic for last panic:
Script try to delete 25278 classes, Creating 8360 classes. Adding 6732 
filters

Panic after 27 restarts of script.

-
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] Fix a lock problem in generic phy code

2007-08-31 Thread Hans-Jürgen Koch
Lock debugging finds a problem in phy.c and phy_device.c,
this patch fixes it. Tested on an AT91SAM9263-EK board, 
kernel 2.6.23-rc4.

Signed-off-by: Hans J. Koch [EMAIL PROTECTED]
---

Index: linux-2.6.23-rc/drivers/net/phy/phy_device.c
===
--- linux-2.6.23-rc.orig/drivers/net/phy/phy_device.c   2007-08-31 
14:07:47.0 +0200
+++ linux-2.6.23-rc/drivers/net/phy/phy_device.c2007-08-31 
14:08:22.0 
+0200
@@ -644,7 +644,7 @@
if (!(phydrv-flags  PHY_HAS_INTERRUPT))
phydev-irq = PHY_POLL;
 
-   spin_lock(phydev-lock);
+   spin_lock_bh(phydev-lock);
 
/* Start out supporting everything. Eventually,
 * a controller will attach, and may modify one
@@ -658,7 +658,7 @@
if (phydev-drv-probe)
err = phydev-drv-probe(phydev);
 
-   spin_unlock(phydev-lock);
+   spin_unlock_bh(phydev-lock);
 
return err;
 
Index: linux-2.6.23-rc/drivers/net/phy/phy.c
===
--- linux-2.6.23-rc.orig/drivers/net/phy/phy.c  2007-08-31 14:15:20.0 
+0200
+++ linux-2.6.23-rc/drivers/net/phy/phy.c   2007-08-31 14:15:43.0 
+0200
@@ -755,7 +755,7 @@
  */
 void phy_start(struct phy_device *phydev)
 {
-   spin_lock(phydev-lock);
+   spin_lock_bh(phydev-lock);
 
switch (phydev-state) {
case PHY_STARTING:
@@ -769,7 +769,7 @@
default:
break;
}
-   spin_unlock(phydev-lock);
+   spin_unlock_bh(phydev-lock);
 }
 EXPORT_SYMBOL(phy_stop);
 EXPORT_SYMBOL(phy_start);
-
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 5/5] Net: ath5k, kconfig changes

2007-08-31 Thread Dan Williams
On Thu, 2007-08-30 at 08:36 -0400, John W. Linville wrote:
 On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
  2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:
 
   Also this whole patch seems rather pointless.  It saves only
   very little and turns the driver into a complete ifdef maze.
 
  Also most
  people will use 5212 code only, 5211 cards are on some old laptops and
  5210, well i couldn't even find  a 5210 for actual testing :P
 
 FWIW, I'd bet dollars to donuts that distros will enable them all
 together.

I would certainly _hope_ that distros enable everything -that is in the
kernel- that they can get their hands on, otherwise when you stick a
card in, it doesn't just work.

Dan

 Is saving code space the only reason to turn these off?  How much
 space do you save?
 
 Is there some way you can isolate and/or limit the number of ifdef
 blocks further?  If so, we might consider a version of this patch
 that depends on EMBEDDED or somesuch...?
 
 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


[PATCH 2/2]: [NET_SCHED]: Making rate table lookups more flexible.

2007-08-31 Thread Jesper Dangaard Brouer
commit ac093f5c2f1160ece72a6fef5c779c1892fc3152
Author: Jesper Dangaard Brouer [EMAIL PROTECTED]
Date:   Fri Aug 31 11:53:35 2007 +0200

[NET_SCHED]: Making rate table lookups more flexible.  Extend the
tc_ratespec struct, with two parameters: 1) cell_align that allow
adjusting the alignment of the rate table. 2) overhead that allow
adding a packet overhead before the lookup.

Signed-off-by: Jesper Dangaard Brouer [EMAIL PROTECTED]

diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 268c515..a127d63 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -78,7 +78,8 @@ struct tc_ratespec
unsigned char   cell_log;
unsigned char   __reserved;
unsigned short  feature;
-   short   addend;
+   charcell_align;
+   unsigned char   overhead;
unsigned short  mpu;
__u32   rate;
 };
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4ebd615..a02ec9e 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -307,7 +307,9 @@ drop:
  */
 static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
 {
-   int slot = pktlen;
+   int slot = pktlen + rtab-rate.cell_align + rtab-rate.overhead;
+   if (slot  0)
+   slot = 0;
slot = rtab-rate.cell_log;
if (slot  255)
return (rtab-data[255]*(slot  8) + rtab-data[slot  0xFF]);

-
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/2]: [NET_SCHED]: Make all rate based scheduler work with TSO.

2007-08-31 Thread Jesper Dangaard Brouer
commit 6fdc0f061be94f5e297650961360fb7a9d1cc85d
Author: Jesper Dangaard Brouer [EMAIL PROTECTED]
Date:   Thu Aug 30 17:53:42 2007 +0200

[NET_SCHED]: Make all rate based scheduler work with TSO.

 Change L2T (length to time) macros, in all rate based schedulers, to
 call a common function qdisc_l2t() that does the rate table lookup.
 This function handles if the packet size lookup is larger than the
 rate table, which often occurs with TSO enabled.

 Note: bstats.packets is only incremented correctly for HTB.
 See: commit c9726d6890f7f3a892c879e067c3ed839f61e745.

Signed-off-by: Jesper Dangaard Brouer [EMAIL PROTECTED]

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 8a67f24..4ebd615 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -302,4 +302,16 @@ drop:
return NET_XMIT_DROP;
 }
 
+/* Length to Time (L2T) lookup in a qdisc_rate_table, to determine how
+   long it will take to send a packet given its size.
+ */
+static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
+{
+   int slot = pktlen;
+   slot = rtab-rate.cell_log;
+   if (slot  255)
+   return (rtab-data[255]*(slot  8) + rtab-data[slot  0xFF]);
+   return rtab-data[slot];
+}
+
 #endif
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 6085be5..8599e47 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -21,8 +21,8 @@
 #include net/act_api.h
 #include net/netlink.h
 
-#define L2T(p,L)   ((p)-tcfp_R_tab-data[(L)(p)-tcfp_R_tab-rate.cell_log])
-#define L2T_P(p,L) ((p)-tcfp_P_tab-data[(L)(p)-tcfp_P_tab-rate.cell_log])
+#define L2T(p,L)   ((p)-tcfp_R_tab, L)
+#define L2T_P(p,L) ((p)-tcfp_P_tab, L)
 
 #define POL_TAB_MASK 15
 static struct tcf_common *tcf_police_ht[POL_TAB_MASK + 1];
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index e38c283..aed2af2 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -175,7 +175,7 @@ struct cbq_sched_data
 };
 
 
-#define L2T(cl,len)((cl)-R_tab-data[(len)(cl)-R_tab-rate.cell_log])
+#define L2T(cl,len)qdisc_l2t((cl)-R_tab,len)
 
 
 static __inline__ unsigned cbq_hash(u32 h)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 246a2f9..5e608a6 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -132,10 +132,8 @@ struct htb_class {
 static inline long L2T(struct htb_class *cl, struct qdisc_rate_table *rate,
   int size)
 {
-   int slot = size  rate-rate.cell_log;
-   if (slot  255)
-   return (rate-data[255]*(slot  8) + rate-data[slot  0xFF]);
-   return rate-data[slot];
+   long result = qdisc_l2t(rate, size);
+   return result;
 }
 
 struct htb_sched {
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 8c2639a..b0d8109 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -115,8 +115,8 @@ struct tbf_sched_data
struct qdisc_watchdog watchdog; /* Watchdog timer */
 };
 
-#define L2T(q,L)   ((q)-R_tab-data[(L)(q)-R_tab-rate.cell_log])
-#define L2T_P(q,L) ((q)-P_tab-data[(L)(q)-P_tab-rate.cell_log])
+#define L2T(q,L)   qdisc_l2t((q)-R_tab,L)
+#define L2T_P(q,L) qdisc_l2t((q)-P_tab,L)
 
 static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {

-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Jarek Poplawski
On Fri, Aug 31, 2007 at 02:48:31PM +0400, Badalian Vyacheslav wrote:
...
 I can only see that say netconsole. If i look to monitor i look last 
 lines. last line is  Scrolling not work
 netconsole run as module and start after system do full load. Then 
 netconsole is up - i run generator of tc scripts.

It would be interesting to know if this bug did ever happen without
netconsole, or, if it wasn't tested this way, if it's possible to
do such a test (not necessarily today)?

 BTW, -git versions are usually more risky than -rc. And, maybe, let
 this 2.6.18 better stay away from this testing...
   
 I look changes between 2.6.23-rc4 and 2.6.23-rc4-git2 and think that 
 paches look good and no do any critical things =)
 
 Now i do many script runs to simulate bug. if i get it on 2.6.23-rc4 - i 
 post it here. 2.6.23-rc4 not have htb_timer function.

I'll not be able to assist you until monday (but I'll try to look
into the code and maybe to prepare some new patch - but it needs
a lot of checking to not add too much of this locking as well).

I think you can stay with a kernel whichever you like - I'm not sure
any config changes or even more debugging can change much, but maybe
I'm wrong. It looks to me like some locking is missing or interrupted.
If you are working weekends and find something new, don't wait: maybe
somebody else here could be interested too.
 
Cheers,
Jarek P. 
-
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.6.24 1/5]S2io: Enable all the error and alarm indications

2007-08-31 Thread Jeff Garzik

Ramkrishna Vepa wrote:

- Added support to unmask entire set of device errors and alarms.

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
Signed-off-by: Santosh Rastapur [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]
---
diff -Nurp orig/drivers/net/s2io.c patch1/drivers/net/s2io.c
--- orig/drivers/net/s2io.c 2007-08-15 08:04:06.0 -0700
+++ patch1/drivers/net/s2io.c   2007-08-15 08:55:53.0 -0700
@@ -892,8 +892,9 @@ static void free_shared_mem(struct s2io_
k++;
}
kfree(mac_control-rings[i].ba[j]);
-nic-mac_control.stats_info-sw_stat.mem_freed += (sizeof(struct buffAdd) * 
-(rxd_count[nic-rxd_mode] + 1));
+nic-mac_control.stats_info-sw_stat.mem_freed += 
+	(sizeof(struct buffAdd) * 
+	(rxd_count[nic-rxd_mode] + 1));

}
kfree(mac_control-rings[i].ba);
 			nic-mac_control.stats_info-sw_stat.mem_freed += 
@@ -1732,6 +1733,365 @@ static int s2io_link_fault_indication(st

return MAC_RMAC_ERR_TIMER;
 }
 
+void en_dis_err_alarms(struct s2io_nic *nic, u16 mask, int flag)

+{
+   struct XENA_dev_config __iomem *bar0 = nic-bar0;
+   register u64 val64 = 0, temp64 = 0, gen_int_mask = 0;
+
+   if (mask  TX_DMA_INTR) {
+   gen_int_mask |= TXDMA_INT_M;
+
+   if (flag == ENABLE_INTRS) {
+
+   val64 = TXDMA_TDA_INT|TXDMA_PFC_INT|TXDMA_PCC_INT
+   |TXDMA_TTI_INT|TXDMA_LSO_INT|TXDMA_TPA_INT
+   |TXDMA_SM_INT;
+   temp64 = readq(bar0-txdma_int_mask);
+   temp64 = ~((u64) val64);
+   writeq(temp64, bar0-txdma_int_mask);



reduce the size of this huge functions by creating a helper function 
whose use would look something like


writebits(TXDMA_TDA_INT|TXDMA_PFC_INT|TXDMA_PCC_INT|
  TXDMA_TTI_INT|TXDMA_LSO_INT|TXDMA_TPA_INT|
  TXDMA_SM_INT,
  flag,
  bar0-txdma_int_mask);

That eliminates the wholesale duplication of code based on the 
'flags==ENABLE_INTRS' test, and overall increases readability and 
decreases code size


-
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.6.24 3/5]S2io: Cleanup - removed unused variable, intr_type

2007-08-31 Thread Jeff Garzik

Ramkrishna Vepa wrote:

- Removed the unused variable, intr_type, in device private structure.

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
Signed-off-by: Santosh Rastapur [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]


ACK (but dropped, since previous patches were dropped)


-
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.6.24 4/5]S2io: Check for CARD_DOWN before handling traffic

2007-08-31 Thread Jeff Garzik

Ramkrishna Vepa wrote:
- Added check to return from the traffic handling function, if the card status 
  is DOWN.


Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
Signed-off-by: Santosh Rastapur [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]
---
diff -Nurp patch3/drivers/net/s2io.c patch4/drivers/net/s2io.c
--- patch3/drivers/net/s2io.c   2007-08-15 08:57:32.0 -0700
+++ patch4/drivers/net/s2io.c   2007-08-15 08:42:14.0 -0700
@@ -2927,6 +2927,11 @@ static int s2io_poll(struct net_device *
int i;
 
 	atomic_inc(nic-isr_cnt);

+   if (unlikely(atomic_read(nic-card_state) == CARD_DOWN)) {
+   atomic_dec(nic-isr_cnt);
+   return IRQ_NONE;
+   }
+
mac_control = nic-mac_control;
config = nic-config;
 


invalid return value, for this function

Overall, this looks quite racy -- why does the card state differ from 
net_device state in the first place?


-
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: Re: pktgen terminating condition

2007-08-31 Thread Daniele Venzano
- Message d'origine -
De: Mandeep Baines [EMAIL PROTECTED]
Date: Wed, 29 Aug 2007 09:59:42 -0700
Sujet: Re: pktgen terminating condition

 Looks good to me given the desire. I would bounce it by whoever the
 maintainer is - they may have some insights on the lazy tx prune habit.


+ [EMAIL PROTECTED]
+ [EMAIL PROTECTED]

I'll work on a NAPI patch.
Here I'm (the maintainer). Sorry for the delay replying.

I don't regard the TxOK solution as something usable for mainline, but it has 
its use for the users of pktgen.

NAPI is the way to go.

Thanks, bye.


--
Daniele Venzano
[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


Re: [patch]support for USB autosuspend in the asix driver

2007-08-31 Thread Jeff Garzik

Oliver Neukum wrote:

Hi,

this implements support for USB autosuspend in the asix USB ethernet
driver.

Regards
Oliver
Signed-off-by: Oliver Neukum [EMAIL PROTECTED]


applied

please put comments like Hi, and Regards Oliver below the --- 
terminator, otherwise they must be hand-edited out to avoid scripts' 
pasting that into the permanent kernel history.



-
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.6.24 5/5]S2io: Optimize isr fast path

2007-08-31 Thread Jeff Garzik

Ramkrishna Vepa wrote:

- Optimized interrupt routine fast path.

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
Signed-off-by: Santosh Rastapur [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]


patch description is completely inadequate.  how was it optimized?  what 
are the gains / why is this patch worth having?




diff -Nurp patch4/drivers/net/s2io.c patch5/drivers/net/s2io.c
--- patch4/drivers/net/s2io.c   2007-08-15 08:42:14.0 -0700
+++ patch5/drivers/net/s2io.c   2007-08-15 08:42:51.0 -0700
@@ -84,7 +84,7 @@
 #include s2io.h
 #include s2io-regs.h
 
-#define DRV_VERSION 2.0.26.1

+#define DRV_VERSION 2.0.26.2
 
 /* S2io Driver name  version. */

 static char s2io_driver_name[] = Neterion;
@@ -4917,71 +4917,76 @@ static irqreturn_t s2io_isr(int irq, voi
 * 1. Rx of packet.
 * 2. Tx complete.
 * 3. Link down.
-* 4. Error in any functional blocks of the NIC.
 */
reason = readq(bar0-general_int_status);
 
-	if (!reason) {

-   /* The interrupt was not raised by us. */
+   if (unlikely(reason == S2IO_MINUS_ONE) ) {
+   /* Nothing much can be done. Get out */
atomic_dec(sp-isr_cnt);
-   return IRQ_NONE;
-   }
-   else if (unlikely(reason == S2IO_MINUS_ONE) ) {
-   /* Disable device and get out */
-   atomic_dec(sp-isr_cnt);
-   return IRQ_NONE;
+   return IRQ_HANDLED;
}
 
-	if (napi) {

-   if (reason  GEN_INTR_RXTRAFFIC) {
-   if ( likely ( netif_rx_schedule_prep(dev)) ) {
-   __netif_rx_schedule(dev);
-   writeq(S2IO_MINUS_ONE, bar0-rx_traffic_mask);
+   if (reason  (GEN_INTR_RXTRAFFIC |
+   GEN_INTR_TXTRAFFIC | GEN_INTR_TXPIC))
+   {
+   writeq(S2IO_MINUS_ONE, bar0-general_int_mask);
+
+   if (config-napi) {
+   if (reason  GEN_INTR_RXTRAFFIC) {
+   if ( likely (netif_rx_schedule_prep(dev)) ) {
+   __netif_rx_schedule(dev);
+   writeq(S2IO_MINUS_ONE,
+   bar0-rx_traffic_mask);
+   } else
+   writeq(S2IO_MINUS_ONE,
+   bar0-rx_traffic_int);
}
-   else
+   } else {
+   /*
+* rx_traffic_int reg is an R1 register, writing all 1's
+* will ensure that the actual interrupt causing bit
+* get's cleared and hence a read can be avoided.
+*/
+   if (reason  GEN_INTR_RXTRAFFIC)
writeq(S2IO_MINUS_ONE, bar0-rx_traffic_int);
+
+   for (i = 0; i  config-rx_ring_num; i++)
+   rx_intr_handler(mac_control-rings[i]);
}
-   } else {
+
/*
-* Rx handler is called by default, without checking for the
-* cause of interrupt.
-* rx_traffic_int reg is an R1 register, writing all 1's
+* tx_traffic_int reg is an R1 register, writing all 1's
 * will ensure that the actual interrupt causing bit get's
 * cleared and hence a read can be avoided.
 */
-   if (reason  GEN_INTR_RXTRAFFIC)
-   writeq(S2IO_MINUS_ONE, bar0-rx_traffic_int);
+   if (reason  GEN_INTR_TXTRAFFIC)
+   writeq(S2IO_MINUS_ONE, bar0-tx_traffic_int);
 
-		for (i = 0; i  config-rx_ring_num; i++) {

-   rx_intr_handler(mac_control-rings[i]);
-   }
-   }
+   for (i = 0; i  config-tx_fifo_num; i++)
+   tx_intr_handler(mac_control-fifos[i]);
 
-	/*

-* tx_traffic_int reg is an R1 register, writing all 1's
-* will ensure that the actual interrupt causing bit get's
-* cleared and hence a read can be avoided.
-*/
-   if (reason  GEN_INTR_TXTRAFFIC)
-   writeq(S2IO_MINUS_ONE, bar0-tx_traffic_int);
+   if (reason  GEN_INTR_TXPIC)
+   s2io_txpic_intr_handle(sp);
 
-	for (i = 0; i  config-tx_fifo_num; i++)

-   tx_intr_handler(mac_control-fifos[i]);
+   /*
+* Reallocate the buffers from the interrupt handler itself.
+*/
+   if (!config-napi) {
+   for (i = 0; i  config-rx_ring_num; i++)
+   s2io_chk_rx_buffers(sp, i);
+   }
+   writeq(sp-general_int_mask, bar0-general_int_mask);
+   

Re: [PATCH 2.6.24 1/2]S2io: Change kmalloc+memset to k[zc]alloc

2007-08-31 Thread Jeff Garzik

Ramkrishna Vepa wrote:

- Changed kmalloc+memset to k[zc]alloc as per Mariusz's patch
  [EMAIL PROTECTED]

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]


ACK patches 1-2, but dropped due to previous dropped patches (presumed 
dependencies)



-
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: [REVISED PATCH] 3c59x: check return of pci_enable_device()

2007-08-31 Thread Jeff Garzik

Mark Hindley wrote:

Revised patch for this.

Mark


commit 5cf33391eba81a49038fa8be8cbad8425b80bf7f
Author: Mark Hindley [EMAIL PROTECTED]
Date:   Thu Aug 16 11:26:35 2007 +0100

Check return of pci_enable_device in vortex_up().

Also modify vortex_up to return error to callers. Handle failure of vortex_up in

vortex_open and vortex_resume.

Signed-off-by: Mark Hindley [EMAIL PROTECTED]


Steffen, did you ACK this?  and/or going to resend it to me?


-
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: [git patches] net driver fixes

2007-08-31 Thread Jeff Garzik

Satyam Sharma wrote:


On Mon, 30 Jul 2007, Jeff Garzik wrote:


true, we should just remove the dev==NULL check


Patch below:

[PATCH] nmclan_cs: Remove bogus (dev==NULL) check in mace_interrupt()

The (dev == NULL) check in drivers/net/pcmcia/nmclan_cs.c:mace_interrupt()
handler is always false, so let's remove it.

Signed-off-by: Satyam Sharma [EMAIL PROTECTED]

---

 drivers/net/pcmcia/nmclan_cs.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)


ACK, but patch does not apply to netdev-2.6.git#upstream alas


-
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/6] ibmveth: Add ethtool TSO handlers

2007-08-31 Thread Jeff Garzik

Brian King wrote:

Add handlers for get_tso and get_ufo to prevent errors being printed
by ethtool.

Signed-off-by: Brian King [EMAIL PROTECTED]
---

 linux-2.6-bjking1/drivers/net/ibmveth.c |2 ++
 1 file changed, 2 insertions(+)

diff -puN drivers/net/ibmveth.c~ibmveth_ethtool_get_tso drivers/net/ibmveth.c
--- linux-2.6/drivers/net/ibmveth.c~ibmveth_ethtool_get_tso 2007-08-08 
10:46:28.0 -0500
+++ linux-2.6-bjking1/drivers/net/ibmveth.c 2007-08-08 10:46:28.0 
-0500
@@ -767,6 +767,8 @@ static const struct ethtool_ops netdev_e
.set_tx_csum= ibmveth_set_tx_csum,
.get_rx_csum= ibmveth_get_rx_csum,
.set_rx_csum= ibmveth_set_rx_csum,
+   .get_tso= ethtool_op_get_tso,
+   .get_ufo= ethtool_op_get_ufo,


This patch is fine, but I wonder if we shouldn't add some code to 
net/core/ethtool.c along the lines of...


if (!netdev-ethtool_ops-get_tso)
ethtool_op_get_tso(args);
else
netdev-ethtool_ops-get_tso(args);

Because this certainly seems like desirable behavior across all devices.


-
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 0/2 v2] PS3: gelic updates

2007-08-31 Thread Masakazu Mokuno
Hi Jeff,

The comments for the patch #1 was rewritten.  I believe
it's more descriptive than the older one.

  #1 Change the way to handle tx skbs (comments rewritten)
  
  #2 Remove work-around code no longer needed

regards.

--
Masakazu MOKUNO

-
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/7] fs_enet: Whitespace cleanup.

2007-08-31 Thread Jeff Garzik

Scott Wood wrote:

Signed-off-by: Scott Wood [EMAIL PROTECTED]
---
 drivers/net/fs_enet/fs_enet-main.c |   85 ---
 drivers/net/fs_enet/fs_enet.h  |4 +-
 drivers/net/fs_enet/mac-fcc.c  |1 -
 drivers/net/fs_enet/mii-fec.c  |1 -
 4 files changed, 41 insertions(+), 50 deletions(-)


ACK patches 2-7


-
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/2 v2] PS3: changed the way to handle tx skbs

2007-08-31 Thread Masakazu Mokuno
The PS3 virtual network device requires a vlan tag in the sending packet
to select the destination device, ethernet port or wireless. 
As the vlan tag field is in the middle of the passed data, 
we should insert it into the packet data.
To avoid copying much of the packet data, the driver used two tx descriptors
for one tx skb; one descriptor was for sending a small static 
buffer which contained vlan tag and copied header (two mac addresses),
one was for the residual data after the vlan field.

This patch changes the way to insert the vlan tag.  By changing 
netdev-hard_header_len, we can make the headroom for moving mac address
fields in the skb buffer. Then we can send one tx skb with
one tx descriptor.  This also gives us a tx throughut gain of approx.
20% according to netperf results.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
CC: Geoff Levand [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |  140 +++-
 1 file changed, 63 insertions(+), 77 deletions(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -351,19 +351,13 @@ static int gelic_net_alloc_rx_skbs(struc
 static void gelic_net_release_tx_descr(struct gelic_net_card *card,
struct gelic_net_descr *descr)
 {
-   struct sk_buff *skb;
+   struct sk_buff *skb = descr-skb;
 
+   BUG_ON(!(descr-data_status  (1  GELIC_NET_TXDESC_TAIL)));
 
-   if (descr-data_status  (1  GELIC_NET_TXDESC_TAIL)) {
-   /* 2nd descriptor */
-   skb = descr-skb;
-   dma_unmap_single(ctodev(card), descr-buf_addr, skb-len,
-DMA_TO_DEVICE);
-   dev_kfree_skb_any(skb);
-   } else {
-   dma_unmap_single(ctodev(card), descr-buf_addr,
-descr-buf_size, DMA_TO_DEVICE);
-   }
+   dma_unmap_single(ctodev(card), descr-buf_addr, skb-len,
+DMA_TO_DEVICE);
+   dev_kfree_skb_any(skb);
 
descr-buf_addr = 0;
descr-buf_size = 0;
@@ -426,7 +420,7 @@ static void gelic_net_release_tx_chain(s
release ++;
}
 out:
-   if (!stop  (2  release))
+   if (!stop  release)
netif_wake_queue(card-netdev);
 }
 
@@ -592,13 +586,10 @@ gelic_net_get_next_tx_descr(struct gelic
 {
if (!card-tx_chain.head)
return NULL;
-   /*  see if we can two consecutive free descrs */
+   /*  see if the next descriptor is free */
if (card-tx_chain.tail != card-tx_chain.head-next 
gelic_net_get_descr_status(card-tx_chain.head) ==
-   GELIC_NET_DESCR_NOT_IN_USE 
-   card-tx_chain.tail != card-tx_chain.head-next-next 
-   gelic_net_get_descr_status(card-tx_chain.head-next) ==
-GELIC_NET_DESCR_NOT_IN_USE )
+   GELIC_NET_DESCR_NOT_IN_USE)
return card-tx_chain.head;
else
return NULL;
@@ -609,44 +600,66 @@ gelic_net_get_next_tx_descr(struct gelic
  * gelic_net_set_txdescr_cmdstat - sets the tx descriptor command field
  * @descr: descriptor structure to fill out
  * @skb: packet to consider
- * @middle: middle of frame
  *
  * fills out the command and status field of the descriptor structure,
  * depending on hardware checksum settings. This function assumes a wmb()
  * has executed before.
  */
 static void gelic_net_set_txdescr_cmdstat(struct gelic_net_descr *descr,
- struct sk_buff *skb, int middle)
+ struct sk_buff *skb)
 {
-   u32 eofr;
-
-   if (middle)
-   eofr = 0;
-   else
-   eofr = GELIC_NET_DMAC_CMDSTAT_END_FRAME;
-
if (skb-ip_summed != CHECKSUM_PARTIAL)
-   descr-dmac_cmd_status = GELIC_NET_DMAC_CMDSTAT_NOCS | eofr;
+   descr-dmac_cmd_status = GELIC_NET_DMAC_CMDSTAT_NOCS |
+   GELIC_NET_DMAC_CMDSTAT_END_FRAME;
else {
/* is packet ip?
 * if yes: tcp? udp? */
if (skb-protocol == htons(ETH_P_IP)) {
if (ip_hdr(skb)-protocol == IPPROTO_TCP)
descr-dmac_cmd_status =
-   GELIC_NET_DMAC_CMDSTAT_TCPCS | eofr;
+   GELIC_NET_DMAC_CMDSTAT_TCPCS |
+   GELIC_NET_DMAC_CMDSTAT_END_FRAME;
+
else if (ip_hdr(skb)-protocol == IPPROTO_UDP)
descr-dmac_cmd_status =
-   GELIC_NET_DMAC_CMDSTAT_UDPCS | eofr;
+   GELIC_NET_DMAC_CMDSTAT_UDPCS |
+   GELIC_NET_DMAC_CMDSTAT_END_FRAME;
else/*
 * the stack should checksum non-tcp and non-udp
 * packets 

Re: [PATCH 1/7] Generic bitbanged MDIO library

2007-08-31 Thread Jeff Garzik

Scott Wood wrote:

Previously, bitbanged MDIO was only supported in individual
hardware-specific drivers.  This code factors out the higher level
protocol implementation, reducing the hardware-specific portion to
functions setting direction, data, and clock.

Signed-off-by: Scott Wood [EMAIL PROTECTED]
---
 drivers/net/phy/Kconfig|9 ++
 drivers/net/phy/Makefile   |1 +
 drivers/net/phy/mdio-bitbang.c |  187 
 include/linux/mdio-bitbang.h   |   42 +
 4 files changed, 239 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/phy/mdio-bitbang.c
 create mode 100644 include/linux/mdio-bitbang.h


I cannot ACK this, nor do I want to see it merged, until users appear 
and have been reviewed alongside this.  I do not see any fs_enet patches 
that actually use this.


five-second-glance comments:

* mdio_bitbang_ is a long prefix.  consider mdiobb_ or somesuch

* the delay (where you call ndelay()) is not guaranteed without a flush 
of some sort


* how widely applicable is this generic library?  have you converted 
any non-embedded drivers over to it?


-
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: [REVISED PATCH] 3c59x: check return of pci_enable_device()

2007-08-31 Thread Steffen Klassert
On Fri, Aug 31, 2007 at 09:08:37AM -0400, Jeff Garzik wrote:
 Mark Hindley wrote:
 Revised patch for this.
 
 Mark
 
 
 commit 5cf33391eba81a49038fa8be8cbad8425b80bf7f
 Author: Mark Hindley [EMAIL PROTECTED]
 Date:   Thu Aug 16 11:26:35 2007 +0100
 
 Check return of pci_enable_device in vortex_up().
 
 Also modify vortex_up to return error to callers. Handle failure of 
 vortex_up in
 vortex_open and vortex_resume.
 
 Signed-off-by: Mark Hindley [EMAIL PROTECTED]
 
 Steffen, did you ACK this?  and/or going to resend it to me?
 

Yes, I did. Andrew has it already in -mm, 
I guess that he will resend it to you soon.

Steffen
-
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.6.24 2/3]S2io: Support for add/delete/store/restore ethernet addresses

2007-08-31 Thread Jeff Garzik

Sreenivasa Honnur wrote:

- Support to add/delete/store/restore 64 and 128 Ethernet addresses for
Xframe I and Xframe II respectively.

Signed-off-by: Sreenivasa Honnur [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]


What is the purpose of this?  We do not support more than one unicast 
MAC address at present...


certainly multicast is different


-
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.6.24 3/3]S2io: Updating transceiver information in ethtool function

2007-08-31 Thread Jeff Garzik

Sreenivasa Honnur wrote:

- Update transceiver information in ethtool function
 
Signed-off-by: Sreenivasa Honnur [EMAIL PROTECTED]

Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]
---
diff -urpN patch2/drivers/net/s2io.c patch3/drivers/net/s2io.c
--- patch2/drivers/net/s2io.c   2007-08-18 07:19:21.0 +0530
+++ patch3/drivers/net/s2io.c   2007-08-18 07:20:27.0 +0530
@@ -84,7 +84,7 @@
 #include s2io.h
 #include s2io-regs.h
 
-#define DRV_VERSION 2.0.26.4

+#define DRV_VERSION 2.0.26.5
 
 /* S2io Driver name  version. */

 static char s2io_driver_name[] = Neterion;
@@ -5459,7 +5459,9 @@ static int s2io_ethtool_gset(struct net_
info-supported = (SUPPORTED_1baseT_Full | SUPPORTED_FIBRE);
info-advertising = (SUPPORTED_1baseT_Full | SUPPORTED_FIBRE);
info-port = PORT_FIBRE;
-   /* info-transceiver?? TODO */
+
+   /* info-transceiver */
+   info-transceiver = XCVR_EXTERNAL;


ACK


-
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 v2] PS3: Remove the workaround no longer needed

2007-08-31 Thread Masakazu Mokuno
Removed the workaround that was needed for PS3 firmware versions 
prior to the first release.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
CC: Geoff Levand [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -732,25 +732,17 @@ static int gelic_net_kick_txdma(struct g
struct gelic_net_descr *descr)
 {
int status = 0;
-   int count = 10;
 
if (card-tx_dma_progress)
return 0;
 
if (gelic_net_get_descr_status(descr) == GELIC_NET_DESCR_CARDOWNED) {
card-tx_dma_progress = 1;
-   /* sometimes we need retry here */
-   while (count--) {
-   status = lv1_net_start_tx_dma(bus_id(card),
- dev_id(card),
- descr-bus_addr, 0);
-   if (!status)
-   break;
-   }
-   if (!count)
+   status = lv1_net_start_tx_dma(bus_id(card), dev_id(card),
+ descr-bus_addr, 0);
+   if (status)
dev_info(ctodev(card), lv1_net_start_txdma failed, \
-   status=%d %#lx\n,
-status, card-irq_status);
+status=%d\n, status);
}
return status;
 }


-- 
Masakazu MOKUNO

-
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: [REVISED PATCH] 3c59x: check return of pci_enable_device()

2007-08-31 Thread Jeff Garzik

Mark Hindley wrote:

Revised patch for this.

Mark


commit 5cf33391eba81a49038fa8be8cbad8425b80bf7f
Author: Mark Hindley [EMAIL PROTECTED]
Date:   Thu Aug 16 11:26:35 2007 +0100

Check return of pci_enable_device in vortex_up().

Also modify vortex_up to return error to callers. Handle failure of vortex_up in

vortex_open and vortex_resume.

Signed-off-by: Mark Hindley [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: [Bugme-new] [Bug 8961] New: BUG triggered by oidentd in netlink code

2007-08-31 Thread Athanasius
On Fri, Aug 31, 2007 at 01:05:04PM +0200, Patrick McHardy wrote:
 Seems to be a bug introduced by the netlink_run_queue conversion,
 since there is no locking and netlink_run_queue doesn't check
 for NULL results from skb_dequeue, it might pass NULL to
 netlink_rcv_skb, which crashes.
 
 Does this patch help?

  I'll compile up a new kernel, likely 2.6.22.6, plus this patch, and
reboot to it tonight.  I still don't know *exactly* how to trigger the
bug on demand though, it's not reocurred since I posted the bug report
(but had happened about a week before as well).

thanks,

-Ath
-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
  Finger athan(at)fysh.org for PGP key
   And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence. Paula Cole - ME


signature.asc
Description: Digital signature


Re: [REVISED PATCH] 3c59x: check return of pci_enable_device()

2007-08-31 Thread Jeff Garzik

Steffen Klassert wrote:

commit 5cf33391eba81a49038fa8be8cbad8425b80bf7f
Author: Mark Hindley [EMAIL PROTECTED]
Date:   Thu Aug 16 11:26:35 2007 +0100

   Check return of pci_enable_device in vortex_up().
   
   Also modify vortex_up to return error to callers. Handle failure of 
   vortex_up in

   vortex_open and vortex_resume.
   
   Signed-off-by: Mark Hindley [EMAIL PROTECTED]

Steffen, did you ACK this?  and/or going to resend it to me?


Yes, I did. Andrew has it already in -mm, 
I guess that he will resend it to you soon.



No need for a resend, I just wanted to make sure I wasn't stepping on 
your toes by applying this patch _instead of_ one that was going to be 
resent.


-
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 8/11] cxgb3 - Update internal memory management

2007-08-31 Thread Jeff Garzik

Divy Le Ray wrote:

From: Divy Le Ray [EMAIL PROTECTED]

Set PM1 internal memory to round robin mode
It balances access to this internal memory for multiport adapters.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/regs.h  |2 ++
 drivers/net/cxgb3/t3_hw.c |2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index 2824278..5e1bc0d 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1326,6 +1326,7 @@
 #define V_D0_WEIGHT(x) ((x)  S_D0_WEIGHT)
 
 #define A_PM1_RX_CFG 0x5c0

+#define A_PM1_RX_MODE 0x5c4
 
 #define A_PM1_RX_INT_ENABLE 0x5d8
 
@@ -1394,6 +1395,7 @@

 #define A_PM1_RX_INT_CAUSE 0x5dc
 
 #define A_PM1_TX_CFG 0x5e0

+#define A_PM1_TX_MODE 0x5e4
 
 #define A_PM1_TX_INT_ENABLE 0x5f8


Future note:

would be nice to see the above as enums as well


-
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 8/11] cxgb3 - Update internal memory management

2007-08-31 Thread Jeff Garzik

Divy Le Ray wrote:

From: Divy Le Ray [EMAIL PROTECTED]

Set PM1 internal memory to round robin mode
It balances access to this internal memory for multiport adapters.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/regs.h  |2 ++
 drivers/net/cxgb3/t3_hw.c |2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)


applied patches 1-8


-
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 9/11] cxgb3 - engine microcode update

2007-08-31 Thread Jeff Garzik

Divy Le Ray wrote:

From: Divy Le Ray [EMAIL PROTECTED]

Load microcode engine when the interface
is configured up.
Bump up version to 1.1.0.
Allow the driver to be and running with
older microcode images.
Allow ethtool to log the microcode version.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]


ACK patches 9-14, but dropped, since they do not apply to #upstream 
(probably due to fixes sent into 2.6.23-rc)



-
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 07/12] sky2: use net_device internal stats

2007-08-31 Thread Jeff Garzik

NAK -- grep around net/core, you want -get_stats()



-
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 01/12] sky2: fe+ chip support

2007-08-31 Thread Jeff Garzik

applied 1-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


Re: Please pull 'upstream-jgarzik' branch of wireless-2.6

2007-08-31 Thread Jeff Garzik

John W. Linville wrote:

Jeff,

A few more for 2.6.24 -- mostly libertas.

Individual patches are available here:


http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/upstream-jgarzik/

Thanks!

John

---

The following changes since commit e54cfa621f4cca9cca500019aa600c71d20f0592:
  Jeff Garzik (1):
Merge branch 'upstream-jgarzik' of 
git://git.kernel.org/.../linville/wireless-2.6 into upstream

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
upstream-jgarzik

Andrew Morton (1):
  libertas: printk warning fixes

Brajesh Dave (1):
  libertas: advertise 11g ad-hoc rates

Dan Williams (4):
  libertas: fix inadvertant removal of bits from commit 
831441862956fffa17b9801db37e6ea1650b0f69
  libertas: reorganize and simplify init sequence
  libertas: don't stomp on interface-specific private data
  libertas: send reset command directly instead of calling 
libertas_reset_device

Jesper Juhl (1):
  net: Kill some unneeded allocation return value casts in libertas

Johannes Berg (1):
  rtl8187: remove IEEE80211_HW_DATA_NULLFUNC_ACK

John W. Linville (1):
  libertas: remove unused adhoc_rates_b definition

Marek Vašut (1):
  libertas: region code values specified as 8bit

Pierre Ossman (1):
  libertas: properly end commands on hardware failure

 drivers/net/wireless/libertas/cmd.c |2 +
 drivers/net/wireless/libertas/cmdresp.c |6 +-
 drivers/net/wireless/libertas/debugfs.c |2 +-
 drivers/net/wireless/libertas/decl.h|3 +-
 drivers/net/wireless/libertas/dev.h |4 -
 drivers/net/wireless/libertas/ethtool.c |3 +-
 drivers/net/wireless/libertas/if_cs.c   |   58 +
 drivers/net/wireless/libertas/if_usb.c  |  371 +
 drivers/net/wireless/libertas/if_usb.h  |4 +-
 drivers/net/wireless/libertas/join.c|7 +-
 drivers/net/wireless/libertas/main.c|  408 +--
 drivers/net/wireless/rtl8187_dev.c  |3 +-
 12 files changed, 354 insertions(+), 517 deletions(-)


pulled


-
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: pktgen terminating condition

2007-08-31 Thread jamal
On Thu, 2007-30-08 at 22:19 -0700, David Miller wrote:

 You could implement this quite simply using skb-destructor.

Thats what i was thinking ..

 It will add some atomics, so on weaker pktgen source systems
 it might decrease the generators rate.

Indeed. So maybe a config option instead; it has value afaics in the
batching case only. Need to experiment.

cheers,
jamal


-
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] bmac: add simple ethtool support for network manager

2007-08-31 Thread Jeff Garzik

Olaf Hering wrote:

NetworkManager will not start dhcpd on an interface unless it reports
link-up state via ethtool.

Signed-off-by: Olaf Hering [EMAIL PROTECTED]

---
 drivers/net/bmac.c |   13 +
 1 file changed, 13 insertions(+)


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: Re: pktgen terminating condition

2007-08-31 Thread jamal
On Fri, 2007-31-08 at 14:17 +0200, Daniele Venzano wrote:

 I don't regard the TxOK solution as something usable for mainline, but it has 
 its 
 use for the users of pktgen.

I dont know if you followed the discussion - by defering the freeing of
skbs, you will be slowing down socket apps sending from the local
machine. It may be ok if the socket buffers were huge, but that comes at
the cost of system memory (which may not be a big deal)
Do you by any chance recall why you used the idle interupt instead of
txok to kick the prunning of tx descriptors?

cheers,
jamal

-
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] [01/10] pasemi_mac: Abstract out register access

2007-08-31 Thread Jeff Garzik

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 v2] [02/10] pasemi_mac: Stop using the pci config space accessors for register read/writes

2007-08-31 Thread Jeff Garzik

Olof Johansson wrote:

Move away from using the pci config access functions for simple register
access.  Our device has all of the registers in the config space (hey,
from the hardware point of view it looks reasonable :-), so we need to
somehow get to it. Newer firmwares have it in the device tree such that
we can just get it and ioremap it there (in case it ever moves in future
products). For now, provide a hardcoded fallback for older firmwares.


Signed-off-by: Olof Johansson [EMAIL PROTECTED]


applied 2-10


-
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 5/5] Net: ath5k, kconfig changes

2007-08-31 Thread Jeff Garzik

Dan Williams wrote:

On Thu, 2007-08-30 at 08:36 -0400, John W. Linville wrote:

On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:

2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:

Also this whole patch seems rather pointless.  It saves only
very little and turns the driver into a complete ifdef maze.

Also most
people will use 5212 code only, 5211 cards are on some old laptops and
5210, well i couldn't even find  a 5210 for actual testing :P

FWIW, I'd bet dollars to donuts that distros will enable them all
together.


I would certainly _hope_ that distros enable everything -that is in the
kernel- that they can get their hands on, otherwise when you stick a
card in, it doesn't just work.


Distros definitely -do not- do this.  Plenty of ancient ISA drivers are 
disabled at build time, for example, in many distros.


Jeff



-
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/6] ibmveth: Enable TCP checksum offload

2007-08-31 Thread Jeff Garzik

Brian King wrote:

This patchset enables TCP checksum offload support for IPV4
on ibmveth. This completely eliminates the generation and checking of
the checksum for packets that are completely virtual and never
touch a physical network. A simple TCP_STREAM netperf run on
a virtual network with maximum mtu set yielded a ~30% increase
in throughput. This feature is enabled by default on systems that
support it, but can be disabled with a module option.

Signed-off-by: Brian King [EMAIL PROTECTED]


applied 1-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


Re: [PATCH 1/2 v2] PS3: changed the way to handle tx skbs

2007-08-31 Thread Jeff Garzik

Masakazu Mokuno wrote:

The PS3 virtual network device requires a vlan tag in the sending packet
to select the destination device, ethernet port or wireless. 
As the vlan tag field is in the middle of the passed data, 
we should insert it into the packet data.

To avoid copying much of the packet data, the driver used two tx descriptors
for one tx skb; one descriptor was for sending a small static 
buffer which contained vlan tag and copied header (two mac addresses),

one was for the residual data after the vlan field.

This patch changes the way to insert the vlan tag.  By changing 
netdev-hard_header_len, we can make the headroom for moving mac address

fields in the skb buffer. Then we can send one tx skb with
one tx descriptor.  This also gives us a tx throughut gain of approx.
20% according to netperf results.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
CC: Geoff Levand [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |  140 +++-
 1 file changed, 63 insertions(+), 77 deletions(-)


applied 1-2, thanks for the update


-
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 07/12] sky2: use net_device internal stats

2007-08-31 Thread Stephen Hemminger
On Fri, 31 Aug 2007 09:43:37 -0400
Jeff Garzik [EMAIL PROTECTED] wrote:

 NAK -- grep around net/core, you want -get_stats()
 
 
 

Unneeded if device leaves get_stats as NULL, then register_netdevice
sets it to internal get stats (in net-2.6.24)
-
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: net-2.6.24 rebased

2007-08-31 Thread John W. Linville
On Thu, Aug 30, 2007 at 10:21:29PM -0700, David Miller wrote:
 From: Johannes Berg [EMAIL PROTECTED]
 Date: Thu, 30 Aug 2007 13:58:12 +0200
 
  Huh? I'm fairly sure I sent a patch to remove it from that driver, no
  idea where it got lost. FWIW, you can simply delete the |
  IEEE80211_HW_DATA_NULLFUNC_ACK part.
 
 It might have been a mis-merge between John and myself.
 A few times because I had rebased I had to take his
 directory of patches and one of us might have made a
 mistake somewhere along the line.
 
 In any event, I've removed the offending line from
 the driver.

Sorry, I sent the patch through Jeff.


http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/upstream-jgarzik/0010-rtl8187-remove-IEEE80211_HW_DATA_NULLFUNC_ACK.patch

But, it sounds like you have taken care of it...?

Let me know if I need to fix this.

John
-- 
John W. Linville
[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


Re: Tc bug (kernel crash) more info

2007-08-31 Thread Badalian Vyacheslav

I found that bug in this place

(gdb) l *0xc01c8973
0xc01c8973 is in rb_insert_color (lib/rbtree.c:80).
75
76  while ((parent = rb_parent(node))  rb_is_red(parent))
77  {
78  gparent = rb_parent(parent);
79
80  if (parent == gparent-rb_left)
81  {
82  {
83  register struct rb_node *uncle = 
gparent-rb_right;

84  if (uncle  rb_is_red(uncle))


if i not wrong understand message unable to handle kernel NULL pointer 
dereference at virtual address 0008 its was known that gparent == 
Null?

Or i hope or i try find a mare's-nest?


Ok =) I hope in next week you found bug place and fix it!

PS. if you ask where i can read kernel panic dump logic literature 
and try find bugline in code.
I read dump and see that bug in function rb_insert_color + some 
shift (in asm?) that called from htb_dequeue? But in htb_dequeue not 
have calling rb_insert_color =( Or some nodes in trace was skipped?


Its for change up my education ;)

I'll not be able to assist you until monday (but I'll try to look
into the code and maybe to prepare some new patch - but it needs
a lot of checking to not add too much of this locking as well).

I think you can stay with a kernel whichever you like - I'm not sure
any config changes or even more debugging can change much, but maybe
I'm wrong. It looks to me like some locking is missing or interrupted.
If you are working weekends and find something new, don't wait: maybe
somebody else here could be interested too.
 
Cheers,

Jarek P.
  


-
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



-
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 5/5] Net: ath5k, kconfig changes

2007-08-31 Thread Dan Williams
On Fri, 2007-08-31 at 09:30 -0400, Jeff Garzik wrote:
 Dan Williams wrote:
  On Thu, 2007-08-30 at 08:36 -0400, John W. Linville wrote:
  On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
  2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:
  Also this whole patch seems rather pointless.  It saves only
  very little and turns the driver into a complete ifdef maze.
  Also most
  people will use 5212 code only, 5211 cards are on some old laptops and
  5210, well i couldn't even find  a 5210 for actual testing :P
  FWIW, I'd bet dollars to donuts that distros will enable them all
  together.
  
  I would certainly _hope_ that distros enable everything -that is in the
  kernel- that they can get their hands on, otherwise when you stick a
  card in, it doesn't just work.
 
 Distros definitely -do not- do this.  Plenty of ancient ISA drivers are 
 disabled at build time, for example, in many distros.

Ok, so let me qualify to within reason.  All 802.11-compliant wireless
cards would fall within the within reason IMHO, but, for example,
older non 802.11 wireless cards (early Aironet products for example)
probably don't.  ISA clearly does not for mainstream distros.

Dan


-
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: Tc bug (kernel crash) more info

2007-08-31 Thread Badalian Vyacheslav

Ok =) I hope in next week you found bug place and fix it!

PS. if you ask where i can read kernel panic dump logic literature and 
try find bugline in code.
I read dump and see that bug in function rb_insert_color + some shift 
(in asm?) that called from htb_dequeue? But in htb_dequeue not have 
calling rb_insert_color =( Or some nodes in trace was skipped?


Its for change up my education ;)

I'll not be able to assist you until monday (but I'll try to look
into the code and maybe to prepare some new patch - but it needs
a lot of checking to not add too much of this locking as well).

I think you can stay with a kernel whichever you like - I'm not sure
any config changes or even more debugging can change much, but maybe
I'm wrong. It looks to me like some locking is missing or interrupted.
If you are working weekends and find something new, don't wait: maybe
somebody else here could be interested too.
 
Cheers,
Jarek P. 

  


-
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/7] Generic bitbanged MDIO library

2007-08-31 Thread Scott Wood
On Fri, Aug 31, 2007 at 09:23:04AM -0400, Jeff Garzik wrote:
 I cannot ACK this, nor do I want to see it merged, until users appear 
 and have been reviewed alongside this.  I do not see any fs_enet patches 
 that actually use this.

The fs_enet patchset does use it in mii-bitbang.c, in patch 6/7 (or 7/8
in the revised patchset).  I'll also be using it on the ep8248e board
(which is why I factored it out), which I'll attach below.

 * the delay (where you call ndelay()) is not guaranteed without a flush 
 of some sort

Hmm...  I'm inclined to push that into the client's implementation of set
mdc/data, primarily because there's no get mdc to do a read-back
generically.

 * how widely applicable is this generic library?

It implements MDIO as described in the ethernet specification; there
should be no implementation dependencies.

  have you converted any non-embedded drivers over to it?

No; most hardware doesn't need bitbanging.  Sunhme does, but I don't have
hardware to test a conversion.

Here's the ep8248e user of the bitbang code:

/*
 * Embedded Planet EP8248E support
 *
 * Copyright 2007 Freescale Semiconductor, Inc.
 * Author: Scott Wood [EMAIL PROTECTED]
 *
 * This program is free software; you can redistribute  it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 */

#include linux/init.h
#include linux/interrupt.h
#include linux/fsl_devices.h
#include linux/mdio-bitbang.h
#include linux/of_platform.h

#include asm/io.h
#include asm/cpm2.h
#include asm/udbg.h
#include asm/machdep.h
#include asm/time.h
#include asm/mpc8260.h

#include sysdev/fsl_soc.h
#include sysdev/cpm2_pic.h

#include pq2.h

static u8 __iomem *ep8248e_bcsr;
static struct device_node *ep8248e_bcsr_node;

#define BCSR7_SCC2_ENABLE 0x10

#define BCSR8_PHY1_ENABLE 0x80
#define BCSR8_PHY1_POWER  0x40
#define BCSR8_PHY2_ENABLE 0x20
#define BCSR8_PHY2_POWER  0x10
#define BCSR8_MDIO_READ   0x04
#define BCSR8_MDIO_CLOCK  0x02
#define BCSR8_MDIO_DATA   0x01

#define BCSR9_USB_ENABLE  0x80
#define BCSR9_USB_POWER   0x40
#define BCSR9_USB_HOST0x20
#define BCSR9_USB_FULL_SPEED_TARGET 0x10

static void __init ep8248_pic_init(void)
{
struct device_node *np = of_find_compatible_node(NULL, NULL, 
fsl,pq2-pic);
if (!np) {
printk(KERN_ERR PIC init: can not find cpm-pic node\n);
return;
}

cpm2_pic_init(np);
of_node_put(np);
}

static void ep8248e_set_mdc(struct mdio_bitbang_ctrl *ctrl, int level)
{
if (level)
setbits8(ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
else
clrbits8(ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);

/* Flush the write before delaying. */
in_8(ep8248e_bcsr[8]);
}

static void ep8248e_set_mdio_dir(struct mdio_bitbang_ctrl *ctrl, int output)
{
if (output)
clrbits8(ep8248e_bcsr[8], BCSR8_MDIO_READ);
else
setbits8(ep8248e_bcsr[8], BCSR8_MDIO_READ);

/* Flush the write before delaying. */
in_8(ep8248e_bcsr[8]);
}

static void ep8248e_set_mdio_data(struct mdio_bitbang_ctrl *ctrl, int data)
{
if (data)
setbits8(ep8248e_bcsr[8], BCSR8_MDIO_DATA);
else
clrbits8(ep8248e_bcsr[8], BCSR8_MDIO_DATA);

/* Flush the write before delaying. */
in_8(ep8248e_bcsr[8]);
}

static int ep8248e_get_mdio_data(struct mdio_bitbang_ctrl *ctrl)
{
return in_8(ep8248e_bcsr[8])  BCSR8_MDIO_DATA;
}

static struct mdio_bitbang_ops ep8248e_mdio_ops = {
.set_mdc = ep8248e_set_mdc,
.set_mdio_dir = ep8248e_set_mdio_dir,
.set_mdio_data = ep8248e_set_mdio_data,
.get_mdio_data = ep8248e_get_mdio_data,
.owner = THIS_MODULE,
};

static struct mdio_bitbang_ctrl ep8248e_mdio_ctrl = {
.ops = ep8248e_mdio_ops,
};

static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
struct mii_bus *bus;
struct resource res;
int ret, i;

if (of_get_parent(ofdev-node) != ep8248e_bcsr_node)
return -ENODEV;

ret = of_address_to_resource(ofdev-node, 0, res);
if (ret)
return ret;

bus = alloc_mdio_bitbang(ep8248e_mdio_ctrl);
if (!bus)
return -ENOMEM;

bus-phy_mask = 0;
bus-irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);

for (i = 0; i  PHY_MAX_ADDR; i++)
bus-irq[i] = -1;

bus-name = ep8248e-mdio-bitbang;
bus-dev = ofdev-dev;
bus-id = res.start;

return mdiobus_register(bus);
}

static int ep8248e_mdio_remove(struct of_device *ofdev)
{
BUG();
return 0;
}

static struct of_device_id ep8248e_mdio_match[] = {
{
.compatible = fsl,ep8248e-mdio-bitbang,
},
{},
};

static struct 

[PATCH] ucc_geth: suppress 'qe_bd_t' undeclared error

2007-08-31 Thread Kim Phillips
drivers/net/ucc_geth.c:2151: error: ‘qe_bd_t’ undeclared (first use in this 
function)

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
Leo, this is for 2.6.23.

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

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 12e01b2..9a38dfe 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2148,7 +2148,7 @@ static void ucc_geth_memclean(struct ucc_geth_private 
*ugeth)
for (j = 0; j  ugeth-ug_info-bdRingLenTx[i]; j++) {
if (ugeth-tx_skbuff[i][j]) {
dma_unmap_single(NULL,
-((qe_bd_t *)bd)-buf,
+((struct qe_bd *)bd)-buf,
 (in_be32((u32 *)bd) 
  BD_LENGTH_MASK),
 DMA_TO_DEVICE);
-- 
1.5.2.2

-
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 a lock problem in generic phy code

2007-08-31 Thread Hans-Jürgen Koch
Am Freitag 31 August 2007 schrieb Hans-Jürgen Koch:
 Lock debugging finds a problem in phy.c and phy_device.c,
 this patch fixes it. Tested on an AT91SAM9263-EK board,
 kernel 2.6.23-rc4.

FYI, here's the log message without that patch:

[3.42] =
[3.42] [ INFO: inconsistent lock state ]
[3.42] 2.6.23-rc3-mm1 #21
[3.42] -
[3.42] inconsistent {softirq-on-W} - {in-softirq-W} usage.
[3.42] swapper/1 [HC0[0]:SC1[1]:HE1:SE0] takes:
[3.42]  (dev-lock){-+..}, at: [c017da1c] phy_timer+0x1c/0x4c8
[3.42] {softirq-on-W} state was registered at:
[3.42]   [c006021c] lock_acquire+0x94/0xac
[3.42]   [c026423c] _spin_lock+0x40/0x50
[3.42]   [c017e2b4] phy_probe+0x40/0x88
[3.42]   [c017e60c] phy_attach+0xc8/0xfc
[3.42]   [c017e6c4] phy_connect+0x1c/0x58
[3.42]   [c017fc44] macb_probe+0x4fc/0x5bc
[3.42]   [c0177b44] platform_drv_probe+0x20/0x24
[3.42]   [c0176210] driver_probe_device+0xb0/0x1bc
[3.42]   [c01764dc] __driver_attach+0xe4/0xe8
[3.42]   [c017550c] bus_for_each_dev+0x54/0x80
[3.42]   [c0176074] driver_attach+0x20/0x28
[3.42]   [c01758d4] bus_add_driver+0x84/0x1e0
[3.42]   [c0176708] driver_register+0x54/0x90
[3.42]   [c0177de0] platform_driver_register+0x6c/0x88
[3.42]   [c00167ec] macb_init+0x14/0x1c
[3.42]   [c00087e4] kernel_init+0x9c/0x2b4
[3.42]   [c0040338] do_exit+0x0/0x8e8
[3.42] irq event stamp: 115025
[3.42] hardirqs last  enabled at (115025): [c0264958] 
_spin_unlock_irq+0x30/0x60
[3.42] hardirqs last disabled at (115024): [c02642c8] 
_spin_lock_irq+0x28/0x60
[3.42] softirqs last  enabled at (114999): [c0042910] 
__do_softirq+0xfc/0x12c
[3.42] softirqs last disabled at (115022): [c0042ee8] 
irq_exit+0x68/0x7c
[3.42]
[3.42] other info that might help us debug this:
[3.42] no locks held by swapper/1.
[3.42]
[3.42] stack backtrace:
[3.42] [c0028af4] (dump_stack+0x0/0x14) from [c005d8e4] 
(print_usage_bug+0x120/0x150)
[3.42] [c005d7c4] (print_usage_bug+0x0/0x150) from [c005e5e8] 
(mark_lock+0x574/0x6bc)
[3.42] [c005e074] (mark_lock+0x0/0x6bc) from [c005f4c0] 
(__lock_acquire+0x4d0/0x1198)
[3.42] [c005eff0] (__lock_acquire+0x0/0x1198) from [c006021c] 
(lock_acquire+0x94/0xac)
[3.42] [c0060188] (lock_acquire+0x0/0xac) from [c026423c] 
(_spin_lock+0x40/0x50)
[3.42] [c02641fc] (_spin_lock+0x0/0x50) from [c017da1c] 
(phy_timer+0x1c/0x4c8)
[3.42]  r5:c098a800 r4:0104
[3.42] [c017da00] (phy_timer+0x0/0x4c8) from [c0046ee4] 
(run_timer_softirq+0x1a0/0x218)
[3.42]  r7:c081ddd0 r6:c0331e80 r5:c098aa50 r4:0104
[3.42] [c0046d44] (run_timer_softirq+0x0/0x218) from [c00428a8] 
(__do_softirq+0x94/0x12c)
[3.42] [c0042814] (__do_softirq+0x0/0x12c) from [c0042ee8] 
(irq_exit+0x68/0x7c)
[3.42] [c0042e80] (irq_exit+0x0/0x7c) from [c0023060] 
(__exception_text_start+0x60/0x74)
[3.42]  r4:0001
[3.42] [c0023000] (__exception_text_start+0x0/0x74) from [c0023b28] 
(__irq_svc+0x48/0x74)
[3.42] Exception stack(0xc081de70 to 0xc081deb8)
[3.42] de60: c030b2a8 c081a800 
6013 c081c000
[3.42] de80: c032db40 c081dee0 c032d758 c081dece 0012 c030b398 
0034 c081df2c
[3.42] dea0: c081deb8 c081deb8 c003d6f0 c003d6f8 6013 
[3.42]  r7:0003 r6:0001 r5:fefff000 r4:
[3.42] [c003d494] (vprintk+0x0/0x474) from [c003d930] 
(printk+0x28/0x30)
[3.42] [c003d908] (printk+0x0/0x30) from [c01d3558] 
(sock_register+0x64/0x84)
[3.42]  r3:0001 r2:0002 r1:0001 r0:c02e4c88
[3.42] [c01d34f4] (sock_register+0x0/0x84) from [c001b7bc] 
(af_unix_init+0x40/0x88)
[3.42]  r5: r4:
[3.42] [c001b77c] (af_unix_init+0x0/0x88) from [c00087e4] 
(kernel_init+0x9c/0x2b4)
[3.42]  r4:
[3.42] [c0008748] (kernel_init+0x0/0x2b4) from [c0040338] 
(do_exit+0x0/0x8e8)
-
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: wither bounds checking for networking sysctls

2007-08-31 Thread Rick Jones

Stephen Hemminger wrote:

On Thu, 30 Aug 2007 18:09:17 -0700
Rick Jones [EMAIL PROTECTED] wrote:


While messing about with sysctl_tcp_rto_min I went back and forth a 
bit as to whether there should have been bounds checking (as did some of 
the folks who did some internal review for me).  That leads to the 
question - is it considered worthwhile to add a bit more bounds checking 
to sundry networking sysctls?


rick jones



IMHO As long as the any value from sysctl doesn't crash kernel, we
should let it go. Enforcing RFC policy or inter-dependencies seems
likes a useless exercise.


I was thinking more along the lines of more fundamental things - like 
precluding negative values when something is clearly a positive.


rick jones
-
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 _minimum_ TCP retransmission timeout configurable take 2

2007-08-31 Thread Rick Jones

John Heffner wrote:

Rick Jones wrote:


Like I said the consumers of this are a triffle well, anxious :)



Just curious, did you or this customer try with F-RTO enabled?  Or is 
this case you're dealing with truly hopeless?


F-RTO was mentioned to the customer and I'm awaiting their response as 
to its efficacy in their situation.  Everything I've seen thusfar is 
leading me to believe that we'll still need a higher than 200 
millisecond minimum rto though.


rick
-
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/, drivers/net/ , missing EXPERIMENTAL in menus

2007-08-31 Thread Randy Dunlap
On Thu, 19 Jul 2007 23:05:57 +0100 Simon Arlott wrote:

 On 19/07/07 17:19, Robert P. J. Day wrote:
  On Thu, 19 Jul 2007, Randy Dunlap wrote:
  I think that Stefan means a patch to the kconfig source code,
  not the the Kconfig files.  Good luck.  I'd still like to see it.
  
  yes, i understand what he wanted now.  as a first step (that
  theoretically shouldn't change any behaviour), i'd patch the Kconfig
  structure to add a new attribute (maturity) which would be allowed
  to be set to *exactly one* of a pre-defined set of values (say,
  OBSOLETE, DEPRECATED, EXPERIMENTAL, and STILLBLEEDING).  and that's
  it, nothing more.
  
  don't try to do anything with any of that just yet, just add the
  infrastructure to support the (optional) association of a maturity
  level with a config option.  that's step one.
 
 What about something like this? I'm not sure if the addition to sym_init
 is desirable... I also had to prefix _ to the name for now otherwise it
 conflicts badly with the current symbols. It probably should stop
 depends on _BROKEN etc. too.

Hi Simon,

(sorry for the delay)

I like this patch very much... I just can't get it to build (on
2.6.23-rc4).

Thanks.

 ---
 diff --git a/init/Kconfig b/init/Kconfig
 diff --git a/net/Kconfig b/net/Kconfig
 index cdba08c..5e2f4db 100644
 --- a/net/Kconfig
 +++ b/net/Kconfig
 @@ -6,6 +6,7 @@ menu Networking
 
  config NET
   bool Networking support
 + maturity _BROKEN
   ---help---
 Unless you really know what you are doing, you should say Y here.
 The reason is that some programs need kernel networking support even
 diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
 index fb2bb30..1dea08e 100644
 --- a/scripts/kconfig/Makefile
 +++ b/scripts/kconfig/Makefile
 @@ -256,7 +256,7 @@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h
  # The following requires flex/bison/gperf
  # By default we use the _shipped versions, uncomment the following line if
  # you are modifying the flex/bison src.
 -# LKC_GENPARSER := 1
 +LKC_GENPARSER := 1
 
  ifdef LKC_GENPARSER
 
 diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
 index 1199baf..cc9be0e 100644
 --- a/scripts/kconfig/conf.c
 +++ b/scripts/kconfig/conf.c
 @@ -211,6 +211,22 @@ static int conf_sym(struct menu *menu)
 
   while (1) {
   printf(%*s%s , indent - 1, , menu-prompt-text);
 + switch (sym-maturity) {
 + case M_EXPERIMENTAL:
 + printf((EXPERIMENTAL) );
 + break;
 + case M_DEPRECATED:
 + printf((DEPRECATED) );
 + break;
 + case M_OBSOLETE:
 + printf((OBSOLETE) );
 + break;
 + case M_BROKEN:
 + printf((BROKEN) );
 + break;
 + default:
 + break;
 + }
   if (sym-name)
   printf((%s) , sym-name);
   type = sym_get_type(sym);
 diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
 index 6084525..a22b6c1 100644
 --- a/scripts/kconfig/expr.h
 +++ b/scripts/kconfig/expr.h
 @@ -60,7 +60,11 @@ struct symbol_value {
  };
 
  enum symbol_type {
 - S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING, S_OTHER
 + S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING, S_MATURITY,
 S_OTHER
 +};
 +
 +enum maturity_level {
 + M_NONE, M_EXPERIMENTAL, M_DEPRECATED, M_OBSOLETE, M_BROKEN
  };
 
  enum {
 @@ -72,6 +76,7 @@ struct symbol {
   struct symbol *next;
   char *name;
   char *help;
 + enum maturity_level maturity;
   enum symbol_type type;
   struct symbol_value curr;
   struct symbol_value def[4];
 diff --git a/scripts/kconfig/lex.zconf.c_shipped
 b/scripts/kconfig/lex.zconf.c_shipped
 diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
 index 8a07ee4..9add1cd 100644
 --- a/scripts/kconfig/lkc.h
 +++ b/scripts/kconfig/lkc.h
 @@ -79,6 +79,7 @@ void menu_end_menu(void);
  void menu_add_entry(struct symbol *sym);
  void menu_end_entry(void);
  void menu_add_dep(struct expr *dep);
 +void menu_set_maturity(struct symbol *sym);
  struct property *menu_add_prop(enum prop_type type, char *prompt,
 struct expr *expr, struct expr *dep);
  struct property *menu_add_prompt(enum prop_type type, char *prompt,
 struct expr *dep);
  void menu_add_expr(enum prop_type type, struct expr *expr, struct expr
 *dep);
 diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
 index d0e4fa5..eaf199b 100644
 --- a/scripts/kconfig/mconf.c
 +++ b/scripts/kconfig/mconf.c
 @@ -238,6 +238,7 @@ search_help[] = N_(
   Result:\n
   -\n
   Symbol: FOO [=m]\n
 + Maturity: FOO\n
   Prompt: Foo bus is used to drive the bar HW\n
   Defined at drivers/pci/Kconfig:47\n
   Depends on: 

Re: [1/1] Block device throttling [Re: Distributed storage.]

2007-08-31 Thread Evgeniy Polyakov
Hi Daniel.

On Thu, Aug 30, 2007 at 04:20:35PM -0700, Daniel Phillips ([EMAIL PROTECTED]) 
wrote:
 On Wednesday 29 August 2007 01:53, Evgeniy Polyakov wrote:
  Then, if of course you will want, which I doubt, you can reread
  previous mails and find that it was pointed to that race and
  possibilities to solve it way too long ago.
 
 What still bothers me about your response is that, while you know the 
 race exists and do not disagree with my example, you don't seem to see 
 that that race can eventually lock up the block device by repeatedly 
 losing throttle counts which are never recovered.  What prevents that?

I posted a trivial hack with pointed possible errors and a question
about should it be further extended (and race fixed by any of the
possible methods and so on) or new one should be developed (like in your
approach when only high level device is charged), instead I got replies
that it contains bugs, whcih will stop system and kill gene pool of the
mankind. I know how it works and where problems are. And if we are going
with this approach I will fix pointed issues.

   --- 2.6.22.clean/block/ll_rw_blk.c2007-07-08 16:32:17.0
   -0700 +++ 2.6.22/block/ll_rw_blk.c2007-08-24 12:07:16.0
   -0700 @@ -3237,6 +3237,15 @@ end_io:
 */
void generic_make_request(struct bio *bio)
{
   + struct request_queue *q = bdev_get_queue(bio-bi_bdev);
   +
   + if (q  q-metric) {
   + int need = bio-bi_reserved = q-metric(bio);
   + bio-queue = q;
 
  In case you have stacked device, this entry will be rewritten and you
  will lost all your account data.
 
 It is a weakness all right.  Well,
 
 - if (q  q-metric) {
 + if (q  q-metric  !bio-queue) {
 
 which fixes that problem.  Maybe there is a better fix possible.  Thanks 
 for the catch!

Yes, it should.

 The original conception was that this block throttling would apply only 
 to the highest level submission of the bio, the one that crosses the 
 boundary between filesystem (or direct block device application) and 
 block layer.  Resubmitting a bio or submitting a dependent bio from 
 inside a block driver does not need to be throttled because all 
 resources required to guarantee completion must have been obtained 
 _before_ the bio was allowed to proceed into the block layer.

We still did not come to the conclusion, but I do not want to start a
flamewar, you believe that throttling must be done on the top level
device, so you need to extend bio and convince others that idea worth
it.

 The other principle we are trying to satisfy is that the throttling 
 should not be released until bio-endio, which I am not completely sure 
 about with the patch as modified above.  Your earlier idea of having 
 the throttle protection only cover the actual bio submission is 
 interesting and may be effective in some cases, in fact it may cover 
 the specific case of ddsnap.  But we don't have to look any further 
 than ddraid (distributed raid) to find a case it doesn't cover - the 
 additional memory allocated to hold parity data has to be reserved 
 until parity data is deallocated, long after the submission completes.
 So while you manage to avoid some logistical difficulties, it also looks 
 like you didn't solve the general problem.

Block layer does not know and should not be bothered with underlying
device nature - if you think that in endio callback limit should not be
rechardged, then provide your own layer on top of bio and thus call
endio callback only when you think it is ready to be completed.

 Hopefully I will be able to report on whether my patch actually works 
 soon, when I get back from vacation.  The mechanism in ddsnap this is 
 supposed to replace is effective, it is just ugly and tricky to verify.
 
 Regards,
 
 Daniel

-- 
Evgeniy Polyakov
-
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/, drivers/net/ , missing EXPERIMENTAL in menus

2007-08-31 Thread Robert P. J. Day
On Fri, 31 Aug 2007, Randy Dunlap wrote:

 On Thu, 19 Jul 2007 23:05:57 +0100 Simon Arlott wrote:

  On 19/07/07 17:19, Robert P. J. Day wrote:
   On Thu, 19 Jul 2007, Randy Dunlap wrote:
   I think that Stefan means a patch to the kconfig source code,
   not the the Kconfig files.  Good luck.  I'd still like to see it.
  
   yes, i understand what he wanted now.  as a first step (that
   theoretically shouldn't change any behaviour), i'd patch the Kconfig
   structure to add a new attribute (maturity) which would be allowed
   to be set to *exactly one* of a pre-defined set of values (say,
   OBSOLETE, DEPRECATED, EXPERIMENTAL, and STILLBLEEDING).  and that's
   it, nothing more.
  
   don't try to do anything with any of that just yet, just add the
   infrastructure to support the (optional) association of a maturity
   level with a config option.  that's step one.
 
  What about something like this? I'm not sure if the addition to sym_init
  is desirable... I also had to prefix _ to the name for now otherwise it
  conflicts badly with the current symbols. It probably should stop
  depends on _BROKEN etc. too.

i'm sure i'm going to get shouted down here, but i really disagree
with BROKEN being considered a maturity level.  IMHO, things like
EXPERIMENTAL, DEPRECATED and OBSOLETE represent maturity levels, for
what i think are obvious reasons.

something like BROKEN, though, has *nothing* to do with maturity.  a
feature can be any of those maturity levels, and simultaneously be
BROKEN.  i consider BROKEN to be what i call a status, and different
status levels might be the default of normal, or KIND_OF_FLAKY or
TOTALLY_BORKED -- that's where BROKEN would fit in.

*please* don't start mixing these different attributes.  it's just
going to make an irreversible mess of things.  leave BROKEN out of
this for the time being.

rday
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca

-
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 _minimum_ TCP retransmission timeout configurable take 2

2007-08-31 Thread Rick Jones

David Miller wrote:

From: Rick Jones [EMAIL PROTECTED]
Date: Thu, 30 Aug 2007 18:07:13 -0700


Anyhow, I'll try grubbing around the source code (already doing that to 
see about writing a pet tcp cong module) but if pointers to the likely 
relevant files were available I could try to help thrash-out the routing 
metric version.  Like I said the consumers of this are a triffle well, 
anxious :)



The change is actually a lot simpler than the sysctl version.

In fact it borders on trivial :-)

Signed-off-by: David S. Miller [EMAIL PROTECTED]

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index c91476c..dff3192 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -351,6 +351,8 @@ enum
 #define RTAX_INITCWND RTAX_INITCWND
RTAX_FEATURES,
 #define RTAX_FEATURES RTAX_FEATURES
+   RTAX_RTO_MIN,
+#define RTAX_RTO_MIN RTAX_RTO_MIN
__RTAX_MAX
 };
 
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c

index 9785df3..1ee7212 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -555,6 +555,16 @@ static void tcp_event_data_recv(struct sock *sk, struct 
sk_buff *skb)
tcp_grow_window(sk, skb);
 }
 
+static u32 tcp_rto_min(struct sock *sk)

+{
+   struct dst_entry *dst = __sk_dst_get(sk);
+   u32 rto_min = TCP_RTO_MIN;
+
+   if (dst_metric_locked(dst, RTAX_RTO_MIN))
+   rto_min = dst-metrics[RTAX_RTO_MIN-1];
+   return rto_min;
+}
+
 /* Called to compute a smoothed rtt estimate. The data fed to this
  * routine either comes from timestamps, or from segments that were
  * known _not_ to have been retransmitted [see Karn/Partridge
@@ -616,13 +626,13 @@ static void tcp_rtt_estimator(struct sock *sk, const 
__u32 mrtt)
if (tp-mdev_max  tp-rttvar)
tp-rttvar -= (tp-rttvar-tp-mdev_max)2;
tp-rtt_seq = tp-snd_nxt;
-   tp-mdev_max = TCP_RTO_MIN;
+   tp-mdev_max = tcp_rto_min(sk);
}
} else {
/* no previous measure. */
tp-srtt = m3;   /* take the measured time to be rtt */
tp-mdev = m1;   /* make sure rto = 3*rtt */
-   tp-mdev_max = tp-rttvar = max(tp-mdev, TCP_RTO_MIN);
+   tp-mdev_max = tp-rttvar = max(tp-mdev, tcp_rto_min(sk));
tp-rtt_seq = tp-snd_nxt;
}
 }


At the risk of showing my ignorance (what me worry about that?-) I 
presume this is then an interface expecting to take-in jiffies?  That 
means the user has to know the value of HZ which can be (IIRC) one of 
three different values?


rick jones
-
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/, drivers/net/ , missing EXPERIMENTAL in menus

2007-08-31 Thread Jeff Garzik

Robert P. J. Day wrote:

On Fri, 31 Aug 2007, Randy Dunlap wrote:


On Thu, 19 Jul 2007 23:05:57 +0100 Simon Arlott wrote:


On 19/07/07 17:19, Robert P. J. Day wrote:

On Thu, 19 Jul 2007, Randy Dunlap wrote:

I think that Stefan means a patch to the kconfig source code,
not the the Kconfig files.  Good luck.  I'd still like to see it.

yes, i understand what he wanted now.  as a first step (that
theoretically shouldn't change any behaviour), i'd patch the Kconfig
structure to add a new attribute (maturity) which would be allowed
to be set to *exactly one* of a pre-defined set of values (say,
OBSOLETE, DEPRECATED, EXPERIMENTAL, and STILLBLEEDING).  and that's
it, nothing more.

don't try to do anything with any of that just yet, just add the
infrastructure to support the (optional) association of a maturity
level with a config option.  that's step one.

What about something like this? I'm not sure if the addition to sym_init
is desirable... I also had to prefix _ to the name for now otherwise it
conflicts badly with the current symbols. It probably should stop
depends on _BROKEN etc. too.


i'm sure i'm going to get shouted down here, but i really disagree
with BROKEN being considered a maturity level.  IMHO, things like
EXPERIMENTAL, DEPRECATED and OBSOLETE represent maturity levels, for
what i think are obvious reasons.

something like BROKEN, though, has *nothing* to do with maturity.  a
feature can be any of those maturity levels, and simultaneously be
BROKEN.  i consider BROKEN to be what i call a status, and different
status levels might be the default of normal, or KIND_OF_FLAKY or
TOTALLY_BORKED -- that's where BROKEN would fit in.


BROKEN is definitely a maturity level.  A more accurate description 
would be BITROTTING perhaps.  The code in question has passed through 
bleeding - experimental - stable, and come out the other side.


In contrast, OBSOLETE and DEPRECATED reflect high-level status not code 
quality/maturity.


Jeff



-
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.6.24 2/3]S2io: Support for add/delete/store/restore ethernet addresses

2007-08-31 Thread David Miller
From: Jeff Garzik [EMAIL PROTECTED]
Date: Fri, 31 Aug 2007 09:28:23 -0400

 Sreenivasa Honnur wrote:
  - Support to add/delete/store/restore 64 and 128 Ethernet addresses for
  Xframe I and Xframe II respectively.
  
  Signed-off-by: Sreenivasa Honnur [EMAIL PROTECTED]
  Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]
 
 What is the purpose of this?  We do not support more than one unicast 
 MAC address at present...

Yes we do, the card can register with the card in -set_rx_mode() or
enable promiscuous mode if it has no alternate MAC facility.

See netdev-uc_list.
-
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.6.24 2/3]S2io: Support for add/delete/store/restore ethernet addresses

2007-08-31 Thread Jeff Garzik

David Miller wrote:

From: Jeff Garzik [EMAIL PROTECTED]
Date: Fri, 31 Aug 2007 09:28:23 -0400


Sreenivasa Honnur wrote:

- Support to add/delete/store/restore 64 and 128 Ethernet addresses for
Xframe I and Xframe II respectively.

Signed-off-by: Sreenivasa Honnur [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]
What is the purpose of this?  We do not support more than one unicast 
MAC address at present...


Yes we do, the card can register with the card in -set_rx_mode() or
enable promiscuous mode if it has no alternate MAC facility.

See netdev-uc_list.


Ah, well objection removed then.  I stand corrected.  Didn't know it was 
in yet.


Jeff



-
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-08-31 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:

 drivers/infiniband/hw/cxgb3/cxio_hal.c |2 +-
 drivers/net/cxgb3/adapter.h|2 +
 drivers/net/cxgb3/common.h |3 +-
 drivers/net/cxgb3/cxgb3_main.c |  252 +++-
 drivers/net/cxgb3/cxgb3_offload.c  |   16 ++-
 drivers/net/cxgb3/cxgb3_offload.h  |2 +
 drivers/net/cxgb3/sge.c|   23 ++-
 drivers/net/cxgb3/t3_hw.c  |   46 +-
 drivers/net/cxgb3/t3cdev.h |3 -
 drivers/net/ioc3-eth.c |   80 ---
 drivers/net/netxen/netxen_nic_hdr.h|6 +-
 drivers/net/netxen/netxen_nic_hw.c |8 +-
 drivers/net/netxen/netxen_nic_main.c   |   19 +--
 drivers/net/ps3_gelic_net.c|1 -
 drivers/s390/net/qeth.h|4 +-
 drivers/s390/net/qeth_main.c   |  158 +++-
 drivers/s390/net/qeth_mpc.h|1 +
 drivers/s390/net/qeth_sys.c|8 +-
 18 files changed, 428 insertions(+), 206 deletions(-)

Divy Le Ray (2):
  cxgb3 - Fix dev-priv usage
  - cxgb3 engine microcode load

Frank Blaschka (2):
  qeth: enforce a rate limit for inbound scatter gather messages
  qeth: Announce tx checksumming for qeth devices in TSO/EDDP mode

Heiko Carstens (1):
  qeth: dont return the return values of void functions.

Klaus D. Wacker (1):
  qeth: Drop ARP packages on HiperSockets interface with NOARP attribute.

Masakazu Mokuno (1):
  PS3: fix the bug that 'ifconfig down' would hang

Ralf Baechle (1):
  IOC3: Program UART predividers.

Ursula Braun (3):
  qeth: ungrouping a device must not be interruptible
  qeth: crash during reboot after failing online setting
  qeth: provide specific message for OSA-adapters exclusively used

[EMAIL PROTECTED] (2):
  netxen: Avoid firmware load in PCI probe
  netxen: fix crashes during module unload

diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c 
b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index 1518b41..beb2a38 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -916,7 +916,7 @@ int cxio_rdev_open(struct cxio_rdev *rdev_p)
PDBG(%s opening rnic dev %s\n, __FUNCTION__, rdev_p-dev_name);
memset(rdev_p-ctrl_qp, 0, sizeof(rdev_p-ctrl_qp));
if (!rdev_p-t3cdev_p)
-   rdev_p-t3cdev_p = T3CDEV(netdev_p);
+   rdev_p-t3cdev_p = dev2t3cdev(netdev_p);
rdev_p-t3cdev_p-ulp = (void *) rdev_p;
err = rdev_p-t3cdev_p-ctl(rdev_p-t3cdev_p, RDMA_GET_PARAMS,
 (rdev_p-rnic_info));
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index ab72563..20e887d 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -50,7 +50,9 @@ typedef irqreturn_t(*intr_handler_t) (int, void *);
 
 struct vlan_group;
 
+struct adapter;
 struct port_info {
+   struct adapter *adapter;
struct vlan_group *vlan_grp;
const struct port_type_info *port_type;
u8 port_id;
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index 1637800..2129210 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -679,7 +679,8 @@ const struct adapter_info *t3_get_adapter_info(unsigned int 
board_id);
 int t3_seeprom_read(struct adapter *adapter, u32 addr, u32 *data);
 int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data);
 int t3_seeprom_wp(struct adapter *adapter, int enable);
-int t3_check_tpsram_version(struct adapter *adapter);
+int t3_get_tp_version(struct adapter *adapter, u32 *vers);
+int t3_check_tpsram_version(struct adapter *adapter, int *must_load);
 int t3_check_tpsram(struct adapter *adapter, u8 *tp_ram, unsigned int size);
 int t3_set_proto_sram(struct adapter *adap, u8 *data);
 int t3_read_flash(struct adapter *adapter, unsigned int addr,
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index dc5d269..5ab319c 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -358,11 +358,14 @@ static int init_dummy_netdevs(struct adapter *adap)
 
for (j = 0; j  pi-nqsets - 1; j++) {
if (!adap-dummy_netdev[dummy_idx]) {
-   nd = alloc_netdev(0, , ether_setup);
+   struct port_info *p;
+
+   nd = alloc_netdev(sizeof(*p), , ether_setup);
if (!nd)
goto free_all;
 
-   nd-priv = adap;
+   p = netdev_priv(nd);
+   p-adapter = adap;
nd-weight = 64;
set_bit(__LINK_STATE_START, 

Re: [PATCH] make _minimum_ TCP retransmission timeout configurable take 2

2007-08-31 Thread David Miller
From: Rick Jones [EMAIL PROTECTED]
Date: Fri, 31 Aug 2007 11:11:37 -0700

 At the risk of showing my ignorance (what me worry about that?-) I 
 presume this is then an interface expecting to take-in jiffies?  That 
 means the user has to know the value of HZ which can be (IIRC) one of 
 three different values?

The iproute2 changes might look something like this:

--- ./include/linux/rtnetlink.h.orig2007-08-31 11:55:30.0 -0700
+++ ./include/linux/rtnetlink.h 2007-08-31 11:52:22.0 -0700
@@ -351,6 +351,8 @@ enum
 #define RTAX_INITCWND RTAX_INITCWND
RTAX_FEATURES,
 #define RTAX_FEATURES RTAX_FEATURES
+   RTAX_RTO_MIN,
+#define RTAX_RTO_MIN RTAX_RTO_MIN
__RTAX_MAX
 };
 
--- ./ip/iproute.c.orig 2007-08-31 11:55:30.0 -0700
+++ ./ip/iproute.c  2007-08-31 11:53:29.0 -0700
@@ -51,6 +51,7 @@ static const char *mx_names[RTAX_MAX+1] 
[RTAX_HOPLIMIT] = hoplimit,
[RTAX_INITCWND] = initcwnd,
[RTAX_FEATURES] = features,
+   [RTAX_RTO_MIN]  = rto_min,
 };
 static void usage(void) __attribute__((noreturn));
 
@@ -74,6 +75,7 @@ static void usage(void)
fprintf(stderr,[ rtt NUMBER ] [ rttvar NUMBER ]\n);
fprintf(stderr,[ window NUMBER] [ cwnd NUMBER ] [ initcwnd 
NUMBER ]\n);
fprintf(stderr,[ ssthresh NUMBER ] [ realms REALM ]\n);
+   fprintf(stderr,[ rto_min NUMBER ]\n);
fprintf(stderr, TYPE := [ unicast | local | broadcast | multicast | 
throw |\n);
fprintf(stderr,   unreachable | prohibit | blackhole | nat 
]\n);
fprintf(stderr, TABLE_ID := [ local | main | default | all | NUMBER 
]\n);
@@ -520,7 +522,8 @@ int print_route(const struct sockaddr_nl
if (mxlock  (1i))
fprintf(fp,  lock);
 
-   if (i != RTAX_RTT  i != RTAX_RTTVAR)
+   if (i != RTAX_RTT  i != RTAX_RTTVAR 
+   i != RTAX_RTO_MIN)
fprintf(fp,  %u, 
*(unsigned*)RTA_DATA(mxrta[i]));
else {
unsigned val = *(unsigned*)RTA_DATA(mxrta[i]);
@@ -528,7 +531,7 @@ int print_route(const struct sockaddr_nl
val *= 1000;
if (i == RTAX_RTT)
val /= 8;
-   else
+   else if (i == RTAX_RTTVAR)
val /= 4;
if (val = hz)
fprintf(fp,  %ums, val/hz);
@@ -803,6 +806,15 @@ int iproute_modify(int cmd, unsigned fla
if (get_unsigned(rtt, *argv, 0))
invarg(\rtt\ value is invalid\n, *argv);
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_RTT, rtt);
+   } else if (strcmp(*argv, rto_min) == 0) {
+   unsigned rto_min;
+   NEXT_ARG();
+   mxlock |= (1RTAX_RTO_MIN);
+   if (get_unsigned(rto_min, *argv, 0))
+   invarg(\rto_min\ value is invalid\n,
+  *argv);
+   rta_addattr32(mxrta, sizeof(mxbuf), RTAX_RTO_MIN,
+ rto_min);
} else if (matches(*argv, window) == 0) {
unsigned win;
NEXT_ARG();
-
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: net-2.6.24 rebased

2007-08-31 Thread David Miller
From: John W. Linville [EMAIL PROTECTED]
Date: Fri, 31 Aug 2007 09:44:32 -0400

 Sorry, I sent the patch through Jeff.
 
   
 http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/upstream-jgarzik/0010-rtl8187-remove-IEEE80211_HW_DATA_NULLFUNC_ACK.patch
 
 But, it sounds like you have taken care of it...?
 
 Let me know if I need to fix this.

Thanks for tracking this down, that is exactly the change
I checked into 2.6.24 so everything is good now.
-
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/, drivers/net/ , missing EXPERIMENTAL in menus

2007-08-31 Thread Jan Engelhardt

On Aug 31 2007 14:06, Jeff Garzik wrote:
 something like BROKEN, though, has *nothing* to do with maturity.  a
 feature can be any of those maturity levels, and simultaneously be
 BROKEN.  i consider BROKEN to be what i call a status, and different
 status levels might be the default of normal, or KIND_OF_FLAKY or
 TOTALLY_BORKED -- that's where BROKEN would fit in.

 BROKEN is definitely a maturity level.  A more accurate description would be
 BITROTTING perhaps.  The code in question has passed through bleeding -
 experimental - stable, and come out the other side.

Software is quite unlike the art of medicine. There, you would go from
'stable' to 'broken', then someone 'experiments' with you, and if
it's a bad day, you bleed out. :)


Jan
-- 
-
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] Fix e100 on systems that have cache incoherent DMA

2007-08-31 Thread David Acker
On the systems that have cache incoherent DMA, including ARM, there is a
race condition between software allocating a new receive buffer and hardware
writing into a buffer.  The two race on touching the last Receive Frame
Descriptor (RFD).  It has its el-bit set and its next link equal to 0.
When hardware encounters this buffer it attempts to write data to it and
then update Status Word bits and Actual Count in the RFD.  At the same time
software may try to clear the el-bit and set the link address to a new buffer.

Since the entire RFD is once cache-line, the two write operations can collide.
This can lead to the receive unit stalling or interpreting random memory as
its receive area.

The fix is to set the el-bit on and the size to 0 on the next to last buffer
in the chain.  When the hardware encounters this buffer it stops and does not
write to it at all.  The hardware issues an RNR interrupt with the receive
unit in the No Resources state.  Software can write to the tail of the list
because it knows hardware will stop on the previous descriptor that was
marked as the end of list.

Once it has a new next to last buffer prepared, it can clear the el-bit and
set the size on the previous one.  The race on this buffer is safe since
the link already points to a valid next buffer and the software can handle
the race setting the size (assuming aligned 16 bit writes are atomic with
respect to the DMA read). If the hardware sees the el-bit cleared without
the size set, it will move on to the next buffer and skip this one.  If it
sees the size set but the el-bit still set, it will complete that buffer
and then RNR interrupt and wait.

Flags are kept in the software descriptor to note if the el bit is set and if
the size was 0.  When software clears the RFD's el bit and set its size, it
also clears the el flag but leaves the size was 0 bit set.  This way software
can identify them when the race may have occurred when cleaning the ring.
On these descriptors, it looks ahead and if the next one is complete then
hardware must have skipped the current one.  Logic is added to prevent two
packets in a row being marked while the receiver is running to avoid running
in lockstep with the hardware and thereby limiting the required lookahead.

This is a patch for 2.6.23-rc4.

Signed-off-by: David Acker [EMAIL PROTECTED]

---

--- linux-2.6.23-rc4/drivers/net/e100.c.orig2007-08-30 13:32:10.0 
-0400
+++ linux-2.6.23-rc4/drivers/net/e100.c 2007-08-30 15:42:07.0 -0400
@@ -106,6 +106,13 @@
  * the RFD, the RFD must be dma_sync'ed to maintain a consistent
  * view from software and hardware.
  *
+ * In order to keep updates to the RFD link field from colliding with
+ * hardware writes to mark packets complete, we use the feature that
+ * hardware will not write to a size 0 descriptor and mark the previous
+ * packet as end-of-list (EL).   After updating the link, we remove EL
+ * and only then restore the size such that hardware may use the
+ * previous-to-end RFD. 
+ *
  * Under typical operation, the  receive unit (RU) is start once,
  * and the controller happily fills RFDs as frames arrive.  If
  * replacement RFDs cannot be allocated, or the RU goes non-active,
@@ -281,14 +288,14 @@ struct csr {
 };
 
 enum scb_status {
+   rus_no_res   = 0x08,
rus_ready= 0x10,
rus_mask = 0x3C,
 };
 
 enum ru_state  {
-   RU_SUSPENDED = 0,
-   RU_RUNNING   = 1,
-   RU_UNINITIALIZED = -1,
+   ru_stopped = 0,
+   ru_running = 1,
 };
 
 enum scb_stat_ack {
@@ -401,10 +408,16 @@ struct rfd {
u16 size;
 };
 
+enum rx_flags {
+   rx_el = 0x01,
+   rx_s0 = 0x02,
+};
+
 struct rx {
struct rx *next, *prev;
struct sk_buff *skb;
dma_addr_t dma_addr;
+   u8 flags;
 };
 
 #if defined(__BIG_ENDIAN_BITFIELD)
@@ -952,7 +965,7 @@ static void e100_get_defaults(struct nic
((nic-mac = mac_82558_D101_A4) ? cb_cid : cb_i));
 
/* Template for a freshly allocated RFD */
-   nic-blank_rfd.command = cpu_to_le16(cb_el);
+   nic-blank_rfd.command = 0;
nic-blank_rfd.rbd = 0x;
nic-blank_rfd.size = cpu_to_le16(VLAN_ETH_FRAME_LEN);
 
@@ -1753,18 +1766,48 @@ static int e100_alloc_cbs(struct nic *ni
return 0;
 }
 
-static inline void e100_start_receiver(struct nic *nic, struct rx *rx)
+static void e100_find_mark_el(struct nic *nic, struct rx *marked_rx, int 
is_running)
 {
-   if(!nic-rxs) return;
-   if(RU_SUSPENDED != nic-ru_running) return;
+   struct rx *rx = nic-rx_to_use-prev-prev;
+   struct rfd *rfd;
+
+   if (marked_rx == rx)
+   return;
+
+   rfd = (struct rfd *) rx-skb-data;
+   rfd-command |= cpu_to_le16(cb_el);
+   rfd-size = 0;
+   pci_dma_sync_single_for_device(nic-pdev, rx-dma_addr,
+   sizeof(struct rfd), PCI_DMA_BIDIRECTIONAL);
+   rx-flags |= (rx_el | rx_s0);
+
+ 

Re: [PATCH] make _minimum_ TCP retransmission timeout configurable take 2

2007-08-31 Thread Rick Jones
I managed to find iproute2 sources (they were debian lenny/testing 
2.6.20-1) and applied the patch, and figured-out how to add a host route 
back to one of my systems.  I then did a change to set rto_min to 300. 
I started a tcpdump and then a netperf, and then forces some 
retransmissions the old fashioned way - by pulling a cable :)  I then 
Ctrl-C'd netperf and at that point got this:


Unable to handle kernel NULL pointer dereference (address 0038)
swapper[0]: Oops 8813272891392 [1]
Modules linked in: ipv6 sg sr_mod cdrom dm_snapshot dm_mirror dm_mod 
loop button shpchp pci_hotplug joydev evdev ext3 jbd mbcache usb_storage 
usbhid hid ide_core mptspi mptscsih ehci_hcd cciss ohci_hcd mptbase 
scsi_transport_spi scsi_mod usbcore e1000 thermal processor fan


Pid: 0, CPU 3, comm:  swapper
psr : 101008026038 ifs : 8001 ip  : [a00100477600] 
   Not tainted

ip is at tcp_rto_min+0x20/0x40
unat:  pfs : 0307 rsc : 0003
rnat: e100f32917e0 bsps: e100f32917e8 pr  : 000166a5
ldrs:  ccv : 00010001 fpsr: 0009804c0270033f
csd :  ssd : 
b0  : a001004777f0 b6  : a00100230700 b7  : a00100452e40
f6  : 0 f7  : 1003e0002813f
f8  : 1003e001c06e2 f9  : 1003e043f
f10 : 1003e000fd24b f11 : 1003e0044b82fa09b5a53
r1  : a001009b2710 r2  :  r3  : e100fd317b40
r8  : 0032 r9  : 012c r10 : 0003
r11 : e00ff07b63a0 r12 : e100fd317b40 r13 : e100fd31
r14 :  r15 : 0038 r16 : 0068
r17 : e00ff07b6380 r18 : fa58 r19 : 8d769671
r20 : 8d769c19 r21 : e00ff07b62f0 r22 : 8d7712e1
r23 : e00ff07b62ec r24 : e00ff07b637c r25 : 012c
r26 : 0032 r27 : e00ff07b6438 r28 : e00ff07b5fc8
r29 : e00ff215bd80 r30 : e00ff07b60d0 r31 : e00ff07b6250

Call Trace:
 [a00100013700] show_stack+0x40/0xa0
sp=e100fd317710 bsp=e100fd311310
 [a00100014000] show_regs+0x840/0x880
sp=e100fd3178e0 bsp=e100fd3112b8
 [a001000351a0] die+0x1a0/0x2a0
sp=e100fd3178e0 bsp=e100fd311270
 [a001000579d0] ia64_do_page_fault+0x8d0/0xa00
sp=e100fd3178e0 bsp=e100fd311220
 [a001b0c0] ia64_leave_kernel+0x0/0x270
sp=e100fd317970 bsp=e100fd311220
 [a00100477600] tcp_rto_min+0x20/0x40
sp=e100fd317b40 bsp=e100fd311218
 [a001004777f0] tcp_rtt_estimator+0x1d0/0x280
sp=e100fd317b40 bsp=e100fd3111e0
 [a00100479110] tcp_ack_saw_tstamp+0x50/0xc0
sp=e100fd317b40 bsp=e100fd3111c0
 [a0010047d7a0] tcp_ack+0x13c0/0x4380
sp=e100fd317b40 bsp=e100fd311120
 [a00100486fa0] tcp_rcv_state_process+0x1420/0x2100
sp=e100fd317b60 bsp=e100fd3110d8
 [a00100498760] tcp_v4_do_rcv+0x960/0xa80
sp=e100fd317b60 bsp=e100fd311078
 [a0010049e830] tcp_v4_rcv+0x19d0/0x1b20
sp=e100fd317b70 bsp=e100fd311008
 [a001004542f0] ip_local_deliver+0x530/0x7c0
sp=e100fd317b70 bsp=e100fd310fd0
 [a00100453cb0] ip_rcv+0xe70/0xf80
sp=e100fd317b80 bsp=e100fd310f98
 [a001003fcb40] netif_receive_skb+0xa20/0xb80
sp=e100fd317ba0 bsp=e100fd310f50
 [a00213211c20] e1000_clean_rx_irq+0x9e0/0xc00 [e1000]
sp=e100fd317ba0 bsp=e100fd310e90
 [a0021320ce50] e1000_clean+0x130/0x6e0 [e1000]
sp=e100fd317ba0 bsp=e100fd310e38
 [a001004034c0] net_rx_action+0x1c0/0x540
sp=e100fd317bb0 bsp=e100fd310df0
 [a001000908f0] __do_softirq+0xf0/0x240
sp=e100fd317bc0 bsp=e100fd310d78
 [a00100090ab0] do_softirq+0x70/0xc0
sp=e100fd317bc0 bsp=e100fd310d18
 [a00100090ca0] irq_exit+0x80/0xa0
sp=e100fd317bc0 bsp=e100fd310d00
 [a00100010cc0] ia64_handle_irq+0x2a0/0x2e0
sp=e100fd317bc0 bsp=e100fd310cd0
 [a001b0c0] ia64_leave_kernel+0x0/0x270
sp=e100fd317bc0 bsp=e100fd310cd0
 [a001000142d0] default_idle+0x110/0x180
sp=e100fd317d90 bsp=e100fd310c90
 [a001000131b0] cpu_idle+0x210/0x2e0
 

  1   2   >