Fdir allocating msix resource is not strictly necessary, if no
resource left, jump the error.

Fixes: 4861cde461 (i40e: new poll mode driver)
Cc: sta...@dpdk.org

Signed-off-by: Jiang Mao <maox.ji...@intel.com>
---
V3: Move type I40E_VSI_FDIR branch into !I40E_VSI_SRIOV branch.
---
 drivers/net/i40e/i40e_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 16fcb8d24e..c19bf868ea 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5736,10 +5736,14 @@ i40e_vsi_setup(struct i40e_pf *pf,
                ret = i40e_res_pool_alloc(&pf->msix_pool, 1);
                if (ret < 0) {
                        PMD_DRV_LOG(ERR, "VSI %d get heap failed %d", 
vsi->seid, ret);
-                       goto fail_queue_alloc;
+                       if (type != I40E_VSI_FDIR)
+                               goto fail_queue_alloc;
+                       vsi->msix_intr = 0;
+                       vsi->nb_msix = 0;
+               } else {
+                       vsi->msix_intr = ret;
+                       vsi->nb_msix = 1;
                }
-               vsi->msix_intr = ret;
-               vsi->nb_msix = 1;
        } else {
                vsi->msix_intr = 0;
                vsi->nb_msix = 0;
-- 
2.17.1

Reply via email to