lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 Aug 2008 19:07:01 +0200
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Pavel Emelyanov <xemul@...nvz.org>
Cc:	Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [RFC][PATCH] Turn part of SNMP accounting macros into functions

Pavel Emelyanov a écrit :
> After turning IP_XXX_STATS, TCP_XXX_STATS and NET_XXX_STATS from
> macros into functions the net/ipv4/built-in.o shrank significantly:
> 
> add/remove: 14/0 grow/shrink: 0/67 up/down: 482/-2246 (-1764)
> 
> Turning the CONFIG_NET_NS option on makes this shrink even larger:
> 
> add/remove: 14/0 grow/shrink: 0/67 up/down: 478/-2646 (-2168)
> 
> So the question is - what was the reason to keep those as macros?
> I thought about the possible performance questions, but netperf
> didn't show any (I admit I just cannot cook it properly).
> 
> The sample patch is here, but it's not good (EXPORTs for ipv6
> and a better place for functions rather than net/ipv4/af_inet.c
> are required).
> 
> Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
> 


I dont know, but passing all those "struct net *net" to every 
network function in the kernel sounds overkill, especially for
!CONFIG_NET_NS users. This is pure bloat.

We could define two macros so that function prototypes dont include
useless pointers, especially on arches where only first and second
parameter is passed in eax and edx register ;)

#ifdef CONFIG_NET_NS
# define VNETPTR ,struct net *net
# define NETPTR  net
#else
# define VNETPTR
# defint NETPTR  &init_net
#endif

...
void TCP_DEC_STATS(int field VNETPTR);
...
void TCP_DEC_STATS(int field VNETPTR)
{
	SNMP_DEC_STATS((NETPTR)->mib.tcp_statistics, field);
}
...



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ