aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-08-21 23:49:21 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:50:49 -0400
commite22bb45d772b5e5c850a6223c2a3245f520de641 (patch)
treeb386f5e9d7e3ee953ecfdc6997a9cfdfe33e2312 /drivers/net/cxgb3
parent27186dc325c3bbb937a27a2467cefd64e2505158 (diff)
cxgb3 - Expose HW memory page info
A HW issue requires limiting the receive window size to 23 pages of internal memory. These pages can be configured to different sizes, thus the RDMA driver needs to know the page size to enforce the upper limit. Also assign explicit enum values. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r--drivers/net/cxgb3/cxgb3_ctl_defs.h52
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c7
2 files changed, 38 insertions, 21 deletions
diff --git a/drivers/net/cxgb3/cxgb3_ctl_defs.h b/drivers/net/cxgb3/cxgb3_ctl_defs.h
index 2095ddacff78..6c4f32066919 100644
--- a/drivers/net/cxgb3/cxgb3_ctl_defs.h
+++ b/drivers/net/cxgb3/cxgb3_ctl_defs.h
@@ -33,27 +33,29 @@
33#define _CXGB3_OFFLOAD_CTL_DEFS_H 33#define _CXGB3_OFFLOAD_CTL_DEFS_H
34 34
35enum { 35enum {
36 GET_MAX_OUTSTANDING_WR, 36 GET_MAX_OUTSTANDING_WR = 0,
37 GET_TX_MAX_CHUNK, 37 GET_TX_MAX_CHUNK = 1,
38 GET_TID_RANGE, 38 GET_TID_RANGE = 2,
39 GET_STID_RANGE, 39 GET_STID_RANGE = 3,
40 GET_RTBL_RANGE, 40 GET_RTBL_RANGE = 4,
41 GET_L2T_CAPACITY, 41 GET_L2T_CAPACITY = 5,
42 GET_MTUS, 42 GET_MTUS = 6,
43 GET_WR_LEN, 43 GET_WR_LEN = 7,
44 GET_IFF_FROM_MAC, 44 GET_IFF_FROM_MAC = 8,
45 GET_DDP_PARAMS, 45 GET_DDP_PARAMS = 9,
46 GET_PORTS, 46 GET_PORTS = 10,
47 47
48 ULP_ISCSI_GET_PARAMS, 48 ULP_ISCSI_GET_PARAMS = 11,
49 ULP_ISCSI_SET_PARAMS, 49 ULP_ISCSI_SET_PARAMS = 12,
50 50
51 RDMA_GET_PARAMS, 51 RDMA_GET_PARAMS = 13,
52 RDMA_CQ_OP, 52 RDMA_CQ_OP = 14,
53 RDMA_CQ_SETUP, 53 RDMA_CQ_SETUP = 15,
54 RDMA_CQ_DISABLE, 54 RDMA_CQ_DISABLE = 16,
55 RDMA_CTRL_QP_SETUP, 55 RDMA_CTRL_QP_SETUP = 17,
56 RDMA_GET_MEM, 56 RDMA_GET_MEM = 18,
57
58 GET_RX_PAGE_INFO = 50,
57}; 59};
58 60
59/* 61/*
@@ -161,4 +163,12 @@ struct rdma_ctrlqp_setup {
161 unsigned long long base_addr; 163 unsigned long long base_addr;
162 unsigned int size; 164 unsigned int size;
163}; 165};
166
167/*
168 * Offload TX/RX page information.
169 */
170struct ofld_page_info {
171 unsigned int page_size; /* Page size, should be a power of 2 */
172 unsigned int num; /* Number of pages */
173};
164#endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */ 174#endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index bdff7baeb59d..bac9214170ae 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -317,6 +317,8 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
317 struct iff_mac *iffmacp; 317 struct iff_mac *iffmacp;
318 struct ddp_params *ddpp; 318 struct ddp_params *ddpp;
319 struct adap_ports *ports; 319 struct adap_ports *ports;
320 struct ofld_page_info *rx_page_info;
321 struct tp_params *tp = &adapter->params.tp;
320 int i; 322 int i;
321 323
322 switch (req) { 324 switch (req) {
@@ -382,6 +384,11 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
382 if (!offload_running(adapter)) 384 if (!offload_running(adapter))
383 return -EAGAIN; 385 return -EAGAIN;
384 return cxgb_rdma_ctl(adapter, req, data); 386 return cxgb_rdma_ctl(adapter, req, data);
387 case GET_RX_PAGE_INFO:
388 rx_page_info = data;
389 rx_page_info->page_size = tp->rx_pg_size;
390 rx_page_info->num = tp->rx_num_pgs;
391 break;
385 default: 392 default:
386 return -EOPNOTSUPP; 393 return -EOPNOTSUPP;
387 } 394 }