From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from MX1.argela.com.tr (mail.argela.com.tr [95.0.156.7]) by dpdk.org (Postfix) with ESMTP id B829D4CBD for ; Thu, 1 Mar 2018 09:05:51 +0100 (CET) Received: from MX1.argela.com.tr (192.168.0.25) by MX1.argela.com.tr (192.168.0.25) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 1 Mar 2018 11:05:14 +0300 Received: from MX1.argela.com.tr ([fe80::4c2:c7b4:5114:a25d]) by MX1.argela.com.tr ([fe80::4c2:c7b4:5114:a25d%12]) with mapi id 15.00.1347.000; Thu, 1 Mar 2018 11:05:14 +0300 From: Ali Volkan Atli To: "users@dpdk.org" CC: Ali Volkan Atli Thread-Topic: L3 Forwarding Exact Match Timeout Thread-Index: AQHTsSxkfgwLVc6xYE6rWBLxzHKr8w== Date: Thu, 1 Mar 2018 08:05:14 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [192.168.2.19] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-users] L3 Forwarding Exact Match Timeout X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 08:05:51 -0000 Hi=20 I'm trying to understand l3fwd application for exact match case. It only ad= ds keys into hash but never deletes them. So I just want to delete entries = according to a timeout by iterating through the hash table. But I have many= entries and I don't want to iterate the hash table in a lump, I need to sw= eep it piece by piece in another thread during adding continuing. So does t= he following pseudo code work in multithread cases? adding_thread { while (1) { ... rte_hash_add_key_data(handle, key, data); // data has a last_seen t= imeout ... } } sweeping_thread { static uint32_t sweep_iter =3D 0; const void *next_key; void *next_data; for (int i =3D 0; i < SWEEP_CNT; ++i) { ... rte_hash_iterate(handle, &next_key, &next_data, &sweep_iter) sweep_iter =3D (sweep_iter + 1) & HASH_MASK if (current_time - next_data->timeout > TIMEOUT) rte_hash_del_key(handle, (void *)&next_key); ... } } Thanks in advance. - Volkan=