Commit 8e9f04a7 authored by Chien Tin Tung's avatar Chien Tin Tung Committed by Doug Ledford

RDMA/i40iw: Correct STag mask to min of 14 bits

STag index mask is calculated incorrectly, missing
the 14 bits minimum requirement. Add max macro to use
either # of MRs or 14 bits in the mask size calculation.
Signed-off-by: default avatarTatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: default avatarFaisal Latif <faisal.latif@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 9510b066
......@@ -107,7 +107,8 @@ u32 i40iw_initialize_hw_resources(struct i40iw_device *iwdev)
spin_lock_init(&iwdev->resource_lock);
spin_lock_init(&iwdev->qptable_lock);
mrdrvbits = 24 - get_count_order(iwdev->max_mr);
/* stag index mask has a minimum of 14 bits */
mrdrvbits = 24 - max(get_count_order(iwdev->max_mr), 14);
iwdev->mr_stagmask = ~(((1 << mrdrvbits) - 1) << (32 - mrdrvbits));
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment