mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
--- a/v1.0/tool/nss_crypto_bench.c
|
|
+++ b/v1.0/tool/nss_crypto_bench.c
|
|
@@ -75,8 +75,8 @@ static DECLARE_WAIT_QUEUE_HEAD(tx_comp);
|
|
static DECLARE_WAIT_QUEUE_HEAD(tx_start);
|
|
static struct task_struct *tx_thread = NULL;
|
|
|
|
-static struct timeval init_time;
|
|
-static struct timeval comp_time;
|
|
+static struct timespec64 init_time;
|
|
+static struct timespec64 comp_time;
|
|
static spinlock_t op_lock;
|
|
static nss_crypto_handle_t crypto_hdl;
|
|
|
|
@@ -782,7 +782,7 @@ static int crypto_bench_tx(void *arg)
|
|
crypto_bench_debug("#");
|
|
|
|
/* get start time */
|
|
- do_gettimeofday(&init_time);
|
|
+ ktime_get_real_ts64(&init_time);
|
|
|
|
/**
|
|
* Request submission
|
|
@@ -812,8 +812,8 @@ static int crypto_bench_tx(void *arg)
|
|
* Calculate time and output the Mbps
|
|
*/
|
|
|
|
- init_usecs = (init_time.tv_sec * 1000 * 1000) + init_time.tv_usec;
|
|
- comp_usecs = (comp_time.tv_sec * 1000 * 1000) + comp_time.tv_usec;
|
|
+ init_usecs = (init_time.tv_sec * 1000 * 1000) + (init_time.tv_nsec / NSEC_PER_USEC);
|
|
+ comp_usecs = (comp_time.tv_sec * 1000 * 1000) + (comp_time.tv_nsec / NSEC_PER_USEC);
|
|
delta_usecs = comp_usecs - init_usecs;
|
|
|
|
reqs_completed = param.num_reqs - atomic_read(&tx_reqs);
|
|
@@ -870,7 +870,7 @@ static void crypto_bench_done(struct nss
|
|
nss_crypto_buf_free(crypto_hdl, buf);
|
|
|
|
if (atomic_dec_and_test(&tx_reqs)) {
|
|
- do_gettimeofday(&comp_time);
|
|
+ ktime_get_real_ts64(&comp_time);
|
|
|
|
wake_up_interruptible(&tx_comp);
|
|
param.num_loops--;
|