X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_hash.c;h=adeac3c27df7561ba065a2ab9aad89a0e0bd07e5;hb=79d5479e9f6dfe097fc24b0ddf2fe7fd1ba0f43b;hp=8c6f0dac218a44f30b6bd16211fd0156e8fc3943;hpb=caf3653dbe9dec81dc37c8e81267f27d3163dd19;p=userspace-rcu.git diff --git a/tests/test_urcu_hash.c b/tests/test_urcu_hash.c index 8c6f0da..adeac3c 100644 --- a/tests/test_urcu_hash.c +++ b/tests/test_urcu_hash.c @@ -41,6 +41,12 @@ #define DEFAULT_MIN_ALLOC_SIZE 1 #define DEFAULT_RAND_POOL 1000000 +/* + * Note: the hash seed should be a random value for hash tables + * targeting production environments to provide protection against + * denial of service attacks. We keep it a static value within this test + * program to compare identical benchmark runs. + */ #define TEST_HASH_SEED 0x42UL /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ @@ -610,7 +616,7 @@ void *thr_writer(void *_count) cds_lfht_test_lookup(test_ht, (void *)(((unsigned long) rand_r(&rand_lookup) % write_pool_size) + write_pool_offset), sizeof(void *), &iter); - ret = cds_lfht_del(test_ht, &iter); + ret = cds_lfht_del(test_ht, cds_lfht_iter_get_node(&iter)); rcu_read_unlock(); if (ret == 0) { node = cds_lfht_iter_get_test_node(&iter); @@ -715,7 +721,7 @@ void test_delete_all_nodes(struct cds_lfht *ht) cds_lfht_for_each_entry(ht, &iter, node, node) { int ret; - ret = cds_lfht_del(test_ht, &iter); + ret = cds_lfht_del(test_ht, cds_lfht_iter_get_node(&iter)); assert(!ret); call_rcu(&node->head, free_node_cb); count++;