source:
branches/backfire/package/mac80211/patches/560minstrel_ht_optimize.patch
@
28388
Last change on this file since 28388 was 28388, checked in by nbd, 5 years ago  

File size: 4.9 KB 

net/mac80211/rc80211_minstrel_ht.h
a b struct minstrel_mcs_group_data { 70 70 }; 71 71 72 72 struct minstrel_ht_sta { 73 struct ieee80211_tx_rate tx_rates[3]; 74 73 75 /* ampdu length (average, per sampling interval) */ 74 76 unsigned int ampdu_len; 75 77 unsigned int ampdu_packets; 
net/mac80211/rc80211_minstrel_ht.c
a b const struct mcs_group minstrel_mcs_grou 87 87 88 88 static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES]; 89 89 90 static void 91 minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, 92 struct ieee80211_tx_rate *rate, int index, 93 bool sample, bool rtscts); 90 94 /* 91 95 * Perform EWMA (Exponentially Weighted Moving Average) calculation 92 96 */ … … minstrel_ht_calc_tp(struct minstrel_priv 174 178 mr>cur_tp = MINSTREL_TRUNC((1000000 / usecs) * mr>probability); 175 179 } 176 180 181 static void 182 minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) 183 { 184 minstrel_ht_set_rate(mp, mi, &mi>tx_rates[0], mi>max_tp_rate, 185 false, false); 186 minstrel_ht_set_rate(mp, mi, &mi>tx_rates[1], mi>max_tp_rate2, 187 false, true); 188 minstrel_ht_set_rate(mp, mi, &mi>tx_rates[2], mi>max_prob_rate, 189 false, true); 190 } 191 177 192 /* 178 193 * Update rate statistics and select new primary rates 179 194 * … … minstrel_ht_update_stats(struct minstrel 292 307 } 293 308 } 294 309 310 minstrel_ht_update_rates(mp, mi); 295 311 mi>stats_update = jiffies; 296 312 } 297 313 … … minstrel_next_sample_idx(struct minstrel 330 346 } 331 347 332 348 static void 333 minstrel_downgrade_rate(struct minstrel_ ht_sta *mi, unsigned int *idx,334 bool primary)349 minstrel_downgrade_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, 350 unsigned int *idx, bool primary) 335 351 { 336 352 int group, orig_group; 337 353 … … minstrel_downgrade_rate(struct minstrel_ 350 366 *idx = mi>groups[group].max_tp_rate; 351 367 else 352 368 *idx = mi>groups[group].max_tp_rate2; 369 minstrel_ht_update_rates(mp, mi); 353 370 break; 354 371 } 355 372 } … … minstrel_ht_tx_status(void *priv, struct 450 467 if (rate>attempts > 30 && 451 468 MINSTREL_FRAC(rate>success, rate>attempts) < 452 469 MINSTREL_FRAC(20, 100)) 453 minstrel_downgrade_rate(m i, &mi>max_tp_rate, true);470 minstrel_downgrade_rate(mp, mi, &mi>max_tp_rate, true); 454 471 455 472 rate2 = minstrel_get_ratestats(mi, mi>max_tp_rate2); 456 473 if (rate2>attempts > 30 && 457 474 MINSTREL_FRAC(rate2>success, rate2>attempts) < 458 475 MINSTREL_FRAC(20, 100)) 459 minstrel_downgrade_rate(m i, &mi>max_tp_rate2, false);476 minstrel_downgrade_rate(mp, mi, &mi>max_tp_rate2, false); 460 477 461 478 if (time_after(jiffies, mi>stats_update + (mp>update_interval / 2 * HZ) / 1000)) { 462 479 minstrel_ht_update_stats(mp, mi); … … minstrel_calc_retransmit(struct minstrel 521 538 static void 522 539 minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, 523 540 struct ieee80211_tx_rate *rate, int index, 524 struct ieee80211_tx_rate_control *txrc,525 541 bool sample, bool rtscts) 526 542 { 527 543 const struct mcs_group *group = &minstrel_mcs_groups[index / MCS_GROUP_RATES]; … … minstrel_ht_get_rate(void *priv, struct 609 625 struct minstrel_priv *mp = priv; 610 626 int sample_idx; 611 627 bool sample = false; 628 int last = 0; 612 629 613 630 if (rate_control_send_low(sta, priv_sta, txrc)) 614 631 return; … … minstrel_ht_get_rate(void *priv, struct 634 651 if (sample_idx >= 0) { 635 652 sample = true; 636 653 minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, 637 t xrc, true, false);654 true, false); 638 655 info>flags = IEEE80211_TX_CTL_RATE_CTRL_PROBE; 639 656 } else { 640 minstrel_ht_set_rate(mp, mi, &ar[0], mi>max_tp_rate, 641 txrc, false, false); 657 ar[0] = mi>tx_rates[0]; 642 658 } 643 659 644 660 if (mp>hw>max_rates >= 3) { … … minstrel_ht_get_rate(void *priv, struct 648 664 * max_tp_rate > max_tp_rate2 > max_prob_rate by default. 649 665 */ 650 666 if (sample_idx >= 0) 651 minstrel_ht_set_rate(mp, mi, &ar[1], mi>max_tp_rate, 652 txrc, false, false); 667 ar[1] = mi>tx_rates[0]; 653 668 else 654 minstrel_ht_set_rate(mp, mi, &ar[1], mi>max_tp_rate2, 655 txrc, false, true); 656 657 minstrel_ht_set_rate(mp, mi, &ar[2], mi>max_prob_rate, 658 txrc, false, !sample); 669 ar[1] = mi>tx_rates[1]; 659 670 660 ar[ 3].count = 0;661 ar[3].idx = 1;671 ar[2] = mi>tx_rates[2]; 672 last = 3; 662 673 } else if (mp>hw>max_rates == 2) { 663 674 /* 664 675 * Only 2 tx rates supported, use 665 676 * sample_rate > max_prob_rate for sampling and 666 677 * max_tp_rate > max_prob_rate by default. 667 678 */ 668 minstrel_ht_set_rate(mp, mi, &ar[1], mi>max_prob_rate, 669 txrc, false, !sample); 670 671 ar[2].count = 0; 672 ar[2].idx = 1; 679 ar[1] = mi>tx_rates[2]; 680 last = 2; 673 681 } else { 674 682 /* Not using MRR, only use the first rate */ 675 ar[1].count = 0;676 ar[1].idx = 1; 683 last = 1; 684 677 685 } 686 ar[last].count = 0; 687 ar[last].idx = 1; 678 688 679 689 mi>total_packets++; 680 690 … … minstrel_ht_update_caps(void *priv, stru 766 776 if (!n_supported) 767 777 goto use_legacy; 768 778 779 minstrel_ht_update_rates(mp, mi); 769 780 return; 770 781 771 782 use_legacy:
Note: See TracBrowser
for help on using the repository browser.