Lines Matching refs:t
1062 struct sge_eth_txq *t = &s->ethtxq[pi->first_qset]; in setup_sge_queues() local
1091 for (j = 0; j < pi->nqsets; j++, t++, q++) { in setup_sge_queues()
1092 err = t4_sge_alloc_eth_txq(adap, t, dev, in setup_sge_queues()
1593 int cxgb4_alloc_atid(struct tid_info *t, void *data) in cxgb4_alloc_atid() argument
1597 spin_lock_bh(&t->atid_lock); in cxgb4_alloc_atid()
1598 if (t->afree) { in cxgb4_alloc_atid()
1599 union aopen_entry *p = t->afree; in cxgb4_alloc_atid()
1601 atid = (p - t->atid_tab) + t->atid_base; in cxgb4_alloc_atid()
1602 t->afree = p->next; in cxgb4_alloc_atid()
1604 t->atids_in_use++; in cxgb4_alloc_atid()
1606 spin_unlock_bh(&t->atid_lock); in cxgb4_alloc_atid()
1614 void cxgb4_free_atid(struct tid_info *t, unsigned int atid) in cxgb4_free_atid() argument
1616 union aopen_entry *p = &t->atid_tab[atid - t->atid_base]; in cxgb4_free_atid()
1618 spin_lock_bh(&t->atid_lock); in cxgb4_free_atid()
1619 p->next = t->afree; in cxgb4_free_atid()
1620 t->afree = p; in cxgb4_free_atid()
1621 t->atids_in_use--; in cxgb4_free_atid()
1622 spin_unlock_bh(&t->atid_lock); in cxgb4_free_atid()
1629 int cxgb4_alloc_stid(struct tid_info *t, int family, void *data) in cxgb4_alloc_stid() argument
1633 spin_lock_bh(&t->stid_lock); in cxgb4_alloc_stid()
1635 stid = find_first_zero_bit(t->stid_bmap, t->nstids); in cxgb4_alloc_stid()
1636 if (stid < t->nstids) in cxgb4_alloc_stid()
1637 __set_bit(stid, t->stid_bmap); in cxgb4_alloc_stid()
1641 stid = bitmap_find_free_region(t->stid_bmap, t->nstids, 1); in cxgb4_alloc_stid()
1646 t->stid_tab[stid].data = data; in cxgb4_alloc_stid()
1647 stid += t->stid_base; in cxgb4_alloc_stid()
1653 t->stids_in_use += 2; in cxgb4_alloc_stid()
1654 t->v6_stids_in_use += 2; in cxgb4_alloc_stid()
1656 t->stids_in_use++; in cxgb4_alloc_stid()
1659 spin_unlock_bh(&t->stid_lock); in cxgb4_alloc_stid()
1666 int cxgb4_alloc_sftid(struct tid_info *t, int family, void *data) in cxgb4_alloc_sftid() argument
1670 spin_lock_bh(&t->stid_lock); in cxgb4_alloc_sftid()
1672 stid = find_next_zero_bit(t->stid_bmap, in cxgb4_alloc_sftid()
1673 t->nstids + t->nsftids, t->nstids); in cxgb4_alloc_sftid()
1674 if (stid < (t->nstids + t->nsftids)) in cxgb4_alloc_sftid()
1675 __set_bit(stid, t->stid_bmap); in cxgb4_alloc_sftid()
1682 t->stid_tab[stid].data = data; in cxgb4_alloc_sftid()
1683 stid -= t->nstids; in cxgb4_alloc_sftid()
1684 stid += t->sftid_base; in cxgb4_alloc_sftid()
1685 t->sftids_in_use++; in cxgb4_alloc_sftid()
1687 spin_unlock_bh(&t->stid_lock); in cxgb4_alloc_sftid()
1694 void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family) in cxgb4_free_stid() argument
1697 if (t->nsftids && (stid >= t->sftid_base)) { in cxgb4_free_stid()
1698 stid -= t->sftid_base; in cxgb4_free_stid()
1699 stid += t->nstids; in cxgb4_free_stid()
1701 stid -= t->stid_base; in cxgb4_free_stid()
1704 spin_lock_bh(&t->stid_lock); in cxgb4_free_stid()
1706 __clear_bit(stid, t->stid_bmap); in cxgb4_free_stid()
1708 bitmap_release_region(t->stid_bmap, stid, 1); in cxgb4_free_stid()
1709 t->stid_tab[stid].data = NULL; in cxgb4_free_stid()
1710 if (stid < t->nstids) { in cxgb4_free_stid()
1712 t->stids_in_use -= 2; in cxgb4_free_stid()
1713 t->v6_stids_in_use -= 2; in cxgb4_free_stid()
1715 t->stids_in_use--; in cxgb4_free_stid()
1718 t->sftids_in_use--; in cxgb4_free_stid()
1721 spin_unlock_bh(&t->stid_lock); in cxgb4_free_stid()
1743 static void cxgb4_queue_tid_release(struct tid_info *t, unsigned int chan, in cxgb4_queue_tid_release() argument
1746 struct adapter *adap = container_of(t, struct adapter, tids); in cxgb4_queue_tid_release()
1747 void **p = &t->tid_tab[tid - t->tid_base]; in cxgb4_queue_tid_release()
1796 void cxgb4_remove_tid(struct tid_info *t, unsigned int chan, unsigned int tid, in cxgb4_remove_tid() argument
1799 struct adapter *adap = container_of(t, struct adapter, tids); in cxgb4_remove_tid()
1804 if (t->tid_tab[tid - adap->tids.tid_base]) { in cxgb4_remove_tid()
1805 t->tid_tab[tid - adap->tids.tid_base] = NULL; in cxgb4_remove_tid()
1806 atomic_dec(&t->conns_in_use); in cxgb4_remove_tid()
1807 if (t->hash_base && (tid >= t->hash_base)) { in cxgb4_remove_tid()
1809 atomic_sub(2, &t->hash_tids_in_use); in cxgb4_remove_tid()
1811 atomic_dec(&t->hash_tids_in_use); in cxgb4_remove_tid()
1814 atomic_sub(2, &t->tids_in_use); in cxgb4_remove_tid()
1816 atomic_dec(&t->tids_in_use); in cxgb4_remove_tid()
1825 cxgb4_queue_tid_release(t, chan, tid); in cxgb4_remove_tid()
1832 static int tid_init(struct tid_info *t) in tid_init() argument
1834 struct adapter *adap = container_of(t, struct adapter, tids); in tid_init()
1835 unsigned int max_ftids = t->nftids + t->nsftids; in tid_init()
1836 unsigned int natids = t->natids; in tid_init()
1843 stid_bmap_size = BITS_TO_LONGS(t->nstids + t->nsftids); in tid_init()
1844 ftid_bmap_size = BITS_TO_LONGS(t->nftids); in tid_init()
1845 hpftid_bmap_size = BITS_TO_LONGS(t->nhpftids); in tid_init()
1846 eotid_bmap_size = BITS_TO_LONGS(t->neotids); in tid_init()
1847 size = t->ntids * sizeof(*t->tid_tab) + in tid_init()
1848 natids * sizeof(*t->atid_tab) + in tid_init()
1849 t->nstids * sizeof(*t->stid_tab) + in tid_init()
1850 t->nsftids * sizeof(*t->stid_tab) + in tid_init()
1852 t->nhpftids * sizeof(*t->hpftid_tab) + in tid_init()
1854 max_ftids * sizeof(*t->ftid_tab) + in tid_init()
1856 t->neotids * sizeof(*t->eotid_tab) + in tid_init()
1859 t->tid_tab = kvzalloc(size, GFP_KERNEL); in tid_init()
1860 if (!t->tid_tab) in tid_init()
1863 t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids]; in tid_init()
1864 t->stid_tab = (struct serv_entry *)&t->atid_tab[natids]; in tid_init()
1865 t->stid_bmap = (unsigned long *)&t->stid_tab[t->nstids + t->nsftids]; in tid_init()
1866 t->hpftid_tab = (struct filter_entry *)&t->stid_bmap[stid_bmap_size]; in tid_init()
1867 t->hpftid_bmap = (unsigned long *)&t->hpftid_tab[t->nhpftids]; in tid_init()
1868 t->ftid_tab = (struct filter_entry *)&t->hpftid_bmap[hpftid_bmap_size]; in tid_init()
1869 t->ftid_bmap = (unsigned long *)&t->ftid_tab[max_ftids]; in tid_init()
1870 t->eotid_tab = (struct eotid_entry *)&t->ftid_bmap[ftid_bmap_size]; in tid_init()
1871 t->eotid_bmap = (unsigned long *)&t->eotid_tab[t->neotids]; in tid_init()
1872 spin_lock_init(&t->stid_lock); in tid_init()
1873 spin_lock_init(&t->atid_lock); in tid_init()
1874 spin_lock_init(&t->ftid_lock); in tid_init()
1876 t->stids_in_use = 0; in tid_init()
1877 t->v6_stids_in_use = 0; in tid_init()
1878 t->sftids_in_use = 0; in tid_init()
1879 t->afree = NULL; in tid_init()
1880 t->atids_in_use = 0; in tid_init()
1881 atomic_set(&t->tids_in_use, 0); in tid_init()
1882 atomic_set(&t->conns_in_use, 0); in tid_init()
1883 atomic_set(&t->hash_tids_in_use, 0); in tid_init()
1884 atomic_set(&t->eotids_in_use, 0); in tid_init()
1889 t->atid_tab[natids - 1].next = &t->atid_tab[natids]; in tid_init()
1890 t->afree = t->atid_tab; in tid_init()
1894 bitmap_zero(t->stid_bmap, t->nstids + t->nsftids); in tid_init()
1896 if (!t->stid_base && in tid_init()
1898 __set_bit(0, t->stid_bmap); in tid_init()
1900 if (t->neotids) in tid_init()
1901 bitmap_zero(t->eotid_bmap, t->neotids); in tid_init()
1904 if (t->nhpftids) in tid_init()
1905 bitmap_zero(t->hpftid_bmap, t->nhpftids); in tid_init()
1906 bitmap_zero(t->ftid_bmap, t->nftids); in tid_init()