From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC4F642DC5; Mon, 3 Jul 2023 20:49:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4EF940ED5; Mon, 3 Jul 2023 20:49:08 +0200 (CEST) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by mails.dpdk.org (Postfix) with ESMTP id 43968400EF for ; Mon, 3 Jul 2023 20:49:07 +0200 (CEST) Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3a38953c928so2320240b6e.1 for ; Mon, 03 Jul 2023 11:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688410146; x=1691002146; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IA4hcuEPhynptGDCejqyVfsh4W7nU225x1/mu771KCw=; b=WhCI3VNV4Jr0vCiD/CI9iTB1uWJV/67eqXrxDI5TWxbI0bQ+jSxiin1euvwQo7Q80j 6TNmAYiIllYgiG2WFqz8sbNoSB8aGfJnbPrdMhGvRhn39+e8SWQL6tj3rFfNAxZL7U0+ JOT3jLgVex0+O1xpS20YZrYFHC2LU8gGLadd3PKuXYdKRxFuA1/+BhbLY2Cj749luOjs a61VN07VqZhRRhwqUSOzB+Sb17FuNA9Cvf76bLp+1mTiA6uaQcNUye9MG6M5c2wFFKRx CZ+SmlNfCe7qm424f+P6kF78ZjuhS65tehuQgLbVV8YTWYb2FjyltsA8a3TwJuKAk5n8 hbdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688410146; x=1691002146; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IA4hcuEPhynptGDCejqyVfsh4W7nU225x1/mu771KCw=; b=Nilp49GnIYq6oze3uiMIMMtgqVWdrcP0Oa8cX9L/wEFtd32O/ShCiGD2PsN0tRbXjs kQAlvleVP6XNe/VlWEHq7AInjMwVT7sWmVzS5tZHkx5YnqpcX26pmdKYX97QQ7T7/3Kk 5PTxC/4QhDyrQvt7AI+5oBOATCyDxmZV1llxa2MKPepvs/huIATAqSIn18BNXGSfmBOn wzDptASP63tt2T+TMJUvGqWsfSG3FyQZ7FWZu/t5HfuYxBwxVy4zG8mocNaMqsiiQEJ0 RsKLhDo4n8PualLfdEuOGGZpuNx+NRnw8w2QQfNbnphURFFBHF1sfc8BBd/3t1Fr0Bhx v/Mg== X-Gm-Message-State: AC+VfDyvS9S1OMlxLxR4XH1ggVS6eSDT8gZzB0DNmG6xcKYPCfIKiCEO jq4jeSzzbb9uKqOh7JUElmQBoSeF26vSRKQdMk0= X-Google-Smtp-Source: ACHHUZ6ydIBTC0pHI4+2I3tWGNCwu/DiiD4lLPsFYH9Ospv4qQ1YMCSNlToaGOKKuUsKPYnmR18D2w== X-Received: by 2002:a54:4713:0:b0:3a3:6743:a9c with SMTP id k19-20020a544713000000b003a367430a9cmr10228129oik.6.1688410146278; Mon, 03 Jul 2023 11:49:06 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id 16-20020aa79210000000b00640dbbd7830sm14645380pfo.18.2023.07.03.11.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 11:49:05 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Anatoly Burakov Subject: [PATCH] test: remove unnecessary rte_srand Date: Mon, 3 Jul 2023 11:49:03 -0700 Message-Id: <20230703184903.51441-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The random number is already initialized to a better random seed during starup process. The calls to rte_srand() are redundant and actually make entropy worse. Signed-off-by: Stephen Hemminger --- app/test/test_fib6_perf.c | 2 -- app/test/test_fib_perf.c | 2 -- app/test/test_hash_multiwriter.c | 2 -- app/test/test_lpm6_perf.c | 2 -- app/test/test_lpm_perf.c | 2 -- app/test/test_malloc.c | 2 -- app/test/test_memzone.c | 1 - app/test/test_reciprocal_division.c | 1 - app/test/test_reciprocal_division_perf.c | 2 -- 9 files changed, 16 deletions(-) diff --git a/app/test/test_fib6_perf.c b/app/test/test_fib6_perf.c index add20c2331b1..f5c06b4fc9d0 100644 --- a/app/test/test_fib6_perf.c +++ b/app/test/test_fib6_perf.c @@ -83,8 +83,6 @@ test_fib6_perf(void) conf.trie.nh_sz = RTE_FIB6_TRIE_4B; conf.trie.num_tbl8 = RTE_MIN(get_max_nh(conf.trie.nh_sz), 1000000U); - rte_srand(rte_rdtsc()); - printf("No. routes = %u\n", (unsigned int) NUM_ROUTE_ENTRIES); print_route_distribution(large_route_table, diff --git a/app/test/test_fib_perf.c b/app/test/test_fib_perf.c index b56293e64f41..fcf8d222d90a 100644 --- a/app/test/test_fib_perf.c +++ b/app/test/test_fib_perf.c @@ -334,8 +334,6 @@ test_fib_perf(void) int status = 0; int64_t count = 0; - rte_srand(rte_rdtsc()); - generate_large_route_rule_table(); printf("No. routes = %u\n", (unsigned int) NUM_ROUTE_ENTRIES); diff --git a/app/test/test_hash_multiwriter.c b/app/test/test_hash_multiwriter.c index 0c5a8ca18607..3b70157b433b 100644 --- a/app/test/test_hash_multiwriter.c +++ b/app/test/test_hash_multiwriter.c @@ -146,8 +146,6 @@ test_hash_multiwriter(void) tbl_multiwriter_test_params.nb_tsx_insertion) * tbl_multiwriter_test_params.nb_tsx_insertion; - rte_srand(rte_rdtsc()); - keys = rte_malloc(NULL, sizeof(uint32_t) * nb_entries, 0); if (keys == NULL) { diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c index 5b684686a687..2e79655aa89c 100644 --- a/app/test/test_lpm6_perf.c +++ b/app/test/test_lpm6_perf.c @@ -66,8 +66,6 @@ test_lpm6_perf(void) config.number_tbl8s = NUMBER_TBL8S; config.flags = 0; - rte_srand(rte_rdtsc()); - printf("No. routes = %u\n", (unsigned) NUM_ROUTE_ENTRIES); print_route_distribution(large_route_table, (uint32_t) NUM_ROUTE_ENTRIES); diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c index e72437ba3850..dcc2eb375ae9 100644 --- a/app/test/test_lpm_perf.c +++ b/app/test/test_lpm_perf.c @@ -605,8 +605,6 @@ test_lpm_perf(void) uint64_t cache_line_counter = 0; int64_t count = 0; - rte_srand(rte_rdtsc()); - generate_large_route_rule_table(); printf("No. routes = %u\n", (unsigned) NUM_ROUTE_ENTRIES); diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index ff081dd93139..b1d8be1e0491 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -692,8 +692,6 @@ test_random_alloc_free(void *_ __rte_unused) unsigned i; unsigned count = 0; - rte_srand((unsigned)rte_rdtsc()); - for (i = 0; i < N; i++){ unsigned free_mem = 0; size_t allocated_size; diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c index f10f4fd9cd39..dd42f783c7ce 100644 --- a/app/test/test_memzone.c +++ b/app/test/test_memzone.c @@ -573,7 +573,6 @@ test_memzone_reserve_max_aligned(void) socket = rte_socket_id_by_idx(i); /* random alignment */ - rte_srand((unsigned int)rte_rdtsc()); const unsigned int align = 1 << ((rte_rand() % 8) + 5); /* from 128 up to 4k alignment */ /* memzone size may be between size and size - align */ diff --git a/app/test/test_reciprocal_division.c b/app/test/test_reciprocal_division.c index 8ea9b1d24d27..c70b90d2f4d7 100644 --- a/app/test/test_reciprocal_division.c +++ b/app/test/test_reciprocal_division.c @@ -32,7 +32,6 @@ test_reciprocal(void) struct rte_reciprocal reci_u32 = {0}; struct rte_reciprocal_u64 reci_u64 = {0}; - rte_srand(rte_rdtsc()); printf("Validating unsigned 32bit division.\n"); for (i = 0; i < MAX_ITERATIONS; i++) { /* Change divisor every DIVIDE_ITER iterations. */ diff --git a/app/test/test_reciprocal_division_perf.c b/app/test/test_reciprocal_division_perf.c index 4f625873e53a..3d25be71cae5 100644 --- a/app/test/test_reciprocal_division_perf.c +++ b/app/test/test_reciprocal_division_perf.c @@ -37,8 +37,6 @@ test_reciprocal_division_perf(void) struct rte_reciprocal reci_u32 = {0}; struct rte_reciprocal_u64 reci_u64 = {0}; - rte_srand(rte_rdtsc()); - printf("Validating unsigned 32bit division.\n"); for (i = 0; i < MAX_ITERATIONS; i++) { /* Change divisor every DIVIDE_ITER iterations. */ -- 2.39.2