From nobody Sun Sep 22 10:29:39 2024 X-Original-To: dev-commits-src-all@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 4XBMnR1LNBz5XGvK; Sun, 22 Sep 2024 10:29:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (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 4XBMnQ2mTDz4gsn; Sun, 22 Sep 2024 10:29:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=fQjuv1MN; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f31 as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6c524b4f8b9so32954746d6.3; Sun, 22 Sep 2024 03:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727000984; x=1727605784; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=uSUvOlsv1UDTS4o5p6zNtLqm3NRrLhTKsSbswin4b/0=; b=fQjuv1MNLR4tRnR8WntVQjIZkU0EorGUCf/AjVPW7cS4gnlqsJGoq6TjfoM2pyBmFl d+90JXWhYBoR1ZZKDC/HzUKC40LFtgerlDmknT+V/456gie7Ux/zKjghexhrs8gYG/Iu 78bZ/OFeVuaSwtmdVUkLdXHu+rHTMGUkm/CGz1NyhMaZYpTd1I2A4IzXNuVByVGjq7xh Je844jYDhGZmkP0ZPSXEa6NcO8XKta2Yo+sx0FbrtZStCLQIt/mll1udFjPhYLATwp20 2IxkhX9AB7wOaQoCvPA2Qc/98KUJLMm44+SsgzEDMY+YHANyixWFFhvPtxnPiTeHd1dj jN2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727000984; x=1727605784; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uSUvOlsv1UDTS4o5p6zNtLqm3NRrLhTKsSbswin4b/0=; b=rKY26xxlHNJFbdYJbtrhGtmt7kS5F4aWqrYrqyBYKx9Rs3ite+U2TWZocNWeDqV/xv NrxCOnqKkDrRb7lDwtt3M9HOZt7nH/cZf/JZyyTkrIH5M/ogXRI7yYh42eccrVYmSrrn e4gE115+BMzFyRXrSAAFijqCF7x2t/UWE4BWZzQduqsSIHY3CajJGjEjIFXnf5TtWYyH 5HF/MjRNxZB9Jun8b0YHLaYRMmYGeinzkjq8dSzEXyRmIExBtVFya1rAgJTVhwsu2YLN 73Wd+LsXDXifWAFrTSybE+KFscPukJjS5+Xzro4O9aa4m93gdE2GfnHs2HymtbmmiTUl L0pA== X-Forwarded-Encrypted: i=1; AJvYcCW0xGeANjwowF8uxPAMHZxbNFhzFxk85luLIZmUsXGhKQ9MgAiQM5mGOOdpLbKQI8qSgV4r2zqLy6+YHOlss0WTtmVw@freebsd.org, AJvYcCWFaKKD1Rz1yNjdx/daKyL+/BxFPEuaCjqYwanr4QdF1bNZ996Hbiu3ptFnahdDwiLEUWANq5ywYpRuDivxMqkVHI8mV4I=@freebsd.org X-Gm-Message-State: AOJu0YzZtLHSGAmJ+ECzmVsRRQCoBW+BlhrCBlhZoSh11IfqHa5DqP8S Nbjomjd64FSKKIQmaftEu2aGq38dFMld8bv9oEx8pnxfR1O/dRpSCG3qLQEL X-Google-Smtp-Source: AGHT+IEOCFuCj2zdBBBAzb47mMjybFEuhkb6TaBDvqLkr4qTqBPhOFjJvp/DizlZoLOlAfyzjxZYSQ== X-Received: by 2002:a05:6214:540f:b0:6c7:c7e3:a799 with SMTP id 6a1803df08f44-6c7c7e3a7eemr98460076d6.13.1727000984409; Sun, 22 Sep 2024 03:29:44 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c75e494a28sm36056696d6.68.2024.09.22.03.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2024 03:29:42 -0700 (PDT) Date: Sun, 22 Sep 2024 06:29:39 -0400 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Bram Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output Message-ID: References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f31:from]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4XBMnQ2mTDz4gsn X-Spamd-Bar: -- 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=94567c8641e235763b5b2926416d89d36654cde1 > > 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? > 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");