summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt.c
diff options
context:
space:
mode:
authorMichael Chan2015-12-28 00:19:26 +0100
committerDavid S. Miller2015-12-28 06:57:28 +0100
commit4a21b49b34c01137a67bf0fe185c5d0fff747e4d (patch)
treec6649b5ef3fbbf28ad320565bd7825d7042b27dc /drivers/net/ethernet/broadcom/bnxt/bnxt.c
parentbnxt_en: Cleanup bnxt_hwrm_func_cfg(). (diff)
downloadkernel-qcow2-linux-4a21b49b34c01137a67bf0fe185c5d0fff747e4d.tar.gz
kernel-qcow2-linux-4a21b49b34c01137a67bf0fe185c5d0fff747e4d.tar.xz
kernel-qcow2-linux-4a21b49b34c01137a67bf0fe185c5d0fff747e4d.zip
bnxt_en: Improve VF resource accounting.
We need to keep track of all resources, such as rx rings, tx rings, cmpl rings, rss contexts, stats contexts, vnics, after we have divided them for the VFs. Otherwise, subsequent ring changes on the PF may not work correctly. We adjust all max resources in struct bnxt_pf_info after they have been assigned to the VFs. There is no need to keep the separate max_pf_tx_rings and max_pf_rx_rings. When SR-IOV is disabled, we call bnxt_hwrm_func_qcaps() to restore the max resources for the PF. Signed-off-by: Michael Chan <mchan@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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 8827b7bf4bce..22c26448fcaf 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3592,7 +3592,7 @@ static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp)
return 0;
}
-static int bnxt_hwrm_func_qcaps(struct bnxt *bp)
+int bnxt_hwrm_func_qcaps(struct bnxt *bp)
{
int rc = 0;
struct hwrm_func_qcaps_input req = {0};
@@ -3616,9 +3616,7 @@ static int bnxt_hwrm_func_qcaps(struct bnxt *bp)
pf->max_rsscos_ctxs = le16_to_cpu(resp->max_rsscos_ctx);
pf->max_cp_rings = le16_to_cpu(resp->max_cmpl_rings);
pf->max_tx_rings = le16_to_cpu(resp->max_tx_rings);
- pf->max_pf_tx_rings = pf->max_tx_rings;
pf->max_rx_rings = le16_to_cpu(resp->max_rx_rings);
- pf->max_pf_rx_rings = pf->max_rx_rings;
pf->max_l2_ctxs = le16_to_cpu(resp->max_l2_ctxs);
pf->max_vnics = le16_to_cpu(resp->max_vnics);
pf->max_stat_ctxs = le16_to_cpu(resp->max_stat_ctx);
@@ -5623,8 +5621,8 @@ void bnxt_get_max_rings(struct bnxt *bp, int *max_rx, int *max_tx)
int max_rings = 0;
if (BNXT_PF(bp)) {
- *max_tx = bp->pf.max_pf_tx_rings;
- *max_rx = bp->pf.max_pf_rx_rings;
+ *max_tx = bp->pf.max_tx_rings;
+ *max_rx = bp->pf.max_rx_rings;
max_rings = min_t(int, bp->pf.max_irqs, bp->pf.max_cp_rings);
max_rings = min_t(int, max_rings, bp->pf.max_stat_ctxs);
} else {