From nobody Sun Sep 22 13:19:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBRZ04XXnz5X9wk for ; Sun, 22 Sep 2024 13:20:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBRZ00vRcz4JcM for ; Sun, 22 Sep 2024 13:20:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2db928dbd53so2838432a91.2 for ; Sun, 22 Sep 2024 06:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727011206; x=1727616006; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qi3opoN4FC5MXNtkIWBPG3XxsqOaivMcwrPmcV5M4qg=; b=Bq1Y3QEUYIsfB0t83J65ZBdJoQgXi70hMZbBFFkNhXvXrW3P+lVeS94DHxKR0mDw1B LlhtTbj2rPeCEZQ0Dle1woK2b/D5uw3QxEvwtwkBKDsfXXdZNoKBTHN70exuhXDTyUXx 6okzlZsucDWwIwPFdU/SbgvR/utC2n4y5FjcJ2vlM4SKwl5mgFEy8oi4mAZGfOuF0Bv9 uZXr2DjCPGRvvYLEWjXXX+CnKPOckCvmtviv8wNPn9HaSy1yXY+7jQPu0LnNILp/eICy fsOBdbmdRWya9CB8sF34LY09XFgkdxvyOKj7BfZ8zBHgh6Q2lEiuNcnhNfSgCCSGk1bn 0Pkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727011206; x=1727616006; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qi3opoN4FC5MXNtkIWBPG3XxsqOaivMcwrPmcV5M4qg=; b=HRs47PGKVGQNNrtBvaBcNCuWu1wQVmUA32mN+JwJUq/4Q9aWDnsJesuOshYSrYqDxn 3iCIp1vQdH86j3NIiqdCv42mn+tLwe5eF6qxSE/vw/cyvDql6HJCjB4yqSHPkuSDROCA IeCbUFXmhhusAG/I0yQR/+s/yUMIjJt3GzijdVDbih260DcT+BXhXyX5uXH6L10jEe4S GmU8tkVNGtYFVJun5yFCNKyrLONKdOTnQc1mhtFNzVlmxPkS/Uj7MjDGmgSvKTn0OKxj MNo4kKL6iMdvBolyu1d9s7IzFFrYfUh2Di8eHXarG0tvgiG+5xNZVK9TXaS4kLgsqore 8FFQ== X-Forwarded-Encrypted: i=1; AJvYcCWdZ7p9LEcjN9ivld248fDvU1CIXyZrhcZsOLA0BOGqJgPbklB2hLIEGwDx28pKt5/aoDdr5gE8EJ11c0SANsWWrmVxiw==@freebsd.org X-Gm-Message-State: AOJu0Yxi2/4lCkWzwJGghQ/njSkhEDlxN4xOs30SlbWTugYpub7aceVz RC5lG382q8MfLWvtDMoWYMNUDo/4YL31E8cEI8t5gSiXDuAHNEqtYpayabvRIpG0Qhg2KsRpoqA PSkqdALOnrBi4PNm3MtRKZ+wlcI+3g6GJjsb/xO/+tPe3tUIdFMk= X-Google-Smtp-Source: AGHT+IH4/b3p2/ykNzMM00o6WRDDIrUz2hG8AaOAeFN+o1YC+9y23npy8bZSHVVoomTm9ff11ayYIg9dKzPg2H477P0= X-Received: by 2002:a17:90b:4b8e:b0:2da:8974:b3e3 with SMTP id 98e67ed59e1d1-2dd7f71a9c1mr11544309a91.27.1727011206091; Sun, 22 Sep 2024 06:20:06 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 22 Sep 2024 14:19:54 +0100 Message-ID: Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output To: Mark Johnston Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Bram Content-Type: multipart/alternative; boundary="00000000000076754d0622b521c7" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XBRZ00vRcz4JcM X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --00000000000076754d0622b521c7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Sep 22, 2024 at 11:29=E2=80=AFAM Mark Johnston = wrote: > On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d= 36654cde1 > > > > commit 94567c8641e235763b5b2926416d89d36654cde1 > > Author: Bram > > AuthorDate: 2024-07-23 08:57:42 +0000 > > Commit: Warner Losh > > CommitDate: 2024-09-20 15:06:26 +0000 > > > > netstat: Resolve duplicate "dropped-packets" key from libxo output > > > > The current libxo output uses the "dropped-packets" key for both > incoming and > > outgoing packets. This commit distinguishes between the two by > adding an "in" > > and "out" suffix. The original "dropped-packets" key is kept for > backwards > > compatibility for now. > > > > PR: 244589 > > Reviewed by: imp, zlei > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 > > --- > > usr.bin/netstat/if.c | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c > > index 172ea5324ccb..f0af785bce04 100644 > > --- a/usr.bin/netstat/if.c > > +++ b/usr.bin/netstat/if.c > > @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) > > IFA_STAT(ipackets), link|network, 1); > > show_stat("lu", nerr_len, "received-errors", > IFA_STAT(ierrors), > > link, 1); > > + /* Below is kept for backwards compatibility. Will be > removed in the future. */ > > show_stat("lu", nerr_len, "dropped-packets", > IFA_STAT(iqdrops), > > link, 1); > > + show_stat("lu", nerr_len, "dropped-packets-in", > IFA_STAT(iqdrops), > > + link, 1); > > This breaks plain netstat output, causing a bunch of network tests to > fail. For instance, "netstat -Wf link -I re0" now prints an extra > column. > > I think we should not bother with backwards compat unless libxo is > emitting structured output. This can be implemented using the "e" > format modifier described in the xo_format modified, but I'm not sure > how to plumb it through show_stat(). > > Let's revert until this is fixed? > Works for me. I hadn't noticed before the push. Thanks for bringing it up. Warner > > if (bflag) > > show_stat("lu", nbyte_len, "received-bytes", > > IFA_STAT(ibytes), link|network, 0); > > @@ -516,7 +519,7 @@ intpr(void (*pfunc)(char *), int af) > > show_stat("NRSlu", nerr_len, "collisions", > IFA_STAT(collisions), > > link, 1); > > if (dflag) > > - show_stat("LSlu", nerr_len, "dropped-packets", > > + show_stat("LSlu", nerr_len, "dropped-packets-out"= , > > IFA_STAT(oqdrops), link, 1); > > xo_emit("\n"); > > > > @@ -705,8 +708,11 @@ loop: > > new->ift_ip - old->ift_ip, 1, 1); > > show_stat("lu", 5, "received-errors", > > new->ift_ie - old->ift_ie, 1, 1); > > + /* Below is kept for backwards compatibility. Will be removed in > the future. */ > > show_stat("lu", 5, "dropped-packets", > > new->ift_id - old->ift_id, 1, 1); > > + show_stat("lu", 5, "dropped-packets-in", > > + new->ift_id - old->ift_id, 1, 1); > > show_stat("lu", 10, "received-bytes", > > new->ift_ib - old->ift_ib, 1, 0); > > show_stat("lu", 10, "sent-packets", > > @@ -718,7 +724,7 @@ loop: > > show_stat("NRSlu", 5, "collisions", > > new->ift_co - old->ift_co, 1, 1); > > if (dflag) > > - show_stat("LSlu", 5, "dropped-packets", > > + show_stat("LSlu", 5, "dropped-packets-out", > > new->ift_od - old->ift_od, 1, 1); > > xo_close_instance("stats"); > > xo_emit("\n"); > --00000000000076754d0622b521c7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Sep 22, 2024 at 11:29=E2=80= =AFAM Mark Johnston <markj@freebsd.= org> wrote:
On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d36654cde1<= /a>
>
> commit 94567c8641e235763b5b2926416d89d36654cde1
> Author:=C2=A0 =C2=A0 =C2=A0Bram <
bram@cbbg.nl>
> AuthorDate: 2024-07-23 08:57:42 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-09-20 15:06:26 +0000
>
>=C2=A0 =C2=A0 =C2=A0netstat: Resolve duplicate "dropped-packets&qu= ot; key from libxo output
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0The current libxo output uses the "dropped-pac= kets" key for both incoming and
>=C2=A0 =C2=A0 =C2=A0outgoing packets. This commit distinguishes between= the two by adding an "in"
>=C2=A0 =C2=A0 =C2=A0and "out" suffix. The original "drop= ped-packets" key is kept for backwards
>=C2=A0 =C2=A0 =C2=A0compatibility for now.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0PR: 244589
>=C2=A0 =C2=A0 =C2=A0Reviewed by: imp, zlei
>=C2=A0 =C2=A0 =C2=A0Pull Request: https://github= .com/freebsd/freebsd-src/pull/1331
> ---
>=C2=A0 usr.bin/netstat/if.c | 10 ++++++++--
>=C2=A0 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
> index 172ea5324ccb..f0af785bce04 100644
> --- a/usr.bin/netstat/if.c
> +++ b/usr.bin/netstat/if.c
> @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0IF= A_STAT(ipackets), link|network, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("= lu", nerr_len, "received-errors", IFA_STAT(ierrors),
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0li= nk, 1);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Below is kept for = backwards compatibility. Will be removed in the future. */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("= lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops),
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0li= nk, 1);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu&qu= ot;, nerr_len, "dropped-packets-in", IFA_STAT(iqdrops),
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0link, 1= );

This breaks plain netstat output, causing a bunch of network tests to
fail.=C2=A0 For instance, "netstat -Wf link -I re0" now prints an= extra
column.

I think we should not bother with backwards compat unless libxo is
emitting structured output.=C2=A0 This can be implemented using the "e= "
format modifier described in the xo_format modified, but I'm not sure how to plumb it through show_stat().

Let's revert until this is fixed?

W= orks for me. I hadn't noticed before the push. Thanks for bringing it u= p.

Warner
=C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (bflag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0show_stat("lu", nbyte_len, "received-bytes"= ;,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0IFA_STAT(ibytes), link|network, 0);
> @@ -516,7 +519,7 @@ intpr(void (*pfunc)(char *), int af)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("= NRSlu", nerr_len, "collisions", IFA_STAT(collisions),
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0li= nk, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (dflag)
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0show_stat("LSlu", nerr_len, "dropped-packets", > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0show_stat("LSlu", nerr_len, "dropped-packets-out"= ;,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0IFA_STAT(oqdrops), link, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xo_emit("\n= ");
>=C2=A0
> @@ -705,8 +708,11 @@ loop:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_ip - old->ift_i= p, 1, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 5, "received-= errors",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_ie - old->ift_i= e, 1, 1);
> +=C2=A0 =C2=A0 =C2=A0/* Below is kept for backwards compatibility. Wil= l be removed in the future. */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 5, "dropped-p= ackets",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_id - old->ift_i= d, 1, 1);
> +=C2=A0 =C2=A0 =C2=A0show_stat("lu", 5, "dropped-packet= s-in",
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_id - old->ift_id, 1,= 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 10, "received= -bytes",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_ib - old->ift_i= b, 1, 0);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 10, "sent-pac= kets",
> @@ -718,7 +724,7 @@ loop:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("NRSlu", 5, "collis= ions",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_co - old->ift_c= o, 1, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (dflag)
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("LSlu&= quot;, 5, "dropped-packets",
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("LSlu&= quot;, 5, "dropped-packets-out",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ne= w->ift_od - old->ift_od, 1, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0xo_close_instance("stats");
>=C2=A0 =C2=A0 =C2=A0 =C2=A0xo_emit("\n");
--00000000000076754d0622b521c7--