From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50040.outbound.protection.outlook.com [40.107.5.40]) by dpdk.org (Postfix) with ESMTP id B3CEE1B107; Mon, 14 Jan 2019 23:39:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/T9F9lTFXJdx6r8xv+g5Gfy1NDkabHfvbOJtckHbkw0=; b=kuT1xtpD+Fv51G4t7Jgu7eXyyd7wklYtzOnezUN530v9j3HX9LTphalWuC4wHknXgsYoKblpEDbIx8HH1Uj1KCO0Ib0Z1Oe2HbS0RHTNg2nEcma2yuUQze/DvOsMUM+wgMkwxFs1yZZFiMegZo/5+oGWspmrrmzdcoprWn5tIa8= Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.76) by AM6PR08MB3174.eurprd08.prod.outlook.com (52.135.164.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.13; Mon, 14 Jan 2019 22:39:28 +0000 Received: from AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::25ec:2db7:d268:2b7b]) by AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::25ec:2db7:d268:2b7b%2]) with mapi id 15.20.1516.019; Mon, 14 Jan 2019 22:39:28 +0000 From: Honnappa Nagarahalli To: "thomas@monjalon.net" , "byron.marohn@intel.com" , "pablo.de.lara.guarch@intel.com" CC: "stable@dpdk.org" , Hari Kumar Vemula , "dev@dpdk.org" , "reshma.pattan@intel.com" , "jananeex.m.parthasarathy@intel.com" , "maxime.coquelin@redhat.com" , nd , nd Thread-Topic: [dpdk-dev] [dpdk-stable] [PATCH v3] lib/efd: fix to free tail queue entry after use Thread-Index: AQHUrFjBygk94UEy0UKlccM9pHkPxKWvWhjw Date: Mon, 14 Jan 2019 22:39:28 +0000 Message-ID: References: <1542109533-14283-1-git-send-email-hari.kumarx.vemula@intel.com> <1547207341-22001-1-git-send-email-hari.kumarx.vemula@intel.com> <2704785.Ctf98vYVr8@xps> In-Reply-To: <2704785.Ctf98vYVr8@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR08MB3174; 6:hw2H2huEcvx4DCAzf0n8iNOUK2uzgP8zW7EaoV0wFgZqKhwqfU/E+z+zaf5aXLcYHLnEQJBqZneLRpXMiI/uM429ZSPMlnr8DJiFiBuorS3k68DqtZhjcyInfM4CYP3Tr1e6ZNBZxAWXmCHI0vLRNAP6uFPAmSnGcBnFNJ0BzpolfetQru7GUxHuPQ+fM6TmZMP/H6uD8jF6Z484yGEEERLAW1pePNk+FdpCEe7OtcIoVCLPenUjN3JgHTMUBXNKS89ajZHngs8v72tMGeVxtgt9k1JLWt0gUfhMFtQAhJdykmzbQnbHFi2x5Y3z4REkTxfMAAI2+7Q0uYlI/mN8X0zJ4VELWKDSSpu8BGOFP4RmCwruHuFKCLk+rMi5wAbPA6wyZPN3g9ftdrSFZszhP+I8iqpXLmp3mbFaud8dMw/rO8+zeEM7Imr4L6nomU+w5zt/eKZLyV+dP1Z5kqMwDg==; 5:JeWy1lk0jBYToDu2CrER8e1NM4ZJE23zNsLLFreiZdq98LU0QXr8EvmhmCSyN0DnRX5NRJdYhmzOQlqN/mevF4gvnJ9n8i8fZ3kuPTEj/w+QpF46lyySuCWtBre8m64kAl4/DKVbyRCaGdP3RZxbRrlerqq199ucWWSQDjksa5+edUR/DIEN9fnFBCeyikeXxnX5KdSRx/3QpI8gbP3b0A==; 7:yS0R8rLpihgNejh0JyO9xv4c0NpawRSM2eUU8GIUiXKqHFDN7FtUE/Bs9ED3IZxZ3Hk0RwnbGO3U0A9RmbcJcngeaw7j5u053L5ulYZqZsqUqAhsisvp/T70ARiQj2eujhxTq/Rs0wh2hgV3f/9K+A== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 80023aec-d162-4222-0a03-08d67a7124b5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600109)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR08MB3174; x-ms-traffictypediagnostic: AM6PR08MB3174: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0917DFAC67 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(136003)(346002)(366004)(39860400002)(396003)(199004)(189003)(72206003)(6436002)(8936002)(81156014)(6246003)(81166006)(478600001)(9686003)(55016002)(53936002)(7736002)(305945005)(68736007)(25786009)(33656002)(74316002)(106356001)(5660300001)(229853002)(105586002)(14454004)(4326008)(316002)(110136005)(54906003)(97736004)(66066001)(2906002)(3846002)(6116002)(99286004)(6506007)(186003)(76176011)(71190400001)(71200400001)(2501003)(476003)(256004)(14444005)(486006)(86362001)(102836004)(11346002)(7696005)(2201001)(446003)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3174; H:AM6PR08MB3672.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: IKP98LZiDBez/NH+h29/e8ya0cBZ5uUjcMtYEp5NcKcZu7HAtjkD0AfuWvtGZ01iO029afVDSQwNYRL6vsrn+XCX6RaL6pIIuL24IIfwmmY1rUidZAR8R4g8TYZSZS0ktk0ua9WWoP8GbLddGlrdh7Ae7JS9M4qYbi0FwTjvoE1+mrHxk7/Scbku2M4x7tfk4WYL0Rxv+7c/sNz5WWXg+y9q8/3KoXzqyez78O1IFgesz0lJE/CcbFk5Cnxe7Nuqc7qBgvLpah4IJSXTTAHKctcPklCAOedLm75f04/ciOxJ6L8h83ARMy/4QYg7t9pLR+tin2PZuqtAtMOjd+Wla1sftj9SoGbPHGg0bDJ8edVoC+y92kFE3oWwDZNTVhBGdXHJ4ML8pHCS3pZ1yh9TRatRm3DD0NeKHbsTKMxxBlU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80023aec-d162-4222-0a03-08d67a7124b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2019 22:39:28.4250 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3174 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v3] lib/efd: fix to free tail queue entry after use 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, 14 Jan 2019 22:39:31 -0000 >=20 > Any review please? >=20 > 11/01/2019 12:49, Hari Kumar Vemula: > > In rte_efd_create() allocated memory for tail queue entry but not > > freed. > > Added freeing the tail queue entry. > > > > Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") > > Cc: stable@dpdk.org > > > > Signed-off-by: Hari Kumar Vemula > > Acked-by: Reshma Pattan > > > > --- > > v3: Replaced TAILQ_FOREACH_SAFE with TAILQ_FOREACH > > v2: Updated commit message. > > --- > > lib/librte_efd/rte_efd.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index > > e6e5cfda2..8b8330e0b 100644 > > --- a/lib/librte_efd/rte_efd.c > > +++ b/lib/librte_efd/rte_efd.c > > @@ -740,17 +740,32 @@ void > > rte_efd_free(struct rte_efd_table *table) { > > uint8_t socket_id; > > + struct rte_efd_list *efd_list; > > + struct rte_tailq_entry *te, *temp; > > > > if (table =3D=3D NULL) > > return; > > > > + efd_list =3D RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); > > + Minor comment. May be better to move this after the 'for' loop below. > > for (socket_id =3D 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) > > rte_free(table->chunks[socket_id]); > > + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); > > > > + TAILQ_FOREACH_SAFE(te, efd_list, next, temp) { > > + if (te->data =3D=3D (void *) table) { > > + TAILQ_REMOVE(efd_list, te, next); > > + rte_free(te); > > + te =3D NULL; > > + } > > + } > > + > > + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); > > rte_ring_free(table->free_slots); > > rte_free(table->offline_chunks); > > rte_free(table->keys); > > rte_free(table); > > + Minor comment, extra space > > } > > > > /** > > Some minor comments. Looks good otherwise. Reviewed-by: Honnappa Nagarahalli >=20 >=20 >=20 >=20