From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net, jakub.kicinski@netronome.com
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next v2 08/13] bnxt_en: Assign more RSS context resources to the VFs.
Date: Sat, 23 Nov 2019 22:30:45 -0500 [thread overview]
Message-ID: <1574566250-7546-9-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1574566250-7546-1-git-send-email-michael.chan@broadcom.com>
The driver currently only assignes 1 RSS context to each VF. This works
for the Linux VF driver. But other drivers, such as DPDK, can make use
of additional RSS contexts. Modify the code to divide up and assign
RSS contexts to VFs just like other resources.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index f6f3454..2aba1e0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -515,6 +515,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
struct bnxt_pf_info *pf = &bp->pf;
int i, rc = 0, min = 1;
u16 vf_msix = 0;
+ u16 vf_rss;
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_VF_RESOURCE_CFG, -1, -1);
@@ -533,9 +534,9 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
vf_tx_rings = hw_resc->max_tx_rings - bp->tx_nr_rings;
vf_vnics = hw_resc->max_vnics - bp->nr_vnics;
vf_vnics = min_t(u16, vf_vnics, vf_rx_rings);
+ vf_rss = hw_resc->max_rsscos_ctxs - bp->rsscos_nr_ctxs;
req.min_rsscos_ctx = cpu_to_le16(BNXT_VF_MIN_RSS_CTX);
- req.max_rsscos_ctx = cpu_to_le16(BNXT_VF_MAX_RSS_CTX);
if (pf->vf_resv_strategy == BNXT_VF_RESV_STRATEGY_MINIMAL_STATIC) {
min = 0;
req.min_rsscos_ctx = cpu_to_le16(min);
@@ -557,6 +558,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
vf_vnics /= num_vfs;
vf_stat_ctx /= num_vfs;
vf_ring_grps /= num_vfs;
+ vf_rss /= num_vfs;
req.min_cmpl_rings = cpu_to_le16(vf_cp_rings);
req.min_tx_rings = cpu_to_le16(vf_tx_rings);
@@ -565,6 +567,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
req.min_vnics = cpu_to_le16(vf_vnics);
req.min_stat_ctx = cpu_to_le16(vf_stat_ctx);
req.min_hw_ring_grps = cpu_to_le16(vf_ring_grps);
+ req.min_rsscos_ctx = cpu_to_le16(vf_rss);
}
req.max_cmpl_rings = cpu_to_le16(vf_cp_rings);
req.max_tx_rings = cpu_to_le16(vf_tx_rings);
@@ -573,6 +576,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
req.max_vnics = cpu_to_le16(vf_vnics);
req.max_stat_ctx = cpu_to_le16(vf_stat_ctx);
req.max_hw_ring_grps = cpu_to_le16(vf_ring_grps);
+ req.max_rsscos_ctx = cpu_to_le16(vf_rss);
if (bp->flags & BNXT_FLAG_CHIP_P5)
req.max_msix = cpu_to_le16(vf_msix / num_vfs);
@@ -598,7 +602,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
hw_resc->max_hw_ring_grps -= le16_to_cpu(req.min_hw_ring_grps) *
n;
hw_resc->max_cp_rings -= le16_to_cpu(req.min_cmpl_rings) * n;
- hw_resc->max_rsscos_ctxs -= pf->active_vfs;
+ hw_resc->max_rsscos_ctxs -= le16_to_cpu(req.min_rsscos_ctx) * n;
hw_resc->max_stat_ctxs -= le16_to_cpu(req.min_stat_ctx) * n;
hw_resc->max_vnics -= le16_to_cpu(req.min_vnics) * n;
if (bp->flags & BNXT_FLAG_CHIP_P5)
--
2.5.1
next prev parent reply other threads:[~2019-11-24 3:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-24 3:30 [PATCH net-next v2 00/13] bnxt_en: Updates Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 01/13] bnxt_en: Add chip IDs for 57452 and 57454 chips Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 02/13] bnxt_en: Disable/enable Bus master during suspend/resume Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 03/13] bnxt_en: Do driver unregister cleanup in bnxt_init_one() failure path Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 04/13] bnxt_en: Combine 2 functions calling the same HWRM_DRV_RGTR fw command Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 05/13] bnxt_en: Send FUNC_RESOURCE_QCAPS command in bnxt_resume() Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 06/13] bnxt_en: Fix suspend/resume path on 57500 chips Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 07/13] bnxt_en: Initialize context memory to the value specified by firmware Michael Chan
2019-11-24 3:30 ` Michael Chan [this message]
2019-11-24 3:30 ` [PATCH net-next v2 09/13] bnxt_en: Skip disabling autoneg before PHY loopback when appropriate Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 10/13] bnxt_en: Refactor the initialization of the ethtool link settings Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 11/13] bnxt_en: Add async. event logic for PHY configuration changes Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 12/13] bnxt_en: Allow PHY settings on multi-function or NPAR PFs if allowed by FW Michael Chan
2019-11-24 3:30 ` [PATCH net-next v2 13/13] bnxt_en: Add support for flashing the device via devlink Michael Chan
2019-11-25 10:19 ` Jiri Pirko
2019-11-26 3:52 ` Vasundhara Volam
2019-11-24 22:55 ` [PATCH net-next v2 00/13] bnxt_en: Updates Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1574566250-7546-9-git-send-email-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).