From patchwork Mon Aug 11 03:43:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takayuki Usui X-Patchwork-Id: 130 Return-Path: Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by dpdk.org (Postfix) with ESMTP id 81ABE6898 for ; Mon, 11 Aug 2014 05:40:48 +0200 (CEST) Received: by mail-pa0-f50.google.com with SMTP id et14so10368204pad.9 for ; Sun, 10 Aug 2014 20:43:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=Wsx7Wu52/jn/RQoinZsg2GmZjtX+Fbnn0kYYKecOF88=; b=BerWqlnfqNhLrYmbW9mJ5FSvWIHraK452Zh43gbWiEVQumdNrBH4JvSSbFG/3DJMdD fLnSjpgUBWIfihCec8Jc0CaU6dYDs+j8P6+52I297o+o6J82Srg/PQ0dzdD3bkhJpw5G moHJbFmjyqoKqwu34oNauWXytnni6FLgQnxVlmpJ9lXC3Ee8r/W0hk79LD9HSvSQvbOF WB1CRHFx7KAJ6GJC+JVzFc2XLWjDLfCFCTsru5CZ8yxjh8mJuPR9LFsroHVT2prDRVqY qu4YQ4u+1+2YIb4j7vcaNz0CiLSyaMeUBGFaetN2fSLI9Cf5PUqdeVNQ/bWXrYkzg/w7 YjTw== X-Gm-Message-State: ALoCoQm1BMjFeDFUXsdoF1/3m4Iha/VMtptPXXmmjtv8UBVa7UHpbJG9nxfUuI9o2vMr105h352n X-Received: by 10.66.139.106 with SMTP id qx10mr1009685pab.126.1407728616652; Sun, 10 Aug 2014 20:43:36 -0700 (PDT) Received: from localhost.localdomain ([240b:10:25c0:200:f157:ab3e:7dde:b8c7]) by mx.google.com with ESMTPSA id gu4sm9806268pbb.54.2014.08.10.20.43.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Aug 2014 20:43:36 -0700 (PDT) From: Takayuki Usui To: dev@dpdk.org Date: Mon, 11 Aug 2014 12:43:02 +0900 Message-Id: <1407728582-19637-1-git-send-email-takayuki@midokura.com> X-Mailer: git-send-email 2.0.3 Subject: [dpdk-dev] [PATCH] table: hash: fix entry size of configurable key size ext and lru 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: Mon, 11 Aug 2014 03:40:48 -0000 Signed-off-by: Takayuki Usui --- lib/librte_table/rte_table_hash_ext.c | 2 +- lib/librte_table/rte_table_hash_lru.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_table/rte_table_hash_ext.c b/lib/librte_table/rte_table_hash_ext.c index 6e26d98..8b86fab 100644 --- a/lib/librte_table/rte_table_hash_ext.c +++ b/lib/librte_table/rte_table_hash_ext.c @@ -221,7 +221,7 @@ rte_table_hash_ext_create(void *params, int socket_id, uint32_t entry_size) /* Internal */ t->bucket_mask = t->n_buckets - 1; t->key_size_shl = __builtin_ctzl(p->key_size); - t->data_size_shl = __builtin_ctzl(p->key_size); + t->data_size_shl = __builtin_ctzl(entry_size); /* Tables */ table_meta_offset = 0; diff --git a/lib/librte_table/rte_table_hash_lru.c b/lib/librte_table/rte_table_hash_lru.c index d1a4984..bf92e81 100644 --- a/lib/librte_table/rte_table_hash_lru.c +++ b/lib/librte_table/rte_table_hash_lru.c @@ -192,7 +192,7 @@ rte_table_hash_lru_create(void *params, int socket_id, uint32_t entry_size) /* Internal */ t->bucket_mask = t->n_buckets - 1; t->key_size_shl = __builtin_ctzl(p->key_size); - t->data_size_shl = __builtin_ctzl(p->key_size); + t->data_size_shl = __builtin_ctzl(entry_size); /* Tables */ table_meta_offset = 0;