public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, mptcp@lists.linux.dev
Subject: Re: [PATCH iproute2 1/2] mptcp: monitor: also show iface name
Date: Wed, 18 Feb 2026 20:03:20 +0100	[thread overview]
Message-ID: <a44c1f27-e9f0-4f33-beda-e5f611197e35@kernel.org> (raw)
In-Reply-To: <20260218103155.486d20ee@phoenix.local>

Hi Stephen,

Thank you for the review!

On 18/02/2026 19:31, Stephen Hemminger wrote:
> On Wed, 11 Feb 2026 13:03:17 +0100
> "Matthieu Baerts (NGI0)" <matttbe@kernel.org> wrote:
> 
>> @@ -530,7 +541,7 @@ static int mptcp_monitor_msg(struct rtnl_ctrl_data *ctrl,
>>  	if (tb[MPTCP_ATTR_TIMEOUT])
>>  		printf(" timeout=%u", rta_getattr_u32(tb[MPTCP_ATTR_TIMEOUT]));
>>  	if (tb[MPTCP_ATTR_IF_IDX])
>> -		printf(" ifindex=%d", rta_getattr_s32(tb[MPTCP_ATTR_IF_IDX]));
>> +		print_iface(rta_getattr_s32(tb[MPTCP_ATTR_IF_IDX]));
>>  	if (tb[MPTCP_ATTR_RESET_REASON])
>>  		printf(" reset_reason=%u", rta_getattr_u32(tb[MPTCP_ATTR_RESET_REASON]));
>>  	if (tb[MPTCP_ATTR_RESET_FLAGS])
> 
> 
> The whole monitor message output format here is divergent from what other
> iproute2 commands do. If you look at ip monitor there are no '=' signs
> in the output.

Indeed, the output is different from 'ip monitor' (but similar to 'ip
ioam monitor').

> Please fix the whole function.

Doing that would likely break scripts parsing 'ip mptcp monitor' output,
are you sure we should still change this output format?

Please note that compared to 'ip monitor', this commands can print quite
a few attributes, and I guess the '=' signs have been added to improve
the parsing (or even the reading?).

  [         CREATED] token=d8392d7c remid=0 locid=0 saddr6=2001:db8:1234:5678:302e:d9cb:3bca:3d88 daddr6=2001:41d0:a:ffcf:1234:5678:8765:1 sport=57432 dport=443 deny_join_id0
  [     ESTABLISHED] token=d8392d7c remid=0 locid=0 saddr6=2001:db8:1234:5678:302e:d9cb:3bca:3d88 daddr6=2001:41d0:a:ffcf:1234:5678:8765:1 sport=57432 dport=443 deny_join_id0
  [       ANNOUNCED] token=d8392d7c remid=1 daddr4=5.196.67.297 dport=443
  [  SF_ESTABLISHED] token=d8392d7c remid=0 locid=22 saddr6=2001:db8:1234:5678:20e:c6ff:fed9:8d06 daddr6=2001:41d0:a:ffcf:1234:5678:8765:1 sport=38949 dport=443 backup=0 ifindex=23
  [         SF_PRIO] token=d8392d7c remid=0 locid=22 saddr6=2001:db8:1234:5678:20e:c6ff:fed9:8d06 daddr6=2001:41d0:a:ffcf:1234:5678:8765:1 sport=38949 dport=443 backup=1 ifindex=23
  [  SF_ESTABLISHED] token=d8392d7c remid=0 locid=27 saddr6=2001:db8:1234:5678:d892:9a8:b192:3428 daddr6=2001:41d0:a:ffcf:1234:5678:8765:1 sport=53295 dport=443 backup=0 ifindex=5
  [       SF_CLOSED] token=d8392d7c remid=0 locid=22 saddr6=2001:db8:1234:5678:20e:c6ff:fed9:8d06 daddr6=2001:41d0:a:ffcf:1234:5678:8765:1 sport=38949 dport=443 backup=1 ifindex=23 error=104
  [          CLOSED] token=d8392d7c

The event type and the way it is displayed is also specific to 'ip mptcp
monitor'.

> Ideally all of iproute commands should
> support JSON in monitor mode as well. But that is a bigger effort.

I agree with you. I guess we copied the behaviour of 'ip monitor' here.
If there is a JSON support, we can probably more easily change the plain
text output format to force people to use the JSON one if still needed.

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


  reply	other threads:[~2026-02-18 19:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 12:03 [PATCH iproute2 0/2] mptcp: support colors & display iface name Matthieu Baerts (NGI0)
2026-02-11 12:03 ` [PATCH iproute2 1/2] mptcp: monitor: also show " Matthieu Baerts (NGI0)
2026-02-18 18:31   ` Stephen Hemminger
2026-02-18 19:03     ` Matthieu Baerts [this message]
2026-02-19 17:11       ` Stephen Hemminger
2026-02-19 17:38         ` Matthieu Baerts
2026-02-19 19:22           ` Stephen Hemminger
2026-02-19 19:26             ` Matthieu Baerts
2026-02-11 12:03 ` [PATCH iproute2 2/2] mptcp: display addr & ifname in color Matthieu Baerts (NGI0)
2026-02-18  4:00 ` [PATCH iproute2 0/2] mptcp: support colors & display iface name patchwork-bot+netdevbpf

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=a44c1f27-e9f0-4f33-beda-e5f611197e35@kernel.org \
    --to=matttbe@kernel.org \
    --cc=dsahern@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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