From: David Miller <davem@davemloft.net>
To: nhorman@tuxdriver.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH] drop_monitor: make last_rx timestamp private
Date: Tue, 01 Sep 2009 18:21:27 -0700 (PDT) [thread overview]
Message-ID: <20090901.182127.96935772.davem@davemloft.net> (raw)
In-Reply-To: <20090831195847.GA6506@hmsreliant.think-freely.org>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 31 Aug 2009 15:58:47 -0400
> It was recently pointed out to me that the last_rx field of the net_device
> structure wasn't updated regularly. In fact only the bonding driver really uses
> it currently. Since the drop_monitor code relies on the last_rx field to detect
> drops on recevie in hardware, We need to find a more reliable way to rate limit
> our drop checks (so that we don't check for drops on every frame recevied, which
> would be inefficient. This patch makes a last_rx timestamp that is private to
> the drop monitor code and is updated for every device that we track.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Neil, this doesn't apply to net-next-2.6:
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 9d66fa9..34a05ce 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
...
> @@ -179,18 +180,21 @@ static void trace_napi_poll_hit(struct napi_struct *napi)
> {
> struct dm_hw_stat_delta *new_stat;
>
> - /*
> - * Ratelimit our check time to dm_hw_check_delta jiffies
> - */
> - if (!time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta))
> - return;
>
> rcu_read_lock();
> list_for_each_entry_rcu(new_stat, &hw_stats_list, list) {
In net-next-2.6 this test reads:
/*
* Ratelimit our check time to dm_hw_check_delta jiffies
*/
if (!napi->dev ||
!time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta))
return;
and you must retain the napi->dev NULL check there as otherwise
the list traversal tests will blindly dereference that pointer.
next prev parent reply other threads:[~2009-09-02 1:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-31 19:58 [PATCH] drop_monitor: make last_rx timestamp private Neil Horman
2009-09-02 1:21 ` David Miller [this message]
2009-09-02 10:55 ` Neil Horman
2009-09-02 13:36 ` Neil Horman
2009-09-02 21:37 ` 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=20090901.182127.96935772.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.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).