[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241012094557.GB77519@kernel.org>
Date: Sat, 12 Oct 2024 10:45:57 +0100
From: Simon Horman <horms@...nel.org>
To: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
Cc: davem@...emloft.net, Liam.Howlett@...cle.com, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
vschneid@...hat.com, jiri@...nulli.us, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, akpm@...ux-foundation.org, shuah@...nel.org,
linux-kselftest@...r.kernel.org, peili.io@...cle.com
Subject: Re: [PATCH net-next 2/3] connector/cn_proc: Kunit tests for threads
hash table
On Fri, Oct 11, 2024 at 05:45:31PM -0700, Anjali Kulkarni wrote:
> Kunit tests to test hash table add, delete, duplicate add and delete.
> Add following configs and compile kernel code:
>
> CONFIG_CONNECTOR=y
> CONFIG_PROC_EVENTS=y
> CONFIG_NET=y
> CONFIG_KUNIT=m/y
> CONFIG_CN_HASH_KUNIT_TEST=m/y
>
> To run kunit tests:
> sudo modprobe cn_hash_test
>
> Output of kunit tests and hash table contents are displayed in
> /var/log/messages (at KERN_DEBUG level).
>
> Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
...
> index 000000000000..2687492864ed
> --- /dev/null
> +++ b/lib/cn_hash_test.c
> @@ -0,0 +1,167 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * KUnit test for the connector threads hashtable code.
> + *
> + * Copyright (c) 2024 Oracle and/or its affiliates.
> + * Author: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
> + */
> +#include <kunit/test.h>
> +
> +#include "cn_hash_test.h"
> +
> +#define ARR_SIZE 4
> +#define HASH_TABLE_LEN 1024
> +
> +struct add_data {
> + pid_t pid;
> + int exit_val;
> + int key;
> +};
> +
> +struct add_data adata[ARR_SIZE];
> +int key_display[HASH_TABLE_LEN];
Hi Anjali,
adata and key_display seem to only be used within this file.
Probably they should be static.
...
Powered by blists - more mailing lists