netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: "CaT" <cat@zip.com.au>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: intermittant petabyte usage reported with broadcom nic
Date: Mon, 16 Apr 2007 12:10:51 -0700	[thread overview]
Message-ID: <1176750651.6217.3.camel@dell> (raw)
In-Reply-To: <1176596401.5847.7.camel@dell>

On Sat, 2007-04-14 at 17:20 -0700, Michael Chan wrote:

> I also like Andi's idea of using change_page_attr() to isolate the
> problem.  I'll try to send you a debug patch in the next few days to try
> that out.  Thanks.
> 
Here's the debug patch for x86 only that will change the statistics
memory block to read-only.  If the kernel is corrupting it, you should
get a page fault that will crash the system.  If you continue to see
bogus counters, it is definitely a firmware or hardware problem.  Please
try it and let me know.  Thanks.

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 0b7aded..b7d491b 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -47,6 +47,7 @@
 #include <linux/prefetch.h>
 #include <linux/cache.h>
 #include <linux/zlib.h>
+#include <asm/cacheflush.h>
 
 #include "bnx2.h"
 #include "bnx2_fw.h"
@@ -436,6 +437,8 @@ bnx2_free_mem(struct bnx2 *bp)
 		}
 	}
 	if (bp->status_blk) {
+		change_page_attr(virt_to_page(bp->status_blk), 1, PAGE_KERNEL);
+		global_flush_tlb();
 		pci_free_consistent(bp->pdev, bp->status_stats_size,
 				    bp->status_blk, bp->status_blk_mapping);
 		bp->status_blk = NULL;
@@ -501,6 +504,7 @@ bnx2_alloc_mem(struct bnx2 *bp)
 	bp->status_stats_size = status_blk_size +
 				sizeof(struct statistics_block);
 
+	bp->status_stats_size = PAGE_SIZE;
 	bp->status_blk = pci_alloc_consistent(bp->pdev, bp->status_stats_size,
 					      &bp->status_blk_mapping);
 	if (bp->status_blk == NULL)
@@ -508,6 +512,10 @@ bnx2_alloc_mem(struct bnx2 *bp)
 
 	memset(bp->status_blk, 0, bp->status_stats_size);
 
+	/* x86 debug code to see if the kernel is corrupting the statistics */
+	change_page_attr(virt_to_page(bp->status_blk), 1, PAGE_KERNEL_RO);
+	global_flush_tlb();
+
 	bp->stats_blk = (void *) ((unsigned long) bp->status_blk +
 				  status_blk_size);
 
@@ -4307,7 +4315,9 @@ bnx2_timer(unsigned long data)
 	msg = (u32) ++bp->fw_drv_pulse_wr_seq;
 	REG_WR_IND(bp, bp->shmem_base + BNX2_DRV_PULSE_MB, msg);
 
+#if 0
 	bp->stats_blk->stat_FwRxDrop = REG_RD_IND(bp, BNX2_FW_RX_DROP_COUNT);
+#endif
 
 	if (bp->phy_flags & PHY_SERDES_FLAG) {
 		if (CHIP_NUM(bp) == CHIP_NUM_5706)



  reply	other threads:[~2007-04-16 18:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070402014319.GA8345@zip.com.au>
2007-04-02  7:13 ` intermittant petabyte usage reported with broadcom nic Andrew Morton
2007-04-02  7:41   ` CaT
2007-04-02 10:31     ` Jean-Daniel Pauget
2007-04-15  0:20     ` Michael Chan
2007-04-16 19:10       ` Michael Chan [this message]
2007-04-16 23:43         ` CaT
2007-04-17 12:01           ` Jean-Daniel Pauget
2007-04-17 15:58           ` Roland Dreier
2007-05-22  1:15       ` Michael Chan
2007-04-12 22:52   ` CaT
2007-04-12 23:13     ` Andrew Morton
2007-04-12 23:18       ` Roland Dreier
2007-04-12 23:25         ` CaT
2007-04-12 23:15     ` Roland Dreier
2007-04-12 23:28     ` Roland Dreier
2007-04-13  1:15       ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1176750651.6217.3.camel@dell \
    --to=mchan@broadcom.com \
    --cc=akpm@linux-foundation.org \
    --cc=cat@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).