Netdev List
 help / color / mirror / Atom feed
* Re: net-2.6.24 breaks powerpc mysteriously
From: Paul Mackerras @ 2007-10-12  5:47 UTC (permalink / raw)
  To: David Miller; +Cc: akpm, netdev, sam, benh
In-Reply-To: <20071011.221845.63126874.davem@davemloft.net>

David Miller writes:

> Here is the patch I'm putting through some paces, let me know if
> it solves the powerpc problem.

Looks fine to me.

Acked-by: Paul Mackerras <paulus@samba.org>

Thanks!

^ permalink raw reply

* Re: [PATCH] tg3: Fix APE induced regression
From: Kyle McMartin @ 2007-10-12  5:44 UTC (permalink / raw)
  To: Matt Carlson; +Cc: netdev
In-Reply-To: <1192153431.4878.219.camel@teletran1>

On Thu, Oct 11, 2007 at 06:43:50PM -0700, Matt Carlson wrote:
> This patch fixes a bug caused by the recent APE support added for 5761
> devices.
> 
> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> 

Woot, thanks! This just bit me as I was testing git head on some of my
parisc boxes.

Cheers,
	Kyle

^ permalink raw reply

* Re: [RFD] iptables:  mangle table obsoletes filter table
From: Al Boldi @ 2007-10-12  5:37 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netfilter-devel, netdev, linux-net, linux-kernel
In-Reply-To: <470EF994.4080403@trash.net>

Patrick McHardy wrote:
> Please send mails discussing netfilter to netfilter-devel.

Ok.  I just found out this changed to vger.  But 
netfilter-devel@vger.kernel.org is bouncing me.

> Al Boldi wrote:
> > With the existence of the mangle table, how useful is the filter table?
> >
> > Other than requiring the REJECT target to be ported to the mangle table,
> > is the filter table faster than the mangle table?
>
> There are some minor differences in ordering (mangle comes before
> DNAT, filter afterwards), but for most rulesets thats completely
> irrelevant. The only difference that really matters is that mangle
> performs rerouting in LOCAL_OUT for packets that had their routing
> key changed, so its really a superset of the filter table. If you
> want to use REJECT in the mangle table, you just need to remove the
> restriction to filter, it works fine. I would prefer to also remove
> the restriction of MARK, CONNMARK etc. to mangle, they're used for
> more than just routing today so that restriction also doesn't make
> much sense. Patches for this are welcome.

Something like this (untested):

--- ipt_REJECT.bak.c    2007-10-12 08:25:17.000000000 +0300
+++ ipt_REJECT.c        2007-10-12 08:31:44.000000000 +0300
@@ -165,6 +165,7 @@ static void send_reset(struct sk_buff *o
 
 static inline void send_unreach(struct sk_buff *skb_in, int code)
 {
+       if (!skb_in->dst) ip_route_me_harder(&skb_in, RTN_UNSPEC);
        icmp_send(skb_in, ICMP_DEST_UNREACH, code, 0);
 }
 
@@ -245,9 +246,6 @@ static struct xt_target ipt_reject_reg =
        .family         = AF_INET,
        .target         = reject,
        .targetsize     = sizeof(struct ipt_reject_info),
-       .table          = "filter",
-       .hooks          = (1 << NF_IP_LOCAL_IN) | (1 << NF_IP_FORWARD) |
-                         (1 << NF_IP_LOCAL_OUT),
        .checkentry     = check,
        .me             = THIS_MODULE,
 };

> > If not, then shouldn't the filter table be obsoleted to avoid confusion?
>
> That would probably confuse people. Just don't use it if you don't
> need to.

The problem is that people think they are safe with the filter table, when in 
fact they need the prerouting chain to seal things.  Right now this is only 
possible in the mangle table.



Thanks!

--
Al


^ permalink raw reply

* Re: net-2.6.24 breaks powerpc mysteriously
From: David Miller @ 2007-10-12  5:18 UTC (permalink / raw)
  To: akpm; +Cc: paulus, netdev, sam, benh
In-Reply-To: <20071011.215429.108742994.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Thu, 11 Oct 2007 21:54:29 -0700 (PDT)

> From: Andrew Morton <akpm@linux-foundation.org>
> Date: Thu, 11 Oct 2007 21:25:39 -0700
> 
> > On Fri, 12 Oct 2007 13:52:14 +1000 Paul Mackerras <paulus@samba.org> wrote:
> > 
> > > So Andrew, what do you think is better - arch/powerpc/boot having its
> > > own copies of the zlib_inflate stuff, or #ifdefs of some kind in
> > > lib/zlib_inflate/*.c?
> > 
> > 
> > The latter - copying code is evil.  Keeping the existing code dual-mode
> > shouldn't be too hard - it's just a matter of people knowing about it.
> > 
> > Perhaps such code should be in its own suitably-named directory, but
> > whatever.
> 
> I'll work on a fix for this.

Here is the patch I'm putting through some paces, let me know if
it solves the powerpc problem.

Thanks!

>From 95702f93bac04b7db373e57fb606a6614c5bfcb4 Mon Sep 17 00:00:00 2001
From: David S. Miller <davem@sunset.davemloft.net>
Date: Thu, 11 Oct 2007 22:15:08 -0700
Subject: [PATCH] [ZLIB]: Fix external builds of zlib_inflate code.

Move zlib_inflate_blob() out into it's own source file,
infutil.c, so that things like the powerpc zImage builder
in arch/powerpc/boot/Makefile don't end up trying to
compile it.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 lib/zlib_inflate/Makefile  |    2 +-
 lib/zlib_inflate/inflate.c |   47 ------------------------------------------
 lib/zlib_inflate/infutil.c |   49 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 48 deletions(-)
 create mode 100644 lib/zlib_inflate/infutil.c

diff --git a/lib/zlib_inflate/Makefile b/lib/zlib_inflate/Makefile
index bf06548..49f8ce5 100644
--- a/lib/zlib_inflate/Makefile
+++ b/lib/zlib_inflate/Makefile
@@ -15,5 +15,5 @@
 
 obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate.o
 
-zlib_inflate-objs := inffast.o inflate.o \
+zlib_inflate-objs := inffast.o inflate.o infutil.o \
 		     inftrees.o inflate_syms.o
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c
index 0ad1ebf..f5ce87b 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib_inflate/inflate.c
@@ -916,50 +916,3 @@ int zlib_inflateIncomp(z_stream *z)
 
     return Z_OK;
 }
-
-#include <linux/errno.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-
-/* Utility function: initialize zlib, unpack binary blob, clean up zlib,
- * return len or negative error code. */
-int zlib_inflate_blob(void *gunzip_buf, unsigned sz, const void *buf, unsigned len)
-{
-	const u8 *zbuf = buf;
-	struct z_stream_s *strm;
-	int rc;
-
-	rc = -ENOMEM;
-	strm = kmalloc(sizeof(*strm), GFP_KERNEL);
-	if (strm == NULL)
-		goto gunzip_nomem1;
-	strm->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
-	if (strm->workspace == NULL)
-		goto gunzip_nomem2;
-
-	/* gzip header (1f,8b,08... 10 bytes total + possible asciz filename)
-	 * expected to be stripped from input */
-
-	strm->next_in = zbuf;
-	strm->avail_in = len;
-	strm->next_out = gunzip_buf;
-	strm->avail_out = sz;
-
-	rc = zlib_inflateInit2(strm, -MAX_WBITS);
-	if (rc == Z_OK) {
-		rc = zlib_inflate(strm, Z_FINISH);
-		/* after Z_FINISH, only Z_STREAM_END is "we unpacked it all" */
-		if (rc == Z_STREAM_END)
-			rc = sz - strm->avail_out;
-		else
-			rc = -EINVAL;
-		zlib_inflateEnd(strm);
-	} else
-		rc = -EINVAL;
-
-	kfree(strm->workspace);
-gunzip_nomem2:
-	kfree(strm);
-gunzip_nomem1:
-	return rc; /* returns Z_OK (0) if successful */
-}
diff --git a/lib/zlib_inflate/infutil.c b/lib/zlib_inflate/infutil.c
new file mode 100644
index 0000000..4824c2c
--- /dev/null
+++ b/lib/zlib_inflate/infutil.c
@@ -0,0 +1,49 @@
+#include <linux/zutil.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+
+/* Utility function: initialize zlib, unpack binary blob, clean up zlib,
+ * return len or negative error code.
+ */
+int zlib_inflate_blob(void *gunzip_buf, unsigned int sz,
+		      const void *buf, unsigned int len)
+{
+	const u8 *zbuf = buf;
+	struct z_stream_s *strm;
+	int rc;
+
+	rc = -ENOMEM;
+	strm = kmalloc(sizeof(*strm), GFP_KERNEL);
+	if (strm == NULL)
+		goto gunzip_nomem1;
+	strm->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+	if (strm->workspace == NULL)
+		goto gunzip_nomem2;
+
+	/* gzip header (1f,8b,08... 10 bytes total + possible asciz filename)
+	 * expected to be stripped from input
+	 */
+	strm->next_in = zbuf;
+	strm->avail_in = len;
+	strm->next_out = gunzip_buf;
+	strm->avail_out = sz;
+
+	rc = zlib_inflateInit2(strm, -MAX_WBITS);
+	if (rc == Z_OK) {
+		rc = zlib_inflate(strm, Z_FINISH);
+		/* after Z_FINISH, only Z_STREAM_END is "we unpacked it all" */
+		if (rc == Z_STREAM_END)
+			rc = sz - strm->avail_out;
+		else
+			rc = -EINVAL;
+		zlib_inflateEnd(strm);
+	} else
+		rc = -EINVAL;
+
+	kfree(strm->workspace);
+gunzip_nomem2:
+	kfree(strm);
+gunzip_nomem1:
+	return rc; /* returns Z_OK (0) if successful */
+}
-- 
1.5.3.3


^ permalink raw reply related

* [RFD] iptables:  mangle table obsoletes filter table
From: Al Boldi @ 2007-10-12  5:14 UTC (permalink / raw)
  To: netfilter-devel, netdev; +Cc: linux-net, linux-kernel

With the existence of the mangle table, how useful is the filter table?

Other than requiring the REJECT target to be ported to the mangle table, is
the filter table faster than the mangle table?

If not, then shouldn't the filter table be obsoleted to avoid confusion?


Thanks!

--
Al


^ permalink raw reply

* Re: net-2.6.24 breaks powerpc mysteriously
From: David Miller @ 2007-10-12  4:54 UTC (permalink / raw)
  To: akpm; +Cc: paulus, netdev, sam, benh
In-Reply-To: <20071011212539.8acafc63.akpm@linux-foundation.org>

From: Andrew Morton <akpm@linux-foundation.org>
Date: Thu, 11 Oct 2007 21:25:39 -0700

> On Fri, 12 Oct 2007 13:52:14 +1000 Paul Mackerras <paulus@samba.org> wrote:
> 
> > So Andrew, what do you think is better - arch/powerpc/boot having its
> > own copies of the zlib_inflate stuff, or #ifdefs of some kind in
> > lib/zlib_inflate/*.c?
> 
> 
> The latter - copying code is evil.  Keeping the existing code dual-mode
> shouldn't be too hard - it's just a matter of people knowing about it.
> 
> Perhaps such code should be in its own suitably-named directory, but
> whatever.

I'll work on a fix for this.

^ permalink raw reply

* Re: [RFD] iptables:  mangle table obsoletes filter table
From: Patrick McHardy @ 2007-10-12  4:39 UTC (permalink / raw)
  To: Al Boldi; +Cc: netfilter-devel, netdev
In-Reply-To: <470EF994.4080403@trash.net>

Patrick McHardy wrote:
> Please send mails discussing netfilter to netfilter-devel.

Correct address CCed and unrelated lists removed .. stupid
auto-completion :)

> Al Boldi wrote:
> 
>>With the existence of the mangle table, how useful is the filter table?
>>
>>Other than requiring the REJECT target to be ported to the mangle table, is 
>>the filter table faster than the mangle table?
> 
> 
> There are some minor differences in ordering (mangle comes before
> DNAT, filter afterwards), but for most rulesets thats completely
> irrelevant. The only difference that really matters is that mangle
> performs rerouting in LOCAL_OUT for packets that had their routing
> key changed, so its really a superset of the filter table. If you
> want to use REJECT in the mangle table, you just need to remove the
> restriction to filter, it works fine. I would prefer to also remove
> the restriction of MARK, CONNMARK etc. to mangle, they're used for
> more than just routing today so that restriction also doesn't make
> much sense. Patches for this are welcome.
> 
> 
>>If not, then shouldn't the filter table be obsoleted to avoid confusion?
> 
> 
> That would probably confuse people. Just don't use it if you don't
> need to.

^ permalink raw reply

* Re: [RFD] iptables:  mangle table obsoletes filter table
From: Patrick McHardy @ 2007-10-12  4:35 UTC (permalink / raw)
  To: Al Boldi
  Cc: netfilter-devel, netdev, linux-net, linux-kernel,
	Netfilter Development Mailinglist
In-Reply-To: <200710120031.42805.a1426z@gawab.com>

Please send mails discussing netfilter to netfilter-devel.

Al Boldi wrote:
> With the existence of the mangle table, how useful is the filter table?
> 
> Other than requiring the REJECT target to be ported to the mangle table, is 
> the filter table faster than the mangle table?

There are some minor differences in ordering (mangle comes before
DNAT, filter afterwards), but for most rulesets thats completely
irrelevant. The only difference that really matters is that mangle
performs rerouting in LOCAL_OUT for packets that had their routing
key changed, so its really a superset of the filter table. If you
want to use REJECT in the mangle table, you just need to remove the
restriction to filter, it works fine. I would prefer to also remove
the restriction of MARK, CONNMARK etc. to mangle, they're used for
more than just routing today so that restriction also doesn't make
much sense. Patches for this are welcome.

> If not, then shouldn't the filter table be obsoleted to avoid confusion?

That would probably confuse people. Just don't use it if you don't
need to.

^ permalink raw reply

* Re: net-2.6.24 breaks powerpc mysteriously
From: Andrew Morton @ 2007-10-12  4:25 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: netdev, Sam Ravnborg, Benjamin Herrenschmidt, David S. Miller
In-Reply-To: <18190.61294.191189.193153@cargo.ozlabs.ibm.com>

On Fri, 12 Oct 2007 13:52:14 +1000 Paul Mackerras <paulus@samba.org> wrote:

> So Andrew, what do you think is better - arch/powerpc/boot having its
> own copies of the zlib_inflate stuff, or #ifdefs of some kind in
> lib/zlib_inflate/*.c?


The latter - copying code is evil.  Keeping the existing code dual-mode
shouldn't be too hard - it's just a matter of people knowing about it.

Perhaps such code should be in its own suitably-named directory, but
whatever.

^ permalink raw reply

* Re: net-2.6.24 breaks powerpc mysteriously
From: Paul Mackerras @ 2007-10-12  3:52 UTC (permalink / raw)
  To: Andrew Morton
  Cc: netdev, Sam Ravnborg, Benjamin Herrenschmidt, David S. Miller
In-Reply-To: <20071011192233.23e1c6bc.akpm@linux-foundation.org>

Andrew Morton writes:

> arch/powerpc/boot/inflate.c:920:19: errno.h: No such file or directory
> arch/powerpc/boot/inflate.c:921:18: slab.h: No such file or directory
> arch/powerpc/boot/inflate.c:922:21: vmalloc.h: No such file or directory

We used to have our own copies of inflate.c etc. for the zImage
wrapper code to use under arch/powerpc/boot.  Then someone said "why
do we have two copies of these files?" and did a patch to make the
build process copy the files from lib/zlib_inflate over and compile
them.  (We can't just use the compiled .o files from lib/zlib_inflate
because the wrapper is 32-bit whereas the kernel is often 64-bit.)

Now it seems someone has made changes to the lib/zlib_inflate versions
that are OK in the context of the kernel but not in the zImage (which
is a separate program).  Avoiding this kind of breakage was the reason
why I made arch/powerpc/boot have its own copies originally.

So Andrew, what do you think is better - arch/powerpc/boot having its
own copies of the zlib_inflate stuff, or #ifdefs of some kind in
lib/zlib_inflate/*.c?

Paul.

^ permalink raw reply

* Re: net-2.6.24 breaks powerpc mysteriously
From: Paul Mackerras @ 2007-10-12  4:09 UTC (permalink / raw)
  To: David Miller; +Cc: akpm, netdev, sam, benh, vda.linux
In-Reply-To: <20071011.194543.75428024.davem@davemloft.net>

David Miller writes:

> The only thing we touched in zlib is in the patch below.
> 
> I suspect the lib/zlib_inflate/inflate.c changes, I had no idea that
> some pieces of code try to use this into userspace.

Not userspace; the zImage wrapper uses inflate.c to gunzip the
compressed kernel image.  It is a separate program to the kernel,
however, and is compiled in an environment where the headers it uses
are not the kernel headers.

> I supposed a hacky fix is to add __KERNEL__ ifdef protection around
> zlib_inflate_blob() and those troublesome includes.  A nicer fix is

That would do, but I don't see why zlib_inflate_blob had to be added
to inflate.c rather than being in a new file under lib/zlib_inflate.
If nothing else, that bloats configs that currently use inflate.c (in
the kernel) but don't need zlib_inflate_blob() - which would be all
the existing uses. :)

Paul.

^ permalink raw reply

* Re: [PATCH] rtnl: Simplify ASSERT_RTNL
From: Eric W. Biederman @ 2007-10-12  3:15 UTC (permalink / raw)
  To: David Miller; +Cc: herbert, netdev, kaber
In-Reply-To: <20071011.173046.66166737.davem@davemloft.net>


David, all.  My apologies. I'm tired and I don't have the energy to
grok yet another part of the kernel right now.  So I can not
productively participate in this discussion.

I do agree that the locking below dev_unicast_add() that was exposed
by the macvlan driver is unmaintainable even if it is currently
correct.

I don't see any fundamental problems with adding a might_sleep(),
ASSERT_RTNL.

I just don't have the energy to audit everything I feel I would have
to audit to be comfortable taking responsibility for adding the
might_sleep() or fixing the locking in dev_unicast_add() (which seems
more important).

So again my apologies.  This is all beyond what I can deal with at the moment.

Eric

^ permalink raw reply

* Re: [PATCH] tg3: Fix APE induced regression
From: David Miller @ 2007-10-12  2:46 UTC (permalink / raw)
  To: mcarlson; +Cc: netdev, andy, mchan
In-Reply-To: <1192153431.4878.219.camel@teletran1>

From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Thu, 11 Oct 2007 18:43:50 -0700

> This patch fixes a bug caused by the recent APE support added for 5761
> devices.
> 
> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>

Thanks for this fix Matt, I'll apply it soon.

^ permalink raw reply

* Re: net-2.6.24 breaks powerpc mysteriously
From: David Miller @ 2007-10-12  2:45 UTC (permalink / raw)
  To: akpm; +Cc: netdev, sam, paulus, benh, vda.linux
In-Reply-To: <20071011192233.23e1c6bc.akpm@linux-foundation.org>

From: Andrew Morton <akpm@linux-foundation.org>
Date: Thu, 11 Oct 2007 19:22:33 -0700

> With net-2.6.24 (pulled yesterday) applied:
> 
> g5:/usr/src/25> ml arch/powerpc/boot/inflate.o
>   Using ARCH=powerpc CROSS_COMPILE=
>   CHK     include/linux/version.h
>   CHK     include/linux/utsrelease.h
>   CALL    scripts/checksyscalls.sh
>   BOOTCC  arch/powerpc/boot/inflate.o
> arch/powerpc/boot/inflate.c:920:19: errno.h: No such file or directory
> arch/powerpc/boot/inflate.c:921:18: slab.h: No such file or directory
> arch/powerpc/boot/inflate.c:922:21: vmalloc.h: No such file or directory
> arch/powerpc/boot/inflate.c: In function `zlib_inflate_blob':
> arch/powerpc/boot/inflate.c:928: error: syntax error before '*' token

The only thing we touched in zlib is in the patch below.

I suspect the lib/zlib_inflate/inflate.c changes, I had no idea that
some pieces of code try to use this into userspace.

I supposed a hacky fix is to add __KERNEL__ ifdef protection around
zlib_inflate_blob() and those troublesome includes.  A nicer fix is
probably to change the zlib_inflate_blob() interface to pass in
pointers to alloc() and free() routines instead of calling kernel ones
directly.

Denys?

commit 8336793baf962163c9fab5a3f39614295fdbab27
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date:   Sun Sep 30 17:56:49 2007 -0700

    [ZLIB]: Move bnx2 driver gzip unpacker into zlib.
    
    Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
    Acked-by: Michael Chan <mchan@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 73d4a57..6d6ea56 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2761,48 +2761,6 @@ bnx2_set_rx_mode(struct net_device *dev)
 	spin_unlock_bh(&bp->phy_lock);
 }
 
-/* To be moved to generic lib/ */
-static int
-bnx2_gunzip(void *gunzip_buf, unsigned sz, u8 *zbuf, int len)
-{
-	struct z_stream_s *strm;
-	int rc;
-
-	/* gzip header (1f,8b,08... 10 bytes total + possible asciz filename)
-	 * is stripped */
-
-	rc = -ENOMEM;
-	strm = kmalloc(sizeof(*strm), GFP_KERNEL);
-	if (strm == NULL)
-		goto gunzip_nomem2;
-	strm->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
-	if (strm->workspace == NULL)
-		goto gunzip_nomem3;
-
-	strm->next_in = zbuf;
-	strm->avail_in = len;
-	strm->next_out = gunzip_buf;
-	strm->avail_out = sz;
-
-	rc = zlib_inflateInit2(strm, -MAX_WBITS);
-	if (rc == Z_OK) {
-		rc = zlib_inflate(strm, Z_FINISH);
-		/* after Z_FINISH, only Z_STREAM_END is "we unpacked it all" */
-		if (rc == Z_STREAM_END)
-			rc = sz - strm->avail_out;
-		else
-			rc = -EINVAL;
-		zlib_inflateEnd(strm);
-	} else
-		rc = -EINVAL;
-
-	kfree(strm->workspace);
-gunzip_nomem3:
-	kfree(strm);
-gunzip_nomem2:
-	return rc;
-}
-
 static void
 load_rv2p_fw(struct bnx2 *bp, u32 *rv2p_code, u32 rv2p_code_len,
 	u32 rv2p_proc)
@@ -2858,7 +2816,7 @@ load_cpu_fw(struct bnx2 *bp, struct cpu_reg *cpu_reg, struct fw_info *fw)
 		text = vmalloc(FW_BUF_SIZE);
 		if (!text)
 			return -ENOMEM;
-		rc = bnx2_gunzip(text, FW_BUF_SIZE, fw->gz_text, fw->gz_text_len);
+		rc = zlib_inflate_blob(text, FW_BUF_SIZE, fw->gz_text, fw->gz_text_len);
 		if (rc < 0) {
 			vfree(text);
 			return rc;
@@ -2935,14 +2893,14 @@ bnx2_init_cpus(struct bnx2 *bp)
 	text = vmalloc(FW_BUF_SIZE);
 	if (!text)
 		return -ENOMEM;
-	rc = bnx2_gunzip(text, FW_BUF_SIZE, bnx2_rv2p_proc1, sizeof(bnx2_rv2p_proc1));
+	rc = zlib_inflate_blob(text, FW_BUF_SIZE, bnx2_rv2p_proc1, sizeof(bnx2_rv2p_proc1));
 	if (rc < 0) {
 		vfree(text);
 		goto init_cpu_err;
 	}
 	load_rv2p_fw(bp, text, rc /* == len */, RV2P_PROC1);
 
-	rc = bnx2_gunzip(text, FW_BUF_SIZE, bnx2_rv2p_proc2, sizeof(bnx2_rv2p_proc2));
+	rc = zlib_inflate_blob(text, FW_BUF_SIZE, bnx2_rv2p_proc2, sizeof(bnx2_rv2p_proc2));
 	if (rc < 0) {
 		vfree(text);
 		goto init_cpu_err;
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 9e3192a..40c49cb 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -82,7 +82,7 @@
 struct internal_state;
 
 typedef struct z_stream_s {
-    Byte    *next_in;   /* next input byte */
+    const Byte *next_in;   /* next input byte */
     uInt     avail_in;  /* number of bytes available at next_in */
     uLong    total_in;  /* total nb of input bytes read so far */
 
@@ -699,4 +699,8 @@ extern int zlib_inflateInit2(z_streamp strm, int  windowBits);
     struct internal_state {int dummy;}; /* hack for buggy compilers */
 #endif
 
+/* Utility function: initialize zlib, unpack binary blob, clean up zlib,
+ * return len or negative error code. */
+extern int zlib_inflate_blob(void *dst, unsigned dst_sz, const void *src, unsigned src_sz);
+
 #endif /* _ZLIB_H */
diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib_inflate/inffast.c
index d84560c..8550b0c 100644
--- a/lib/zlib_inflate/inffast.c
+++ b/lib/zlib_inflate/inffast.c
@@ -69,22 +69,22 @@
 void inflate_fast(z_streamp strm, unsigned start)
 {
     struct inflate_state *state;
-    unsigned char *in;      /* local strm->next_in */
-    unsigned char *last;    /* while in < last, enough input available */
-    unsigned char *out;     /* local strm->next_out */
-    unsigned char *beg;     /* inflate()'s initial strm->next_out */
-    unsigned char *end;     /* while out < end, enough space available */
+    const unsigned char *in;    /* local strm->next_in */
+    const unsigned char *last;  /* while in < last, enough input available */
+    unsigned char *out;         /* local strm->next_out */
+    unsigned char *beg;         /* inflate()'s initial strm->next_out */
+    unsigned char *end;         /* while out < end, enough space available */
 #ifdef INFLATE_STRICT
     unsigned dmax;              /* maximum distance from zlib header */
 #endif
     unsigned wsize;             /* window size or zero if not using window */
     unsigned whave;             /* valid bytes in the window */
     unsigned write;             /* window write index */
-    unsigned char *window;  /* allocated sliding window, if wsize != 0 */
+    unsigned char *window;      /* allocated sliding window, if wsize != 0 */
     unsigned long hold;         /* local strm->hold */
     unsigned bits;              /* local strm->bits */
-    code const *lcode;      /* local strm->lencode */
-    code const *dcode;      /* local strm->distcode */
+    code const *lcode;          /* local strm->lencode */
+    code const *dcode;          /* local strm->distcode */
     unsigned lmask;             /* mask for first level of length codes */
     unsigned dmask;             /* mask for first level of distance codes */
     code this;                  /* retrieved table entry */
@@ -92,7 +92,7 @@ void inflate_fast(z_streamp strm, unsigned start)
                                 /*  window position, window bytes to copy */
     unsigned len;               /* match length, unused bytes */
     unsigned dist;              /* match distance */
-    unsigned char *from;    /* where to copy match from */
+    unsigned char *from;        /* where to copy match from */
 
     /* copy state to local variables */
     state = (struct inflate_state *)strm->state;
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c
index 7e1e311..0ad1ebf 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib_inflate/inflate.c
@@ -332,14 +332,14 @@ static int zlib_inflateSyncPacket(z_streamp strm)
 int zlib_inflate(z_streamp strm, int flush)
 {
     struct inflate_state *state;
-    unsigned char *next;    /* next input */
-    unsigned char *put;     /* next output */
+    const unsigned char *next;  /* next input */
+    unsigned char *put;         /* next output */
     unsigned have, left;        /* available input and output */
     unsigned long hold;         /* bit buffer */
     unsigned bits;              /* bits in bit buffer */
     unsigned in, out;           /* save starting available input and output */
     unsigned copy;              /* number of stored or match bytes to copy */
-    unsigned char *from;    /* where to copy match bytes from */
+    unsigned char *from;        /* where to copy match bytes from */
     code this;                  /* current decoding table entry */
     code last;                  /* parent table entry */
     unsigned len;               /* length to copy for repeats, bits to drop */
@@ -897,7 +897,7 @@ int zlib_inflateIncomp(z_stream *z)
 
     /* Setup some variables to allow misuse of updateWindow */
     z->avail_out = 0;
-    z->next_out = z->next_in + z->avail_in;
+    z->next_out = (unsigned char*)z->next_in + z->avail_in;
 
     zlib_updatewindow(z, z->avail_in);
 
@@ -916,3 +916,50 @@ int zlib_inflateIncomp(z_stream *z)
 
     return Z_OK;
 }
+
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+
+/* Utility function: initialize zlib, unpack binary blob, clean up zlib,
+ * return len or negative error code. */
+int zlib_inflate_blob(void *gunzip_buf, unsigned sz, const void *buf, unsigned len)
+{
+	const u8 *zbuf = buf;
+	struct z_stream_s *strm;
+	int rc;
+
+	rc = -ENOMEM;
+	strm = kmalloc(sizeof(*strm), GFP_KERNEL);
+	if (strm == NULL)
+		goto gunzip_nomem1;
+	strm->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+	if (strm->workspace == NULL)
+		goto gunzip_nomem2;
+
+	/* gzip header (1f,8b,08... 10 bytes total + possible asciz filename)
+	 * expected to be stripped from input */
+
+	strm->next_in = zbuf;
+	strm->avail_in = len;
+	strm->next_out = gunzip_buf;
+	strm->avail_out = sz;
+
+	rc = zlib_inflateInit2(strm, -MAX_WBITS);
+	if (rc == Z_OK) {
+		rc = zlib_inflate(strm, Z_FINISH);
+		/* after Z_FINISH, only Z_STREAM_END is "we unpacked it all" */
+		if (rc == Z_STREAM_END)
+			rc = sz - strm->avail_out;
+		else
+			rc = -EINVAL;
+		zlib_inflateEnd(strm);
+	} else
+		rc = -EINVAL;
+
+	kfree(strm->workspace);
+gunzip_nomem2:
+	kfree(strm);
+gunzip_nomem1:
+	return rc; /* returns Z_OK (0) if successful */
+}
diff --git a/lib/zlib_inflate/inflate_syms.c b/lib/zlib_inflate/inflate_syms.c
index 2061d4f..67329fe 100644
--- a/lib/zlib_inflate/inflate_syms.c
+++ b/lib/zlib_inflate/inflate_syms.c
@@ -16,4 +16,5 @@ EXPORT_SYMBOL(zlib_inflateInit2);
 EXPORT_SYMBOL(zlib_inflateEnd);
 EXPORT_SYMBOL(zlib_inflateReset);
 EXPORT_SYMBOL(zlib_inflateIncomp); 
+EXPORT_SYMBOL(zlib_inflate_blob);
 MODULE_LICENSE("GPL");

^ permalink raw reply related

* [PATCH] forcedeth: Fix MAC address detection on network card (regression in 2.6.23)
From: Michael Pyne @ 2007-10-12  2:42 UTC (permalink / raw)
  To: Andrew Morton, Jeff Garzik; +Cc: netdev

Partially revert a change to mac address detection introduced to the forcedeth 
driver.  The change was intended to correct mac address detection for newer 
nVidia chipsets where the mac address was stored in reverse order.  One of 
those chipsets appears to still have the mac address in reverse order (or at 
least, it does on my system).

Signed-off-by: Michael J. Pyne <michael.pyne@kdemail.net>
---
The change that broke mac address detection for my card was commit 
ef756b3e56c68a4d76d9d7b9a73fa8f4f739180f "forcedeth: mac address correct"

My network card is an nVidia built-in Ethernet card, output from lspci as 
follows (with text and numeric ids):
$ lspci | grep Ethernet
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
$ lspci -n | grep 07.0
00:07.0 0680: 10de:03ef (rev a2)

The vendor id is, of course, nVidia.  The device id corresponds to the 
NVIDIA_NVENET_19 entry.

The included patch fixes the MAC address detection on my system.  
Interestingly, the MAC address appears to be in the range reserved for my 
motherboard manufacturer (Gigabyte) and not nVidia.

If you need any further information about my hardware configuration just let 
me know.

Regards,
 - Michael Pyne

--- a/drivers/net/forcedeth.c       2007-10-11 22:01:26 -0400
+++ b/drivers/net/forcedeth-new.c   2007-10-11 22:06:52 -0400
@@ -5513,7 +5513,7 @@ static struct pci_device_id pci_tbl[] = 
 	},
 	{	/* MCP61 Ethernet Controller */
 		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_19),
-		.driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|
DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|
DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
+		.driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|
DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|
DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
 	},
 	{	/* MCP65 Ethernet Controller */
 		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_20),

^ permalink raw reply

* Re: Regression in net-2.6.24?
From: David Miller @ 2007-10-12  2:40 UTC (permalink / raw)
  To: mchan; +Cc: shemminger, takano, netdev, ilpo.jarvinen
In-Reply-To: <1192159036.6889.6.camel@dell>

From: "Michael Chan" <mchan@broadcom.com>
Date: Thu, 11 Oct 2007 20:17:16 -0700

> On Thu, 2007-10-11 at 18:14 -0700, David Miller wrote:
> > +       while (1) {
> > +               work_done = tg3_poll_work(tp, work_done, budget);
> > +
> > +               if (unlikely(tp->tg3_flags & TG3_FLAG_TX_RECOVERY_PENDING))
> > +                       goto tx_recovery;
> > +
> > +               if (unlikely(work_done >= budget))
> > +                       break;
> > +
> > +               if (likely(!tg3_has_work(tp))) {
> > +                       struct tg3_hw_status *sblk = tp->hw_status;
> > +
> 
> --> new status block DMA
> 
> > +                       if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) {
> > +                               tp->last_tag = sblk->status_tag;
> > +                               rmb();
> > +                       } else
> > +                               sblk->status &= ~SD_STATUS_UPDATED;
> 
> We need to read the sblk->status_tag before calling tg3_has_work().  If
> a new status block DMA happens in between (shown above), tp->last_tag
> will get the new tag and we will end up acknowledging work that we
> haven't processed.

Hmmm, the old code didn't do that and seemingly has the same
problem.  Also, if you look at the before-patch code and think
about what it does if we ->poll() multiple times for a single
interrupt the side-effects are essentially the same.

What's the crucial difference?

> I'll go over this some more tonight and will send a patch to refine it.

Thanks Michael.

^ permalink raw reply

* net-2.6.24 breaks powerpc mysteriously
From: Andrew Morton @ 2007-10-12  2:22 UTC (permalink / raw)
  To: netdev, Sam Ravnborg, Paul Mackerras, Benjamin Herrenschmidt,
	David S. Miller

With net-2.6.24 (pulled yesterday) applied:

g5:/usr/src/25> ml arch/powerpc/boot/inflate.o
  Using ARCH=powerpc CROSS_COMPILE=
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CALL    scripts/checksyscalls.sh
  BOOTCC  arch/powerpc/boot/inflate.o
arch/powerpc/boot/inflate.c:920:19: errno.h: No such file or directory
arch/powerpc/boot/inflate.c:921:18: slab.h: No such file or directory
arch/powerpc/boot/inflate.c:922:21: vmalloc.h: No such file or directory
arch/powerpc/boot/inflate.c: In function `zlib_inflate_blob':
arch/powerpc/boot/inflate.c:928: error: syntax error before '*' token
arch/powerpc/boot/inflate.c:932: error: `ENOMEM' undeclared (first use in this function)
arch/powerpc/boot/inflate.c:932: error: (Each undeclared identifier is reported only once
arch/powerpc/boot/inflate.c:932: error: for each function it appears in.)
arch/powerpc/boot/inflate.c:933: warning: implicit declaration of function `kmalloc'
arch/powerpc/boot/inflate.c:933: error: `GFP_KERNEL' undeclared (first use in this function)
arch/powerpc/boot/inflate.c:933: warning: assignment makes pointer from integer without a cast
arch/powerpc/boot/inflate.c:936: warning: assignment makes pointer from integer without a cast
arch/powerpc/boot/inflate.c:943: error: `zbuf' undeclared (first use in this function)
arch/powerpc/boot/inflate.c:955: error: `EINVAL' undeclared (first use in this function)
arch/powerpc/boot/inflate.c:960: warning: implicit declaration of function `kfree'

without it applied:

g5:/usr/src/25> ml arch/powerpc/boot/inflate.o
scripts/kconfig/conf -s arch/powerpc/Kconfig
#
# configuration written to .config
#
  Using ARCH=powerpc CROSS_COMPILE=
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTLD  scripts/mod/modpost
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CC      arch/powerpc/kernel/asm-offsets.s
  GEN     include/asm-powerpc/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  COPY    arch/powerpc/boot/zlib.h
  COPY    arch/powerpc/boot/inflate.c
  BOOTCC  arch/powerpc/boot/inflate.o
.config:308:warning: trying to assign nonexistent symbol INET_LRO
.config:638:warning: trying to assign nonexistent symbol VETH
.config:639:warning: trying to assign nonexistent symbol IP1000

Note that those two COPY commands didn't happen with net-2.6.24 applied, although
that might be because `make' decided they were already performed, dunno.

I also have today's git-kbuild applied here, as well as yesterday's git-powerpc.

But I have enough to fix here so I'm going to do a report-and-run on this one.
I'll release 2.6.23-mm1 in this state for your bug-hunting convenience ;)

^ permalink raw reply

* Re: Regression in net-2.6.24?
From: Michael Chan @ 2007-10-12  3:17 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, takano, netdev, ilpo.jarvinen
In-Reply-To: <20071011.181449.130846976.davem@davemloft.net>

On Thu, 2007-10-11 at 18:14 -0700, David Miller wrote:
> +       while (1) {
> +               work_done = tg3_poll_work(tp, work_done, budget);
> +
> +               if (unlikely(tp->tg3_flags & TG3_FLAG_TX_RECOVERY_PENDING))
> +                       goto tx_recovery;
> +
> +               if (unlikely(work_done >= budget))
> +                       break;
> +
> +               if (likely(!tg3_has_work(tp))) {
> +                       struct tg3_hw_status *sblk = tp->hw_status;
> +

--> new status block DMA

> +                       if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) {
> +                               tp->last_tag = sblk->status_tag;
> +                               rmb();
> +                       } else
> +                               sblk->status &= ~SD_STATUS_UPDATED;

We need to read the sblk->status_tag before calling tg3_has_work().  If
a new status block DMA happens in between (shown above), tp->last_tag
will get the new tag and we will end up acknowledging work that we
haven't processed.

I'll go over this some more tonight and will send a patch to refine it.
Thanks.

> +
> +                       netif_rx_complete(tp->dev, napi);
> +                       tg3_restart_ints(tp);
> +                       break;
> +               }


^ permalink raw reply

* [PATCH] tg3: Fix APE induced regression
From: Matt Carlson @ 2007-10-12  1:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, andy, Michael Chan

This patch fixes a bug caused by the recent APE support added for 5761
devices.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index d2b30fb..e978a79 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6966,9 +6966,10 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 		break;
 	};
 
-	/* Write our heartbeat update interval to APE. */
-	tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_INT_MS,
-			APE_HOST_HEARTBEAT_INT_DISABLE);
+	if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
+		/* Write our heartbeat update interval to APE. */
+		tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_INT_MS,
+				APE_HOST_HEARTBEAT_INT_DISABLE);
 
 	tg3_write_sig_post_reset(tp, RESET_KIND_INIT);
 



^ permalink raw reply related

* Re: [PATCH 1/6] sky2: status polling loop (post merge)
From: Stephen Hemminger @ 2007-10-12  1:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20071011.183146.39159626.davem@davemloft.net>

On Thu, 11 Oct 2007 18:31:46 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Thu, 11 Oct 2007 18:29:21 -0700
> 
> > Handle the corner case where budget is exhausted correctly.
> > And save unnecessary read of index register.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
> 
> Applied.
> 
> You can submit the rest later, I deleted them since they
> likely depend upon line offsets and other things in this
> patch.

Actually, they are exactly the same...

-- 
Stephen Hemminger <shemminger@linux-foundation.org>

^ permalink raw reply

* Re: [PATCH 1/6] sky2: status polling loop (post merge)
From: David Miller @ 2007-10-12  1:31 UTC (permalink / raw)
  To: shemminger; +Cc: netdev
In-Reply-To: <20071011182921.1b20505c@freepuppy.rosehill>

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Thu, 11 Oct 2007 18:29:21 -0700

> Handle the corner case where budget is exhausted correctly.
> And save unnecessary read of index register.
> 
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

Applied.

You can submit the rest later, I deleted them since they
likely depend upon line offsets and other things in this
patch.

^ permalink raw reply

* Re: Question on TSO maximum segment sizes.
From: Ben Greear @ 2007-10-12  1:29 UTC (permalink / raw)
  To: John Heffner; +Cc: netdev
In-Reply-To: <470ECC71.1070303@psc.edu>

John Heffner wrote:
> Ben Greear wrote:
>> I just tried turning off my explicit SO_SNDBUF/SO_RCVBUG settings in 
>> my app,
>> and the connection ran very poorly through a link with even a small
>> bit of latency (~2-4ms I believe).
> 
> I often run at full gigabit or faster with latencies of 100+ ms.  Can 
> you give a bit more detail?

I'm doing non-blocking TCP sends, write sizes of around 64k, and I'm
doing this to/from the same system with the send-to-self patch.
I am running full-duplex (930+Mbps tx + rx on both ports)
(this is about 980Mbps on the wire).

If I don't set the tx-queue % rx-queue sizes large (~4MB), it does not
perform well when running through my latency emulator.

If I do set them, then it runs just fine (barring an occassional
TCP throughput deadlock & ACK storm that is being worked on separately.)

If it works for other people, then it could be something else
weird about my setup.  I have an easy work-around (been in the
code for years and years now), so I'm not too worried either way.

Thanks,
Ben

> 
>   -John


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply

* [PATCH 1/6] sky2: status polling loop (post merge)
From: Stephen Hemminger @ 2007-10-12  1:29 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20071011.182358.21595252.davem@davemloft.net>

Handle the corner case where budget is exhausted correctly.
And save unnecessary read of index register.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/net/sky2.c	2007-10-11 18:26:56.000000000 -0700
+++ b/drivers/net/sky2.c	2007-10-11 18:27:12.000000000 -0700
@@ -2245,15 +2245,13 @@ static inline void sky2_tx_done(struct n
 }
 
 /* Process status response ring */
-static int sky2_status_intr(struct sky2_hw *hw, int to_do)
+static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
 {
 	int work_done = 0;
 	unsigned rx[2] = { 0, 0 };
-	u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
 
 	rmb();
-
-	while (hw->st_idx != hwidx) {
+	do {
 		struct sky2_port *sky2;
 		struct sky2_status_le *le  = hw->st_le + hw->st_idx;
 		unsigned port = le->css & CSS_LINK_BIT;
@@ -2364,7 +2362,7 @@ static int sky2_status_intr(struct sky2_
 				printk(KERN_WARNING PFX
 				       "unknown status opcode 0x%x\n", le->opcode);
 		}
-	}
+	} while (hw->st_idx != idx);
 
 	/* Fully processed status ring so clear irq */
 	sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
@@ -2607,6 +2605,7 @@ static int sky2_poll(struct napi_struct 
 	struct sky2_hw *hw = container_of(napi, struct sky2_hw, napi);
 	u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
 	int work_done = 0;
+	u16 idx;
 
 	if (unlikely(status & Y2_IS_ERROR))
 		sky2_err_intr(hw, status);
@@ -2617,29 +2616,23 @@ static int sky2_poll(struct napi_struct 
 	if (status & Y2_IS_IRQ_PHY2)
 		sky2_phy_intr(hw, 1);
 
-	for(;;) {
-		work_done += sky2_status_intr(hw, work_limit);
+	while ((idx = sky2_read16(hw, STAT_PUT_IDX)) != hw->st_idx) {
+		work_done += sky2_status_intr(hw, work_limit - work_done, idx);
 
 		if (work_done >= work_limit)
-			break;
-
-		/* More work? */
-		if (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX))
-			continue;
-
-		/* Bug/Errata workaround?
-		 * Need to kick the TX irq moderation timer.
-		 */
-		if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
-			sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
-			sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
-		}
-
-		napi_complete(napi);
-		sky2_read32(hw, B0_Y2_SP_LISR);
-		break;
+			goto done;
+	}
 
+	/* Bug/Errata workaround?
+	 * Need to kick the TX irq moderation timer.
+	 */
+	if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
+		sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
+		sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
 	}
+	napi_complete(napi);
+	sky2_read32(hw, B0_Y2_SP_LISR);
+done:
 
 	return work_done;
 }

^ permalink raw reply

* Re: [PATCH 1/6] sky2: status polling loop
From: Stephen Hemminger @ 2007-10-12  1:25 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20071011.182358.21595252.davem@davemloft.net>

On Thu, 11 Oct 2007 18:23:58 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Thu, 11 Oct 2007 18:19:52 -0700
> 
> > Handle the corner case where budget is exhausted correctly.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
> 
> Doesn't apply, I checked in my fixed version of your original patch
> already.
> 
> You had to have some idea I would apply that fix, so this patch series
> seems a bit premature since it's almost guarenteed to not apply any
> more.

I like to test my signed patches before applying... And if possible
send them out from the kernel running the actual code.

-- 
Stephen Hemminger <shemminger@linux-foundation.org>

^ permalink raw reply

* Re: Regression in net-2.6.24?
From: David Miller @ 2007-10-12  1:25 UTC (permalink / raw)
  To: shemminger; +Cc: takano, netdev, ilpo.jarvinen, mchan
In-Reply-To: <20071011182259.3715182d@freepuppy.rosehill>

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Thu, 11 Oct 2007 18:22:59 -0700

> Please use the version I just sent, it saves another non-cached read.

No, rather, please send me fixed relative to that.

I'm trying to get the net-2.6.24 merge out the door.


^ permalink raw reply


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