netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] selftests/net: timestamping: Fix bind_phc check
@ 2022-01-30  9:54 Gerhard Engleder
  2022-01-31 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Gerhard Engleder @ 2022-01-30  9:54 UTC (permalink / raw)
  To: yangbo.lu, davem, kuba; +Cc: netdev, Gerhard Engleder

From: Gerhard Engleder <gerhard@engleder-embedded.com>

timestamping checks socket options during initialisation. For the field
bind_phc of the socket option SO_TIMESTAMPING it expects the value -1 if
PHC is not bound. Actually the value of bind_phc is 0 if PHC is not
bound. This results in the following output:

SIOCSHWTSTAMP: tx_type 0 requested, got 0; rx_filter 0 requested, got 0
SO_TIMESTAMP 0
SO_TIMESTAMPNS 0
SO_TIMESTAMPING flags 0, bind phc 0
   not expected, flags 0, bind phc -1

This is fixed by setting default value and expected value of bind_phc to
0.

Fixes: 2214d7032479 ("selftests/net: timestamping: support binding PHC")
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
---
 tools/testing/selftests/net/timestamping.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/timestamping.c b/tools/testing/selftests/net/timestamping.c
index aee631c5284e..044bc0e9ed81 100644
--- a/tools/testing/selftests/net/timestamping.c
+++ b/tools/testing/selftests/net/timestamping.c
@@ -325,8 +325,8 @@ int main(int argc, char **argv)
 	struct ifreq device;
 	struct ifreq hwtstamp;
 	struct hwtstamp_config hwconfig, hwconfig_requested;
-	struct so_timestamping so_timestamping_get = { 0, -1 };
-	struct so_timestamping so_timestamping = { 0, -1 };
+	struct so_timestamping so_timestamping_get = { 0, 0 };
+	struct so_timestamping so_timestamping = { 0, 0 };
 	struct sockaddr_in addr;
 	struct ip_mreq imr;
 	struct in_addr iaddr;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] selftests/net: timestamping: Fix bind_phc check
  2022-01-30  9:54 [PATCH net-next] selftests/net: timestamping: Fix bind_phc check Gerhard Engleder
@ 2022-01-31 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-31 11:50 UTC (permalink / raw)
  To: Gerhard Engleder; +Cc: yangbo.lu, davem, kuba, netdev

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Sun, 30 Jan 2022 10:54:22 +0100 you wrote:
> From: Gerhard Engleder <gerhard@engleder-embedded.com>
> 
> timestamping checks socket options during initialisation. For the field
> bind_phc of the socket option SO_TIMESTAMPING it expects the value -1 if
> PHC is not bound. Actually the value of bind_phc is 0 if PHC is not
> bound. This results in the following output:
> 
> [...]

Here is the summary with links:
  - [net-next] selftests/net: timestamping: Fix bind_phc check
    https://git.kernel.org/netdev/net-next/c/678dfd528034

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-31 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-30  9:54 [PATCH net-next] selftests/net: timestamping: Fix bind_phc check Gerhard Engleder
2022-01-31 11:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).