Lines Matching refs:egrbufs
423 rcd->egrbufs.count = round_down(rcvtids, in hfi1_create_ctxtdata()
425 if (rcd->egrbufs.count > MAX_EAGER_ENTRIES) { in hfi1_create_ctxtdata()
428 rcd->egrbufs.count = MAX_EAGER_ENTRIES; in hfi1_create_ctxtdata()
432 rcd->ctxt, rcd->egrbufs.count); in hfi1_create_ctxtdata()
442 rcd->egrbufs.buffers = in hfi1_create_ctxtdata()
443 kcalloc_node(rcd->egrbufs.count, in hfi1_create_ctxtdata()
444 sizeof(*rcd->egrbufs.buffers), in hfi1_create_ctxtdata()
446 if (!rcd->egrbufs.buffers) in hfi1_create_ctxtdata()
448 rcd->egrbufs.rcvtids = in hfi1_create_ctxtdata()
449 kcalloc_node(rcd->egrbufs.count, in hfi1_create_ctxtdata()
450 sizeof(*rcd->egrbufs.rcvtids), in hfi1_create_ctxtdata()
452 if (!rcd->egrbufs.rcvtids) in hfi1_create_ctxtdata()
454 rcd->egrbufs.size = eager_buffer_size; in hfi1_create_ctxtdata()
460 if (rcd->egrbufs.size < hfi1_max_mtu) { in hfi1_create_ctxtdata()
461 rcd->egrbufs.size = __roundup_pow_of_two(hfi1_max_mtu); in hfi1_create_ctxtdata()
464 rcd->ctxt, rcd->egrbufs.size); in hfi1_create_ctxtdata()
466 rcd->egrbufs.rcvtid_size = HFI1_MAX_EAGER_BUFFER_SIZE; in hfi1_create_ctxtdata()
1140 kfree(rcd->egrbufs.rcvtids); in hfi1_free_ctxtdata()
1141 rcd->egrbufs.rcvtids = NULL; in hfi1_free_ctxtdata()
1143 for (e = 0; e < rcd->egrbufs.alloced; e++) { in hfi1_free_ctxtdata()
1144 if (rcd->egrbufs.buffers[e].dma) in hfi1_free_ctxtdata()
1146 rcd->egrbufs.buffers[e].len, in hfi1_free_ctxtdata()
1147 rcd->egrbufs.buffers[e].addr, in hfi1_free_ctxtdata()
1148 rcd->egrbufs.buffers[e].dma); in hfi1_free_ctxtdata()
1150 kfree(rcd->egrbufs.buffers); in hfi1_free_ctxtdata()
1151 rcd->egrbufs.alloced = 0; in hfi1_free_ctxtdata()
1152 rcd->egrbufs.buffers = NULL; in hfi1_free_ctxtdata()
1936 if (rcd->egrbufs.size < (round_mtu * dd->rcv_entries.group_size)) in hfi1_setup_eagerbufs()
1937 rcd->egrbufs.size = round_mtu * dd->rcv_entries.group_size; in hfi1_setup_eagerbufs()
1943 rcd->egrbufs.rcvtid_size = round_mtu; in hfi1_setup_eagerbufs()
1949 if (rcd->egrbufs.size <= (1 << 20)) in hfi1_setup_eagerbufs()
1950 rcd->egrbufs.rcvtid_size = max((unsigned long)round_mtu, in hfi1_setup_eagerbufs()
1951 rounddown_pow_of_two(rcd->egrbufs.size / 8)); in hfi1_setup_eagerbufs()
1953 while (alloced_bytes < rcd->egrbufs.size && in hfi1_setup_eagerbufs()
1954 rcd->egrbufs.alloced < rcd->egrbufs.count) { in hfi1_setup_eagerbufs()
1955 rcd->egrbufs.buffers[idx].addr = in hfi1_setup_eagerbufs()
1957 rcd->egrbufs.rcvtid_size, in hfi1_setup_eagerbufs()
1958 &rcd->egrbufs.buffers[idx].dma, in hfi1_setup_eagerbufs()
1960 if (rcd->egrbufs.buffers[idx].addr) { in hfi1_setup_eagerbufs()
1961 rcd->egrbufs.buffers[idx].len = in hfi1_setup_eagerbufs()
1962 rcd->egrbufs.rcvtid_size; in hfi1_setup_eagerbufs()
1963 rcd->egrbufs.rcvtids[rcd->egrbufs.alloced].addr = in hfi1_setup_eagerbufs()
1964 rcd->egrbufs.buffers[idx].addr; in hfi1_setup_eagerbufs()
1965 rcd->egrbufs.rcvtids[rcd->egrbufs.alloced].dma = in hfi1_setup_eagerbufs()
1966 rcd->egrbufs.buffers[idx].dma; in hfi1_setup_eagerbufs()
1967 rcd->egrbufs.alloced++; in hfi1_setup_eagerbufs()
1968 alloced_bytes += rcd->egrbufs.rcvtid_size; in hfi1_setup_eagerbufs()
1980 if (rcd->egrbufs.rcvtid_size == round_mtu || in hfi1_setup_eagerbufs()
1988 new_size = rcd->egrbufs.rcvtid_size / 2; in hfi1_setup_eagerbufs()
1996 rcd->egrbufs.rcvtid_size = new_size; in hfi1_setup_eagerbufs()
2004 rcd->egrbufs.alloced = 0; in hfi1_setup_eagerbufs()
2006 if (i >= rcd->egrbufs.count) in hfi1_setup_eagerbufs()
2008 rcd->egrbufs.rcvtids[i].dma = in hfi1_setup_eagerbufs()
2009 rcd->egrbufs.buffers[j].dma + offset; in hfi1_setup_eagerbufs()
2010 rcd->egrbufs.rcvtids[i].addr = in hfi1_setup_eagerbufs()
2011 rcd->egrbufs.buffers[j].addr + offset; in hfi1_setup_eagerbufs()
2012 rcd->egrbufs.alloced++; in hfi1_setup_eagerbufs()
2013 if ((rcd->egrbufs.buffers[j].dma + offset + in hfi1_setup_eagerbufs()
2015 (rcd->egrbufs.buffers[j].dma + in hfi1_setup_eagerbufs()
2016 rcd->egrbufs.buffers[j].len)) { in hfi1_setup_eagerbufs()
2023 rcd->egrbufs.rcvtid_size = new_size; in hfi1_setup_eagerbufs()
2026 rcd->egrbufs.numbufs = idx; in hfi1_setup_eagerbufs()
2027 rcd->egrbufs.size = alloced_bytes; in hfi1_setup_eagerbufs()
2031 rcd->ctxt, rcd->egrbufs.alloced, in hfi1_setup_eagerbufs()
2032 rcd->egrbufs.rcvtid_size / 1024, rcd->egrbufs.size / 1024); in hfi1_setup_eagerbufs()
2039 rcd->egrbufs.threshold = in hfi1_setup_eagerbufs()
2040 rounddown_pow_of_two(rcd->egrbufs.alloced / 2); in hfi1_setup_eagerbufs()
2047 egrtop = roundup(rcd->egrbufs.alloced, dd->rcv_entries.group_size); in hfi1_setup_eagerbufs()
2054 rcd->ctxt, rcd->egrbufs.alloced, rcd->expected_count, in hfi1_setup_eagerbufs()
2057 if (!hfi1_rcvbuf_validate(rcd->egrbufs.rcvtid_size, PT_EAGER, &order)) { in hfi1_setup_eagerbufs()
2060 rcd->ctxt, rcd->egrbufs.rcvtid_size); in hfi1_setup_eagerbufs()
2065 for (idx = 0; idx < rcd->egrbufs.alloced; idx++) { in hfi1_setup_eagerbufs()
2067 rcd->egrbufs.rcvtids[idx].dma, order); in hfi1_setup_eagerbufs()
2074 for (idx = 0; idx < rcd->egrbufs.alloced && in hfi1_setup_eagerbufs()
2075 rcd->egrbufs.buffers[idx].addr; in hfi1_setup_eagerbufs()
2078 rcd->egrbufs.buffers[idx].len, in hfi1_setup_eagerbufs()
2079 rcd->egrbufs.buffers[idx].addr, in hfi1_setup_eagerbufs()
2080 rcd->egrbufs.buffers[idx].dma); in hfi1_setup_eagerbufs()
2081 rcd->egrbufs.buffers[idx].addr = NULL; in hfi1_setup_eagerbufs()
2082 rcd->egrbufs.buffers[idx].dma = 0; in hfi1_setup_eagerbufs()
2083 rcd->egrbufs.buffers[idx].len = 0; in hfi1_setup_eagerbufs()