lkml.org 
[lkml]   [2004]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2.6] ibmveth bug fixes 2/4
Andrew,

This patch fixes a race condition that would panic the kernel when
replenishing a buffer pool. Please apply.

Signed-off-by: Santiago Leon <santil@us.ibm.com>

--
Santiago A. Leon
Power Linux Development
IBM Linux Technology Center
===== drivers/net/ibmveth.c 1.14 vs edited =====
--- 1.14/drivers/net/ibmveth.c Tue Aug 10 11:56:29 2004
+++ edited/drivers/net/ibmveth.c Tue Aug 10 11:57:09 2004
@@ -219,6 +219,7 @@

dma_addr = vio_map_single(adapter->vdev, skb->data, pool->buff_size, DMA_FROM_DEVICE);

+ pool->free_map[free_index] = 0xffff;
pool->dma_addr[index] = dma_addr;
pool->skbuff[index] = skb;

@@ -233,6 +234,7 @@
lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);

if(lpar_rc != H_Success) {
+ pool->free_map[free_index] = index;
pool->skbuff[index] = NULL;
pool->consumer_index--;
vio_unmap_single(adapter->vdev, pool->dma_addr[index], pool->buff_size, DMA_FROM_DEVICE);
@@ -240,7 +242,6 @@
adapter->replenish_add_buff_failure++;
break;
} else {
- pool->free_map[free_index] = 0xffff;
buffers_added++;
adapter->replenish_add_buff_success++;
}
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.038 / U:1.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site