aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/vnic_rq.h
diff options
context:
space:
mode:
authorVasanthy Kolluri <vkolluri@cisco.com>2010-06-24 06:51:51 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-25 23:50:24 -0400
commitb5bab85c15ed3d1ae7f917a7c077086ac6c04572 (patch)
treee7a259fc15178a546cd9e4d0757ec040b4209bc6 /drivers/net/enic/vnic_rq.h
parent70feadf36df94dc0dc2f32fec4c131ecd75344f2 (diff)
enic: Use receive queue buffer blocks of 32/64 entries
Change the receive queue buffer allocations into blocks of 32 entries when ring size is less than 64, otherwise use 64 entries per block. Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/vnic_rq.h')
-rw-r--r--drivers/net/enic/vnic_rq.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/enic/vnic_rq.h b/drivers/net/enic/vnic_rq.h
index 35e736cc2d88..8f0fb78f0cdf 100644
--- a/drivers/net/enic/vnic_rq.h
+++ b/drivers/net/enic/vnic_rq.h
@@ -52,12 +52,16 @@ struct vnic_rq_ctrl {
52 u32 pad10; 52 u32 pad10;
53}; 53};
54 54
55/* Break the vnic_rq_buf allocations into blocks of 64 entries */ 55/* Break the vnic_rq_buf allocations into blocks of 32/64 entries */
56#define VNIC_RQ_BUF_BLK_ENTRIES 64 56#define VNIC_RQ_BUF_MIN_BLK_ENTRIES 32
57#define VNIC_RQ_BUF_BLK_SZ \ 57#define VNIC_RQ_BUF_DFLT_BLK_ENTRIES 64
58 (VNIC_RQ_BUF_BLK_ENTRIES * sizeof(struct vnic_rq_buf)) 58#define VNIC_RQ_BUF_BLK_ENTRIES(entries) \
59 ((unsigned int)((entries < VNIC_RQ_BUF_DFLT_BLK_ENTRIES) ? \
60 VNIC_RQ_BUF_MIN_BLK_ENTRIES : VNIC_RQ_BUF_DFLT_BLK_ENTRIES))
61#define VNIC_RQ_BUF_BLK_SZ(entries) \
62 (VNIC_RQ_BUF_BLK_ENTRIES(entries) * sizeof(struct vnic_rq_buf))
59#define VNIC_RQ_BUF_BLKS_NEEDED(entries) \ 63#define VNIC_RQ_BUF_BLKS_NEEDED(entries) \
60 DIV_ROUND_UP(entries, VNIC_RQ_BUF_BLK_ENTRIES) 64 DIV_ROUND_UP(entries, VNIC_RQ_BUF_BLK_ENTRIES(entries))
61#define VNIC_RQ_BUF_BLKS_MAX VNIC_RQ_BUF_BLKS_NEEDED(4096) 65#define VNIC_RQ_BUF_BLKS_MAX VNIC_RQ_BUF_BLKS_NEEDED(4096)
62 66
63struct vnic_rq_buf { 67struct vnic_rq_buf {