From patchwork Sat Jun 27 15:06:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 72351 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A6B74A0522; Sat, 27 Jun 2020 17:03:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 374011C0AF; Sat, 27 Jun 2020 17:02:34 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 64F161BFC8; Sat, 27 Jun 2020 17:02:30 +0200 (CEST) IronPort-SDR: loi1Swc0kxAT/shlG7yTVf7cvNjQNxUh1CwqVxLXkCGFJDI76wtAMUiYWSd9c/jiygMjS8xDTP pRI773EsLvUw== X-IronPort-AV: E=McAfee;i="6000,8403,9664"; a="125833261" X-IronPort-AV: E=Sophos;i="5.75,287,1589266800"; d="scan'208";a="125833261" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2020 08:02:30 -0700 IronPort-SDR: sIv8yF8brGDRf5xEXA75S2Q49+RxfYMdAhm9lMAnkLqUmhAtgyf/qCtQUMM5TR4wvDWceOsAOK W0yUquDtRJYg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,287,1589266800"; d="scan'208";a="480301654" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by fmsmga005.fm.intel.com with ESMTP; 27 Jun 2020 08:02:28 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org, Vignesh Sridhar , Paul M Stillwell Jr Date: Sat, 27 Jun 2020 23:06:14 +0800 Message-Id: <20200627150615.2233-8-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200627150615.2233-1-qi.z.zhang@intel.com> References: <20200627150615.2233-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 7/8] net/ice/base: clear and free XLT entries on reset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This fix has been added to address memory leak issues resulting from triggering a sudden driver reset which does not allow us to follow our normal removal flows for SW XLT entries for advanced features. - Adding call to destroy flow profile locks when clearing SW XLT tables. - Extraction sequence entries were not correctly cleared previously which could cause ownership conflicts for repeated reset-replay calls. Fixes: 969890d505b1 ("net/ice/base: enable clearing of HW tables") Cc: stable@dpdk.org Signed-off-by: Vignesh Sridhar Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_flex_pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index 016dc2b39..284569464 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -3666,6 +3666,8 @@ static void ice_free_flow_profs(struct ice_hw *hw, u8 blk_idx) LIST_DEL(&p->l_entry); if (p->acts) ice_free(hw, p->acts); + + ice_destroy_lock(&p->entries_lock); ice_free(hw, p); } ice_release_lock(&hw->fl_profs_locks[blk_idx]); @@ -3794,7 +3796,7 @@ void ice_clear_hw_tbls(struct ice_hw *hw) prof_redir->count * sizeof(*prof_redir->t), ICE_NONDMA_MEM); - ice_memset(es->t, 0, es->count * sizeof(*es->t), + ice_memset(es->t, 0, es->count * sizeof(*es->t) * es->fvw, ICE_NONDMA_MEM); ice_memset(es->ref_count, 0, es->count * sizeof(*es->ref_count), ICE_NONDMA_MEM);