[dpdk-stable] patch 'net/i40e/base: properly clean resources' has been queued to LTS release 16.11.9

Luca Boccassi bluca at debian.org
Mon Oct 15 13:51:23 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/17/18. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Luca Boccassi

---
>From 76c0093f43adee5774ac5c2bd530979ed9ede8bd Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang at intel.com>
Date: Tue, 25 Sep 2018 10:34:31 +0800
Subject: [PATCH] net/i40e/base: properly clean resources

[ upstream commit 02016804ed5e6a46f9162737bcdc78a3780332f5 ]

Allocated resources were not freed in the event of a failure in
i40e_init_lan_hmc function. This patch gracefully handles the fail
case after initializing the lan hmc.

Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
Acked-by: Beilei Xing <beilei.xing at intel.com>
---
 drivers/net/i40e/base/i40e_lan_hmc.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_lan_hmc.c b/drivers/net/i40e/base/i40e_lan_hmc.c
index 226064847f..739f3d5a4d 100644
--- a/drivers/net/i40e/base/i40e_lan_hmc.c
+++ b/drivers/net/i40e/base/i40e_lan_hmc.c
@@ -143,7 +143,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
 		DEBUGOUT3("i40e_init_lan_hmc: Tx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
 			  txq_num, obj->max_cnt, ret_code);
-		goto init_lan_hmc_out;
+		goto free_hmc_out;
 	}
 
 	/* aggregate values into the full LAN object for later */
@@ -166,7 +166,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
 		DEBUGOUT3("i40e_init_lan_hmc: Rx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
 			  rxq_num, obj->max_cnt, ret_code);
-		goto init_lan_hmc_out;
+		goto free_hmc_out;
 	}
 
 	/* aggregate values into the full LAN object for later */
@@ -189,7 +189,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
 		DEBUGOUT3("i40e_init_lan_hmc: FCoE context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
 			  fcoe_cntx_num, obj->max_cnt, ret_code);
-		goto init_lan_hmc_out;
+		goto free_hmc_out;
 	}
 
 	/* aggregate values into the full LAN object for later */
@@ -212,7 +212,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
 		DEBUGOUT3("i40e_init_lan_hmc: FCoE filter: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
 			  fcoe_filt_num, obj->max_cnt, ret_code);
-		goto init_lan_hmc_out;
+		goto free_hmc_out;
 	}
 
 	/* aggregate values into the full LAN object for later */
@@ -233,7 +233,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 					  (sizeof(struct i40e_hmc_sd_entry) *
 					  hw->hmc.sd_table.sd_cnt));
 		if (ret_code)
-			goto init_lan_hmc_out;
+			goto free_hmc_out;
 		hw->hmc.sd_table.sd_entry =
 			(struct i40e_hmc_sd_entry *)hw->hmc.sd_table.addr.va;
 	}
@@ -241,6 +241,11 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 	full_obj->size = l2fpm_size;
 
 init_lan_hmc_out:
+	return ret_code;
+free_hmc_out:
+	if (hw->hmc.hmc_obj_virt_mem.va)
+		i40e_free_virt_mem(hw, &hw->hmc.hmc_obj_virt_mem);
+
 	return ret_code;
 }
 
-- 
2.19.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-10-15 12:48:34.704135671 +0100
+++ 0003-net-i40e-base-properly-clean-resources.patch	2018-10-15 12:48:34.501096017 +0100
@@ -1,14 +1,14 @@
-From 02016804ed5e6a46f9162737bcdc78a3780332f5 Mon Sep 17 00:00:00 2001
+From 76c0093f43adee5774ac5c2bd530979ed9ede8bd Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang at intel.com>
 Date: Tue, 25 Sep 2018 10:34:31 +0800
 Subject: [PATCH] net/i40e/base: properly clean resources
 
+[ upstream commit 02016804ed5e6a46f9162737bcdc78a3780332f5 ]
+
 Allocated resources were not freed in the event of a failure in
 i40e_init_lan_hmc function. This patch gracefully handles the fail
 case after initializing the lan hmc.
 
-Cc: stable at dpdk.org
-
 Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
 Acked-by: Beilei Xing <beilei.xing at intel.com>
 ---
@@ -16,10 +16,10 @@
  1 file changed, 10 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/net/i40e/base/i40e_lan_hmc.c b/drivers/net/i40e/base/i40e_lan_hmc.c
-index 510c11826c..0afee49b13 100644
+index 226064847f..739f3d5a4d 100644
 --- a/drivers/net/i40e/base/i40e_lan_hmc.c
 +++ b/drivers/net/i40e/base/i40e_lan_hmc.c
-@@ -114,7 +114,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -143,7 +143,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
  		DEBUGOUT3("i40e_init_lan_hmc: Tx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
  			  txq_num, obj->max_cnt, ret_code);
@@ -28,7 +28,7 @@
  	}
  
  	/* aggregate values into the full LAN object for later */
-@@ -137,7 +137,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -166,7 +166,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
  		DEBUGOUT3("i40e_init_lan_hmc: Rx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
  			  rxq_num, obj->max_cnt, ret_code);
@@ -37,7 +37,7 @@
  	}
  
  	/* aggregate values into the full LAN object for later */
-@@ -160,7 +160,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -189,7 +189,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
  		DEBUGOUT3("i40e_init_lan_hmc: FCoE context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
  			  fcoe_cntx_num, obj->max_cnt, ret_code);
@@ -46,7 +46,7 @@
  	}
  
  	/* aggregate values into the full LAN object for later */
-@@ -183,7 +183,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -212,7 +212,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
  		DEBUGOUT3("i40e_init_lan_hmc: FCoE filter: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
  			  fcoe_filt_num, obj->max_cnt, ret_code);
@@ -55,7 +55,7 @@
  	}
  
  	/* aggregate values into the full LAN object for later */
-@@ -204,7 +204,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -233,7 +233,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  					  (sizeof(struct i40e_hmc_sd_entry) *
  					  hw->hmc.sd_table.sd_cnt));
  		if (ret_code)
@@ -64,7 +64,7 @@
  		hw->hmc.sd_table.sd_entry =
  			(struct i40e_hmc_sd_entry *)hw->hmc.sd_table.addr.va;
  	}
-@@ -212,6 +212,11 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -241,6 +241,11 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  	full_obj->size = l2fpm_size;
  
  init_lan_hmc_out:


More information about the stable mailing list