[2/2] net/i40e: fix fdir allocating msix resource error

Message ID 20200609013712.27026-2-maox.jiang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: xiaolong ye
Headers
Series [1/2] net/i40e: fix binding interrupt without msix vectors |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/checkpatch warning coding style issues

Commit Message

Jiang Mao June 9, 2020, 1:37 a.m. UTC
  Fdir allocating msix resource is not strictly necessary, if no resource left, print a warning message.

Signed-off-by: Jiang Mao <maox.jiang@intel.com>

Fixes: 4861cde461 (i40e: new poll mode driver)
---
 drivers/net/i40e/i40e_ethdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 33ed556c8..acc43077d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5744,6 +5744,17 @@  i40e_vsi_setup(struct i40e_pf *pf,
 			vsi->nb_msix = RTE_MIN(vsi->nb_qps,
 					       RTE_MAX_RXTX_INTR_VEC_ID);
 		}
+	} else if (type == I40E_VSI_FDIR) {
+		ret = i40e_res_pool_alloc(&pf->msix_pool, 1);
+		if (ret < 0) {
+			PMD_DRV_LOG(WARNING, "MSIX vectors used up, FDIR can`t bind interrupt");
+			vsi->msix_intr = 0;
+			vsi->nb_msix = 0;
+		} else {
+			vsi->msix_intr = ret;
+			vsi->nb_msix = 1;
+		}
+
 	} else if (type != I40E_VSI_SRIOV) {
 		ret = i40e_res_pool_alloc(&pf->msix_pool, 1);
 		if (ret < 0) {