rculfhash: add comment about hash seed randomness within test program
[userspace-rcu.git] / tests / test_urcu_hash.c
index 8c6f0dac218a44f30b6bd16211fd0156e8fc3943..adeac3c27df7561ba065a2ab9aad89a0e0bd07e5 100644 (file)
 #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++;
This page took 0.03605 seconds and 4 git commands to generate.