DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40e: fix the issue of trying more VSIs for VMDq than available
@ 2015-11-12  7:09 Helin Zhang
  2015-11-12 11:15 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Helin Zhang @ 2015-11-12  7:09 UTC (permalink / raw)
  To: dev

It fixes the issue of trying to allocate more VSIs for VMDq than
hardware remaining. It adds a check of the hardware remaining
before allocating VSIs for VMDq.

Fixes: c80707a0fd9c ("i40e: fix VMDq pool limit")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index e4684d3..323b1ff 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3118,7 +3118,8 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev)
 	pf->vmdq_nb_qps = 0;
 	pf->max_nb_vmdq_vsi = 0;
 	if (hw->func_caps.vmdq) {
-		if (qp_count < hw->func_caps.num_tx_qp) {
+		if (qp_count < hw->func_caps.num_tx_qp &&
+			vsi_count < hw->func_caps.num_vsis) {
 			pf->max_nb_vmdq_vsi = (hw->func_caps.num_tx_qp -
 				qp_count) / pf->vmdq_nb_qp_max;
 
@@ -3126,6 +3127,8 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev)
 			 * ethdev can support
 			 */
 			pf->max_nb_vmdq_vsi = RTE_MIN(pf->max_nb_vmdq_vsi,
+				hw->func_caps.num_vsis - vsi_count);
+			pf->max_nb_vmdq_vsi = RTE_MIN(pf->max_nb_vmdq_vsi,
 				ETH_64_POOLS);
 			if (pf->max_nb_vmdq_vsi) {
 				pf->flags |= I40E_FLAG_VMDQ;
@@ -3140,7 +3143,7 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev)
 					    "VMDq");
 			}
 		} else {
-			PMD_DRV_LOG(INFO, "No queue left for VMDq");
+			PMD_DRV_LOG(INFO, "No queue or VSI left for VMDq");
 		}
 	}
 	qp_count += pf->vmdq_nb_qps * pf->max_nb_vmdq_vsi;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-12 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12  7:09 [dpdk-dev] [PATCH] i40e: fix the issue of trying more VSIs for VMDq than available Helin Zhang
2015-11-12 11:15 ` Thomas Monjalon

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).