diff mbox series

[PATCHv2,net-next] neigh: support smaller retrans_time settting

Message ID 20200401020749.2608-1-liuhangbin@gmail.com
State Superseded
Delegated to: David Miller
Headers show
Series [PATCHv2,net-next] neigh: support smaller retrans_time settting | expand

Commit Message

Hangbin Liu April 1, 2020, 2:07 a.m. UTC
Currently, we limited the retrans_time to be greater than HZ/2. i.e.
setting retrans_time less than 500ms will not work. This makes the user
unable to achieve a more accurate control for bonding arp fast failover.

Update the sanity check to HZ/100, which is 10ms, to let users have more
ability on the retrans_time control.

v2: use HZ instead of hard code number

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/core/neighbour.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Dumazet April 1, 2020, 2:36 a.m. UTC | #1
On 3/31/20 7:07 PM, Hangbin Liu wrote:
> Currently, we limited the retrans_time to be greater than HZ/2. i.e.
> setting retrans_time less than 500ms will not work. This makes the user
> unable to achieve a more accurate control for bonding arp fast failover.
> 
> Update the sanity check to HZ/100, which is 10ms, to let users have more
> ability on the retrans_time control.
> 
> v2: use HZ instead of hard code number
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  net/core/neighbour.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index 5bf8d22a47ec..46a5611a9f3d 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -1125,7 +1125,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
>  			neigh->nud_state     = NUD_INCOMPLETE;
>  			neigh->updated = now;
>  			next = now + max(NEIGH_VAR(neigh->parms, RETRANS_TIME),
> -					 HZ/2);
> +					 HZ/100);
>  			neigh_add_timer(neigh, next);
>  			immediate_probe = true;
>  		} else {
> 

Note that IPv6 has a different limit (HZ/10)

It would be nice to have converged values.
diff mbox series

Patch

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 5bf8d22a47ec..46a5611a9f3d 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1125,7 +1125,7 @@  int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
 			neigh->nud_state     = NUD_INCOMPLETE;
 			neigh->updated = now;
 			next = now + max(NEIGH_VAR(neigh->parms, RETRANS_TIME),
-					 HZ/2);
+					 HZ/100);
 			neigh_add_timer(neigh, next);
 			immediate_probe = true;
 		} else {