netdev
[Top] [All Lists]

Re: fealnx oopses

To: Andreas Henriksson <andreas@xxxxxxxxxxxx>
Subject: Re: fealnx oopses
From: Francois Romieu <romieu@xxxxxxxxxxxxx>
Date: Mon, 29 Mar 2004 01:38:34 +0200
Cc: Denis Vlasenko <vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Jeff Garzik <jgarzik@xxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20040328232707.GA17524@xxxxxxxxxxxxxxxxxxx>; from andreas@xxxxxxxxxxxx on Mon, Mar 29, 2004 at 01:27:07AM +0200
References: <200403261214.58127.vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <200403272328.51291.vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20040328005533.A6117@xxxxxxxxxxxxxxxxxxxxxxxxxx> <200403282219.56799.vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20040328232707.GA17524@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
Andreas Henriksson <andreas@xxxxxxxxxxxx> :
[...]
> > --- fealnx.c.orig   Fri Nov 28 20:26:20 2003
> > +++ fealnx.c        Sun Mar 28 21:32:56 2004
> > @@ -1134,15 +1134,17 @@
> >             struct sk_buff *skb;
> >  
> >             skb = dev_alloc_skb(np->rx_buf_sz);
> > -           np->lack_rxbuf->skbuff = skb;
> > -
> >             if (skb == NULL)
> >                     break;  /* Better luck next round. */
> >  
> 
> np->lack_rxbuf == NULL here....
> 
> (verified by inserting a "BUG_ON(np->lack_rxbuf==NULL);"...)

Oops, I forgot to initialize np->lack_rxbuf correctly.

If you have some time to spend, you can change in netdev_rx:
                                pci_unmap_single(np->pci_dev,
                                                 np->cur_rx->buffer,
                                                 np->rx_buf_sz,
                                                 PCI_DMA_FROMDEVICE);
                                skb_put(skb = np->cur_rx->skbuff, pkt_len);
                                np->cur_rx->skbuff = NULL;
                                --np->really_rx_count;
into:
                                pci_unmap_single(np->pci_dev,
                                                 np->cur_rx->buffer,
                                                 np->rx_buf_sz,
                                                 PCI_DMA_FROMDEVICE);
                                skb_put(skb = np->cur_rx->skbuff, pkt_len);
                                np->cur_rx->skbuff = NULL;
                                if (!np->lack_rxbuf)                 <<<
                                        np->lack_rxbuf = np->cur_rx; <<<
                                np->cur_rx->skbuff = NULL;
                                --np->really_rx_count;

It may be simpler/safer to turn (init_ring):
        np->lack_rxbuf = NULL;
into
        np->lack_rxbuf = np->rx_ring;

I'll check the whole thing tomorrow. It's time to sleep now.

Thanks for your report.

--
Ueimor

<Prev in Thread] Current Thread [Next in Thread>