diff options
author | Santiago Leon <santil@us.ibm.com> | 2005-10-26 12:47:01 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 16:07:30 -0400 |
commit | b6d35182fe62e57d368062adcc880ca35119d88e (patch) | |
tree | dd7767a40490d2d532cda4d35a18f8b8e614ab19 /drivers/net/ibmveth.h | |
parent | 0abe791e94033b727f2b55670c2966f3d3d3cf70 (diff) |
[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.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h index 51a470da9686..a5d27a9cdf1f 100644 --- a/drivers/net/ibmveth.h +++ b/drivers/net/ibmveth.h | |||
@@ -49,6 +49,7 @@ | |||
49 | #define H_SEND_LOGICAL_LAN 0x120 | 49 | #define H_SEND_LOGICAL_LAN 0x120 |
50 | #define H_MULTICAST_CTRL 0x130 | 50 | #define H_MULTICAST_CTRL 0x130 |
51 | #define H_CHANGE_LOGICAL_LAN_MAC 0x14C | 51 | #define H_CHANGE_LOGICAL_LAN_MAC 0x14C |
52 | #define H_FREE_LOGICAL_LAN_BUFFER 0x1D4 | ||
52 | 53 | ||
53 | /* hcall macros */ | 54 | /* hcall macros */ |
54 | #define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \ | 55 | #define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \ |
@@ -69,13 +70,15 @@ | |||
69 | #define h_change_logical_lan_mac(ua, mac) \ | 70 | #define h_change_logical_lan_mac(ua, mac) \ |
70 | plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac) | 71 | plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac) |
71 | 72 | ||
72 | #define IbmVethNumBufferPools 3 | 73 | #define h_free_logical_lan_buffer(ua, bufsize) \ |
73 | #define IbmVethPool0DftSize (1024 * 2) | 74 | plpar_hcall_norets(H_FREE_LOGICAL_LAN_BUFFER, ua, bufsize) |
74 | #define IbmVethPool1DftSize (1024 * 4) | 75 | |
75 | #define IbmVethPool2DftSize (1024 * 10) | 76 | #define IbmVethNumBufferPools 5 |
76 | #define IbmVethPool0DftCnt 256 | 77 | #define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */ |
77 | #define IbmVethPool1DftCnt 256 | 78 | |
78 | #define IbmVethPool2DftCnt 256 | 79 | /* pool_size should be sorted */ |
80 | static int pool_size[] = { 512, 1024 * 2, 1024 * 16, 1024 * 32, 1024 * 64 }; | ||
81 | static int pool_count[] = { 256, 768, 256, 256, 256 }; | ||
79 | 82 | ||
80 | #define IBM_VETH_INVALID_MAP ((u16)0xffff) | 83 | #define IBM_VETH_INVALID_MAP ((u16)0xffff) |
81 | 84 | ||
@@ -90,6 +93,7 @@ struct ibmveth_buff_pool { | |||
90 | u16 *free_map; | 93 | u16 *free_map; |
91 | dma_addr_t *dma_addr; | 94 | dma_addr_t *dma_addr; |
92 | struct sk_buff **skbuff; | 95 | struct sk_buff **skbuff; |
96 | int active; | ||
93 | }; | 97 | }; |
94 | 98 | ||
95 | struct ibmveth_rx_q { | 99 | struct ibmveth_rx_q { |