From: Eric Dumazet <dada1@cosmosbay.com>
To: Wang Chen <wangchen@cn.fujitsu.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] IPV4: add raw drops counter
Date: Wed, 14 Nov 2007 07:00:52 +0100 [thread overview]
Message-ID: <473A8F14.7050703@cosmosbay.com> (raw)
In-Reply-To: <473A4EF2.5090507@cn.fujitsu.com>
Wang Chen a écrit :
> Eric Dumazet said the following on 2007-11-13 19:11:
>> Wang Chen a écrit :
>>> Add raw drops counter for IPv4 in /proc/net/raw .
>>>
>>> + atomic_t sk_drops;
>>>
>> This doesnt need an atomic_t , just an 'unsigned int' is OK, since
>> sock_queue_rcv_skb() is called on a locked socket.
>>
>
> Yes, sock_queue_rcv_skb() is called on a locked socket. But sk_drops
> will not only used with sock_queue_rcv_skb(), but also with
> xfrm4_policy_check(), skb_checksum_complete(), skb_kill_datagram(),etc.
> So, atomic_t ensure sk_drops will be atomic increment.
>
>> Also, I suggest doing the sk_drops increment in sock_queue_rcv_skb() so
>> that it can be used for other sockets as well ?
>>
>
> As I described before, sk_drops will be used on different conditions,
> on which the raw drop happens.
> So doing sk_drops increment in upper caller is better than in
> sock_queue_rcv_skb().
>
> Thank you for your suggestion, I will make a new patch to add sk_drops
> increment in other places.
>
Thank you for clarifications, I was not aware upcoming patches were planed.
next prev parent reply other threads:[~2007-11-14 6:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 9:57 [PATCH] IPV4: add raw drops counter Wang Chen
2007-11-13 11:11 ` Eric Dumazet
2007-11-14 1:27 ` Wang Chen
2007-11-14 6:00 ` Eric Dumazet [this message]
2007-11-14 3:12 ` [PATCH 1/2] SOCK: " Wang Chen
2007-11-14 3:15 ` [PATCH 2/2] SOCK: add raw6 " Wang Chen
2007-11-14 4:31 ` David Miller
2007-11-14 4:50 ` Wang Chen
2007-11-14 5:48 ` Eric Dumazet
2007-11-14 6:45 ` Wang Chen
2007-11-14 4:30 ` [PATCH 1/2] SOCK: add raw " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=473A8F14.7050703@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=netdev@vger.kernel.org \
--cc=wangchen@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).