netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 09/14] bnxt_en: Assign additional vnics to VFs.
Date: Thu, 29 Dec 2016 12:13:39 -0500	[thread overview]
Message-ID: <1483031624-20076-10-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1483031624-20076-1-git-send-email-michael.chan@broadcom.com>

Assign additional vnics to VFs whenever possible so that NTUPLE can be
supported on the VFs.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index c696025..0c9f6c1 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -429,6 +429,8 @@ static int bnxt_hwrm_func_cfg(struct bnxt *bp, int num_vfs)
 		vf_rx_rings = (pf->max_rx_rings - bp->rx_nr_rings) / num_vfs;
 	vf_ring_grps = (bp->pf.max_hw_ring_grps - bp->rx_nr_rings) / num_vfs;
 	vf_tx_rings = (pf->max_tx_rings - bp->tx_nr_rings) / num_vfs;
+	vf_vnics = (pf->max_vnics - bp->nr_vnics) / num_vfs;
+	vf_vnics = min_t(u16, vf_vnics, vf_rx_rings);
 
 	req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_MTU |
 				  FUNC_CFG_REQ_ENABLES_MRU |
@@ -451,7 +453,6 @@ static int bnxt_hwrm_func_cfg(struct bnxt *bp, int num_vfs)
 	req.num_rx_rings = cpu_to_le16(vf_rx_rings);
 	req.num_hw_ring_grps = cpu_to_le16(vf_ring_grps);
 	req.num_l2_ctxs = cpu_to_le16(4);
-	vf_vnics = 1;
 
 	req.num_vnics = cpu_to_le16(vf_vnics);
 	/* FIXME spec currently uses 1 bit for stats ctx */
@@ -506,6 +507,8 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
 			    min_rx_rings)
 				rx_ok = 1;
 		}
+		if (bp->pf.max_vnics - bp->nr_vnics < min_rx_rings)
+			rx_ok = 0;
 
 		if (bp->pf.max_tx_rings - bp->tx_nr_rings >= min_tx_rings)
 			tx_ok = 1;
-- 
1.8.3.1

  parent reply	other threads:[~2016-12-29 17:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-29 17:13 [PATCH net-next 00/14] bnxt_en: updates for net-next Michael Chan
2016-12-29 17:13 ` [PATCH net-next 01/14] bnxt_en: Remove busy poll logic in the driver Michael Chan
2016-12-29 17:13 ` [PATCH net-next 02/14] bnxt_en: Use napi_complete_done() Michael Chan
2016-12-29 17:13 ` [PATCH net-next 03/14] bnxt_en: Improve the IRQ disable sequence during shutdown Michael Chan
2016-12-29 17:13 ` [PATCH net-next 04/14] bnxt_en: Fix and clarify link_info->advertising Michael Chan
2016-12-29 17:13 ` [PATCH net-next 05/14] bnxt_en: Refactor TPA code path Michael Chan
2016-12-29 17:13 ` [PATCH net-next 06/14] bnxt_en: Add function to get vnic capability Michael Chan
2016-12-29 17:13 ` [PATCH net-next 07/14] bnxt_en: Refactor code that determines RFS capability Michael Chan
2016-12-29 17:13 ` [PATCH net-next 08/14] bnxt_en: Add new hardware RFS mode Michael Chan
2016-12-29 17:13 ` Michael Chan [this message]
2016-12-29 17:13 ` [PATCH net-next 10/14] bnxt_en: Add IPV6 hardware RFS support Michael Chan
2016-12-29 17:13 ` [PATCH net-next 11/14] bnxt_en: Implement new scheme to reserve tx rings Michael Chan
2016-12-29 17:13 ` [PATCH net-next 12/14] bnxt_en: Set default completion ring for async events Michael Chan
2016-12-29 17:13 ` [PATCH net-next 13/14] bnxt_en: Handle no aggregation ring gracefully Michael Chan
2016-12-29 17:13 ` [PATCH net-next 14/14] MAINTAINERS: Add bnxt_en maintainer info Michael Chan
2016-12-29 19:42 ` [PATCH net-next 00/14] bnxt_en: updates for net-next David Miller

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=1483031624-20076-10-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --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).