aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/qla3xxx.h
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2007-02-26 11:06:37 -0800
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 b2d76ea6882..51173e585ce 100755
--- a/drivers/net/qla3xxx.h
+++ b/drivers/net/qla3xxx.h
@@ -1014,13 +1014,15 @@ struct eeprom_data {
/* Transmit and Receive Buffers */
#define NUM_LBUFQ_ENTRIES 128
+#define JUMBO_NUM_LBUFQ_ENTRIES \
+(NUM_LBUFQ_ENTRIES/(JUMBO_MTU_SIZE/NORMAL_MTU_SIZE))
#define NUM_SBUFQ_ENTRIES 64
#define QL_SMALL_BUFFER_SIZE 32
#define QL_ADDR_ELE_PER_BUFQ_ENTRY \
(sizeof(struct lrg_buf_q_entry) / sizeof(struct bufq_addr_element))
/* Each send has at least control block. This is how many we keep. */
#define NUM_SMALL_BUFFERS NUM_SBUFQ_ENTRIES * QL_ADDR_ELE_PER_BUFQ_ENTRY
-#define NUM_LARGE_BUFFERS NUM_LBUFQ_ENTRIES * QL_ADDR_ELE_PER_BUFQ_ENTRY
+
#define QL_HEADER_SPACE 32 /* make header space at top of skb. */
/*
* Large & Small Buffers for Receives
@@ -1207,9 +1209,11 @@ struct ql3_adapter {
u32 lrg_buf_q_producer_index;
u32 lrg_buf_release_cnt;
struct bufq_addr_element *lrg_buf_next_free;
+ u32 num_large_buffers;
+ u32 num_lbufq_entries;
/* Large (Receive) Buffers */
- struct ql_rcv_buf_cb lrg_buf[NUM_LARGE_BUFFERS];
+ struct ql_rcv_buf_cb *lrg_buf;
struct ql_rcv_buf_cb *lrg_buf_free_head;
struct ql_rcv_buf_cb *lrg_buf_free_tail;
u32 lrg_buf_free_count;