Lines Matching full:mw

485 			     struct hns_roce_mw *mw)  in hns_roce_mw_free()  argument
490 if (mw->enabled) { in hns_roce_mw_free()
492 key_to_hw_index(mw->rkey) & in hns_roce_mw_free()
495 dev_warn(dev, "MW DESTROY_MPT failed (%d)\n", ret); in hns_roce_mw_free()
498 key_to_hw_index(mw->rkey)); in hns_roce_mw_free()
502 (int)key_to_hw_index(mw->rkey)); in hns_roce_mw_free()
506 struct hns_roce_mw *mw) in hns_roce_mw_enable() argument
511 unsigned long mtpt_idx = key_to_hw_index(mw->rkey); in hns_roce_mw_enable()
525 ret = hr_dev->hw->mw_write_mtpt(mailbox->buf, mw); in hns_roce_mw_enable()
527 dev_err(dev, "MW write mtpt fail!\n"); in hns_roce_mw_enable()
534 dev_err(dev, "MW CREATE_MPT failed (%d)\n", ret); in hns_roce_mw_enable()
538 mw->enabled = 1; in hns_roce_mw_enable()
558 struct hns_roce_mw *mw = to_hr_mw(ibmw); in hns_roce_alloc_mw() local
562 /* Allocate a key for mw from mr_table */ in hns_roce_alloc_mw()
566 ibdev_err(ibdev, "failed to alloc id for MW key, id(%d)\n", id); in hns_roce_alloc_mw()
570 mw->rkey = hw_index_to_key(id); in hns_roce_alloc_mw()
572 ibmw->rkey = mw->rkey; in hns_roce_alloc_mw()
573 mw->pdn = to_hr_pd(ibmw->pd)->pdn; in hns_roce_alloc_mw()
574 mw->pbl_hop_num = hr_dev->caps.pbl_hop_num; in hns_roce_alloc_mw()
575 mw->pbl_ba_pg_sz = hr_dev->caps.pbl_ba_pg_sz; in hns_roce_alloc_mw()
576 mw->pbl_buf_pg_sz = hr_dev->caps.pbl_buf_pg_sz; in hns_roce_alloc_mw()
578 ret = hns_roce_mw_enable(hr_dev, mw); in hns_roce_alloc_mw()
585 hns_roce_mw_free(hr_dev, mw); in hns_roce_alloc_mw()
592 struct hns_roce_mw *mw = to_hr_mw(ibmw); in hns_roce_dealloc_mw() local
594 hns_roce_mw_free(hr_dev, mw); in hns_roce_dealloc_mw()