From patchwork Fri Sep 28 03:08:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 45544 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0F47B1B11F; Fri, 28 Sep 2018 05:09:00 +0200 (CEST) Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) by dpdk.org (Postfix) with ESMTP id 4DA621B109; Fri, 28 Sep 2018 05:08:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1129; q=dns/txt; s=iport; t=1538104137; x=1539313737; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=fhpml+Xw0ws9l1M0rOADrEdQBMu2/NoU2UQqamVvbY4=; b=HYTB9y9XwYpGFAbPYtN4Ny7dP8apH2JZ2ewn5ezXfgDkXkrxrwNxKjIb ks7H39RfdKAX6qlAqBOSyuH2WpFSos3E00oZQLsEnXcISI+JfXFCaPDFa 2weLTrGjZsokpsTQvJWPqbPhMqjK6ohoawbRBGALzgXptVPSQiBsGi4z1 4=; X-IronPort-AV: E=Sophos;i="5.54,313,1534809600"; d="scan'208";a="177911766" Received: from rcdn-core-9.cisco.com ([173.37.93.145]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2018 03:08:56 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-9.cisco.com (8.15.2/8.15.2) with ESMTP id w8S38t5S010574; Fri, 28 Sep 2018 03:08:55 GMT Received: by cisco.com (Postfix, from userid 392789) id 8A4F920F2001; Thu, 27 Sep 2018 20:08:55 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, John Daley , stable@dpdk.org, Hyong Youb Kim Date: Thu, 27 Sep 2018 20:08:36 -0700 Message-Id: <20180928030838.15887-1-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180928015827.25786-1-johndale@cisco.com> References: <20180928015827.25786-1-johndale@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-9.cisco.com Subject: [dpdk-dev] [PATCH v2 1/3] net/enic: fix flow API memory leak 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" rte_flow structures were not being freed when destroyed or flushed. Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled") Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Signed-off-by: John Daley --- v2: fix signoff drivers/net/enic/enic_flow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c index 0cf04aefd..9b612f1d5 100644 --- a/drivers/net/enic/enic_flow.c +++ b/drivers/net/enic/enic_flow.c @@ -1532,6 +1532,7 @@ enic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, enic_flow_del_filter(enic, flow->enic_filter_id, error); LIST_REMOVE(flow, next); rte_spinlock_unlock(&enic->flows_lock); + rte_free(flow); return 0; } @@ -1555,6 +1556,7 @@ enic_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) flow = LIST_FIRST(&enic->flows); enic_flow_del_filter(enic, flow->enic_filter_id, error); LIST_REMOVE(flow, next); + rte_free(flow); } rte_spinlock_unlock(&enic->flows_lock); return 0;