* [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
@ 2010-12-02 4:04 Shan Wei
2010-12-02 9:57 ` Thomas Graf
2010-12-02 21:27 ` David Miller
0 siblings, 2 replies; 6+ messages in thread
From: Shan Wei @ 2010-12-02 4:04 UTC (permalink / raw)
To: David Miller; +Cc: Network-Maillist, Shan Wei
__ICMP_MIB_MAX is equal to the total number of icmp mib,
So no need to add 1. This wastes 4/8 bytes memory.
Change it to be same as ICMP6_MIB_MAX, TCP_MIB_MAX, UDP_MIB_MAX.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
include/net/snmp.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/net/snmp.h b/include/net/snmp.h
index a0e6180..aebb553 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -61,8 +61,7 @@ struct ipstats_mib {
/* ICMP */
#define ICMP_MIB_DUMMY __ICMP_MIB_MAX
-#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
-
+#define ICMP_MIB_MAX __ICMP_MIB_MAX
struct icmp_mib {
unsigned long mibs[ICMP_MIB_MAX];
};
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
2010-12-02 4:04 [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value Shan Wei
@ 2010-12-02 9:57 ` Thomas Graf
2010-12-02 10:35 ` Shan Wei
2010-12-02 17:38 ` David Miller
2010-12-02 21:27 ` David Miller
1 sibling, 2 replies; 6+ messages in thread
From: Thomas Graf @ 2010-12-02 9:57 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, Network-Maillist
On Thu, Dec 02, 2010 at 12:04:43PM +0800, Shan Wei wrote:
> __ICMP_MIB_MAX is equal to the total number of icmp mib,
> So no need to add 1. This wastes 4/8 bytes memory.
>
> Change it to be same as ICMP6_MIB_MAX, TCP_MIB_MAX, UDP_MIB_MAX.
>
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---
> include/net/snmp.h | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/snmp.h b/include/net/snmp.h
> index a0e6180..aebb553 100644
> --- a/include/net/snmp.h
> +++ b/include/net/snmp.h
> @@ -61,8 +61,7 @@ struct ipstats_mib {
>
> /* ICMP */
> #define ICMP_MIB_DUMMY __ICMP_MIB_MAX
> -#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
> -
> +#define ICMP_MIB_MAX __ICMP_MIB_MAX
Looks like the +1 is there to account for ICMP_MIB_DUMMY. It is
unused though but you have to remove it as well if you want to
kill that extra +1.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
2010-12-02 9:57 ` Thomas Graf
@ 2010-12-02 10:35 ` Shan Wei
2010-12-02 10:42 ` Thomas Graf
2010-12-02 17:38 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: Shan Wei @ 2010-12-02 10:35 UTC (permalink / raw)
To: tgraf; +Cc: David Miller, Network-Maillist, Shan Wei
Thomas Graf wrote, at 12/02/2010 05:57 PM:
>> /* ICMP */
>> #define ICMP_MIB_DUMMY __ICMP_MIB_MAX
>> -#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
>> -
>> +#define ICMP_MIB_MAX __ICMP_MIB_MAX
>
> Looks like the +1 is there to account for ICMP_MIB_DUMMY. It is
> unused though but you have to remove it as well if you want to
> kill that extra +1.
I don't know the history about ICMP_MIB_DUMMY before v2.6.12-rc2.
But after that, it is abandoned.
ICMP_MIB_DUMMY is killed in patch:
[PATCH v2 4/4] net: kill unused macros from head file
--
Best Regards
-----
Shan Wei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
2010-12-02 10:35 ` Shan Wei
@ 2010-12-02 10:42 ` Thomas Graf
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Graf @ 2010-12-02 10:42 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, Network-Maillist
On Thu, Dec 02, 2010 at 06:35:50PM +0800, Shan Wei wrote:
> Thomas Graf wrote, at 12/02/2010 05:57 PM:
> >> /* ICMP */
> >> #define ICMP_MIB_DUMMY __ICMP_MIB_MAX
> >> -#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
> >> -
> >> +#define ICMP_MIB_MAX __ICMP_MIB_MAX
> >
> > Looks like the +1 is there to account for ICMP_MIB_DUMMY. It is
> > unused though but you have to remove it as well if you want to
> > kill that extra +1.
>
> I don't know the history about ICMP_MIB_DUMMY before v2.6.12-rc2.
> But after that, it is abandoned.
>
> ICMP_MIB_DUMMY is killed in patch:
> [PATCH v2 4/4] net: kill unused macros from head file
OK, fair enough. Wasn't obvious while reviewing this patch.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
2010-12-02 9:57 ` Thomas Graf
2010-12-02 10:35 ` Shan Wei
@ 2010-12-02 17:38 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2010-12-02 17:38 UTC (permalink / raw)
To: tgraf; +Cc: shanwei, netdev
From: Thomas Graf <tgraf@infradead.org>
Date: Thu, 2 Dec 2010 04:57:53 -0500
> Looks like the +1 is there to account for ICMP_MIB_DUMMY. It is
> unused though but you have to remove it as well if you want to
> kill that extra +1.
He does in patch #4
ICMP_MIB_DUMMY was used in pre-GIT times, as a throw away ICMP counter
that gets bumped when we have no specific counter that should be
bumped for an ICMP code type. There was a table, per ICMP code,
that listed the counter to bump amongst other things, and this
dummy value was used in that table.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
2010-12-02 4:04 [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value Shan Wei
2010-12-02 9:57 ` Thomas Graf
@ 2010-12-02 21:27 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2010-12-02 21:27 UTC (permalink / raw)
To: shanwei; +Cc: netdev
From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Thu, 02 Dec 2010 12:04:43 +0800
> __ICMP_MIB_MAX is equal to the total number of icmp mib,
> So no need to add 1. This wastes 4/8 bytes memory.
>
> Change it to be same as ICMP6_MIB_MAX, TCP_MIB_MAX, UDP_MIB_MAX.
>
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-12-02 21:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-02 4:04 [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value Shan Wei
2010-12-02 9:57 ` Thomas Graf
2010-12-02 10:35 ` Shan Wei
2010-12-02 10:42 ` Thomas Graf
2010-12-02 17:38 ` David Miller
2010-12-02 21:27 ` David Miller
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).