Lines Matching full:mw
484 struct hns_roce_mw *mw) in hns_roce_mw_free() argument
489 if (mw->enabled) { in hns_roce_mw_free()
491 key_to_hw_index(mw->rkey) & in hns_roce_mw_free()
494 dev_warn(dev, "MW DESTROY_MPT failed (%d)\n", ret); in hns_roce_mw_free()
497 key_to_hw_index(mw->rkey)); in hns_roce_mw_free()
501 (int)key_to_hw_index(mw->rkey)); in hns_roce_mw_free()
505 struct hns_roce_mw *mw) in hns_roce_mw_enable() argument
510 unsigned long mtpt_idx = key_to_hw_index(mw->rkey); in hns_roce_mw_enable()
524 ret = hr_dev->hw->mw_write_mtpt(mailbox->buf, mw); in hns_roce_mw_enable()
526 dev_err(dev, "MW write mtpt fail!\n"); in hns_roce_mw_enable()
533 dev_err(dev, "MW CREATE_MPT failed (%d)\n", ret); in hns_roce_mw_enable()
537 mw->enabled = 1; in hns_roce_mw_enable()
557 struct hns_roce_mw *mw = to_hr_mw(ibmw); in hns_roce_alloc_mw() local
561 /* Allocate a key for mw from mr_table */ in hns_roce_alloc_mw()
565 ibdev_err(ibdev, "failed to alloc id for MW key, id(%d)\n", id); in hns_roce_alloc_mw()
569 mw->rkey = hw_index_to_key(id); in hns_roce_alloc_mw()
571 ibmw->rkey = mw->rkey; in hns_roce_alloc_mw()
572 mw->pdn = to_hr_pd(ibmw->pd)->pdn; in hns_roce_alloc_mw()
573 mw->pbl_hop_num = hr_dev->caps.pbl_hop_num; in hns_roce_alloc_mw()
574 mw->pbl_ba_pg_sz = hr_dev->caps.pbl_ba_pg_sz; in hns_roce_alloc_mw()
575 mw->pbl_buf_pg_sz = hr_dev->caps.pbl_buf_pg_sz; in hns_roce_alloc_mw()
577 ret = hns_roce_mw_enable(hr_dev, mw); in hns_roce_alloc_mw()
584 hns_roce_mw_free(hr_dev, mw); in hns_roce_alloc_mw()
591 struct hns_roce_mw *mw = to_hr_mw(ibmw); in hns_roce_dealloc_mw() local
593 hns_roce_mw_free(hr_dev, mw); in hns_roce_dealloc_mw()