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

Kevin Traynor ktraynor at redhat.com
Wed Nov 21 17:47:33 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/27/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.

Kevin Traynor

---
>From bbbd302c63944f40adc6b3fa4958e6865b66c58b 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 f03f38133..52c5f8100 100644
--- a/drivers/net/i40e/base/i40e_lan_hmc.c
+++ b/drivers/net/i40e/base/i40e_lan_hmc.c
@@ -144,5 +144,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		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;
 	}
 
@@ -167,5 +167,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		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;
 	}
 
@@ -190,5 +190,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		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;
 	}
 
@@ -213,5 +213,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 		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;
 	}
 
@@ -234,5 +234,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 					  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;
@@ -242,4 +242,9 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
 
 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.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-21 16:44:31.454151081 +0000
+++ 0019-net-i40e-base-properly-clean-resources.patch	2018-11-21 16:44:30.000000000 +0000
@@ -1,14 +1,14 @@
-From 02016804ed5e6a46f9162737bcdc78a3780332f5 Mon Sep 17 00:00:00 2001
+From bbbd302c63944f40adc6b3fa4958e6865b66c58b 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,45 +16,45 @@
  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 510c11826..0afee49b1 100644
+index f03f38133..52c5f8100 100644
 --- a/drivers/net/i40e/base/i40e_lan_hmc.c
 +++ b/drivers/net/i40e/base/i40e_lan_hmc.c
-@@ -115,5 +115,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -144,5 +144,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		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;
  	}
  
-@@ -138,5 +138,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -167,5 +167,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		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;
  	}
  
-@@ -161,5 +161,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -190,5 +190,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		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;
  	}
  
-@@ -184,5 +184,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -213,5 +213,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  		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;
  	}
  
-@@ -205,5 +205,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -234,5 +234,5 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  					  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;
-@@ -213,4 +213,9 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
+@@ -242,4 +242,9 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
  
  init_lan_hmc_out:
 +	return ret_code;


More information about the stable mailing list