Commit cf992af5 authored by Divy Le Ray's avatar Divy Le Ray Committed by Jeff Garzik

cxgb3 - sge page management

Streamline sge page management.
Fix dma mappings when buffers are recycled.
Signed-off-by: default avatarDivy Le Ray <divy@chelsio.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 287aa83d
...@@ -71,27 +71,29 @@ enum { /* adapter flags */ ...@@ -71,27 +71,29 @@ enum { /* adapter flags */
QUEUES_BOUND = (1 << 3), QUEUES_BOUND = (1 << 3),
}; };
struct fl_pg_chunk {
struct page *page;
void *va;
unsigned int offset;
};
struct rx_desc; struct rx_desc;
struct rx_sw_desc; struct rx_sw_desc;
struct sge_fl_page { struct sge_fl { /* SGE per free-buffer list state */
struct skb_frag_struct frag; unsigned int buf_size; /* size of each Rx buffer */
unsigned char *va; unsigned int credits; /* # of available Rx buffers */
}; unsigned int size; /* capacity of free list */
unsigned int cidx; /* consumer index */
struct sge_fl { /* SGE per free-buffer list state */ unsigned int pidx; /* producer index */
unsigned int buf_size; /* size of each Rx buffer */ unsigned int gen; /* free list generation */
unsigned int credits; /* # of available Rx buffers */ struct fl_pg_chunk pg_chunk;/* page chunk cache */
unsigned int size; /* capacity of free list */ unsigned int use_pages; /* whether FL uses pages or sk_buffs */
unsigned int cidx; /* consumer index */ struct rx_desc *desc; /* address of HW Rx descriptor ring */
unsigned int pidx; /* producer index */ struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */
unsigned int gen; /* free list generation */ dma_addr_t phys_addr; /* physical address of HW ring start */
unsigned int cntxt_id; /* SGE context id for the free list */ unsigned int cntxt_id; /* SGE context id for the free list */
struct sge_fl_page page; unsigned long empty; /* # of times queue ran out of buffers */
struct rx_desc *desc; /* address of HW Rx descriptor ring */
struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */
dma_addr_t phys_addr; /* physical address of HW ring start */
unsigned long empty; /* # of times queue ran out of buffers */
unsigned long alloc_failed; /* # of times buffer allocation failed */ unsigned long alloc_failed; /* # of times buffer allocation failed */
}; };
......
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