Blame SOURCES/0001-net-i40e-fix-port-segmentation-fault-when-restart.patch

702481
From aca851c907f7450672fe2b5fecfcbcc3d602bf9c Mon Sep 17 00:00:00 2001
702481
From: Wei Zhao <wei.zhao1@intel.com>
702481
Date: Fri, 12 Jan 2018 14:59:19 +0800
702481
Subject: [PATCH] net/i40e: fix port segmentation fault when restart
702481
702481
[ upstream commit 37b68eacfc9901f9c30f2127c68ef806e2bd2a61 ]
702481
702481
This patch will go into the process of clear all queue region
702481
related configuration when dev stop even if there is no queue region
702481
command before, so this is a bug, it may cause error. So add code
702481
to check if there is queue configuration exist when flush queue
702481
region config and remove this process when device stop. Queue region
702481
clear only do when device initialization or PMD get flush command.
702481
702481
Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush")
702481
702481
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
702481
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
702481
---
702481
 drivers/net/i40e/i40e_ethdev.c  |  3 ---
702481
 drivers/net/i40e/rte_pmd_i40e.c | 27 ++++++++++++++-------------
702481
 2 files changed, 14 insertions(+), 16 deletions(-)
702481
702481
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
702481
index 5f1faf1..bd83e7b 100644
702481
--- a/drivers/net/i40e/i40e_ethdev.c
702481
+++ b/drivers/net/i40e/i40e_ethdev.c
702481
@@ -2155,7 +2155,4 @@ static inline void i40e_GLQF_reg_init(struct i40e_hw *hw)
702481
 	pf->tm_conf.committed = false;
702481
 
702481
-	/* Remove all the queue region configuration */
702481
-	i40e_flush_queue_region_all_conf(dev, hw, pf, 0);
702481
-
702481
 	hw->adapter_stopped = 1;
702481
 }
702481
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
702481
index aeb92af..c2e2466 100644
702481
--- a/drivers/net/i40e/rte_pmd_i40e.c
702481
+++ b/drivers/net/i40e/rte_pmd_i40e.c
702481
@@ -2846,20 +2846,21 @@ int rte_pmd_i40e_flow_type_mapping_get(
702481
 	}
702481
 
702481
-	info->queue_region_number = 1;
702481
-	info->region[0].queue_num = main_vsi->nb_used_qps;
702481
-	info->region[0].queue_start_index = 0;
702481
+	if (info->queue_region_number) {
702481
+		info->queue_region_number = 1;
702481
+		info->region[0].queue_num = main_vsi->nb_used_qps;
702481
+		info->region[0].queue_start_index = 0;
702481
 
702481
-	ret = i40e_vsi_update_queue_region_mapping(hw, pf);
702481
-	if (ret != I40E_SUCCESS)
702481
-		PMD_DRV_LOG(INFO, "Failed to flush queue region mapping.");
702481
+		ret = i40e_vsi_update_queue_region_mapping(hw, pf);
702481
+		if (ret != I40E_SUCCESS)
702481
+			PMD_DRV_LOG(INFO, "Failed to flush queue region mapping.");
702481
 
702481
-	ret = i40e_dcb_init_configure(dev, TRUE);
702481
-	if (ret != I40E_SUCCESS) {
702481
-		PMD_DRV_LOG(INFO, "Failed to flush dcb.");
702481
-		pf->flags &= ~I40E_FLAG_DCB;
702481
+		ret = i40e_dcb_init_configure(dev, TRUE);
702481
+		if (ret != I40E_SUCCESS) {
702481
+			PMD_DRV_LOG(INFO, "Failed to flush dcb.");
702481
+			pf->flags &= ~I40E_FLAG_DCB;
702481
+		}
702481
+
702481
+		i40e_init_queue_region_conf(dev);
702481
 	}
702481
-
702481
-	i40e_init_queue_region_conf(dev);
702481
-
702481
 	return 0;
702481
 }
702481
-- 
702481
1.8.3.1
702481