I have noticed that mira will choose rates which result in a substantial
number of Tx retries, almost 50% or so even for normal 64 byte ping packets.

The diff below makes retry-heavy rates less attractive which makes the
number of retried frames shrink significantly.

The highest rate shown by ifconfig may go down. If the top rate was MCS 7
it might now go down to 6 or 5. This is nothing to worry about. Where this
happens frames sent at MCS 7 were retried at lower rates anyway.

ok?

Index: if_iwm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.151
diff -u -p -r1.151 if_iwm.c
--- if_iwm.c    8 Dec 2016 17:24:25 -0000       1.151
+++ if_iwm.c    9 Dec 2016 17:01:26 -0000
@@ -3386,10 +3386,10 @@ iwm_rx_tx_cmd_single(struct iwm_softc *s
                in->in_mn.frames += tx_resp->frame_count;
                in->in_mn.ampdu_size = le16toh(tx_resp->byte_cnt);
                in->in_mn.agglen = tx_resp->frame_count;
-               if (txfail) {
-                       in->in_mn.retries += tx_resp->failure_frame;
+               if (tx_resp->failure_frame > 0)
+                       in->in_mn.retries++;
+               if (txfail)
                        in->in_mn.txfail += tx_resp->frame_count;
-               }
                if (ic->ic_state == IEEE80211_S_RUN)
                        ieee80211_mira_choose(&in->in_mn, ic, &in->in_ni);
                /* 
Index: if_iwn.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.177
diff -u -p -r1.177 if_iwn.c
--- if_iwn.c    7 Dec 2016 15:48:44 -0000       1.177
+++ if_iwn.c    9 Dec 2016 17:05:09 -0000
@@ -2378,10 +2378,10 @@ iwn_tx_done(struct iwn_softc *sc, struct
                wn->mn.frames += nframes;
                wn->mn.ampdu_size = len;
                wn->mn.agglen = nframes; 
-               if (txfail) {
-                       wn->mn.retries += ackfailcnt;
+               if (ackfailcnt > 0)
+                       wn->mn.retries++;
+               if (txfail)
                        wn->mn.txfail += nframes;
-               }
                if (ic->ic_state == IEEE80211_S_RUN)
                        ieee80211_mira_choose(&wn->mn, ic, data->ni);
        } else {

Reply via email to