From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 1D073B62 for ; Mon, 15 Oct 2018 13:51:55 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id r63-v6so18586825wma.4 for ; Mon, 15 Oct 2018 04:51:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PFg/ip0NU4MqYkj6blK/hMmlp+K1modJ/j4VXAVsJfU=; b=JcwrlKoN53PjPJ9cJy+WX4zkp1m/Ypd2ZCed/0dGKiBg9HE7C8ouo5zL+eYAis+0pe 2qMHcbcJBxDu8l/2/Qa0i9PaLYDoo7HWtaAchPsiRDug1g1boqUoLK66bYEnjcZJ5ia4 QTqpYtEaj+vPXL3eAtqcjL9+5rRMWAV6mmXHMf64WEL4Jj9leupHdk2UXyOK9CuFzML0 97sRVgTTqUU5Z2uNY4HbUVuMgNwASaY8w7T37EreMZqoewYQVNnLXtXiuLMwbcoHeF07 cJ4Zug8Cys2ZR5/gV4wKgexr0WnNw3MM0AXB87Tb7GFmRs321ezlg/T8gifMr8NySgm/ JfTA== X-Gm-Message-State: ABuFfojiexpVvDVXuvQ9eSH+Xy03bgBx/j5UpRWiwCxy7SPnQvdsPfs5 UicF/zmPrvdRwMP2LVBS3TY= X-Google-Smtp-Source: ACcGV61Ih+7fj0oqqvtrNj8ydsHqt8uverzeHKdvsosqfCaJR5Mg7kPYlYtTKseu8yMoNelu2z/wDg== X-Received: by 2002:a1c:2984:: with SMTP id p126-v6mr13847677wmp.5.1539604314681; Mon, 15 Oct 2018 04:51:54 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id s7-v6sm17346186wmd.0.2018.10.15.04.51.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 04:51:53 -0700 (PDT) From: Luca Boccassi To: Qi Zhang Cc: Beilei Xing , dpdk stable Date: Mon, 15 Oct 2018 12:51:23 +0100 Message-Id: <20181015115144.27626-3-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181015115144.27626-1-bluca@debian.org> References: <20181003162121.16364-1-bluca@debian.org> <20181015115144.27626-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e/base: properly clean resources' has been queued to LTS release 16.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 11:51:55 -0000 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 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 Acked-by: Beilei Xing --- 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 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@dpdk.org - Signed-off-by: Qi Zhang Acked-by: Beilei Xing --- @@ -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: