提交 4f1df844 编写于 作者: S Selvin Xavier 提交者: Roland Dreier

RDMA/ocrdma: Increase the size of STAG array in dev structure to 16K

HW can support 16K STAG entries.  Change this max limit.  Also, move
this array out of ocrdma_dev to reduce the size of this structure.
Signed-off-by: NDevesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: NSelvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 920de55d
...@@ -236,7 +236,7 @@ struct ocrdma_dev { ...@@ -236,7 +236,7 @@ struct ocrdma_dev {
struct list_head entry; struct list_head entry;
struct rcu_head rcu; struct rcu_head rcu;
int id; int id;
u64 stag_arr[OCRDMA_MAX_STAG]; u64 *stag_arr;
u8 sl; /* service level */ u8 sl; /* service level */
bool pfc_state; bool pfc_state;
atomic_t update_sl; atomic_t update_sl;
......
...@@ -324,6 +324,11 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev) ...@@ -324,6 +324,11 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev)
if (!dev->qp_tbl) if (!dev->qp_tbl)
goto alloc_err; goto alloc_err;
} }
dev->stag_arr = kzalloc(sizeof(u64) * OCRDMA_MAX_STAG, GFP_KERNEL);
if (dev->stag_arr == NULL)
goto alloc_err;
spin_lock_init(&dev->av_tbl.lock); spin_lock_init(&dev->av_tbl.lock);
spin_lock_init(&dev->flush_q_lock); spin_lock_init(&dev->flush_q_lock);
return 0; return 0;
...@@ -334,6 +339,7 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev) ...@@ -334,6 +339,7 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev)
static void ocrdma_free_resources(struct ocrdma_dev *dev) static void ocrdma_free_resources(struct ocrdma_dev *dev)
{ {
kfree(dev->stag_arr);
kfree(dev->qp_tbl); kfree(dev->qp_tbl);
kfree(dev->cq_tbl); kfree(dev->cq_tbl);
kfree(dev->sgid_tbl); kfree(dev->sgid_tbl);
......
...@@ -107,7 +107,7 @@ enum { ...@@ -107,7 +107,7 @@ enum {
#define OCRDMA_MAX_QP 2048 #define OCRDMA_MAX_QP 2048
#define OCRDMA_MAX_CQ 2048 #define OCRDMA_MAX_CQ 2048
#define OCRDMA_MAX_STAG 8192 #define OCRDMA_MAX_STAG 16384
enum { enum {
OCRDMA_DB_RQ_OFFSET = 0xE0, OCRDMA_DB_RQ_OFFSET = 0xE0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册