summaryrefslogtreecommitdiffstats
path: root/drivers/net/ibmveth.h
diff options
context:
space:
mode:
authorSantiago Leon <santil@us.ibm.com>2005-10-26 10:47:01 -0600
committerJeff Garzik <jgarzik@pobox.com>2005-10-28 16:07:30 -0400
commitb6d35182fe62e57d368062adcc880ca35119d88e (patch)
treedd7767a40490d2d532cda4d35a18f8b8e614ab19 /drivers/net/ibmveth.h
parent0abe791e94033b727f2b55670c2966f3d3d3cf70 (diff)
downloadop-kernel-dev-b6d35182fe62e57d368062adcc880ca35119d88e.zip
op-kernel-dev-b6d35182fe62e57d368062adcc880ca35119d88e.tar.gz
[PATCH] ibmveth fix buffer pool management
This patch changes the way the ibmveth driver handles the receive buffers. The old code mallocs and maps all the buffers in the pools regardless of MTU size and it also limits the number of buffer pools to three. This patch makes the driver malloc and map the buffers necessary to support the current MTU. It also changes the hardcoded names of the buffer pool number, size, and elements to arrays to make it easier to change (with the hope of making them runtime parameters in the future). Signed-off-by: Santiago Leon <santil@us.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/ibmveth.h')
-rw-r--r--drivers/net/ibmveth.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index 51a470d..a5d27a9 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -49,6 +49,7 @@
#define H_SEND_LOGICAL_LAN 0x120
#define H_MULTICAST_CTRL 0x130
#define H_CHANGE_LOGICAL_LAN_MAC 0x14C
+#define H_FREE_LOGICAL_LAN_BUFFER 0x1D4
/* hcall macros */
#define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \
@@ -69,13 +70,15 @@
#define h_change_logical_lan_mac(ua, mac) \
plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac)
-#define IbmVethNumBufferPools 3
-#define IbmVethPool0DftSize (1024 * 2)
-#define IbmVethPool1DftSize (1024 * 4)
-#define IbmVethPool2DftSize (1024 * 10)
-#define IbmVethPool0DftCnt 256
-#define IbmVethPool1DftCnt 256
-#define IbmVethPool2DftCnt 256
+#define h_free_logical_lan_buffer(ua, bufsize) \
+ plpar_hcall_norets(H_FREE_LOGICAL_LAN_BUFFER, ua, bufsize)
+
+#define IbmVethNumBufferPools 5
+#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */
+
+/* pool_size should be sorted */
+static int pool_size[] = { 512, 1024 * 2, 1024 * 16, 1024 * 32, 1024 * 64 };
+static int pool_count[] = { 256, 768, 256, 256, 256 };
#define IBM_VETH_INVALID_MAP ((u16)0xffff)
@@ -90,6 +93,7 @@ struct ibmveth_buff_pool {
u16 *free_map;
dma_addr_t *dma_addr;
struct sk_buff **skbuff;
+ int active;
};
struct ibmveth_rx_q {
OpenPOWER on IntegriCloud