Commit 377f111e authored by Mitko Haralanov's avatar Mitko Haralanov Committed by Doug Ledford

staging/rdma/hfi1: Verbs Mem affinity support

Change verbs memory allocations to the device numa node.  This keeps memory
close to the device for optimal performance.
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarMitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent cc57236f
...@@ -134,7 +134,8 @@ int hfi1_create_ctxts(struct hfi1_devdata *dd) ...@@ -134,7 +134,8 @@ int hfi1_create_ctxts(struct hfi1_devdata *dd)
/* Control context has to be always 0 */ /* Control context has to be always 0 */
BUILD_BUG_ON(HFI1_CTRL_CTXT != 0); BUILD_BUG_ON(HFI1_CTRL_CTXT != 0);
dd->rcd = kcalloc(dd->num_rcv_contexts, sizeof(*dd->rcd), GFP_KERNEL); dd->rcd = kzalloc_node(dd->num_rcv_contexts * sizeof(*dd->rcd),
GFP_KERNEL, dd->node);
if (!dd->rcd) if (!dd->rcd)
goto nomem; goto nomem;
......
...@@ -596,13 +596,13 @@ void *qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp, ...@@ -596,13 +596,13 @@ void *qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp,
{ {
struct hfi1_qp_priv *priv; struct hfi1_qp_priv *priv;
priv = kzalloc(sizeof(*priv), gfp); priv = kzalloc_node(sizeof(*priv), gfp, rdi->dparms.node);
if (!priv) if (!priv)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
priv->owner = qp; priv->owner = qp;
priv->s_hdr = kzalloc(sizeof(*priv->s_hdr), gfp); priv->s_hdr = kzalloc_node(sizeof(*priv->s_hdr), gfp, rdi->dparms.node);
if (!priv->s_hdr) { if (!priv->s_hdr) {
kfree(priv); kfree(priv);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
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