[PATCH 2.6] ibmveth bug fixes 4/4

From: Santiago Leon
Date: Tue Aug 10 2004 - 13:42:28 EST


Andrew,

This patch adds a memory barrier to ensure synchronization with the hypervisor (and avoid a panic when the hypervisor is halfway through writing to the descriptor). It also removes an unnecessary check that is flawed anyway because the value can change between the atomic_inc() and the assert. Please apply.

Signed-off-by: Santiago Leon <santil@xxxxxxxxxx>

--
Santiago A. Leon
Power Linux Development
IBM Linux Technology Center
===== drivers/net/ibmveth.c 1.16 vs edited =====
--- 1.16/drivers/net/ibmveth.c Tue Aug 10 12:00:57 2004
+++ edited/drivers/net/ibmveth.c Tue Aug 10 12:01:46 2004
@@ -271,7 +271,6 @@
adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);

atomic_inc(&adapter->not_replenishing);
- ibmveth_assert(atomic_read(&adapter->not_replenishing) == 1);
}

/* kick the replenish tasklet if we need replenishing and it isn't already running */
@@ -733,6 +732,8 @@

if(ibmveth_rxq_pending_buffer(adapter)) {
struct sk_buff *skb;
+
+ rmb();

if(!ibmveth_rxq_buffer_valid(adapter)) {
wmb(); /* suggested by larson1 */