Lines Matching refs:ddp
120 if (cdev->ddp) in cxgbi_device_destroy()
1289 static inline int ddp_find_unused_entries(struct cxgbi_ddp_info *ddp, in ddp_find_unused_entries() argument
1304 spin_lock(&ddp->map_lock); in ddp_find_unused_entries()
1307 if (ddp->gl_map[k]) in ddp_find_unused_entries()
1312 ddp->gl_map[k] = gl; in ddp_find_unused_entries()
1313 spin_unlock(&ddp->map_lock); in ddp_find_unused_entries()
1318 spin_unlock(&ddp->map_lock); in ddp_find_unused_entries()
1324 static inline void ddp_unmark_entries(struct cxgbi_ddp_info *ddp, in ddp_unmark_entries() argument
1327 spin_lock(&ddp->map_lock); in ddp_unmark_entries()
1328 memset(&ddp->gl_map[start], 0, in ddp_unmark_entries()
1330 spin_unlock(&ddp->map_lock); in ddp_unmark_entries()
1465 struct cxgbi_ddp_info *ddp = cdev->ddp; in ddp_tag_release() local
1468 idx = (tag >> PPOD_IDX_SHIFT) & ddp->idx_mask; in ddp_tag_release()
1469 if (idx < ddp->nppods) { in ddp_tag_release()
1470 struct cxgbi_gather_list *gl = ddp->gl_map[idx]; in ddp_tag_release()
1483 ddp_unmark_entries(ddp, idx, npods); in ddp_tag_release()
1484 ddp_release_gl(gl, ddp->pdev); in ddp_tag_release()
1486 pr_warn("tag 0x%x, idx %u > max %u.\n", tag, idx, ddp->nppods); in ddp_tag_release()
1494 struct cxgbi_ddp_info *ddp = cdev->ddp; in ddp_tag_reserve() local
1503 if (ddp->idx_last == ddp->nppods) in ddp_tag_reserve()
1504 idx = ddp_find_unused_entries(ddp, 0, ddp->nppods, in ddp_tag_reserve()
1507 idx = ddp_find_unused_entries(ddp, ddp->idx_last + 1, in ddp_tag_reserve()
1508 ddp->nppods, npods, in ddp_tag_reserve()
1510 if (idx < 0 && ddp->idx_last >= npods) { in ddp_tag_reserve()
1511 idx = ddp_find_unused_entries(ddp, 0, in ddp_tag_reserve()
1512 min(ddp->idx_last + npods, ddp->nppods), in ddp_tag_reserve()
1528 hdr.pgsz_tag_clr = htonl(tag & ddp->rsvd_tag_mask); in ddp_tag_reserve()
1536 ddp->idx_last = idx; in ddp_tag_reserve()
1545 ddp_unmark_entries(ddp, idx, npods); in ddp_tag_reserve()
1558 if (page_idx >= DDP_PGIDX_MAX || !cdev->ddp || in cxgbi_ddp_reserve()
1584 struct cxgbi_ddp_info *ddp = container_of(kref, in ddp_destroy() local
1587 struct cxgbi_device *cdev = ddp->cdev; in ddp_destroy()
1590 pr_info("kref 0, destroy ddp 0x%p, cdev 0x%p.\n", ddp, cdev); in ddp_destroy()
1592 while (i < ddp->nppods) { in ddp_destroy()
1593 struct cxgbi_gather_list *gl = ddp->gl_map[i]; in ddp_destroy()
1604 cxgbi_free_big_mem(ddp); in ddp_destroy()
1609 struct cxgbi_ddp_info *ddp = cdev->ddp; in cxgbi_ddp_cleanup() local
1612 "cdev 0x%p, release ddp 0x%p.\n", cdev, ddp); in cxgbi_ddp_cleanup()
1613 cdev->ddp = NULL; in cxgbi_ddp_cleanup()
1614 if (ddp) in cxgbi_ddp_cleanup()
1615 return kref_put(&ddp->refcnt, ddp_destroy); in cxgbi_ddp_cleanup()
1624 struct cxgbi_ddp_info *ddp; in cxgbi_ddp_init() local
1633 ddp = cxgbi_alloc_big_mem(sizeof(struct cxgbi_ddp_info) + in cxgbi_ddp_init()
1637 if (!ddp) { in cxgbi_ddp_init()
1641 ddp->gl_map = (struct cxgbi_gather_list **)(ddp + 1); in cxgbi_ddp_init()
1642 cdev->ddp = ddp; in cxgbi_ddp_init()
1644 spin_lock_init(&ddp->map_lock); in cxgbi_ddp_init()
1645 kref_init(&ddp->refcnt); in cxgbi_ddp_init()
1647 ddp->cdev = cdev; in cxgbi_ddp_init()
1648 ddp->pdev = cdev->pdev; in cxgbi_ddp_init()
1649 ddp->llimit = llimit; in cxgbi_ddp_init()
1650 ddp->ulimit = ulimit; in cxgbi_ddp_init()
1651 ddp->max_txsz = min_t(unsigned int, max_txsz, ULP2_MAX_PKT_SIZE); in cxgbi_ddp_init()
1652 ddp->max_rxsz = min_t(unsigned int, max_rxsz, ULP2_MAX_PKT_SIZE); in cxgbi_ddp_init()
1653 ddp->nppods = ppmax; in cxgbi_ddp_init()
1654 ddp->idx_last = ppmax; in cxgbi_ddp_init()
1655 ddp->idx_bits = bits; in cxgbi_ddp_init()
1656 ddp->idx_mask = (1 << bits) - 1; in cxgbi_ddp_init()
1657 ddp->rsvd_tag_mask = (1 << (bits + PPOD_IDX_SHIFT)) - 1; in cxgbi_ddp_init()
1660 cdev->tag_format.rsvd_bits = ddp->idx_bits; in cxgbi_ddp_init()
1670 ddp->max_txsz - ISCSI_PDU_NONPAYLOAD_LEN); in cxgbi_ddp_init()
1672 ddp->max_rxsz - ISCSI_PDU_NONPAYLOAD_LEN); in cxgbi_ddp_init()
1676 cdev->ports[0]->name, cdev->tx_max_size, ddp->max_txsz, in cxgbi_ddp_init()
1677 cdev->rx_max_size, ddp->max_rxsz); in cxgbi_ddp_init()