From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 449924189D6 for ; Thu, 2 Jul 2026 11:30:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782991847; cv=none; b=bgMs18qXXTrcmb6xKdqgYzJMiwJLseRwJKY/L9dfmoMOhwqvwgd7yGWTp/obpJjIannKk/W2rrddA5AJw5IYVDM7V31DVHWzSfRRaNM26ibS1o98AEf7RfwnWsC4GbkGvOwSd9wstPW5dlD9iZsVaFAPu6eRi8mMdjX/OQ38VGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782991847; c=relaxed/simple; bh=rstFJgyxKE753P4Jrw7HbV3svWEHgBRqkt0vcWN7dmc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uaykrzb3yFK9H3IMKJW8uCEkIVdnO1e3FslRlNpbVrfTkIdA3Vka88BCfPAwzw2MYGit1+mqsCSRiY8PDarYgaaGEqL965PNY/jr8fk41TyjZ48JOkiLgLDDPvylJqUb3cDEFJpysU58QBvRcxbLqzgZsNbvxLZpndGOvS662EE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mPK1cH64; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mPK1cH64" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782991846; x=1814527846; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rstFJgyxKE753P4Jrw7HbV3svWEHgBRqkt0vcWN7dmc=; b=mPK1cH64gmtlOXiaaR/iQDS4itVPipctK2CNf3L897UKjkCXi1kMdBnX o/f2C7LGNWXjfVylXJU9FCEs5udz1KFicz10snvDM7Ja5rjhrv4yd/5TN XFlE9sP6j0YYvXqHw9FqxN6g6hzspmZukJDyoosDNRG9MZ7VHAddiqGON HCOa3/Cre+E9YeFbxMD89X3V8XhbLCtbSV3K7gKUyxD6oUTakvpY+hgnp +YSXvswpRmlv3oVAJ8c+j4J9taR0ARG6vOPt7/dFrWse8uumrFkLoyWyr HT+Vwss0BuXeNAZFtfzgGYo1bgo80rMMg2FD0bit1tcnAG0bhFymGkvep w==; X-CSE-ConnectionGUID: fd41suZZQMeKxekqOep8JA== X-CSE-MsgGUID: qGv01ZoxRZ6vHOaOxupJSg== X-IronPort-AV: E=McAfee;i="6800,10657,11834"; a="83611752" X-IronPort-AV: E=Sophos;i="6.25,143,1779174000"; d="scan'208";a="83611752" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2026 04:30:46 -0700 X-CSE-ConnectionGUID: UlyzB9ejQ6ytuHWtn+kUEQ== X-CSE-MsgGUID: eVn/GHmVShmcfdW1A1v6rw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,143,1779174000"; d="scan'208";a="251788431" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa010.jf.intel.com with ESMTP; 02 Jul 2026 04:30:45 -0700 Received: from gond.igk.intel.com (gond.igk.intel.com [10.123.220.52]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 40CE028760; Thu, 2 Jul 2026 12:30:43 +0100 (IST) From: Marcin Szycik To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, sandeep.penigalapati@intel.com, ananth.s@intel.com, alexander.duyck@gmail.com, anthony.l.nguyen@intel.com, Marcin Szycik , Aleksandr Loktionov , Przemek Kitszel Subject: [PATCH iwl-next v5 11/12] ice: re-introduce ice_dealloc_flow_entry() helper Date: Thu, 2 Jul 2026 12:30:05 +0200 Message-ID: <20260702103007.97020-12-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260702103007.97020-1-marcin.szycik@linux.intel.com> References: <20260702103007.97020-1-marcin.szycik@linux.intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit It was removed in commit ad667d626825 ("ice: remove null checks before devm_kfree() calls"). Now it's useful again. Signed-off-by: Marcin Szycik Reviewed-by: Aleksandr Loktionov Reviewed-by: Przemek Kitszel --- v5: * ice_flow_acl_add_scen_entry_sync(), ice_flow_add_entry(): ice_flow_acl_free_act_cntr() additions make more sense in patch adding this code, move them to that patch. Now this patch is a pure refactor. v3: * ice_flow_acl_add_scen_entry_sync(), ice_flow_add_entry(): call ice_flow_acl_free_act_cntr() in unroll v2: * Add this patch --- drivers/net/ethernet/intel/ice/ice_flow.c | 35 +++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c index e0a1d8463d6f..de751774affc 100644 --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c @@ -1589,6 +1589,23 @@ ice_flow_find_prof_id(struct ice_hw *hw, enum ice_block blk, u64 prof_id) return NULL; } +/** + * ice_dealloc_flow_entry - Deallocate flow entry memory + * @hw: pointer to the HW struct + * @entry: flow entry to be removed + */ +static void +ice_dealloc_flow_entry(struct ice_hw *hw, struct ice_flow_entry *entry) +{ + if (!entry) + return; + + kfree(entry->entry); + kfree(entry->range_buf); + kfree(entry->acts); + devm_kfree(ice_hw_to_dev(hw), entry); +} + /** * ice_flow_get_hw_prof - return the HW profile for a specific profile ID handle * @hw: pointer to the HW struct @@ -1757,11 +1774,7 @@ static int ice_flow_rem_entry_sync(struct ice_hw *hw, enum ice_block blk, } list_del(&entry->l_entry); - - kfree(entry->entry); - kfree(entry->range_buf); - kfree(entry->acts); - devm_kfree(ice_hw_to_dev(hw), entry); + ice_dealloc_flow_entry(hw, entry); return 0; } @@ -2948,10 +2961,7 @@ static int ice_flow_acl_add_scen_entry_sync(struct ice_hw *hw, if (e->acts_cnt && e->acts) ice_flow_acl_free_act_cntr(hw, e->acts, e->acts_cnt); exist->id = e->id; - kfree(e->entry); - kfree(e->range_buf); - kfree(e->acts); - devm_kfree(ice_hw_to_dev(hw), e); + ice_dealloc_flow_entry(hw, e); *entry = exist; } out: @@ -3075,12 +3085,7 @@ int ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, if (blk == ICE_BLK_ACL && e->acts_cnt && e->acts) ice_flow_acl_free_act_cntr(hw, e->acts, e->acts_cnt); dealloc_entry: - if (e) { - kfree(e->entry); - kfree(e->range_buf); - kfree(e->acts); - devm_kfree(ice_hw_to_dev(hw), e); - } + ice_dealloc_flow_entry(hw, e); return status; } -- 2.49.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D83FC43602 for ; Thu, 2 Jul 2026 11:30:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 297ED6110D; Thu, 2 Jul 2026 11:30:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jS_MivHoyqUr; Thu, 2 Jul 2026 11:30:50 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org DF4EF60ED9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1782991849; bh=CnhYo9W7Wwu6GesBT8GY9bqSqzoohd65n3lryZkoDTk=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hKCsnSynktpjhisW7CoECl3AIT+XNY+WNrdEAnrEnnUXNXh8AbBjONwlwsKhpKRYw oco5wSL0sbY7FFK8Chh/LGJWQ9hw4JWakUITsmYxcaTDqUNqP69pigtxHWpzd3/5j3 f05xdlS8lYcK3eQDj2+PW2OIm2Uak/mr24VOUAN4KzAAaACDTN0ldvfA55h4zaL42h GaZcszX9dH3tNQL9SZ4vShFzzHpxC9V8YZ3AyOFaXs8PjUBZo6rDgWuYovJFemk5LE cqHAA1yjCleS43lBonh8WjXEpzvtFzNwHoyX6JFxBQLneOipMWTIR3x8OEH2FpCUnf ven4d9r0vczWQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id DF4EF60ED9; Thu, 2 Jul 2026 11:30:49 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with ESMTP id E387D316 for ; Thu, 2 Jul 2026 11:30:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CA0C182376 for ; Thu, 2 Jul 2026 11:30:47 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pYiv9Et5jo3A for ; Thu, 2 Jul 2026 11:30:47 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.21; helo=mgamail.intel.com; envelope-from=marcin.szycik@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 54DA282349 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 54DA282349 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by smtp1.osuosl.org (Postfix) with ESMTPS id 54DA282349 for ; Thu, 2 Jul 2026 11:30:46 +0000 (UTC) X-CSE-ConnectionGUID: baVytReHQEac2RJTsHozlg== X-CSE-MsgGUID: B79ak6SkRVmaMV4lOQq4iQ== X-IronPort-AV: E=McAfee;i="6800,10657,11834"; a="83611753" X-IronPort-AV: E=Sophos;i="6.25,143,1779174000"; d="scan'208";a="83611753" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2026 04:30:46 -0700 X-CSE-ConnectionGUID: UlyzB9ejQ6ytuHWtn+kUEQ== X-CSE-MsgGUID: eVn/GHmVShmcfdW1A1v6rw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,143,1779174000"; d="scan'208";a="251788431" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa010.jf.intel.com with ESMTP; 02 Jul 2026 04:30:45 -0700 Received: from gond.igk.intel.com (gond.igk.intel.com [10.123.220.52]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 40CE028760; Thu, 2 Jul 2026 12:30:43 +0100 (IST) From: Marcin Szycik To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, sandeep.penigalapati@intel.com, ananth.s@intel.com, alexander.duyck@gmail.com, anthony.l.nguyen@intel.com, Marcin Szycik , Aleksandr Loktionov , Przemek Kitszel Date: Thu, 2 Jul 2026 12:30:05 +0200 Message-ID: <20260702103007.97020-12-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260702103007.97020-1-marcin.szycik@linux.intel.com> References: <20260702103007.97020-1-marcin.szycik@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782991847; x=1814527847; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rstFJgyxKE753P4Jrw7HbV3svWEHgBRqkt0vcWN7dmc=; b=lEh3ZsPQdwKX1tI2ObnCmraXXs50sYfzOBv4ilF051JkR/2wHxSUusIx /EzN7wkPTFLafLplQ+OhsEeCmNrWJHRUMQ3zbus16RC+rrvabtuHYWZq9 /gs/bXWU77rzFf6WLxSAq46spZuZ6osyV5ETCk/dMlV5cEC4tDWYipMb5 RDAnbg6/F2BYDHBXwOCQdZttjji45GCF1lrQh42TX8z075PfpVa7abdFe Mnpucf7vyrdWZltTNc1rNYGZoftIFwy30BDg1V/BZ+el7dfWcg8WTJs1T E7YGjna+BYDLbgCNEdDYGoStIAaWkZDvwXLecYTDB38MZpcB69M68eX7c A==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lEh3ZsPQ Subject: [Intel-wired-lan] [PATCH iwl-next v5 11/12] ice: re-introduce ice_dealloc_flow_entry() helper X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" It was removed in commit ad667d626825 ("ice: remove null checks before devm_kfree() calls"). Now it's useful again. Signed-off-by: Marcin Szycik Reviewed-by: Aleksandr Loktionov Reviewed-by: Przemek Kitszel --- v5: * ice_flow_acl_add_scen_entry_sync(), ice_flow_add_entry(): ice_flow_acl_free_act_cntr() additions make more sense in patch adding this code, move them to that patch. Now this patch is a pure refactor. v3: * ice_flow_acl_add_scen_entry_sync(), ice_flow_add_entry(): call ice_flow_acl_free_act_cntr() in unroll v2: * Add this patch --- drivers/net/ethernet/intel/ice/ice_flow.c | 35 +++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c index e0a1d8463d6f..de751774affc 100644 --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c @@ -1589,6 +1589,23 @@ ice_flow_find_prof_id(struct ice_hw *hw, enum ice_block blk, u64 prof_id) return NULL; } +/** + * ice_dealloc_flow_entry - Deallocate flow entry memory + * @hw: pointer to the HW struct + * @entry: flow entry to be removed + */ +static void +ice_dealloc_flow_entry(struct ice_hw *hw, struct ice_flow_entry *entry) +{ + if (!entry) + return; + + kfree(entry->entry); + kfree(entry->range_buf); + kfree(entry->acts); + devm_kfree(ice_hw_to_dev(hw), entry); +} + /** * ice_flow_get_hw_prof - return the HW profile for a specific profile ID handle * @hw: pointer to the HW struct @@ -1757,11 +1774,7 @@ static int ice_flow_rem_entry_sync(struct ice_hw *hw, enum ice_block blk, } list_del(&entry->l_entry); - - kfree(entry->entry); - kfree(entry->range_buf); - kfree(entry->acts); - devm_kfree(ice_hw_to_dev(hw), entry); + ice_dealloc_flow_entry(hw, entry); return 0; } @@ -2948,10 +2961,7 @@ static int ice_flow_acl_add_scen_entry_sync(struct ice_hw *hw, if (e->acts_cnt && e->acts) ice_flow_acl_free_act_cntr(hw, e->acts, e->acts_cnt); exist->id = e->id; - kfree(e->entry); - kfree(e->range_buf); - kfree(e->acts); - devm_kfree(ice_hw_to_dev(hw), e); + ice_dealloc_flow_entry(hw, e); *entry = exist; } out: @@ -3075,12 +3085,7 @@ int ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, if (blk == ICE_BLK_ACL && e->acts_cnt && e->acts) ice_flow_acl_free_act_cntr(hw, e->acts, e->acts_cnt); dealloc_entry: - if (e) { - kfree(e->entry); - kfree(e->range_buf); - kfree(e->acts); - devm_kfree(ice_hw_to_dev(hw), e); - } + ice_dealloc_flow_entry(hw, e); return status; } -- 2.49.0