Hi everybody,

About the metric computation from the tx_rate:
We made a patch (against compat-wireless 2014-06-03) that uses an API added 
some time ago by Antonio Quartulli
The patch finds the expected throughput from minstrel_ht when possible

Don’t know if it will solve you issue, but anyway here it is:

==================
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -12,6 +12,7 @@
 #include <asm/unaligned.h>
 #include "wme.h"
 #include "mesh.h"
+#include "rate.h"
 
 #define TEST_FRAME_LEN 8192
 #define MAX_METRIC     0xffffffff
@@ -325,6 +326,8 @@ static u32 airtime_link_metric_get(struc
                                   struct sta_info *sta)
 {
        struct rate_info rinfo;
+       /* Added for retreive rate */
+       struct rate_control_ref *ref = local->rate_ctrl;
        /* This should be adjusted for each device */
        int device_constant = 1 << ARITH_SHIFT;
        int test_frame_len = TEST_FRAME_LEN << ARITH_SHIFT;
@@ -336,17 +339,27 @@ static u32 airtime_link_metric_get(struc
        if (sta->fail_avg >= 100)
                return MAX_METRIC;
 
-       sta_set_rate_info_tx(sta, &sta->last_tx_rate, &rinfo);
-       rate = cfg80211_calculate_bitrate(&rinfo);
+       /* CD le 01/04/2014 recupere les informations du minstrel[_ht] si
+        * disponible cf patch de AQ */
+       if (ref && ref->ops->get_expected_throughput) {
+               rate = ref->ops->get_expected_throughput(sta->rate_ctrl_priv);
+       } else {
+               sta_set_rate_info_tx(sta, &sta->last_tx_rate, &rinfo);
+               /* Rate is given in units of 10 Kbps by get_expected_throughput
+                * so times this rate by 10 to keep the same unit and not
+                * lose precision */
+               rate = cfg80211_calculate_bitrate(&rinfo)*100;
+       }
+       /* End of cd */
        if (WARN_ON(!rate))
                return MAX_METRIC;
 
        err = (sta->fail_avg << ARITH_SHIFT) / 100;
 
-       /* bitrate is in units of 100 Kbps, while we need rate in units of
+       /* bitrate is in units of 10 Kbps, while we need rate in units of
         * 1Mbps. This will be corrected on tx_time computation.
         */
-       tx_time = (device_constant + 10 * test_frame_len / rate);
+       tx_time = (device_constant + 1000 * test_frame_len / rate);
        estimated_retx = ((1 << (2 * ARITH_SHIFT)) / (s_unit - err));
        result = (tx_time * estimated_retx) >> (2 * ARITH_SHIFT) ;
        return (u32)result; 
==================

Regards
Jean-Pierre Tosoni
> 
> -----Message d'origine-----
> De : Devel [mailto:[email protected]] De la part de Bob
> Copeland via Devel Envoyé : mercredi 10 juin 2015 16:11 À : Yeoh Chun-
> Yeow; [email protected] Objet : Re: Mesh Path - HWMP Problem
> 
> On Wed, Jun 10, 2015 at 09:39:14PM +0800, Yeoh Chun-Yeow via Devel wrote:
> > > However when there is high traffic between two nodes A and B,
> > > sometimes the next hop of A and B changes to another address for a
> > > short time and the metric gets worse. After 2 – 3 seconds the original
> direct next hop returns.
> > >
> >
> > There are two possibilities that I think of:
> > 1. Node A does not receive direct PREP from node B.
> > 2. Node B does not receive direct PREQ from node A 3. Node A received
> > PREP from Node B via another hop which has better metric than direct
> > PREP from node B.
> >
> > For 1 and 2, it may due to the link is terrible and packet are dropped.
> >
> > For 3, you may look on reverting this patch and see how.
> 
> I hope reverting this is not a solution as it fixed some path instability
> problems for me.
> 
> Packet capture from a 3rd party station during the path switch would be
> helpful, it will tell us if some path selection frames got lost.  Would be
> nice if you can grab a bunch of mpath dumps along with that.
> 
> The path metric should prefer single hops over multiple hops due to the
> constant term; that said, there are some bogus things about the path
> metric as currently implemented:
> 
>  - the constant term is just made up and may not penalize multiple hops
>    correctly
>  - last_tx_rate is often the wrong thing (might be a probe rate, e.g.)
> 
> We should probably add the metrics to the debug statements...
> 
> --
> Bob Copeland %% http://bobcopeland.com/
> _______________________________________________
> Devel mailing list
> [email protected]
> http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel


_______________________________________________
Devel mailing list
[email protected]
http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel

Reply via email to