From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 43F6D8D95 for ; Sat, 17 Sep 2016 11:43:36 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id 133so7120425wmq.2 for ; Sat, 17 Sep 2016 02:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=dfcX5IB7DbLOF82fbdPnbl1dJe81ZI0hcRjvk6sjvBQ=; b=Tmp3nfe48+WhE5/ZkdOD95CNkpaJRSwYeyogRoAZW7WGfp9f3GE26G5VAWjCGgTGbq KBwdTgsnn3PL4unhV+CuDBlKazNRLWZ1/uXnQqno94V1NUnp3UNdGZHlKEfEnFg5SJ8d nYvH1TMAxyQpZgbSeMwTBsXJ/H4N0scAtrbvd3BJAGNxAwlSHHvk0o/NWcFTUcZOZvMU MsK7qfsvWT4Rg6LZ7hHnzjPEarBgnfWoPeqa4ZAKVJweWpUZ4zYk3gG0QdCinDriVJNm YcyA1qiIdfOLUOxRy//cBlkemyRGZ+uwnprzROWz7Ee/UU5e8i7VUZ5kZluxpzLaqUHX 76wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dfcX5IB7DbLOF82fbdPnbl1dJe81ZI0hcRjvk6sjvBQ=; b=YxgNhCBj2h1jLXjhjYTDU6jluQTBD3QD3Q5R9wg2mLtvIHS2HWKxRaiYcuMm9RSSb7 zJaDunlQTvl8A40FLCyT8YEFfZf40SdJSMGcplVAywbrAxewL7VyPTie1QAZConGP3rR y8ssPigjO7ARYF3co2lloYaH/zkF3MNNFXnX/sA6muSAoVnFsvDhKCiAG/CQ1eOUdHmK ESX/u6YOs9wyJlh1DPN0aiZ1odDHsUlKRhkg8e/ZFGLPymnFHbnERKEwMA79W83olwrF D9aQvGAjntiHBC0k9mhE38Rg6sG+WI9lxEnUG5mERT5o5JPod1juIkmprg3c9DcCovrh hTlA== X-Gm-Message-State: AE9vXwMJseN8G85NmvP3mUnsAgZ3pe6cbJXT6MG8krcjeLEJVvtmZYWR/o6PS9F2vV/iPQ== X-Received: by 10.28.232.18 with SMTP id f18mr1357254wmh.51.1474105415862; Sat, 17 Sep 2016 02:43:35 -0700 (PDT) Received: from masoud.inside.sahab.ir ([89.165.43.38]) by smtp.gmail.com with ESMTPSA id b188sm11272563wmg.24.2016.09.17.02.43.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 17 Sep 2016 02:43:35 -0700 (PDT) From: Masoud Hasanifard To: dev@dpdk.org Cc: Masoud Hasanifard Date: Sat, 17 Sep 2016 14:13:24 +0430 Message-Id: <1474105404-27654-1-git-send-email-masoudhasanifard@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] hash: Correctly set the compare function. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 09:43:36 -0000 Set cmp_jump_table_idx to KEY_CUSTOM in rte_hash_cmp_eq so that the custom function we are setting in rte_hash_set_cmp_func properly works. The custom function is only called by rte_hash_cmp_eq if cmp_jump_table_idx is set to KEY_CUSTOM. --- lib/librte_hash/rte_cuckoo_hash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 26e54f6..2e6429f 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -98,6 +98,7 @@ rte_hash_find_existing(const char *name) void rte_hash_set_cmp_func(struct rte_hash *h, rte_hash_cmp_eq_t func) { + h->cmp_jump_table_idx = KEY_CUSTOM; h->rte_hash_custom_cmp_eq = func; } -- 2.7.4