aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ibmveth.c13
-rw-r--r--drivers/net/ibmveth.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index d2cc6d3f401c..3515ef318eb0 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -178,7 +178,7 @@ static void ibmveth_init_buffer_pool(struct ibmveth_buff_pool *pool, u32 pool_in
178 pool->size = pool_size; 178 pool->size = pool_size;
179 pool->index = pool_index; 179 pool->index = pool_index;
180 pool->buff_size = buff_size; 180 pool->buff_size = buff_size;
181 pool->threshold = pool_size / 2; 181 pool->threshold = pool_size * 7 / 8;
182 pool->active = pool_active; 182 pool->active = pool_active;
183} 183}
184 184
@@ -315,10 +315,13 @@ static void ibmveth_replenish_task(struct ibmveth_adapter *adapter)
315 315
316 adapter->replenish_task_cycles++; 316 adapter->replenish_task_cycles++;
317 317
318 for (i = (IbmVethNumBufferPools - 1); i >= 0; i--) 318 for (i = (IbmVethNumBufferPools - 1); i >= 0; i--) {
319 if(adapter->rx_buff_pool[i].active) 319 struct ibmveth_buff_pool *pool = &adapter->rx_buff_pool[i];
320 ibmveth_replenish_buffer_pool(adapter, 320
321 &adapter->rx_buff_pool[i]); 321 if (pool->active &&
322 (atomic_read(&pool->available) < pool->threshold))
323 ibmveth_replenish_buffer_pool(adapter, pool);
324 }
322 325
323 adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); 326 adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);
324} 327}
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index ec76ace66c6b..f3ede8184b6d 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -102,7 +102,7 @@ static inline long h_illan_attributes(unsigned long unit_address,
102#define IBMVETH_MAX_BUF_SIZE (1024 * 128) 102#define IBMVETH_MAX_BUF_SIZE (1024 * 128)
103 103
104static int pool_size[] = { 512, 1024 * 2, 1024 * 16, 1024 * 32, 1024 * 64 }; 104static int pool_size[] = { 512, 1024 * 2, 1024 * 16, 1024 * 32, 1024 * 64 };
105static int pool_count[] = { 256, 768, 256, 256, 256 }; 105static int pool_count[] = { 256, 512, 256, 256, 256 };
106static int pool_active[] = { 1, 1, 0, 0, 0}; 106static int pool_active[] = { 1, 1, 0, 0, 0};
107 107
108#define IBM_VETH_INVALID_MAP ((u16)0xffff) 108#define IBM_VETH_INVALID_MAP ((u16)0xffff)