netdev
[Top] [All Lists]

Re: [PATCH]snmp6 64-bit counter support in proc.c

To: xma@xxxxxxxxxx
Subject: Re: [PATCH]snmp6 64-bit counter support in proc.c
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Thu, 22 Jan 2004 05:27:47 +0900 (JST)
Cc: davem@xxxxxxxxxx, mashirle@xxxxxxxxxx, kuznet@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx
In-reply-to: <OF1837C6DA.A9CB8829-ON87256E22.006C142B@us.ibm.com>
Organization: USAGI Project
References: <OF1837C6DA.A9CB8829-ON87256E22.006C142B@us.ibm.com>
Sender: netdev-bounce@xxxxxxxxxxx
In article <OF1837C6DA.A9CB8829-ON87256E22.006C142B@xxxxxxxxxx> (at Wed, 21 Jan 
2004 11:45:30 -0800), Shirley Ma <xma@xxxxxxxxxx> says:

> > So I'm going to let this sit for another day or two so people can voice
> any
> objections they may have.
> 
> Did you hear different voices? If not could you please check in this patch?

I'm not against holding in u64, 
but I rebember that Linus did not liked that.
Is it okay?

BTW,

diff -urN linux-2.6.1/net/ipv6/proc.c linux-2.6.1-ipv6mib2-64/net/ipv6/proc.c
:
 struct snmp6_item
 {
        char *name;
+       int   size;
        int   offset;
 };
:
+               if (size == 4) {
+                       res += *((__u32 *)
+                               (((void *)per_cpu_ptr(mib[0], i)) + offt));
+                       res += *((__u32 *)
+                               (((void *)per_cpu_ptr(mib[1], i)) + offt));
+               } else if (size == 8) {
+                       res += *((__u64 *)
+                               (((void *)per_cpu_ptr(mib[0], i)) + offt));
+                       res += *((__u32 *)
                                  ~~~~~__u64?
+                               (((void *)per_cpu_ptr(mib[1], i)) + offt));
+               }

I don't understand who really requires the "size" field.
The size is always 8, isn't it?
Am I missing sonething?

I'd prefer:
                if (size == sizeof(u32)) {
                        :
                } else if (size == sizeof(u64) {
                        :
                }

> I am going to submit another patch about new IPv6 MIBs system & interface
> statistics counters for your review, which depends on this one.

Please be sure not to change the interface when you submit the next patch.

--yoshfuji

<Prev in Thread] Current Thread [Next in Thread>