From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Donald Becker <becker@scyld.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: PATCH] via-rhine.c: don't reference skb after passing it to netif_rx
Date: Mon, 26 Feb 2001 21:15:36 -0300 [thread overview]
Message-ID: <20010226211536.O8692@conectiva.com.br> (raw)
In-Reply-To: <20010226210441.K8692@conectiva.com.br> <Pine.LNX.4.10.10102262050220.1129-100000@vaio.greennet>
In-Reply-To: <Pine.LNX.4.10.10102262050220.1129-100000@vaio.greennet>; from becker@scyld.com on Mon, Feb 26, 2001 at 08:52:39PM -0500
Em Mon, Feb 26, 2001 at 08:52:39PM -0500, Donald Becker escreveu:
> On Mon, 26 Feb 2001, Arnaldo Carvalho de Melo wrote:
>
> > Em Mon, Feb 26, 2001 at 08:33:59PM -0300, Arnaldo Carvalho de Melo escreveu:
> > I've just read davem's post at netdev about the brokeness of
> > referencing skbs after passing it to netif_rx, so please consider applying
> > this patch. Ah, this was just added to the Janitor's TODO list at
>
> > --- linux-2.4.2/drivers/net/via-rhine.c Mon Dec 11 19:38:29 2000
> > +++ linux-2.4.2.acme/drivers/net/via-rhine.c Mon Feb 26 22:36:18 2001
> > @@ -1147,9 +1147,9 @@
> > np->rx_buf_sz, PCI_DMA_FROMDEVICE);
> > }
> > skb->protocol = eth_type_trans(skb, dev);
> > + np->stats.rx_bytes += skb->len;
> > netif_rx(skb);
> > dev->last_rx = jiffies;
> > - np->stats.rx_bytes += skb->len;
> > np->stats.rx_packets++;
> > }
>
> Easier fix:
> - np->stats.rx_bytes += skb->len;
> + np->stats.rx_bytes += pkt_len;
>
> Grouping the writes to np->stats results in better cache usage.
thanks, I'll take that into account for the remaining ones and this should
be checked by the driver authors for the ones I've already sent.
- Arnaldo
next prev parent reply other threads:[~2001-02-27 1:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-27 0:04 PATCH] via-rhine.c: don't reference skb after passing it to netif_rx Arnaldo Carvalho de Melo
2001-02-27 1:52 ` Donald Becker
2001-02-27 0:15 ` Arnaldo Carvalho de Melo [this message]
2001-02-27 9:07 ` Urban Widmark
2001-02-27 9:43 ` PATCH] via-rhine.c: don't reference skb after passing it tonetif_rx Jeff Garzik
2001-02-27 16:24 ` PATCH] via-rhine.c: don't reference skb after passing it to netif_rx Arnaldo Carvalho de Melo
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=20010226211536.O8692@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=becker@scyld.com \
--cc=linux-kernel@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).