From ec14bcd20f5139a3dc42cfc34cdcebcbdc062c00 Mon Sep 17 00:00:00 2001 From: Javier Cardona Date: Thu, 12 Apr 2012 14:32:23 -0700 Subject: mac80211: Take into account TSF adjustment latency in Toffset setpoint When testing mesh synchronization we observed a global TSF slowdown that was dependent on the number of synchronized mesh stations. This seems to be caused by the TSF adjustment (read/write) latency. Adding a small margin to the Toffset setpoint solved the problem. Signed-off-by: Shinichi Hotori Signed-off-by: Yu Niiro Signed-off-by: Javier Cardona Signed-off-by: John W. Linville --- net/mac80211/mesh_sync.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'net/mac80211/mesh_sync.c') diff --git a/net/mac80211/mesh_sync.c b/net/mac80211/mesh_sync.c index 22a5f1e6699..ff60d6bcc63 100644 --- a/net/mac80211/mesh_sync.c +++ b/net/mac80211/mesh_sync.c @@ -24,11 +24,17 @@ */ #define TOFFSET_MINIMUM_ADJUSTMENT 10 +/* This is not in the standard. It is a margin added to the + * Toffset setpoint to mitigate TSF overcorrection + * introduced by TSF adjustment latency. + */ +#define TOFFSET_SET_MARGIN 20 + /* This is not in the standard. It represents the maximum Toffset jump above * which we'll invalidate the Toffset setpoint and choose a new setpoint. This * could be, for instance, in case a neighbor is restarted and its TSF counter * reset. - * */ + */ #define TOFFSET_MAXIMUM_ADJUSTMENT 30000 /* 30 ms */ struct sync_method { -- cgit v1.2.3-18-g5258