All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Hannes Diethelm <hannes.diethelm@gmail.com>
Cc: xenomai@lists.linux.dev
Subject: Re: [PATCH 1/1] tidbits: net-ping: add ping tidbit using raw socket
Date: Sun, 05 Jul 2026 18:52:15 +0200	[thread overview]
Message-ID: <87pl11qszk.fsf@xenomai.org> (raw)
In-Reply-To: <7f0d1a81-adce-4d15-9707-87b8469cf8ae@gmail.com> (Hannes Diethelm's message of "Sun, 5 Jul 2026 17:27:55 +0200")

Hannes Diethelm <hannes.diethelm@gmail.com> writes:

> Am 05.07.26 um 16:57 schrieb Philippe Gerum:
>> Hannes Diethelm <hannes.diethelm@gmail.com> writes:
>> 
>>> This tidbit allows to ping any host and measure the response time.
>>>
>>> Signed-off-by: Hannes Diethelm <hannes.diethelm@gmail.com>
>>> ---
>>>   tidbits/meson.build    |   6 +
>>>   tidbits/oob-net-ping.c | 480 +++++++++++++++++++++++++++++++++++++++++
>>>   2 files changed, 486 insertions(+)
>>>   create mode 100644 tidbits/oob-net-ping.c
>>>
>> Thanks. We need this to build on 32bit systems:
>> --- a/tidbits/oob-net-ping.c
>> +++ b/tidbits/oob-net-ping.c
>> @@ -215,7 +215,7 @@ static size_t build_icmp_request(uint8_t *o_frame, size_t icmplen,
>>   	icmphdr->checksum = cksum;
>>     	if (verbosity > 1) {
>> -		evl_printf("ip_len=%zd, icmp_len=%zd, ip_len=%d, datalen=%ld\n",
>> +		evl_printf("ip_len=%zd, icmp_len=%zd, ip_len=%d, datalen=%zu\n",
>>   			   sizeof(*iphdr), sizeof(struct icmphdr),
>>   			   ntohs(iphdr->ip_len), datalen);
>>   		print_ip_header(iphdr);
>> What about turning this code into the (currently missing) 'evl-ping'
>> utility? I believe it is of general interest to any user.
>> 
>
> Thanks, I will fix this.
>
> Why not. So I would move the code in the tools place and rename it? Meanwhile,
> I was continuing work, so statistics are available, ping style.
>
> oob-ping:
> 2 packets transmitted, 2 received, 0% packet loss, time 1633ms
> rtt min/avg/max/mdev = 226.8/248.3/269.9/21.6 us
>

Yep, that's nice. We would make good use of this program as a standard
evl utility.

> ping:
> 3 packets transmitted, 3 received, 0% packet loss, time 2030ms
> rtt min/avg/max/mdev = 0.118/0.142/0.159/0.017 ms
>
> The only difference is, that I use us instead of ms. That could confuse some users.
> What do you think, stay at us or use ms?
>

I would stick with the standard ping convention (ms), maybe adding an
option to display delays in microseconds.

> BTW: This is in a VM, that's the reason for the bad timing.

Noted.

-- 
Philippe.

  reply	other threads:[~2026-07-05 16:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28 15:39 [PATCH 0/1] tidbits: net-ping: add ping tidbit using raw socket Hannes Diethelm
2026-06-28 15:39 ` [PATCH 1/1] " Hannes Diethelm
2026-07-05 14:57   ` Philippe Gerum
2026-07-05 15:27     ` Hannes Diethelm
2026-07-05 16:52       ` Philippe Gerum [this message]
2026-07-05 15:01 ` [PATCH 0/1] " Philippe Gerum
2026-07-05 15:21   ` Hannes Diethelm
2026-07-05 16:49     ` Philippe Gerum
2026-07-05 22:17       ` Hannes Diethelm
2026-07-05 23:57         ` Hannes Diethelm

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=87pl11qszk.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=hannes.diethelm@gmail.com \
    --cc=xenomai@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.