netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] bnx2: Fix jumbo frames error handling.
       [not found] <1234396338-14859-1-git-send-email-mchan@broadcom.com>
@ 2009-02-11 23:52 ` Michael Chan
  2009-02-13  0:55   ` David Miller
  2009-02-11 23:52 ` [PATCH 4/4] bnx2: Update version to 1.9.2 and copyright Michael Chan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Michael Chan @ 2009-02-11 23:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan, Matt Carlson, Benjamin Li

If errors are reported on a frame descriptor, we need to
account for the buffer pages that may have been used for this
error packet and recycle them.  Otherwise, we may get the wrong
pages for the next packet.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
---
 drivers/net/bnx2.c |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 49e0e51..903d13b 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2920,18 +2920,8 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
 
 		rx_hdr = (struct l2_fhdr *) skb->data;
 		len = rx_hdr->l2_fhdr_pkt_len;
+		status = rx_hdr->l2_fhdr_status;
 
-		if ((status = rx_hdr->l2_fhdr_status) &
-			(L2_FHDR_ERRORS_BAD_CRC |
-			L2_FHDR_ERRORS_PHY_DECODE |
-			L2_FHDR_ERRORS_ALIGNMENT |
-			L2_FHDR_ERRORS_TOO_SHORT |
-			L2_FHDR_ERRORS_GIANT_FRAME)) {
-
-			bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons,
-					  sw_ring_prod);
-			goto next_rx;
-		}
 		hdr_len = 0;
 		if (status & L2_FHDR_STATUS_SPLIT) {
 			hdr_len = rx_hdr->l2_fhdr_ip_xsum;
@@ -2941,6 +2931,24 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
 			pg_ring_used = 1;
 		}
 
+		if (unlikely(status & (L2_FHDR_ERRORS_BAD_CRC |
+				       L2_FHDR_ERRORS_PHY_DECODE |
+				       L2_FHDR_ERRORS_ALIGNMENT |
+				       L2_FHDR_ERRORS_TOO_SHORT |
+				       L2_FHDR_ERRORS_GIANT_FRAME))) {
+
+			bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons,
+					  sw_ring_prod);
+			if (pg_ring_used) {
+				int pages;
+
+				pages = PAGE_ALIGN(len - hdr_len) >> PAGE_SHIFT;
+
+				bnx2_reuse_rx_skb_pages(bp, rxr, NULL, pages);
+			}
+			goto next_rx;
+		}
+
 		len -= 4;
 
 		if (len <= bp->rx_copy_thresh) {
-- 
1.5.6.GIT



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] bnx2: Update version to 1.9.2 and copyright.
       [not found] <1234396338-14859-1-git-send-email-mchan@broadcom.com>
  2009-02-11 23:52 ` [PATCH 3/4] bnx2: Fix jumbo frames error handling Michael Chan
@ 2009-02-11 23:52 ` Michael Chan
  2009-02-13  0:55   ` David Miller
  2009-02-13  0:55 ` [PATCH 1/4] bnx2: Update 5706/5708 firmware David Miller
       [not found] ` <1234396338-14859-2-git-send-email-mchan@broadcom.com>
  3 siblings, 1 reply; 6+ messages in thread
From: Michael Chan @ 2009-02-11 23:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan

Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/bnx2.c |    6 +++---
 drivers/net/bnx2.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 903d13b..8466d35 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -1,6 +1,6 @@
 /* bnx2.c: Broadcom NX2 network driver.
  *
- * Copyright (c) 2004-2008 Broadcom Corporation
+ * Copyright (c) 2004-2009 Broadcom Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -57,8 +57,8 @@
 
 #define DRV_MODULE_NAME		"bnx2"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"1.9.0"
-#define DRV_MODULE_RELDATE	"Dec 16, 2008"
+#define DRV_MODULE_VERSION	"1.9.2"
+#define DRV_MODULE_RELDATE	"Feb 11, 2009"
 
 #define RUN_AT(x) (jiffies + (x))
 
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 900641a..704cbbc 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -1,6 +1,6 @@
 /* bnx2.h: Broadcom NX2 network driver.
  *
- * Copyright (c) 2004-2007 Broadcom Corporation
+ * Copyright (c) 2004-2009 Broadcom Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
-- 
1.5.6.GIT



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] bnx2: Update 5706/5708 firmware.
       [not found] <1234396338-14859-1-git-send-email-mchan@broadcom.com>
  2009-02-11 23:52 ` [PATCH 3/4] bnx2: Fix jumbo frames error handling Michael Chan
  2009-02-11 23:52 ` [PATCH 4/4] bnx2: Update version to 1.9.2 and copyright Michael Chan
@ 2009-02-13  0:55 ` David Miller
       [not found] ` <1234396338-14859-2-git-send-email-mchan@broadcom.com>
  3 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-02-13  0:55 UTC (permalink / raw)
  To: mchan; +Cc: netdev

From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 11 Feb 2009 15:52:15 -0800

> New firmware fixes a data corruption issue when receiving and
> placing jumbo frames into host buffers.  In some cases, the
> buffer descriptor is not updated correctly and this will lead
> to the driver linking the wrong number of pages into the SKB.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

I was hesistent to add this and the other firmware update to net-2.6,
but memory corruption is a very serious issue so applied.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] bnx2: Update 5709 firmware.
       [not found] ` <1234396338-14859-2-git-send-email-mchan@broadcom.com>
@ 2009-02-13  0:55   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-02-13  0:55 UTC (permalink / raw)
  To: mchan; +Cc: netdev

From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 11 Feb 2009 15:52:16 -0800

> New firmware fixes a data corruption issue when receiving and
> placing jumbo frames into host buffers.  In some cases, the
> buffer descriptor is not updated correctly and this will lead
> to the driver linking the wrong number of pages into the SKB.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/4] bnx2: Fix jumbo frames error handling.
  2009-02-11 23:52 ` [PATCH 3/4] bnx2: Fix jumbo frames error handling Michael Chan
@ 2009-02-13  0:55   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-02-13  0:55 UTC (permalink / raw)
  To: mchan; +Cc: netdev, mcarlson, benli

From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 11 Feb 2009 15:52:17 -0800

> If errors are reported on a frame descriptor, we need to
> account for the buffer pages that may have been used for this
> error packet and recycle them.  Otherwise, we may get the wrong
> pages for the next packet.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/4] bnx2: Update version to 1.9.2 and copyright.
  2009-02-11 23:52 ` [PATCH 4/4] bnx2: Update version to 1.9.2 and copyright Michael Chan
@ 2009-02-13  0:55   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-02-13  0:55 UTC (permalink / raw)
  To: mchan; +Cc: netdev

From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 11 Feb 2009 15:52:18 -0800

> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-13  0:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1234396338-14859-1-git-send-email-mchan@broadcom.com>
2009-02-11 23:52 ` [PATCH 3/4] bnx2: Fix jumbo frames error handling Michael Chan
2009-02-13  0:55   ` David Miller
2009-02-11 23:52 ` [PATCH 4/4] bnx2: Update version to 1.9.2 and copyright Michael Chan
2009-02-13  0:55   ` David Miller
2009-02-13  0:55 ` [PATCH 1/4] bnx2: Update 5706/5708 firmware David Miller
     [not found] ` <1234396338-14859-2-git-send-email-mchan@broadcom.com>
2009-02-13  0:55   ` [PATCH 2/4] bnx2: Update 5709 firmware David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).