diff mbox series

[net-next,v4,4/4] rxtimestamp.c: add the test for SOF_TIMESTAMPING_OPT_RX_FILTER

Message ID 20240905071738.3725-5-kerneljasonxing@gmail.com (mailing list archive)
State New
Headers show
Series net-timestamp: introduce a flag to filter out rx software and hardware report | expand

Commit Message

Jason Xing Sept. 5, 2024, 7:17 a.m. UTC
From: Jason Xing <kernelxing@tencent.com>

Test when we use SOF_TIMESTAMPING_OPT_RX_FILTER with software
or hardware report flag. The expected result is no rx timestamp
report.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 tools/testing/selftests/net/rxtimestamp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Jason Xing Sept. 5, 2024, 10:31 a.m. UTC | #1
On Thu, Sep 5, 2024 at 3:18 PM Jason Xing <kerneljasonxing@gmail.com> wrote:
>
> From: Jason Xing <kernelxing@tencent.com>
>
> Test when we use SOF_TIMESTAMPING_OPT_RX_FILTER with software
> or hardware report flag. The expected result is no rx timestamp
> report.
>
> Reviewed-by: Willem de Bruijn <willemb@google.com>
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
> ---
>  tools/testing/selftests/net/rxtimestamp.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/tools/testing/selftests/net/rxtimestamp.c b/tools/testing/selftests/net/rxtimestamp.c
> index 9eb42570294d..9760abdb6e05 100644
> --- a/tools/testing/selftests/net/rxtimestamp.c
> +++ b/tools/testing/selftests/net/rxtimestamp.c
> @@ -57,6 +57,7 @@ static struct sof_flag sof_flags[] = {
>         SOF_FLAG(SOF_TIMESTAMPING_SOFTWARE),
>         SOF_FLAG(SOF_TIMESTAMPING_RX_SOFTWARE),
>         SOF_FLAG(SOF_TIMESTAMPING_RX_HARDWARE),
> +       SOF_FLAG(SOF_TIMESTAMPING_OPT_RX_FILTER),

Ah.. I missed adding SOF_TIMESTAMPING_RAW_HARDWARE :S

I'll repost it in 24 hour.

>  };
>
>  static struct socket_type socket_types[] = {
> @@ -97,6 +98,16 @@ static struct test_case test_cases[] = {
>                         | SOF_TIMESTAMPING_RX_HARDWARE },
>                 {}
>         },
> +       {
> +               { .so_timestamping = SOF_TIMESTAMPING_RAW_HARDWARE
> +                       | SOF_TIMESTAMPING_OPT_RX_FILTER },
> +               {}
> +       },
> +       {
> +               { .so_timestamping = SOF_TIMESTAMPING_SOFTWARE
> +                       | SOF_TIMESTAMPING_OPT_RX_FILTER },
> +               {}
> +       },
>         {
>                 { .so_timestamping = SOF_TIMESTAMPING_SOFTWARE
>                         | SOF_TIMESTAMPING_RX_SOFTWARE },
> --
> 2.37.3
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/rxtimestamp.c b/tools/testing/selftests/net/rxtimestamp.c
index 9eb42570294d..9760abdb6e05 100644
--- a/tools/testing/selftests/net/rxtimestamp.c
+++ b/tools/testing/selftests/net/rxtimestamp.c
@@ -57,6 +57,7 @@  static struct sof_flag sof_flags[] = {
 	SOF_FLAG(SOF_TIMESTAMPING_SOFTWARE),
 	SOF_FLAG(SOF_TIMESTAMPING_RX_SOFTWARE),
 	SOF_FLAG(SOF_TIMESTAMPING_RX_HARDWARE),
+	SOF_FLAG(SOF_TIMESTAMPING_OPT_RX_FILTER),
 };
 
 static struct socket_type socket_types[] = {
@@ -97,6 +98,16 @@  static struct test_case test_cases[] = {
 			| SOF_TIMESTAMPING_RX_HARDWARE },
 		{}
 	},
+	{
+		{ .so_timestamping = SOF_TIMESTAMPING_RAW_HARDWARE
+			| SOF_TIMESTAMPING_OPT_RX_FILTER },
+		{}
+	},
+	{
+		{ .so_timestamping = SOF_TIMESTAMPING_SOFTWARE
+			| SOF_TIMESTAMPING_OPT_RX_FILTER },
+		{}
+	},
 	{
 		{ .so_timestamping = SOF_TIMESTAMPING_SOFTWARE
 			| SOF_TIMESTAMPING_RX_SOFTWARE },