Commit 7c734359 authored by Ron Mercer's avatar Ron Mercer Committed by David S. Miller

qlge: Size RX buffers based on MTU.

Change RX large buffer size based on MTU. If pages are larger
than the MTU the page is divided up into multiple chunks and passed to
the hardware.  When pages are smaller than MTU each RX buffer can
contain be comprised of up to 2 pages.
Signed-off-by: default avatarRon Mercer <ron.mercer@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb2ff967
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
MAX_DB_PAGES_PER_BQ(NUM_LARGE_BUFFERS) * sizeof(u64)) MAX_DB_PAGES_PER_BQ(NUM_LARGE_BUFFERS) * sizeof(u64))
#define SMALL_BUFFER_SIZE 512 #define SMALL_BUFFER_SIZE 512
#define SMALL_BUF_MAP_SIZE (SMALL_BUFFER_SIZE / 2) #define SMALL_BUF_MAP_SIZE (SMALL_BUFFER_SIZE / 2)
#define LARGE_BUFFER_SIZE PAGE_SIZE #define LARGE_BUFFER_MAX_SIZE 8192
#define LARGE_BUFFER_MIN_SIZE 2048
#define MAX_SPLIT_SIZE 1023 #define MAX_SPLIT_SIZE 1023
#define QLGE_SB_PAD 32 #define QLGE_SB_PAD 32
...@@ -1201,9 +1202,17 @@ struct tx_ring_desc { ...@@ -1201,9 +1202,17 @@ struct tx_ring_desc {
struct tx_ring_desc *next; struct tx_ring_desc *next;
}; };
struct page_chunk {
struct page *page; /* master page */
char *va; /* virt addr for this chunk */
u64 map; /* mapping for master */
unsigned int offset; /* offset for this chunk */
unsigned int last_flag; /* flag set for last chunk in page */
};
struct bq_desc { struct bq_desc {
union { union {
struct page *lbq_page; struct page_chunk pg_chunk;
struct sk_buff *skb; struct sk_buff *skb;
} p; } p;
__le64 *addr; __le64 *addr;
...@@ -1272,6 +1281,7 @@ struct rx_ring { ...@@ -1272,6 +1281,7 @@ struct rx_ring {
dma_addr_t lbq_base_dma; dma_addr_t lbq_base_dma;
void *lbq_base_indirect; void *lbq_base_indirect;
dma_addr_t lbq_base_indirect_dma; dma_addr_t lbq_base_indirect_dma;
struct page_chunk pg_chunk; /* current page for chunks */
struct bq_desc *lbq; /* array of control blocks */ struct bq_desc *lbq; /* array of control blocks */
void __iomem *lbq_prod_idx_db_reg; /* PCI doorbell mem area + 0x18 */ void __iomem *lbq_prod_idx_db_reg; /* PCI doorbell mem area + 0x18 */
u32 lbq_prod_idx; /* current sw prod idx */ u32 lbq_prod_idx; /* current sw prod idx */
...@@ -1526,6 +1536,7 @@ struct ql_adapter { ...@@ -1526,6 +1536,7 @@ struct ql_adapter {
struct rx_ring rx_ring[MAX_RX_RINGS]; struct rx_ring rx_ring[MAX_RX_RINGS];
struct tx_ring tx_ring[MAX_TX_RINGS]; struct tx_ring tx_ring[MAX_TX_RINGS];
unsigned int lbq_buf_order;
int rx_csum; int rx_csum;
u32 default_rx_queue; u32 default_rx_queue;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment