Subject: Re: [PATCH 2/2] SOCK: add raw6 drops counter

From: Wang Chen <[email-masked]>
Date: Wed, 14 Nov 2007 14:45:33 +0800

Eric Dumazet said the following on 2007-11-14 13:48:
>> diff -Nurp linux-2.6.24-rc2.org/net/ipv6/raw.c
>> linux-2.6.24-rc2/net/ipv6/raw.c
>> --- linux-2.6.24-rc2.org/net/ipv6/raw.c    2007-11-09
>> 16:38:05.000000000 +0800
>> +++ linux-2.6.24-rc2/net/ipv6/raw.c    2007-11-14 09:46:54.000000000
>> +0800
>> @@ -354,14 +354,14 @@ static inline int rawv6_rcv_skb(struct s
>>  {
>>      if ((raw6_sk(sk)->checksum || sk->sk_filter) &&
>>          skb_checksum_complete(skb)) {
>> -        /* FIXME: increment a raw6 drops counter here */
>> +        atomic_inc(&sk->sk_drops);   
> 
> I am not sure the comment was refering to a per socket counter here.
> 
> If the frame checksum is bad, we can not be sure the socket is OK, since
> the garbaged bits could be in the tuple that identify the socket.
> 
> Maybe here we want to increment a global raw6 drop counter (well, for
> the given ipv6 instance)
> 

What the /proc/net/raw6 shows is statistical information about raw socket
in IPv6 stack. And the information is per socket per row. 
So I think it's better to count it to per socket.