Lines Matching refs:egrbufs

395 		rcd->egrbufs.count = round_down(rcvtids,  in hfi1_create_ctxtdata()
397 if (rcd->egrbufs.count > MAX_EAGER_ENTRIES) { in hfi1_create_ctxtdata()
400 rcd->egrbufs.count = MAX_EAGER_ENTRIES; in hfi1_create_ctxtdata()
404 rcd->ctxt, rcd->egrbufs.count); in hfi1_create_ctxtdata()
414 rcd->egrbufs.buffers = in hfi1_create_ctxtdata()
415 kcalloc_node(rcd->egrbufs.count, in hfi1_create_ctxtdata()
416 sizeof(*rcd->egrbufs.buffers), in hfi1_create_ctxtdata()
418 if (!rcd->egrbufs.buffers) in hfi1_create_ctxtdata()
420 rcd->egrbufs.rcvtids = in hfi1_create_ctxtdata()
421 kcalloc_node(rcd->egrbufs.count, in hfi1_create_ctxtdata()
422 sizeof(*rcd->egrbufs.rcvtids), in hfi1_create_ctxtdata()
424 if (!rcd->egrbufs.rcvtids) in hfi1_create_ctxtdata()
426 rcd->egrbufs.size = eager_buffer_size; in hfi1_create_ctxtdata()
432 if (rcd->egrbufs.size < hfi1_max_mtu) { in hfi1_create_ctxtdata()
433 rcd->egrbufs.size = __roundup_pow_of_two(hfi1_max_mtu); in hfi1_create_ctxtdata()
436 rcd->ctxt, rcd->egrbufs.size); in hfi1_create_ctxtdata()
438 rcd->egrbufs.rcvtid_size = HFI1_MAX_EAGER_BUFFER_SIZE; in hfi1_create_ctxtdata()
1106 kfree(rcd->egrbufs.rcvtids); in hfi1_free_ctxtdata()
1107 rcd->egrbufs.rcvtids = NULL; in hfi1_free_ctxtdata()
1109 for (e = 0; e < rcd->egrbufs.alloced; e++) { in hfi1_free_ctxtdata()
1110 if (rcd->egrbufs.buffers[e].addr) in hfi1_free_ctxtdata()
1112 rcd->egrbufs.buffers[e].len, in hfi1_free_ctxtdata()
1113 rcd->egrbufs.buffers[e].addr, in hfi1_free_ctxtdata()
1114 rcd->egrbufs.buffers[e].dma); in hfi1_free_ctxtdata()
1116 kfree(rcd->egrbufs.buffers); in hfi1_free_ctxtdata()
1117 rcd->egrbufs.alloced = 0; in hfi1_free_ctxtdata()
1118 rcd->egrbufs.buffers = NULL; in hfi1_free_ctxtdata()
1829 if (rcd->egrbufs.size < (round_mtu * dd->rcv_entries.group_size)) in hfi1_setup_eagerbufs()
1830 rcd->egrbufs.size = round_mtu * dd->rcv_entries.group_size; in hfi1_setup_eagerbufs()
1836 rcd->egrbufs.rcvtid_size = round_mtu; in hfi1_setup_eagerbufs()
1842 if (rcd->egrbufs.size <= (1 << 20)) in hfi1_setup_eagerbufs()
1843 rcd->egrbufs.rcvtid_size = max((unsigned long)round_mtu, in hfi1_setup_eagerbufs()
1844 rounddown_pow_of_two(rcd->egrbufs.size / 8)); in hfi1_setup_eagerbufs()
1846 while (alloced_bytes < rcd->egrbufs.size && in hfi1_setup_eagerbufs()
1847 rcd->egrbufs.alloced < rcd->egrbufs.count) { in hfi1_setup_eagerbufs()
1848 rcd->egrbufs.buffers[idx].addr = in hfi1_setup_eagerbufs()
1850 rcd->egrbufs.rcvtid_size, in hfi1_setup_eagerbufs()
1851 &rcd->egrbufs.buffers[idx].dma, in hfi1_setup_eagerbufs()
1853 if (rcd->egrbufs.buffers[idx].addr) { in hfi1_setup_eagerbufs()
1854 rcd->egrbufs.buffers[idx].len = in hfi1_setup_eagerbufs()
1855 rcd->egrbufs.rcvtid_size; in hfi1_setup_eagerbufs()
1856 rcd->egrbufs.rcvtids[rcd->egrbufs.alloced].addr = in hfi1_setup_eagerbufs()
1857 rcd->egrbufs.buffers[idx].addr; in hfi1_setup_eagerbufs()
1858 rcd->egrbufs.rcvtids[rcd->egrbufs.alloced].dma = in hfi1_setup_eagerbufs()
1859 rcd->egrbufs.buffers[idx].dma; in hfi1_setup_eagerbufs()
1860 rcd->egrbufs.alloced++; in hfi1_setup_eagerbufs()
1861 alloced_bytes += rcd->egrbufs.rcvtid_size; in hfi1_setup_eagerbufs()
1873 if (rcd->egrbufs.rcvtid_size == round_mtu || in hfi1_setup_eagerbufs()
1881 new_size = rcd->egrbufs.rcvtid_size / 2; in hfi1_setup_eagerbufs()
1889 rcd->egrbufs.rcvtid_size = new_size; in hfi1_setup_eagerbufs()
1897 rcd->egrbufs.alloced = 0; in hfi1_setup_eagerbufs()
1899 if (i >= rcd->egrbufs.count) in hfi1_setup_eagerbufs()
1901 rcd->egrbufs.rcvtids[i].dma = in hfi1_setup_eagerbufs()
1902 rcd->egrbufs.buffers[j].dma + offset; in hfi1_setup_eagerbufs()
1903 rcd->egrbufs.rcvtids[i].addr = in hfi1_setup_eagerbufs()
1904 rcd->egrbufs.buffers[j].addr + offset; in hfi1_setup_eagerbufs()
1905 rcd->egrbufs.alloced++; in hfi1_setup_eagerbufs()
1906 if ((rcd->egrbufs.buffers[j].dma + offset + in hfi1_setup_eagerbufs()
1908 (rcd->egrbufs.buffers[j].dma + in hfi1_setup_eagerbufs()
1909 rcd->egrbufs.buffers[j].len)) { in hfi1_setup_eagerbufs()
1916 rcd->egrbufs.rcvtid_size = new_size; in hfi1_setup_eagerbufs()
1919 rcd->egrbufs.numbufs = idx; in hfi1_setup_eagerbufs()
1920 rcd->egrbufs.size = alloced_bytes; in hfi1_setup_eagerbufs()
1924 rcd->ctxt, rcd->egrbufs.alloced, in hfi1_setup_eagerbufs()
1925 rcd->egrbufs.rcvtid_size / 1024, rcd->egrbufs.size / 1024); in hfi1_setup_eagerbufs()
1932 rcd->egrbufs.threshold = in hfi1_setup_eagerbufs()
1933 rounddown_pow_of_two(rcd->egrbufs.alloced / 2); in hfi1_setup_eagerbufs()
1940 egrtop = roundup(rcd->egrbufs.alloced, dd->rcv_entries.group_size); in hfi1_setup_eagerbufs()
1947 rcd->ctxt, rcd->egrbufs.alloced, rcd->expected_count, in hfi1_setup_eagerbufs()
1950 if (!hfi1_rcvbuf_validate(rcd->egrbufs.rcvtid_size, PT_EAGER, &order)) { in hfi1_setup_eagerbufs()
1953 rcd->ctxt, rcd->egrbufs.rcvtid_size); in hfi1_setup_eagerbufs()
1958 for (idx = 0; idx < rcd->egrbufs.alloced; idx++) { in hfi1_setup_eagerbufs()
1960 rcd->egrbufs.rcvtids[idx].dma, order); in hfi1_setup_eagerbufs()
1967 for (idx = 0; idx < rcd->egrbufs.alloced && in hfi1_setup_eagerbufs()
1968 rcd->egrbufs.buffers[idx].addr; in hfi1_setup_eagerbufs()
1971 rcd->egrbufs.buffers[idx].len, in hfi1_setup_eagerbufs()
1972 rcd->egrbufs.buffers[idx].addr, in hfi1_setup_eagerbufs()
1973 rcd->egrbufs.buffers[idx].dma); in hfi1_setup_eagerbufs()
1974 rcd->egrbufs.buffers[idx].addr = NULL; in hfi1_setup_eagerbufs()
1975 rcd->egrbufs.buffers[idx].dma = 0; in hfi1_setup_eagerbufs()
1976 rcd->egrbufs.buffers[idx].len = 0; in hfi1_setup_eagerbufs()