Skip to contentSkip to conversation

BUG: warning at kernel/softirq.c:141/local_bh_enable()

DISCUSSION Eric Dumazet 2 participants 3 messages Oct 17, 2006 – Oct 18, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · John Philips
Quoted 1 line

Which NIC driver is handling eth6 ?

Eric,

eth6 is a NatSemi DP83815 NIC

Well... lot of changes in drivers/net/natsemi.c between 2.4 and 2.6

Previous versions had a max_interrupt_work = 20;
RX_RING_SIZE is 32 for this NIC

But NAPI standard weight is 64, maybe you should try to lower it ? (so that an interrupt dont try to queue/dequeue too many packets at once)

/proc/sys/net/core/dev_weight
/proc/sys/net/core/netdev_budget

Eric

#2 lore raw
Quoted 8 lines
Quoted 1 line

eth6 is a NatSemi DP83815 NIC

Well... lot of changes in drivers/net/natsemi.c between 2.4 and 2.6

Previous versions had a max_interrupt_work = 20; RX_RING_SIZE is 32 for this NIC

Quoted 7 lines

But NAPI standard weight is 64, maybe you should try to lower it ? (so that an
interrupt dont try to queue/dequeue too many packets at once)

/proc/sys/net/core/dev_weight
/proc/sys/net/core/netdev_budget

Eric,

Thanks for the suggestions, but I don't really
understand what you're saying.

Currently dev_weight is 64 and netdev_budget is 300. What do you recommend I set them to?

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#3 lore raw
In reply to Eric Dumazet

Eric,

Today I upgraded a few routers running 2.6.11.6 to the same 2.6.17.8 kernel and experienced the same issues. It only happens on the boxes with the NatSemi card.

Attached you will find a diff between the natsemi.c driver from 2.6.11.6 and 2.6.17.8. Perhaps you'll see where the problem exists (I don't understand C code).

Thanks

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

6d5
< Portions copyright 2004 Harald Welte <[email protected]>
138a138,139

Quoted 2 lines

* support for an external PHY
* NAPI

162d162
< #include <linux/prefetch.h>
185a186,187

Quoted 2 lines

/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 20;

190c192
< static const int multicast_filter_limit = 100;
---

Quoted 1 line

static int multicast_filter_limit = 100;

229c231
< #define NATSEMI_DEF_EEPROM_SIZE 24 /* 12 16-bit values */
---

Quoted 1 line

#define NATSEMI_EEPROM_SIZE 24 /* 12 16-bit values */

241c243
< static const char version[] __devinitdata =
---

Quoted 1 line

static char version[] __devinitdata =

251a254

Quoted 1 line

module_param(max_interrupt_work, int, 0);

256a260,261

Quoted 2 lines

MODULE_PARM_DESC(max_interrupt_work,

	"DP8381x maximum events handled per interrupt");

372c377
< static const struct {
---

Quoted 1 line

static struct {

689,690d693
< /* Interrupt status */
< u32 intr_status;
717,718d719
< /* EEPROM data */
< int eeprom_size;
750,751c751
< static int natsemi_poll(struct net_device *dev, int *budget);
< static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do);
---

Quoted 1 line

static void netdev_rx(struct net_device *dev);

779,790d778
< static inline void natsemi_irq_enable(struct net_device *dev) < {
< writel(1, ns_ioaddr(dev) + IntrEnable);
< readl(ns_ioaddr(dev) + IntrEnable);
< }
<
< static inline void natsemi_irq_disable(struct net_device *dev) < {
< writel(0, ns_ioaddr(dev) + IntrEnable);
< readl(ns_ioaddr(dev) + IntrEnable);
< }
<
894,895d881
< np->intr_status = 0;
< np->eeprom_size = NATSEMI_DEF_EEPROM_SIZE;
949,951d934
< dev->poll = natsemi_poll;
< dev->weight = 64;
<
1504,1528d1486
< static void reset_rx(struct net_device *dev)
< {
< int i;
< struct netdev_private *np = netdev_priv(dev);
< void __iomem *ioaddr = ns_ioaddr(dev);
<
< np->intr_status &= ~RxResetDone;
<
< writel(RxReset, ioaddr + ChipCmd);
<
< for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
< np->intr_status |= readl(ioaddr + IntrStatus);
< if (np->intr_status & RxResetDone)
< break;
< udelay(15);
< }
< if (i==NATSEMI_HW_TIMEOUT) {
< printk(KERN_WARNING "%s: RX reset did not complete in %d usec.\n",
< dev->name, i*15);
< } else if (netif_msg_hw(np)) {
< printk(KERN_WARNING "%s: RX reset took %d usec.\n",
< dev->name, i*15);
< }
< }
<
1971c1929
< skb->data, buflen, PCI_DMA_FROMDEVICE);
---

Quoted 1 line
				skb->tail, buflen, PCI_DMA_FROMDEVICE);

2203,2204c2161,2162
< /* The interrupt handler doesn't actually handle interrupts itself, it < * schedules a NAPI poll if there is anything to do. */
---

Quoted 2 lines

/* The interrupt handler does all of the Rx thread work and cleans up
after the Tx thread. */

2209a2168,2169

Quoted 2 lines
	int boguscnt = max_interrupt_work;
	unsigned int handled = 0;

2213,2226c2173,2175
<
< /* Reading automatically acknowledges. */
< np->intr_status = readl(ioaddr + IntrStatus);
<
< if (netif_msg_intr(np))
< printk(KERN_DEBUG

< 		       "%s: Interrupt, status %#08x, mask %#08x.\n",
< 		       dev->name, np->intr_status,
< 		       readl(ioaddr + IntrMask));

<
< if (!np->intr_status)
< return IRQ_NONE;
<
< prefetch(&np->rx_skbuff[np->cur_rx % RX_RING_SIZE]);
---

Quoted 3 lines
	do {
		/* Reading automatically acknowledges all int sources. */
		u32 intr_status = readl(ioaddr + IntrStatus);

2228,2234c2177,2181
< if (netif_rx_schedule_prep(dev)) {
< /* Disable interrupts and register for poll */
< natsemi_irq_disable(dev);
< __netif_rx_schedule(dev);
< }
< return IRQ_HANDLED;
< }
---

Quoted 5 lines
		if (netif_msg_intr(np))
			printk(KERN_DEBUG
				"%s: Interrupt, status %#08x, mask %#08x.\n",
				dev->name, intr_status,
				readl(ioaddr + IntrMask));

2236,2242c2183,2185
< /* This is the NAPI poll routine. As well as the standard RX handling < * it also handles all other interrupts that the chip might raise. < */
< static int natsemi_poll(struct net_device *dev, int *budget) < {
< struct netdev_private *np = netdev_priv(dev);
< void __iomem * ioaddr = ns_ioaddr(dev);
---

Quoted 3 lines
		if (intr_status == 0)
			break;
		handled = 1;

2244,2245c2187,2191
< int work_to_do = min(*budget, dev->quota);
< int work_done = 0;
---

Quoted 5 lines
		if (intr_status &
		   (IntrRxDone | IntrRxIntr | RxStatusFIFOOver |
		    IntrRxErr | IntrRxOverrun)) {
			netdev_rx(dev);
		}

2247,2249c2193,2194
< do {
< if (np->intr_status &
< (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) {
---

Quoted 2 lines
		if (intr_status &
		   (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) {

2256,2269c2201,2202
< if (np->intr_status & IntrAbnormalSummary)
< netdev_error(dev, np->intr_status);
<
< if (np->intr_status &
< (IntrRxDone | IntrRxIntr | RxStatusFIFOOver |
< IntrRxErr | IntrRxOverrun)) {
< netdev_rx(dev, &work_done, work_to_do);
< }
<
< *budget -= work_done;
< dev->quota -= work_done;
<
< if (work_done >= work_to_do)
< return 1;
---

Quoted 2 lines
		if (intr_status & IntrAbnormalSummary)
			netdev_error(dev, intr_status);

2271,2274c2204,2212
< np->intr_status = readl(ioaddr + IntrStatus);
< } while (np->intr_status);
<
< netif_rx_complete(dev);
---

Quoted 9 lines
		if (--boguscnt < 0) {
			if (netif_msg_intr(np))
				printk(KERN_WARNING
					"%s: Too much work at interrupt, "
					"status=%#08x.\n",
					dev->name, intr_status);
			break;
		}
	} while (1);

2276,2281c2214,2215
< /* Reenable interrupts providing nothing is trying to shut
< * the chip down. */
< spin_lock(&np->lock);
< if (!np->hands_off && netif_running(dev))
< natsemi_irq_enable(dev);
< spin_unlock(&np->lock);
---

Quoted 2 lines
	if (netif_msg_intr(np))
		printk(KERN_DEBUG "%s: exiting interrupt.\n", dev->name);

2283c2217
< return 0;
---

Quoted 1 line
	return IRQ_RETVAL(handled);

2288c2222
< static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
---

Quoted 1 line

static void netdev_rx(struct net_device *dev)

2306,2311d2239
<
< if (*work_done >= work_to_do)
< break;
<
< (*work_done)++;
<
2323,2339d2250
<
< /* The RX state machine has probably
< * locked up beneath us. Follow the
< * reset procedure documented in
< * AN-1287. */
<
< spin_lock_irq(&np->lock);
< reset_rx(dev);
< reinit_rx(dev);
< writel(np->ring_dma, ioaddr + RxRingPtr);
< check_link(dev);
< spin_unlock_irq(&np->lock);
<
< /* We'll enable RX on exit from this
< * function. */
< break;
<
2372c2283
< np->rx_skbuff[entry]->data, pkt_len, 0);
---

Quoted 1 line
					np->rx_skbuff[entry]->tail, pkt_len, 0);

2385c2296
< netif_receive_skb(skb);
---

Quoted 1 line
			netif_rx(skb);

2525,2527c2436,2438
< writel(HASH_TABLE + i, ioaddr + RxFilterAddr);
< writel((mc_filter[i + 1] << 8) + mc_filter[i],
< ioaddr + RxFilterData);
---

Quoted 3 lines
			writew(HASH_TABLE + i, ioaddr + RxFilterAddr);
			writew((mc_filter[i+1]<<8) + mc_filter[i],
				ioaddr + RxFilterData);

2588,2589c2499
< struct netdev_private *np = netdev_priv(dev);
< return np->eeprom_size;
---

Quoted 1 line
	return NATSEMI_EEPROM_SIZE;

2676c2586
< u8 *eebuf;
---

Quoted 1 line
	u8 eebuf[NATSEMI_EEPROM_SIZE];

2679,2682d2588
< eebuf = kmalloc(np->eeprom_size, GFP_KERNEL);
< if (!eebuf)
< return -ENOMEM;
<
2689d2594
< kfree(eebuf);
3045d2949
< struct netdev_private *np = netdev_priv(dev);
3048c2952
< for (i = 0; i < np->eeprom_size/2; i++) {
---

Quoted 1 line
	for (i = 0; i < NATSEMI_EEPROM_SIZE/2; i++) {

3173c3077,3079
< natsemi_irq_disable(dev);
---

Quoted 3 lines
	/* Disable interrupts, and flush posted writes */
	writel(0, ioaddr + IntrEnable);
	readl(ioaddr + IntrEnable);

3255,3257d3160

<  *      * natsemi_poll: checks before reenabling interrupts.  suspend
<  *              sets hands_off, disables interrupts and then waits with
<  *              netif_poll_disable().

3262c3165
< static int natsemi_suspend (struct pci_dev *pdev, pm_message_t state)
---

Quoted 1 line

static int natsemi_suspend (struct pci_dev *pdev, u32 state)

3283,3284d3185
< netif_poll_disable(dev);
<
3337d3237
< netif_poll_enable(dev);