netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jeff@melix.org
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] neighbour: fix base_reachable_time(_ms) not effective immediatly when changed
Date: Tue, 13 Jan 2015 22:04:38 -0500 (EST)	[thread overview]
Message-ID: <20150113.220438.1470978767602235254.davem@davemloft.net> (raw)
In-Reply-To: <1421135479-15952-1-git-send-email-jeff@melix.org>

From: Jean-Francois Remy <jeff@melix.org>
Date: Tue, 13 Jan 2015 08:51:19 +0100

> When setting base_reachable_time or base_reachable_time_ms through
> sysctl or netlink, the reachable_time value is not updated.
> This means that neighbour entries will continue to be updated using the
> old value until it is recomputed in neigh_period_work (which
>     recomputes the value every 300*HZ).
> On systems with HZ equal to 1000 for instance, it means 5mins before
> the change is effective.
> 
> This patch changes this behavior by recomputing reachable_time after
> each set on base_reachable_time or base_reachable_time_ms.
> The new value will become effective the next time the neighbour's timer
> is triggered.
> 
> Changes are made in two places: the netlink code for set and the sysctl
> handling code. For sysctl, I use a proc_handler. The ipv6 network
> code does provide its own handler but it already refreshes
> reachable_time correctly so it's not an issue.
> Any other user of neighbour which provide its own handlers must
> refresh reachable_time.
> 
> Signed-off-by: Jean-Francois Remy <jeff@melix.org>

Your change is correct but there are some coding style issues to
deal with:

> +				/*
> +				 * update reachable_time as well, otherwise, the change will
> +				 * only be effective after the next time neigh_periodic_work
> +				 * decides to recompute it (can be multiple minutes)
> +				 */

Comments in the networking should be:

	/* Of this
	 * form.
	 */


> +	if (write && ret == 0 ) {

No space between '0' and the closing parenthesis please.

> +		/*
> +		 * update reachable_time as well, otherwise, the change will
> +		 * only be effective after the next time neigh_periodic_work
> +		 * decides to recompute it
> +		 */

Please fix this comment's layout as per above.

> +		/*
> +		 * Those handlers will update p->reachable_time after
> +		 * base_reachable_time(_ms) is set to ensure the new timer starts being
> +		 * applied after the next neighbour update instead of waiting for
> +		 * neigh_periodic_work to update its value (can be multiple minutes)
> +		 * So any handler that replaces them should do this as well
> +		 */

Likewise.

  reply	other threads:[~2015-01-14  3:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  7:51 [PATCH] neighbour: fix base_reachable_time(_ms) not effective immediatly when changed Jean-Francois Remy
2015-01-14  3:04 ` David Miller [this message]
2015-01-14  3:22   ` Jean-Francois Remy
2015-01-14  5:28     ` 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=20150113.220438.1470978767602235254.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jeff@melix.org \
    --cc=netdev@vger.kernel.org \
    /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).