Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c033a6d1 authored by Santiago Leon's avatar Santiago Leon Committed by David S. Miller
Browse files

ibmveth: batch rx buffer replacement



At the moment we try and replenish the receive ring on every rx interrupt.
We even have a pool->threshold but aren't using it.

To limit the maximum latency incurred when refilling, change the threshold
from 1/2 to 7/8 and reduce the largest rx pool from 768 buffers to 512 which
should be more than enough.

Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarSantiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a613f581
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -178,7 +178,7 @@ static void ibmveth_init_buffer_pool(struct ibmveth_buff_pool *pool, u32 pool_in
	pool->size = pool_size;
	pool->size = pool_size;
	pool->index = pool_index;
	pool->index = pool_index;
	pool->buff_size = buff_size;
	pool->buff_size = buff_size;
	pool->threshold = pool_size / 2;
	pool->threshold = pool_size * 7 / 8;
	pool->active = pool_active;
	pool->active = pool_active;
}
}


@@ -315,10 +315,13 @@ static void ibmveth_replenish_task(struct ibmveth_adapter *adapter)


	adapter->replenish_task_cycles++;
	adapter->replenish_task_cycles++;


	for (i = (IbmVethNumBufferPools - 1); i >= 0; i--)
	for (i = (IbmVethNumBufferPools - 1); i >= 0; i--) {
		if(adapter->rx_buff_pool[i].active)
		struct ibmveth_buff_pool *pool = &adapter->rx_buff_pool[i];
			ibmveth_replenish_buffer_pool(adapter,

						     &adapter->rx_buff_pool[i]);
		if (pool->active &&
		    (atomic_read(&pool->available) < pool->threshold))
			ibmveth_replenish_buffer_pool(adapter, pool);
	}


	adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);
	adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ static inline long h_illan_attributes(unsigned long unit_address,
#define IBMVETH_MAX_BUF_SIZE (1024 * 128)
#define IBMVETH_MAX_BUF_SIZE (1024 * 128)


static int pool_size[] = { 512, 1024 * 2, 1024 * 16, 1024 * 32, 1024 * 64 };
static int pool_size[] = { 512, 1024 * 2, 1024 * 16, 1024 * 32, 1024 * 64 };
static int pool_count[] = { 256, 768, 256, 256, 256 };
static int pool_count[] = { 256, 512, 256, 256, 256 };
static int pool_active[] = { 1, 1, 0, 0, 0};
static int pool_active[] = { 1, 1, 0, 0, 0};


#define IBM_VETH_INVALID_MAP ((u16)0xffff)
#define IBM_VETH_INVALID_MAP ((u16)0xffff)