Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3414023pxb; Sat, 9 Oct 2021 09:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuFN7SqrcjzOCfnJnCPebi3c3dPLRtDC1Vi6DXPY03CgSTCDPoSs9/lGYakCMfVhGbRPv7 X-Received: by 2002:a17:906:b803:: with SMTP id dv3mr12959756ejb.289.1633797877388; Sat, 09 Oct 2021 09:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633797877; cv=none; d=google.com; s=arc-20160816; b=OyeGP7BHvUgqFixUE2jAcMJNVa1IKbXHxR0632E6zTKV9oewqhefDJIvTNGlyzm9UW fMsYpqNZw0/EPstIDBksDPMLQryrBOcVcdvRIpLiEYSAqVX097NfpqBXlpiHMcU/p5mW NK32SXMLqxyyRNsrdJhMMKwElmHe+BIsGhp/OTIJ+kbLH5+hH8rTBF3HLNHMMXBCVGa1 HZ0F60ocAVDnxUmU2WkqBiAyWMjE3VXcZUm/f08c+jWdr20fbaChcAmbTJfGhq8DpvjU 855WzpVe3vnqgzEKbg/odMQxtyW8JbDnNZ3XM5O47CmcxYQ2y4iWdKj4AdO4lvP+/olZ uPiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oC3W0L4nbj+Es3qnEJSnPIpp2bogBOkZdrry4xHeY8Y=; b=LTSezwZ3kUV02lziOESe4KKBePxBV4hWEK+BasrPF7EeMkIzQ3UGuNiZeUqGqcrSpt vAZfvOFuJRpdVL2QTcNgYVcOrWXAqRIluwlB1xFkXsPyrSW1x/rbfjPkyTUySgGKHn7K MpEe+GMFbmzwX1Cd2IGET57xdKE9IQfQgMohCZn0AV3A0IeV/sDZbKTe4UE5ivy99vbz uWXHhVwECz5FS39L58Qlqb+pWadIgvBPGwCKIcpOVhFmjs8S48bdyQeYgfZ1KRfM9tGy 6wyaS216YfktwKFZ408f1ddmekV20EuAIfiboHAiw6513WAq7P7zbqBaYjAcN3ffQwhJ xvVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hbfKNn7s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si4049282edh.30.2021.10.09.09.44.12; Sat, 09 Oct 2021 09:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hbfKNn7s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbhJIQou (ORCPT + 99 others); Sat, 9 Oct 2021 12:44:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbhJIQot (ORCPT ); Sat, 9 Oct 2021 12:44:49 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A69B3C061570; Sat, 9 Oct 2021 09:42:52 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id a25so32631447edx.8; Sat, 09 Oct 2021 09:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oC3W0L4nbj+Es3qnEJSnPIpp2bogBOkZdrry4xHeY8Y=; b=hbfKNn7sYURhUZT0/cn/Y5MI5W30HAzpz+g/ZdDeyc3fLP7UgvcB8X800okGHUOSEb qArJoFO58daWe3xe9XhgXSbo1274tYU7URbayX4mKAuow2RANl9nkZ8aX1Zxz7/rU2AW wpZIUekchUR4dePvshcMnwWSYcioGwjWE8SFfzT39QupeMvMkmLilAco8hoV2P8m/1Oc YNpacH967Vji89pQkbHlgbp1iArI49xCGCaTVzoTPLEEW71pr0C0D3ozCH7grr8VkBeP vBQmB7748J+9vAKI9hDZgnLLYaNeWRSRUxAhNyzngnRPrdhZHrwxs47FVFFJ+9hUDeba s0sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oC3W0L4nbj+Es3qnEJSnPIpp2bogBOkZdrry4xHeY8Y=; b=njE0atsCv8KMc4UyCdDpEmhzYrMvgLHIMpJz4JUxXji/d0i5pv96g6VhdZIhIfkhqt 0yjkqH5B2ODW8Ggf7RTMuO3ZQn6LA+iW+ft08cLen1LxgVn8Zzy+xOuMPFDAAg9/ZLx2 bzycSJVmfBETGSavJIaT2TD0FnDFS3XQm/ZrWP/is03jNdWOHWHYkMtpkuB2i0SDRD9o iy9bSdLiZ8M77s4sEF3acXtK5yEosn7lOCew7IX9/DVEyuWNq6h3PsEpqRpbpmwnDMUJ bjTwvR64TpONXLRejnpsUG8A2uYqMquNnovH7ywkXYMH/y20T8tPtz+Y0fH3U0UvjgcY 8uMQ== X-Gm-Message-State: AOAM530/GNyGCsPAR7tGgeasTSXftxbtVh+P3Ul1Z+QRrNGRi8TVz0Ah Cy9Z4skRrjbClMsw5Z3G2Rg= X-Received: by 2002:a50:da8f:: with SMTP id q15mr25805243edj.139.1633797771213; Sat, 09 Oct 2021 09:42:51 -0700 (PDT) Received: from skbuf ([188.26.53.217]) by smtp.gmail.com with ESMTPSA id g2sm1424437edq.81.2021.10.09.09.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Oct 2021 09:42:50 -0700 (PDT) Date: Sat, 9 Oct 2021 19:42:49 +0300 From: Vladimir Oltean To: Yajun Deng Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: procfs: add seq_puts() statement for dev_mcast Message-ID: <20211009164249.euf7dfpccr6kz7a3@skbuf> References: <20210816085757.28166-1-yajun.deng@linux.dev> <20211009163511.vayjvtn3rrteglsu@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211009163511.vayjvtn3rrteglsu@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 09, 2021 at 07:35:11PM +0300, Vladimir Oltean wrote: > On Mon, Aug 16, 2021 at 04:57:57PM +0800, Yajun Deng wrote: > > Add seq_puts() statement for dev_mcast, make it more readable. > > As also, keep vertical alignment for {dev, ptype, dev_mcast} that > > under /proc/net. > > > > Signed-off-by: Yajun Deng > > --- > > FYI, this program got broken by this commit (reverting it restores > functionality): > > root@debian:~# ifstat > ifstat: /proc/net/dev: unsupported format. > > Confusingly enough, the "ifstat" provided by Debian is not from iproute2: > https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/misc/ifstat.c > but rather a similarly named program: > https://packages.debian.org/source/bullseye/ifstat > https://github.com/matttbe/ifstat > > I haven't studied how this program parses /proc/net/dev, but here's how > the kernel's output changed: Ah, it scrapes the text for "Inter-|": https://github.com/matttbe/ifstat/blob/main/drivers.c#L825 > > Doesn't work: > > root@debian:~# cat /proc/net/dev > Interface| Receive | Transmit > | bytes packets errs drop fifo frame compressed multicast| bytes packets errs drop fifo colls carrier compressed > lo: 97400 1204 0 0 0 0 0 0 97400 1204 0 0 0 0 0 0 > bond0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > eno2: 5002206 6651 0 0 0 0 0 0 105518642 1465023 0 0 0 0 0 0 > swp0: 134531 2448 0 0 0 0 0 0 99599598 1464381 0 0 0 0 0 0 > swp1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > swp2: 4867675 4203 0 0 0 0 0 0 58134 631 0 0 0 0 0 0 > sw0p0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw0p1: 124739 2448 0 1422 0 0 0 0 93741184 1464369 0 0 0 0 0 0 > sw0p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw2p0: 4850863 4203 0 0 0 0 0 0 54722 619 0 0 0 0 0 0 > sw2p1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw2p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw2p3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > br0: 10508 212 0 212 0 0 0 212 61369558 958857 0 0 0 0 0 0 > > Works: > > root@debian:~# cat /proc/net/dev > Inter-| Receive | Transmit > face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed > lo: 13160 164 0 0 0 0 0 0 13160 164 0 0 0 0 0 0 > bond0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > eno2: 30824 268 0 0 0 0 0 0 3332 37 0 0 0 0 0 0 > swp0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > swp1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > swp2: 30824 268 0 0 0 0 0 0 2428 27 0 0 0 0 0 0 > sw0p0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw0p1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw0p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw2p0: 29752 268 0 0 0 0 0 0 1564 17 0 0 0 0 0 0 > sw2p1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw2p2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > sw2p3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0