• Home
  • Raw
  • Download

Lines Matching refs:buf_desc

48 			 struct smc_buf_desc *buf_desc);
674 static void smcr_buf_unmap_link(struct smc_buf_desc *buf_desc, bool is_rmb, in smcr_buf_unmap_link() argument
678 buf_desc->is_reg_mr[lnk->link_idx] = false; in smcr_buf_unmap_link()
679 if (!buf_desc->is_map_ib[lnk->link_idx]) in smcr_buf_unmap_link()
682 if (buf_desc->mr_rx[lnk->link_idx]) { in smcr_buf_unmap_link()
684 buf_desc->mr_rx[lnk->link_idx]); in smcr_buf_unmap_link()
685 buf_desc->mr_rx[lnk->link_idx] = NULL; in smcr_buf_unmap_link()
687 smc_ib_buf_unmap_sg(lnk, buf_desc, DMA_FROM_DEVICE); in smcr_buf_unmap_link()
689 smc_ib_buf_unmap_sg(lnk, buf_desc, DMA_TO_DEVICE); in smcr_buf_unmap_link()
691 sg_free_table(&buf_desc->sgt[lnk->link_idx]); in smcr_buf_unmap_link()
692 buf_desc->is_map_ib[lnk->link_idx] = false; in smcr_buf_unmap_link()
699 struct smc_buf_desc *buf_desc, *bf; in smcr_buf_unmap_lgr() local
704 list_for_each_entry_safe(buf_desc, bf, &lgr->rmbs[i], list) in smcr_buf_unmap_lgr()
705 smcr_buf_unmap_link(buf_desc, true, lnk); in smcr_buf_unmap_lgr()
708 list_for_each_entry_safe(buf_desc, bf, &lgr->sndbufs[i], in smcr_buf_unmap_lgr()
710 smcr_buf_unmap_link(buf_desc, false, lnk); in smcr_buf_unmap_lgr()
751 struct smc_buf_desc *buf_desc) in smcr_buf_free() argument
756 smcr_buf_unmap_link(buf_desc, is_rmb, &lgr->lnk[i]); in smcr_buf_free()
758 if (buf_desc->pages) in smcr_buf_free()
759 __free_pages(buf_desc->pages, buf_desc->order); in smcr_buf_free()
760 kfree(buf_desc); in smcr_buf_free()
764 struct smc_buf_desc *buf_desc) in smcd_buf_free() argument
768 buf_desc->len += sizeof(struct smcd_cdc_msg); in smcd_buf_free()
769 smc_ism_unregister_dmb(lgr->smcd, buf_desc); in smcd_buf_free()
771 kfree(buf_desc->cpu_addr); in smcd_buf_free()
773 kfree(buf_desc); in smcd_buf_free()
777 struct smc_buf_desc *buf_desc) in smc_buf_free() argument
780 smcd_buf_free(lgr, is_rmb, buf_desc); in smc_buf_free()
782 smcr_buf_free(lgr, is_rmb, buf_desc); in smc_buf_free()
787 struct smc_buf_desc *buf_desc, *bf_desc; in __smc_lgr_free_bufs() local
796 list_for_each_entry_safe(buf_desc, bf_desc, buf_list, in __smc_lgr_free_bufs()
798 list_del(&buf_desc->list); in __smc_lgr_free_bufs()
799 smc_buf_free(lgr, is_rmb, buf_desc); in __smc_lgr_free_bufs()
846 struct smc_buf_desc *buf_desc; in smcd_unregister_all_dmbs() local
848 list_for_each_entry(buf_desc, &lgr->rmbs[i], list) { in smcd_unregister_all_dmbs()
849 buf_desc->len += sizeof(struct smcd_cdc_msg); in smcd_unregister_all_dmbs()
850 smc_ism_unregister_dmb(lgr->smcd, buf_desc); in smcd_unregister_all_dmbs()
1435 static int smcr_buf_map_link(struct smc_buf_desc *buf_desc, bool is_rmb, in smcr_buf_map_link() argument
1440 if (buf_desc->is_map_ib[lnk->link_idx]) in smcr_buf_map_link()
1443 rc = sg_alloc_table(&buf_desc->sgt[lnk->link_idx], 1, GFP_KERNEL); in smcr_buf_map_link()
1446 sg_set_buf(buf_desc->sgt[lnk->link_idx].sgl, in smcr_buf_map_link()
1447 buf_desc->cpu_addr, buf_desc->len); in smcr_buf_map_link()
1450 rc = smc_ib_buf_map_sg(lnk, buf_desc, in smcr_buf_map_link()
1463 buf_desc, lnk->link_idx); in smcr_buf_map_link()
1466 smc_ib_sync_sg_for_device(lnk, buf_desc, DMA_FROM_DEVICE); in smcr_buf_map_link()
1468 buf_desc->is_map_ib[lnk->link_idx] = true; in smcr_buf_map_link()
1472 smc_ib_buf_unmap_sg(lnk, buf_desc, in smcr_buf_map_link()
1475 sg_free_table(&buf_desc->sgt[lnk->link_idx]); in smcr_buf_map_link()
1500 struct smc_buf_desc *buf_desc, *bf; in _smcr_buf_map_lgr() local
1504 list_for_each_entry_safe(buf_desc, bf, lst, list) { in _smcr_buf_map_lgr()
1505 if (!buf_desc->used) in _smcr_buf_map_lgr()
1507 rc = smcr_buf_map_link(buf_desc, is_rmb, lnk); in _smcr_buf_map_lgr()
1541 struct smc_buf_desc *buf_desc, *bf; in smcr_buf_reg_lgr() local
1546 list_for_each_entry_safe(buf_desc, bf, &lgr->rmbs[i], list) { in smcr_buf_reg_lgr()
1547 if (!buf_desc->used) in smcr_buf_reg_lgr()
1549 rc = smcr_link_reg_rmb(lnk, buf_desc); in smcr_buf_reg_lgr()
1562 struct smc_buf_desc *buf_desc; in smcr_new_buf_create() local
1565 buf_desc = kzalloc(sizeof(*buf_desc), GFP_KERNEL); in smcr_new_buf_create()
1566 if (!buf_desc) in smcr_new_buf_create()
1569 buf_desc->order = get_order(bufsize); in smcr_new_buf_create()
1570 buf_desc->pages = alloc_pages(GFP_KERNEL | __GFP_NOWARN | in smcr_new_buf_create()
1573 buf_desc->order); in smcr_new_buf_create()
1574 if (!buf_desc->pages) { in smcr_new_buf_create()
1575 kfree(buf_desc); in smcr_new_buf_create()
1578 buf_desc->cpu_addr = (void *)page_address(buf_desc->pages); in smcr_new_buf_create()
1579 buf_desc->len = bufsize; in smcr_new_buf_create()
1580 return buf_desc; in smcr_new_buf_create()
1587 struct smc_buf_desc *buf_desc, bool is_rmb) in smcr_buf_map_usable_links() argument
1598 if (smcr_buf_map_link(buf_desc, is_rmb, lnk)) { in smcr_buf_map_usable_links()
1616 struct smc_buf_desc *buf_desc; in smcd_new_buf_create() local
1623 buf_desc = kzalloc(sizeof(*buf_desc), GFP_KERNEL); in smcd_new_buf_create()
1624 if (!buf_desc) in smcd_new_buf_create()
1627 rc = smc_ism_register_dmb(lgr, bufsize, buf_desc); in smcd_new_buf_create()
1629 kfree(buf_desc); in smcd_new_buf_create()
1636 buf_desc->pages = virt_to_page(buf_desc->cpu_addr); in smcd_new_buf_create()
1638 buf_desc->len = bufsize - sizeof(struct smcd_cdc_msg); in smcd_new_buf_create()
1640 buf_desc->cpu_addr = kzalloc(bufsize, GFP_KERNEL | in smcd_new_buf_create()
1643 if (!buf_desc->cpu_addr) { in smcd_new_buf_create()
1644 kfree(buf_desc); in smcd_new_buf_create()
1647 buf_desc->len = bufsize; in smcd_new_buf_create()
1649 return buf_desc; in smcd_new_buf_create()
1654 struct smc_buf_desc *buf_desc = ERR_PTR(-ENOMEM); in __smc_buf_create() local
1684 buf_desc = smc_buf_get_slot(bufsize_short, lock, buf_list); in __smc_buf_create()
1685 if (buf_desc) { in __smc_buf_create()
1686 memset(buf_desc->cpu_addr, 0, bufsize); in __smc_buf_create()
1691 buf_desc = smcd_new_buf_create(lgr, is_rmb, bufsize); in __smc_buf_create()
1693 buf_desc = smcr_new_buf_create(lgr, is_rmb, bufsize); in __smc_buf_create()
1695 if (PTR_ERR(buf_desc) == -ENOMEM) in __smc_buf_create()
1697 if (IS_ERR(buf_desc)) in __smc_buf_create()
1700 buf_desc->used = 1; in __smc_buf_create()
1702 list_add(&buf_desc->list, buf_list); in __smc_buf_create()
1707 if (IS_ERR(buf_desc)) in __smc_buf_create()
1708 return PTR_ERR(buf_desc); in __smc_buf_create()
1711 if (smcr_buf_map_usable_links(lgr, buf_desc, is_rmb)) { in __smc_buf_create()
1712 smcr_buf_unuse(buf_desc, lgr); in __smc_buf_create()
1718 conn->rmb_desc = buf_desc; in __smc_buf_create()
1723 smc_rmb_wnd_update_limit(buf_desc->len); in __smc_buf_create()
1727 conn->sndbuf_desc = buf_desc; in __smc_buf_create()