i40iw: Query device accounts for internal rsrc
Some resources are consumed internally and not available to the user. After hw is initialized, figure out how many resources are consumed and subtract those numbers from the initial max device capability in i40iw_query_device(). Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:

zatwierdzone przez
Doug Ledford

rodzic
e7f9774af5
commit
85a87c90ee
@@ -1557,6 +1557,20 @@ exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* i40iw_get_used_rsrc - determine resources used internally
|
||||
* @iwdev: iwarp device
|
||||
*
|
||||
* Called after internal allocations
|
||||
*/
|
||||
static void i40iw_get_used_rsrc(struct i40iw_device *iwdev)
|
||||
{
|
||||
iwdev->used_pds = find_next_zero_bit(iwdev->allocated_pds, iwdev->max_pd, 0);
|
||||
iwdev->used_qps = find_next_zero_bit(iwdev->allocated_qps, iwdev->max_qp, 0);
|
||||
iwdev->used_cqs = find_next_zero_bit(iwdev->allocated_cqs, iwdev->max_cq, 0);
|
||||
iwdev->used_mrs = find_next_zero_bit(iwdev->allocated_mrs, iwdev->max_mr, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* i40iw_open - client interface operation open for iwarp/uda device
|
||||
* @ldev: lan device information
|
||||
@@ -1629,6 +1643,7 @@ static int i40iw_open(struct i40e_info *ldev, struct i40e_client *client)
|
||||
status = i40iw_initialize_hw_resources(iwdev);
|
||||
if (status)
|
||||
break;
|
||||
i40iw_get_used_rsrc(iwdev);
|
||||
dev->ccq_ops->ccq_arm(dev->ccq);
|
||||
status = i40iw_hmc_init_pble(&iwdev->sc_dev, iwdev->pble_rsrc);
|
||||
if (status)
|
||||
|
Reference in New Issue
Block a user