Skip to contentSkip to conversation

Introduce and use print_ip and print_ipv6

PATCH In review Joe Perches 6 participants 10 messages Sep 20, 2007 – Sep 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Introduce and use print_ip and print_ipv6

In the same vein as print_mac, the implementations introduce declaration macros:
DECLARE_IP_BUF(var) DECLARE_IPV6_BUF(var)
and functions:
print_ip
print_ipv6
print_ipv6_nofmt

IPV4 Use:

	DECLARE_IP_BUF(ipbuf);
	__be32 addr;
	print_ip(ipbuf, addr);

IPV6 use:

	DECLARE_IPV6_BUF(ipv6buf);
	const struct in6_addr *addr;
	print_ipv6(ipv6buf, addr);
and
	print_ipv6_nofmt(ipv6buf, addr);

compiled x86, defconfig and allyesconfig

#1 lore raw
Quoted 17 lines · On Wed, 19 Sep 2007 23:53:31 -0700 Joe Perches wrote:

In the same vein as print_mac, the implementations introduce declaration macros:
DECLARE_IP_BUF(var) DECLARE_IPV6_BUF(var)
and functions:
print_ip
print_ipv6
print_ipv6_nofmt

IPV4 Use:

	DECLARE_IP_BUF(ipbuf);
	__be32 addr;
	print_ip(ipbuf, addr);

IPV6 use:

Quoted 7 lines
	DECLARE_IPV6_BUF(ipv6buf);
	const struct in6_addr *addr;
	print_ipv6(ipv6buf, addr);
and
	print_ipv6_nofmt(ipv6buf, addr);

compiled x86, defconfig and allyesconfig

How large are the patches if you posted them for review instead of just referencing gits for them? (which cuts down on review possibilities)

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw
Quoted 3 lines · Randy Dunlap

How large are the patches if you posted them for review instead of just referencing gits for them? (which cuts down on review possibilities)

The v4 is ~130kb, the v6 ~35kb.

There is a gitweb available at:

print_ip:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=shortlog;h=print_ipv4
commit diff:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=commitdiff;h=1e3a30d5d8b49b3accca07cc84ecf6d977cacdd5

print_ipv6:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=shortlog;h=print_ipv6
commit diff:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=commitdiff;h=e96b794a57a164db84379e2baf5fe2622a5ae3bf

#3 lore raw
Quoted 14 lines · Joe Perches
Quoted 3 lines · Randy Dunlap

How large are the patches if you posted them for review instead of just referencing gits for them? (which cuts down on review possibilities)

The v4 is ~130kb, the v6 ~35kb.

There is a gitweb available at:

print_ip:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=shortlog;h=print_ipv4
commit diff:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=commitdiff;h=1e3a30d5d8b49b3accca07cc84ecf6d977cacdd5

Quoted 4 lines

print_ipv6:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=shortlog;h=print_ipv6
commit diff:
http://repo.or.cz/w/linux-2.6/trivial-mods.git?a=commitdiff;h=e96b794a57a164db84379e2baf5fe2622a5ae3bf

...Alternatively you could split it up a bit and send those smaller chunks for reviewing purposes only (even though it would be combined to a single big patch in the end).

Signature · 1 line
 i.
#4 lore raw
In reply to Joe Perches

* Joe Perches <[email protected]> 2007-09-19 23:53

Quoted 17 lines

In the same vein as print_mac, the implementations introduce declaration macros:
DECLARE_IP_BUF(var) DECLARE_IPV6_BUF(var)
and functions:
print_ip
print_ipv6
print_ipv6_nofmt

IPV4 Use:

	DECLARE_IP_BUF(ipbuf);
	__be32 addr;
	print_ip(ipbuf, addr);

IPV6 use:

Quoted 7 lines
	DECLARE_IPV6_BUF(ipv6buf);
	const struct in6_addr *addr;
	print_ipv6(ipv6buf, addr);
and
	print_ipv6_nofmt(ipv6buf, addr);

compiled x86, defconfig and allyesconfig

What exactly is the advantage of this?

#5 lore raw
Quoted 1 line · Thomas Graf

What exactly is the advantage of this?

It makes the kernel image smaller and has consistency, typechecking and sparse advantages.

print_mac(char *buf, const u8 *addr)
print_ip(char *buf, __be32 addr)
print_ipv6(char *buf, const u8 *addr)

Current use of formatting for IPV6:
NIP6_FMT in each format, 38 bytes %s is 2. NIP6(addr) is 8 args, and inlined ntohs overhead
now it's:
automatic buffer, format "%s", function call and 2 args

IPv4 is more or less a wash:
format "%u.%u.%u.%u", 11 bytes, 4 args inlined
vs
automatic buffer, format "%s", function call and 2 args

maintainer
#6 lore raw
In reply to Joe Perches

From: Joe Perches <[email protected]>
Date: Wed, 19 Sep 2007 23:53:31 -0700

Quoted 2 lines

In the same vein as print_mac, the implementations introduce declaration macros:

I'm going to hold on this for now, there is no universal agreement that this is something we want to do and I'd like to take care of getting the more certain stuff into net-2.6.24 before "iffy" bits like this one.

Thanks.

#7 lore raw
Quoted 4 lines · David Miller

I'm going to hold on this for now, there is no universal agreement that this is something we want to do and I'd like to take care of getting the more certain stuff into net-2.6.24 before "iffy" bits like this one.

Here's an argument for inclusion:

defconfig without patches:

$ size vmlinux
   text    data     bss     dec     hex filename
4738370  518986  622592 5879948  59b88c vmlinux

defconfig with patches:

$ size vmlinux
   text    data     bss     dec     hex filename
4735238  518986  622592 5876816  59ac50 vmlinux

cheers, Joe

maintainer
#8 lore raw

From: Joe Perches <[email protected]>
Date: Tue, 25 Sep 2007 21:36:38 -0700

Quoted 9 lines · David Miller
Quoted 4 lines

I'm going to hold on this for now, there is no universal agreement that this is something we want to do and I'd like to take care of getting the more certain stuff into net-2.6.24 before "iffy" bits like this one.

Here's an argument for inclusion:

defconfig without patches:

Sure, but this ignores certain things that text/data/bss size don't show you.

For one thing, stack frames might now be larger in the functions where the new variables get added, even if they aren't used to print out the debugging message. And that could have negative performance implications.

Nothing is every black and white, everything is gray :-)

#9 lore raw
Quoted 8 lines · David Miller

From: Joe Perches <[email protected]>
Date: Tue, 25 Sep 2007 21:36:38 -0700

Quoted 5 lines · David Miller
Quoted 4 lines

I'm going to hold on this for now, there is no universal agreement that this is something we want to do and I'd like to take care of getting the more certain stuff into net-2.6.24 before "iffy" bits like this one.

Quoted 6 lines
Quoted 3 lines

Here's an argument for inclusion:

defconfig without patches:

Sure, but this ignores certain things that text/data/bss size don't show you.

size(1) output also ignores the merge noise this creates, and IMO we've got a lot of that already...

Jeff