aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qla3xxx.h
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2007-02-26 14:06:37 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-27 04:21:44 -0500
commit1357bfcf71063637d16a7014639d675b5cbf5189 (patch)
treeceddef8001201bcc1a84af6421f052923d5270c6 /drivers/net/qla3xxx.h
parentcb8bac12ec92ec469ecfe0967429bf9032f835c1 (diff)
qla3xxx: Dynamically size the rx buffer queue based on the MTU.
This change removes use of constants for rx buffer queue size and instead calculates the queue length based on what he MTU is set to. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/qla3xxx.h')
-rwxr-xr-xdrivers/net/qla3xxx.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h
index b2d76ea68827..51173e585ce9 100755
--- a/drivers/net/qla3xxx.h
+++ b/drivers/net/qla3xxx.h
@@ -1014,13 +1014,15 @@ struct eeprom_data {
1014 1014
1015/* Transmit and Receive Buffers */ 1015/* Transmit and Receive Buffers */
1016#define NUM_LBUFQ_ENTRIES 128 1016#define NUM_LBUFQ_ENTRIES 128
1017#define JUMBO_NUM_LBUFQ_ENTRIES \
1018(NUM_LBUFQ_ENTRIES/(JUMBO_MTU_SIZE/NORMAL_MTU_SIZE))
1017#define NUM_SBUFQ_ENTRIES 64 1019#define NUM_SBUFQ_ENTRIES 64
1018#define QL_SMALL_BUFFER_SIZE 32 1020#define QL_SMALL_BUFFER_SIZE 32
1019#define QL_ADDR_ELE_PER_BUFQ_ENTRY \ 1021#define QL_ADDR_ELE_PER_BUFQ_ENTRY \
1020(sizeof(struct lrg_buf_q_entry) / sizeof(struct bufq_addr_element)) 1022(sizeof(struct lrg_buf_q_entry) / sizeof(struct bufq_addr_element))
1021 /* Each send has at least control block. This is how many we keep. */ 1023 /* Each send has at least control block. This is how many we keep. */
1022#define NUM_SMALL_BUFFERS NUM_SBUFQ_ENTRIES * QL_ADDR_ELE_PER_BUFQ_ENTRY 1024#define NUM_SMALL_BUFFERS NUM_SBUFQ_ENTRIES * QL_ADDR_ELE_PER_BUFQ_ENTRY
1023#define NUM_LARGE_BUFFERS NUM_LBUFQ_ENTRIES * QL_ADDR_ELE_PER_BUFQ_ENTRY 1025
1024#define QL_HEADER_SPACE 32 /* make header space at top of skb. */ 1026#define QL_HEADER_SPACE 32 /* make header space at top of skb. */
1025/* 1027/*
1026 * Large & Small Buffers for Receives 1028 * Large & Small Buffers for Receives
@@ -1207,9 +1209,11 @@ struct ql3_adapter {
1207 u32 lrg_buf_q_producer_index; 1209 u32 lrg_buf_q_producer_index;
1208 u32 lrg_buf_release_cnt; 1210 u32 lrg_buf_release_cnt;
1209 struct bufq_addr_element *lrg_buf_next_free; 1211 struct bufq_addr_element *lrg_buf_next_free;
1212 u32 num_large_buffers;
1213 u32 num_lbufq_entries;
1210 1214
1211 /* Large (Receive) Buffers */ 1215 /* Large (Receive) Buffers */
1212 struct ql_rcv_buf_cb lrg_buf[NUM_LARGE_BUFFERS]; 1216 struct ql_rcv_buf_cb *lrg_buf;
1213 struct ql_rcv_buf_cb *lrg_buf_free_head; 1217 struct ql_rcv_buf_cb *lrg_buf_free_head;
1214 struct ql_rcv_buf_cb *lrg_buf_free_tail; 1218 struct ql_rcv_buf_cb *lrg_buf_free_tail;
1215 u32 lrg_buf_free_count; 1219 u32 lrg_buf_free_count;