Message ID | 20200331033356.29956-1-liuhangbin@gmail.com |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | [net-next] neigh: support smaller retrans_time settting | expand |
From: Hangbin Liu <liuhangbin@gmail.com> Date: Tue, 31 Mar 2020 11:33:56 +0800 > Currently, we limited the retrans_time to be greater than HZ/2. For > example, if the HZ = 1000, 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. > > But remove the sanity check would make the retransmission immediately > if user set retrans_time to 0 by wrong config. So I hard code the sanity > check to 10, which is 10ms if HZ is 1000 and 100ms if HZ is 100. > This number should be enough for user to get more accurate neigh > control. > > Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> It only makes sense to make the safety limit be constant (time wise), and therefore relative to HZ.
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 789a73aa7bd8..245bb5bd30e2 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); + 10); neigh_add_timer(neigh, next); immediate_probe = true; } else {
Currently, we limited the retrans_time to be greater than HZ/2. For example, if the HZ = 1000, 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. But remove the sanity check would make the retransmission immediately if user set retrans_time to 0 by wrong config. So I hard code the sanity check to 10, which is 10ms if HZ is 1000 and 100ms if HZ is 100. This number should be enough for user to get more accurate neigh control. Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> --- net/core/neighbour.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)