[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <463A0732.2060802@freescale.com>
Date: Thu, 03 May 2007 11:00:50 -0500
From: Scott Wood <scottwood@...escale.com>
To: Kumar Gala <galak@...nel.crashing.org>
CC: jgarzik@...ox.com, netdev@...r.kernel.org, linuxppc-dev@...abs.org
Subject: Re: [PATCH v2] gianfar: Add I/O barriers when touching buffer descriptor
ownership.
Kumar Gala wrote:
> So what about some thing like this where we do the read only once?
>
> - k
>
> diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
> index a06d8d1..9cd7d1e 100644
> --- a/drivers/net/gianfar.c
> +++ b/drivers/net/gianfar.c
> @@ -1438,31 +1438,35 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
> {
> struct rxbd8 *bdp;
> struct sk_buff *skb;
> - u16 pkt_len;
> + u16 pkt_len, status;
> + u32 bd_info;
I suggested that on IRC yesterday, and Segher was concerned that the
compiler might, in theory, "optimize" it into to two lhz instructions.
I'm rather skeptical that it would actually do so (even if it needs to
load twice due to register pressure, why not just use lwz both times?),
and there's probably many other places that would break if it did, but I
wasn't up for digging around GCC to prove otherwise.
Plus, that wouldn't synchronize the bd_info read with the buffer data reads.
-Scott
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists