Subject: Re: [PATCH 2/2] netxen: Add sanity checks for Rx buffers returning from hardware

From: David Gibson <[email-masked]>
Date: Fri, 24 Jan 2014 16:21:26 +1100

On Thu, Dec 19, 2013 at 03:05:27PM -0500, David Miller wrote:
> From: David Gibson <[email-masked]>
> Date: Tue, 17 Dec 2013 16:22:33 +1100
> 
> > +static int netxen_check_rx_buf(int index, struct netxen_rx_buffer *rxbuf)
> > +{
> > +	int ret = 0;
> > +
> > +	if ((rxbuf->list.next != LIST_POISON1)
> > +	    || (rxbuf->list.prev != LIST_POISON2)) {
> > +		printk(KERN_ERR "netxen: Rx buffer is already on free list "
> > +		       "(next=%p, prev=%p)\n", rxbuf->list.next,
> > +		       rxbuf->list.prev);
> > +		ret = -1;
> > +	}
> 
> First, you should be using netdev_err() or similar.

Well, I was just matching the form used in the rest of the driver.

> Second, doing this unconditionally for every receive packet is
> not really reasonable.

Yeah, trouble is I don't know what the alternative is.  Whatever is
causing this problem, it's triggered very rarely - I'm only seeing a
pattern by looking across everything reported by Red Hat customers.
Just adding diagnostics for one customer is unlikely to be useful,
because the chances are they'll never hit the bug again.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson