MPTCP Linux Development
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next 1/5] selftests: mptcp: simult_flows: unify errors msgs
Date: Fri, 10 Jan 2025 11:35:39 +0100	[thread overview]
Message-ID: <8c360ded-d7a4-4149-aa70-854292655073@kernel.org> (raw)
In-Reply-To: <e94e771e8993b4b40e151959fccb7716a8d29a86.camel@kernel.org>

Hi Geliang,

On 10/01/2025 09:16, Geliang Tang wrote:
> Hi Matt,
> 
> On Wed, 2025-01-08 at 19:40 +0100, Matthieu Baerts (NGI0) wrote:
>> In order to unify what is printed in case of error, similar to what
>> is
>> done in mptcp_connect.sh and mptcp_join.sh, it is interesting to do
>> the
>> following modifications in simult_flows.sh:
>>
>> - Print the rc errors at the end of the line.
>>
>> - Print the MIB counters.
>>
>> - Use the same ss options: add -M (MPTCP sockets) and -e (detailed
>>   socket information).
>>
>> While at it, also print of the 'max' time only in case of success,
>> because 'mptcp_connect.c' will already print this info in case of
>> error,
>> e.g.:
>>
>>   transfer slower than expected! runtime 11948 ms, expected 11921 ms
>>
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>> ---
>>  tools/testing/selftests/net/mptcp/simult_flows.sh | 21
>> ++++++++++++++++-----
>>  1 file changed, 16 insertions(+), 5 deletions(-)
>>
>> diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh
>> b/tools/testing/selftests/net/mptcp/simult_flows.sh
>> index
>> 8fa77c8e9b651171a34c89bfd5c9ded0288a5bde..e98e5907d52c2d0e9c0152efda8
>> 2176861905cf1 100755
>> --- a/tools/testing/selftests/net/mptcp/simult_flows.sh
>> +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh
>> @@ -155,6 +155,11 @@ do_transfer()
>>   sleep 1
>>   fi
>>  
>> + NSTAT_HISTORY=/tmp/${ns3}.nstat ip netns exec ${ns3} \
>> + nstat -n
>> + NSTAT_HISTORY=/tmp/${ns1}.nstat ip netns exec ${ns1} \
>> + nstat -n
>> +
>>   timeout ${timeout_test} \
>>   ip netns exec ${ns3} \
>>   ./mptcp_connect -jt ${timeout_poll} -l -p $port -T $max_time \
>> @@ -180,25 +185,31 @@ do_transfer()
>>   kill ${cappid_connector}
>>   fi
>>  
>> + NSTAT_HISTORY=/tmp/${ns3}.nstat ip netns exec ${ns3} \
>> + nstat | grep Tcp > /tmp/${ns3}.out
>> + NSTAT_HISTORY=/tmp/${ns1}.nstat ip netns exec ${ns1} \
>> + nstat | grep Tcp > /tmp/${ns1}.out
> 
> Here I got "nstat: history is aged out, resetting" warnings, and I
> don't know how to fix it:
> 
> Selftest Test: ./simult_flows.sh
> TAP version 13
> 1..1
> [    1.022664] ip (155) used greatest stack depth: 12280 bytes left
> [    1.316990] netem: version 1.3
> # 01 balanced bwidth                                            
> 7401nstat: history is aged out, resetting
> # nstat: history is aged out, resetting
> #  max 7906       [ OK ]
> # 02 balanced bwidth - reverse direction                         7394
> max 7906       [ OK ]

Interesting: I already saw this message on NIPA, but I could not
reproduce it on my side.

Could you eventually try to find out what it is? Maybe the stats from
files in /tmp are wrong inside your VM?

The code of nstat is in the iproute2 repo:

https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/tree/misc/nstat.c#n691

  if (!ignore_history) {
      FILE *tfp;
      long uptime = -1;

      if ((tfp = fopen("/proc/uptime", "r")) != NULL) {
          if (fscanf(tfp, "%ld", &uptime) != 1)
              uptime = -1;
          fclose(tfp);
      }
      if (uptime >= 0 && time(NULL) >= stb.st_mtime+uptime) {
          fprintf(stderr, "nstat: history is aged out, resetting\n");
          if (ftruncate(fileno(hist_fp), 0) < 0)
              perror("nstat: ftruncate");
      }
  }

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2025-01-10 10:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08 18:40 [PATCH mptcp-next 0/5] selftests: mptcp: more info in case of errors Matthieu Baerts (NGI0)
2025-01-08 18:40 ` [PATCH mptcp-next 1/5] selftests: mptcp: simult_flows: unify errors msgs Matthieu Baerts (NGI0)
2025-01-10  8:16   ` Geliang Tang
2025-01-10 10:35     ` Matthieu Baerts [this message]
2025-01-08 18:40 ` [PATCH mptcp-next 2/5] selftests: mptcp: move stats info in case of errors to lib.sh Matthieu Baerts (NGI0)
2025-01-09  9:24   ` Geliang Tang
2025-01-09 15:30     ` Matthieu Baerts
2025-01-10  3:05       ` Geliang Tang
2025-01-08 18:40 ` [PATCH mptcp-next 3/5] selftests: mptcp: add -m with ss in case of errors Matthieu Baerts (NGI0)
2025-01-08 18:40 ` [PATCH mptcp-next 4/5] selftests: mptcp: connect: remove unused variable Matthieu Baerts (NGI0)
2025-01-08 18:40 ` [PATCH mptcp-next 5/5] selftests: mptcp: connect: better display the files size Matthieu Baerts (NGI0)
2025-01-08 19:50 ` [PATCH mptcp-next 0/5] selftests: mptcp: more info in case of errors MPTCP CI
2025-01-12 12:38 ` Matthieu Baerts

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=8c360ded-d7a4-4149-aa70-854292655073@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox