From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com
Subject: [PATCH net-next-2.6 02/10] sfc: Use ACCESS_ONCE when copying efx_tx_queue::read_count
Date: Fri, 10 Dec 2010 17:38:17 +0000 [thread overview]
Message-ID: <1292002697.11673.16.camel@bwh-desktop> (raw)
In-Reply-To: <1292002527.11673.14.camel@bwh-desktop>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/sfc/tx.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c
index 03194f7..fef2235 100644
--- a/drivers/net/sfc/tx.c
+++ b/drivers/net/sfc/tx.c
@@ -240,8 +240,7 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
* of read_count. */
smp_mb();
tx_queue->old_read_count =
- *(volatile unsigned *)
- &tx_queue->read_count;
+ ACCESS_ONCE(tx_queue->read_count);
fill_level = (tx_queue->insert_count
- tx_queue->old_read_count);
q_space = efx->txq_entries - 1 - fill_level;
@@ -764,7 +763,7 @@ static int efx_tx_queue_insert(struct efx_tx_queue *tx_queue,
* stopped from the access of read_count. */
smp_mb();
tx_queue->old_read_count =
- *(volatile unsigned *)&tx_queue->read_count;
+ ACCESS_ONCE(tx_queue->read_count);
fill_level = (tx_queue->insert_count
- tx_queue->old_read_count);
q_space = efx->txq_entries - 1 - fill_level;
--
1.7.3.2
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2010-12-10 17:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-10 17:35 pull request: sfc-next-2.6 2010-12-10 Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 01/10] sfc: Reorder struct efx_nic to separate fields by volatility Ben Hutchings
2010-12-10 17:38 ` Ben Hutchings [this message]
2010-12-10 17:38 ` [PATCH net-next-2.6 03/10] sfc: Expand/correct comments on collector behaviour and function usage Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 04/10] sfc: Remove redundant memory barriers between MMIOs Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 05/10] sfc: Add compile-time checks for correctness of paged register writes Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 06/10] sfc: Remove locking from implementation of efx_writeo_paged() Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 07/10] sfc: Use TX push whenever adding descriptors to an empty queue Ben Hutchings
2010-12-10 17:39 ` [PATCH net-next-2.6 08/10] sfc: Log start and end of ethtool self-test at INFO level Ben Hutchings
2010-12-10 17:39 ` [PATCH net-next-2.6 09/10] sfc: Remove filter table IDs from filter functions Ben Hutchings
2010-12-10 17:39 ` [PATCH net-next-2.6 10/10] sfc: Generalise filter spec initialisation Ben Hutchings
2010-12-10 18:47 ` pull request: sfc-next-2.6 2010-12-10 David Miller
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=1292002697.11673.16.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@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).