提交 e22bb45d 编写于 作者: D Divy Le Ray 提交者: David S. Miller

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: NDivy Le Ray <divy@chelsio.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 27186dc3
...@@ -33,27 +33,29 @@ ...@@ -33,27 +33,29 @@
#define _CXGB3_OFFLOAD_CTL_DEFS_H #define _CXGB3_OFFLOAD_CTL_DEFS_H
enum { enum {
GET_MAX_OUTSTANDING_WR, GET_MAX_OUTSTANDING_WR = 0,
GET_TX_MAX_CHUNK, GET_TX_MAX_CHUNK = 1,
GET_TID_RANGE, GET_TID_RANGE = 2,
GET_STID_RANGE, GET_STID_RANGE = 3,
GET_RTBL_RANGE, GET_RTBL_RANGE = 4,
GET_L2T_CAPACITY, GET_L2T_CAPACITY = 5,
GET_MTUS, GET_MTUS = 6,
GET_WR_LEN, GET_WR_LEN = 7,
GET_IFF_FROM_MAC, GET_IFF_FROM_MAC = 8,
GET_DDP_PARAMS, GET_DDP_PARAMS = 9,
GET_PORTS, GET_PORTS = 10,
ULP_ISCSI_GET_PARAMS, ULP_ISCSI_GET_PARAMS = 11,
ULP_ISCSI_SET_PARAMS, ULP_ISCSI_SET_PARAMS = 12,
RDMA_GET_PARAMS, RDMA_GET_PARAMS = 13,
RDMA_CQ_OP, RDMA_CQ_OP = 14,
RDMA_CQ_SETUP, RDMA_CQ_SETUP = 15,
RDMA_CQ_DISABLE, RDMA_CQ_DISABLE = 16,
RDMA_CTRL_QP_SETUP, RDMA_CTRL_QP_SETUP = 17,
RDMA_GET_MEM, RDMA_GET_MEM = 18,
GET_RX_PAGE_INFO = 50,
}; };
/* /*
...@@ -161,4 +163,12 @@ struct rdma_ctrlqp_setup { ...@@ -161,4 +163,12 @@ struct rdma_ctrlqp_setup {
unsigned long long base_addr; unsigned long long base_addr;
unsigned int size; unsigned int size;
}; };
/*
* Offload TX/RX page information.
*/
struct ofld_page_info {
unsigned int page_size; /* Page size, should be a power of 2 */
unsigned int num; /* Number of pages */
};
#endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */ #endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */
...@@ -317,6 +317,8 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data) ...@@ -317,6 +317,8 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
struct iff_mac *iffmacp; struct iff_mac *iffmacp;
struct ddp_params *ddpp; struct ddp_params *ddpp;
struct adap_ports *ports; struct adap_ports *ports;
struct ofld_page_info *rx_page_info;
struct tp_params *tp = &adapter->params.tp;
int i; int i;
switch (req) { switch (req) {
...@@ -382,6 +384,11 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data) ...@@ -382,6 +384,11 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
if (!offload_running(adapter)) if (!offload_running(adapter))
return -EAGAIN; return -EAGAIN;
return cxgb_rdma_ctl(adapter, req, data); return cxgb_rdma_ctl(adapter, req, data);
case GET_RX_PAGE_INFO:
rx_page_info = data;
rx_page_info->page_size = tp->rx_pg_size;
rx_page_info->num = tp->rx_num_pgs;
break;
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册