The 'rds_ib_sysctl_max_recv_allocation' allocation is used to manage
and allocate the size of IB receive queue entry (RQE) for each IB
connection. However, it relies on the hardcoded RDS_FRAG_SIZE.
Lets make it scalable based on supported fragment sizes for different
IB connection. Each connection can allocate different RQE size
depending on the per connection fragment_size.
Orabug:
21894138
Reviewed-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
/* Protocol version specific information */
unsigned int i_flowctl:1; /* enable/disable flow ctl */
u16 i_frag_sz; /* IB fragment size */
+ int8_t i_frag_pages:1;
/* Batched completions */
unsigned int i_unsignaled_wrs;
return NULL;
avail_allocs = atomic_add_unless(&rds_ib_allocation,
- 1, rds_ib_sysctl_max_recv_allocation);
-
+ ic->i_frag_pages,
+ rds_ib_sysctl_max_recv_allocation);
if (!avail_allocs) {
if (test_and_clear_bit(0, &rds_ib_allocation_warn)) {
printk(KERN_NOTICE "RDS/IB: WARNING - "
ic->i_frag_sz, page_mask);
if (ret) {
kmem_cache_free(rds_ib_frag_slab, frag);
- atomic_dec(&rds_ib_allocation);
+ atomic_sub(ic->i_frag_pages, &rds_ib_allocation);
return NULL;
}
rds_ib_stats_inc(s_ib_rx_total_frags);