Netdev List
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 Willem de Bruijn <willemb@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 David Ahern <dsahern@kernel.org>,
	 Jason Xing <kerneljasonxing@gmail.com>,
	 Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next v4 3/3] selftests: txtimestamp: add SCM_TS_OPT_ID test
Date: Mon, 09 Sep 2024 16:31:37 -0400	[thread overview]
Message-ID: <66df5b295992c_7296f294db@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <5358489d-faff-4f0a-bf47-f5b45127e9e6@linux.dev>

Vadim Fedorenko wrote:
> On 09/09/2024 18:50, Willem de Bruijn wrote:
> > Vadim Fedorenko wrote:
> >> Extend txtimestamp test to run with fixed tskey using
> >> SCM_TS_OPT_ID control message for all types of sockets.
> >>
> >> Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
> >> Reviewed-by: Willem de Bruijn <willemb@google.com>
> >> Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
> >> ---
> >>   tools/include/uapi/asm-generic/socket.h    |  2 +
> >>   tools/testing/selftests/net/txtimestamp.c  | 48 +++++++++++++++++-----
> >>   tools/testing/selftests/net/txtimestamp.sh | 12 +++---
> >>   3 files changed, 47 insertions(+), 15 deletions(-)
> >>
> >> diff --git a/tools/include/uapi/asm-generic/socket.h b/tools/include/uapi/asm-generic/socket.h
> >> index 54d9c8bf7c55..281df9139d2b 100644
> >> --- a/tools/include/uapi/asm-generic/socket.h
> >> +++ b/tools/include/uapi/asm-generic/socket.h
> >> @@ -124,6 +124,8 @@
> >>   #define SO_PASSPIDFD		76
> >>   #define SO_PEERPIDFD		77
> >>   
> >> +#define SCM_TS_OPT_ID		78
> >> +
> >>   #if !defined(__KERNEL__)
> >>   
> >>   #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
> >> diff --git a/tools/testing/selftests/net/txtimestamp.c b/tools/testing/selftests/net/txtimestamp.c
> >> index ec60a16c9307..bdd0eb74326c 100644
> >> --- a/tools/testing/selftests/net/txtimestamp.c
> >> +++ b/tools/testing/selftests/net/txtimestamp.c
> >> @@ -54,6 +54,10 @@
> >>   #define USEC_PER_SEC	1000000L
> >>   #define NSEC_PER_SEC	1000000000LL
> >>   
> >> +#ifndef SCM_TS_OPT_ID
> >> +# define SCM_TS_OPT_ID 78
> >> +#endif
> > 
> > This should not be needed. And along with the uapi change above means
> > the test will be broken on other platforms.
> > 
> > (SO|SCM)_TXTIME ostensibly has the same issue and does not do this.
> 
> I had the same feeling, but apparently I wasn't able to build tests
> without this addition. Looks like selftests rely on system's uapi rather
> the one provided in tool/include/uapi.

Right, as they should.

make headers_install will install headers by default under $KSRC/usr

tools/testing/selftests/net/Makefile has

CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES)

Haven't tried, but I assume this will pick up the right header
depending on the arch.

> With SCM_TXTIME it worked because the option was added back in 2018 in
> 80b14dee2bea ("net: Add a new socket option for a future transmit 
> time.") by Richard while tests were added in 2019 by yourself in
> af5136f95045 ("selftests/net: SO_TXTIME with ETF and FQ").
> 
> Though selftests do miss uapi for other architectures, it might be a
> good reason to respin the series, but fixing selftests infra is a bit
> different story, I believe... I may try to fix it and post another
> series.



  reply	other threads:[~2024-09-09 20:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 16:50 [PATCH net-next v4 0/3] Add option to provide OPT_ID value via cmsg Vadim Fedorenko
2024-09-09 16:50 ` [PATCH net-next v4 1/3] net_tstamp: add SCM_TS_OPT_ID to provide OPT_ID in control message Vadim Fedorenko
2024-09-09 17:48   ` Willem de Bruijn
2024-09-09 16:50 ` [PATCH net-next v4 2/3] net_tstamp: add SCM_TS_OPT_ID for RAW sockets Vadim Fedorenko
2024-09-09 17:48   ` Willem de Bruijn
2024-09-10  7:05   ` kernel test robot
2024-09-10  7:47   ` kernel test robot
2024-09-09 16:50 ` [PATCH net-next v4 3/3] selftests: txtimestamp: add SCM_TS_OPT_ID test Vadim Fedorenko
2024-09-09 17:50   ` Willem de Bruijn
2024-09-09 19:59     ` Vadim Fedorenko
2024-09-09 20:31       ` Willem de Bruijn [this message]
2024-09-09 20:37         ` Vadim Fedorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66df5b295992c_7296f294db@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=horms@kernel.org \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox