Search Linux Wireless

RE: How to use the rate control in mac80211?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>
> Sent: Monday, October 24, 2022 10:25 PM
> To: Ping-Ke Shih <pkshih@xxxxxxxxxxx>; linux-wireless@xxxxxxxxxxxxxxx
> Subject: Re: How to use the rate control in mac80211?
> 
> On 24/10/2022 05:13, Ping-Ke Shih wrote:
> >
> >> -----Original Message-----
> >> From: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>
> >> Sent: Sunday, October 23, 2022 5:24 AM
> >> To: linux-wireless@xxxxxxxxxxxxxxx
> >> Subject: How to use the rate control in mac80211?
> >>
> >> Hi!
> >>
> >> What does a driver (rtl8xxxu) need to do to make the rate control work?
> >>
> >> I thought it's like this:
> >> 1) don't set HAS_RATE_CONTROL
> >> 2) tell the chip to use the rate from tx_info->control.rates[0]
> >> 3) report if the frame was acked or not
> >>
> >> But it's not that easy. I'm always getting MCS0. Currently rtl8xxxu
> >> doesn't ask the chip for TX reports and always sets IEEE80211_TX_STAT_ACK.
> >> I thought this would get me MCS7 for all data frames, but it doesn't.
> >
> > I don't dig rate control of mac80211, but I think it is hard to support this
> > by Realtek chip, because the item 3 you listed.
> >
> > Realtek WiFi chip only reports TX status for specific packets, because bus
> > bandwidth is limited, so reduce these reports to have better performance.
> > And, firmware has implemented rate control called rate adaptive (RA), and
> > using firmware RA is expected.
> >
> > If you really want to control rate by driver, you can refer to implementation
> > of management frame below:
> >
> > 	if (ieee80211_is_mgmt(hdr->frame_control)) {
> > 		tx_desc->txdw5 = cpu_to_le32(rate);
> > 		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_USE_DRIVER_RATE);
> > 		tx_desc->txdw5 |= cpu_to_le32(6 << TXDESC32_RETRY_LIMIT_SHIFT);
> > 		tx_desc->txdw5 |= cpu_to_le32(TXDESC32_RETRY_LIMIT_ENABLE);
> > 	}
> >
> > Another thing is that retry rate is decided by hardware by another register
> > settings, but I'm not familiar with them, because I always use RA mentioned
> > above. Maybe, you still can use *default* settings of retry rate that could
> > work but not always good in all situations.
> >
> > Ping-Ke
> >
> Normally, we use the firmware rate control, but RTL8188EU doesn't have it:
> https://github.com/lwfinger/rtl8188eu/blob/c4908ca4caf861d858c4d9e8452a2ad5c88cf2ba/rtl8188eu_xmit.c#L
> 349
> https://github.com/lwfinger/rtl8188eu/blob/c4908ca4caf861d858c4d9e8452a2ad5c88cf2ba/hal8188erateadapti
> ve.c

You are right. The RTL8188EU does different thing from other chips. 

Firmware collects TX status and send TX_REPORT2 events to driver, and
then driver can use it to decide rate. Another thing is to set maximum
mac_id to tell firmware how many entries driver needs.

  rtw_write8(adapter, REG_TX_RPT_CTRL + 1, maxMacid + 1);

> 
> (I guess they used the space in the firmware on the IOL stuff and the rate
> control code didn't fit?)
> 
> Maybe we don't need to ask for TX reports for every data frame?

Maybe, we can ask TX report per 10 or 100 packets, but I don't know if
this can get positive result.

Ping-Ke





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux