netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Denis Cheng <crquan@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jeff Garzik <jgarzik@pobox.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [net/ipv4]: fib_seq_show function adjustment to get a more sensable output of /proc/net/route
Date: Mon, 22 Oct 2007 21:31:40 +0200	[thread overview]
Message-ID: <471CFA9C.7010300@cosmosbay.com> (raw)
In-Reply-To: <1193077582-4790-1-git-send-email-crquan@gmail.com>

Denis Cheng a écrit :
> the temporary bf[127] char array is redundant, and the specified width 127 make the output of /proc/net/route include many trailing spaces;
> since most terminal's cols are less than 127, this made every fib entry occupy two lines,
> 
> after applied this patch, the output of /proc/net/route is more sensable like this:
> 
> Iface	Destination	Gateway 	Flags	RefCnt	Use	Metric	Mask		MTU	Window	IRTT
> eth0	0001A8C0	00000000	0001	0	0	0	00FFFFFF	0	0	0
> lo	0000007F	00000000	0001	0	0	0	000000FF	0	0	0
> eth0	00000000	0101A8C0	0003	0	0	0	00000000	0	0	0
> 
> Signed-off-by: Denis Cheng <crquan@gmail.com>

Hum... did you test your patch with many routes declared ? (more than 32 on 
i386/x86_64)

127 is not a random value, but chosen as a power of two minus 1.
PAGE_SIZE is garanted to be a multiple of 128 (127 chars + line_feed) on all 
arches.

So each read() on /proc/net/route delivers PAGE_SIZE/128 lines.

With your patch, some lines might be truncated (one every 32 on i386)



      reply	other threads:[~2007-10-22 19:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22 18:26 [PATCH] [net/ipv4]: fib_seq_show function adjustment to get a more sensable output of /proc/net/route Denis Cheng
2007-10-22 19:31 ` Eric Dumazet [this message]

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=471CFA9C.7010300@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=crquan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).