Skip to content

Commit

Permalink
qlge: Size RX buffers based on MTU.
Browse files Browse the repository at this point in the history
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: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ron Mercer authored and David S. Miller committed Oct 20, 2009
1 parent eb2ff96 commit 7c73435
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 74 deletions.
15 changes: 13 additions & 2 deletions drivers/net/qlge/qlge.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
MAX_DB_PAGES_PER_BQ(NUM_LARGE_BUFFERS) * sizeof(u64))
#define SMALL_BUFFER_SIZE 512
#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 QLGE_SB_PAD 32

Expand Down Expand Up @@ -1201,9 +1202,17 @@ struct tx_ring_desc {
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 {
union {
struct page *lbq_page;
struct page_chunk pg_chunk;
struct sk_buff *skb;
} p;
__le64 *addr;
Expand Down Expand Up @@ -1272,6 +1281,7 @@ struct rx_ring {
dma_addr_t lbq_base_dma;
void *lbq_base_indirect;
dma_addr_t lbq_base_indirect_dma;
struct page_chunk pg_chunk; /* current page for chunks */
struct bq_desc *lbq; /* array of control blocks */
void __iomem *lbq_prod_idx_db_reg; /* PCI doorbell mem area + 0x18 */
u32 lbq_prod_idx; /* current sw prod idx */
Expand Down Expand Up @@ -1526,6 +1536,7 @@ struct ql_adapter {

struct rx_ring rx_ring[MAX_RX_RINGS];
struct tx_ring tx_ring[MAX_TX_RINGS];
unsigned int lbq_buf_order;

int rx_csum;
u32 default_rx_queue;
Expand Down
Loading

0 comments on commit 7c73435

Please sign in to comment.