diff options
author | Michael Chan | 2018-01-17 09:21:11 +0100 |
---|---|---|
committer | David S. Miller | 2018-01-17 20:48:26 +0100 |
commit | 4673d66468b80dc37abd1159a4bd038128173d48 (patch) | |
tree | 77ef772b4ebb79ecb256fe435114c4b38ad3b66e /drivers/net/ethernet/broadcom/bnxt/bnxt.c | |
parent | bnxt_en: Reserve resources for RFS. (diff) | |
download | kernel-qcow2-linux-4673d66468b80dc37abd1159a4bd038128173d48.tar.gz kernel-qcow2-linux-4673d66468b80dc37abd1159a4bd038128173d48.tar.xz kernel-qcow2-linux-4673d66468b80dc37abd1159a4bd038128173d48.zip |
bnxt_en: Implement new method for the PF to assign SRIOV resources.
Instead of the old method of evenly dividing the resources to the VFs,
use the new firmware API to specify min and max resources for each VF.
This way, there is more flexibility for each VF to allocate more or less
resources.
The min is the absolute minimum for each VF to function. The max is the
global resources minus the resources used by the PF. Each VF is
guaranteed the min. Up to max resources may be available for some VFs.
The PF driver can use one of 2 strategies specified in NVRAM to assign
the resources. The old legacy strategy of evenly dividing the resources
or the new flexible strategy.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 8b74e6e86bb4..de79c9049181 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -5018,6 +5018,14 @@ static int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp) hw_resc->min_stat_ctxs = le16_to_cpu(resp->min_stat_ctx); hw_resc->max_stat_ctxs = le16_to_cpu(resp->max_stat_ctx); + if (BNXT_PF(bp)) { + struct bnxt_pf_info *pf = &bp->pf; + + pf->vf_resv_strategy = + le16_to_cpu(resp->vf_reservation_strategy); + if (pf->vf_resv_strategy > BNXT_VF_RESV_STRATEGY_MINIMAL) + pf->vf_resv_strategy = BNXT_VF_RESV_STRATEGY_MAXIMAL; + } hwrm_func_resc_qcaps_exit: mutex_unlock(&bp->hwrm_cmd_lock); return rc; |