From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id A6DF31B7D6 for ; Thu, 12 Apr 2018 06:12:31 +0200 (CEST) Received: by mail-pf0-f176.google.com with SMTP id p15so2519900pff.11 for ; Wed, 11 Apr 2018 21:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=wnpfdhmEdbrQ335mgsC/oSXbpeO9p7OtxGMZaZtSEsk=; b=cFBZq4pfSHY7SBh4vZgH9fCCeB4/tONvtFVvWLXc82xTsK6AkJ9xQ++0OAuiQsRP0/ fbbmeuy273IxM1h6Xf+JqXDCt7sK+3DS3dFaOg7GAMReGP7NRRc9vEz5zS5vbv9A/NmO 07V1ITfBTVODiafZJwScFkU9bxcP1X2hbdh2TBoZziPL7kTdw8YiRpV50cG/03peS0sR 19WYGa4BSEP8HRytd++uyL5kUhUx5GRM7jX3QmYpOfArsWrysCYzdEbF+hZD3mAilWYd x+D9HhJnDdN6lh0y+rh1g7Psmlu+keq0fo19sE8cwgSyGLAmkpG/dNQpl60Wl0HywNIf hMAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=wnpfdhmEdbrQ335mgsC/oSXbpeO9p7OtxGMZaZtSEsk=; b=jhVPKgrXfY7uH7QUK+ezRs10llfQi/ZIiucgPEYYml+943ifCDjKSwWes75TEzUWns ZkqrwaUBBTeKnabar+6L0rBVSNd6L4+0172P2kBx4/O4qLzNnBMtkrXbvf5FMw/AAeKT 6CZZm1O7xaizPHmc5RfJN6gVnOaHBTajIOS+4tXTBNHLh1Uyew5sUOOSzvYWjursLzkp yvnyd9SjGh60yhSxoKr0ZtyYjEF+cTvJhqZqtG1mzl88ctKuHBs9L0DzeK/jc3AtvTOw XrlB/aTK467kU4h+xqc9DeR3F/LChiY1luduoGLOXexlmYfuJdqNjFHPWp2e0OcG2K1W xrfQ== X-Gm-Message-State: ALQs6tD0BIgXNXL30ilogNrIxAyi5AS28Z6Sofs72jJEhg7rsbrCDmxC ReU0RJvLVGijNhHLR/DuQS9RSWWRG76gn6qsvh94Wg== X-Google-Smtp-Source: AIpwx4+SH3Dsr4VPtRkTP8xQYip9B+O7BdnSeSTTexZpItzgMCC9f1O+a7+18wbeBqH9sPRxIExh/G2daN/l1HkHNK4= X-Received: by 10.99.173.67 with SMTP id y3mr5127514pgo.109.1523506350439; Wed, 11 Apr 2018 21:12:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.164.142 with HTTP; Wed, 11 Apr 2018 21:12:29 -0700 (PDT) From: Brijesh Singh Date: Wed, 11 Apr 2018 21:12:29 -0700 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] rte_hash thread safe 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: , X-List-Received-Date: Thu, 12 Apr 2018 04:12:31 -0000 Hello, I want to use DPDK's rte_hash library to keep track of tcp flows. The lookups will be done by multiple threads but inserts will be done only on one thread. As per the documentation rte_hash library has thread safe lookups. Key /data inserts should be done on single thread, since those operations are not thread safe. Is this documentation still correct? The lookup code compares the key and returns the data if the key matches, this doesn't look like thread safe. Am I missing something? _rte_hash_lookup_with_hash(const struct rte_hash *h, const void *key, hash_sig_t sig, void **data) { =E2=80=A6 if (rte_hash_cmp_eq(key, k->key, h) =3D=3D 0) { if (data !=3D NULL) *data =3D k->pdata; } Regards, Brijesh