All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Chuang <yhchuang@realtek.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: "kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
	Pkshih <pkshih@realtek.com>, Andy Huang <tehuang@realtek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [RFC v2 04/12] rtw88: trx files
Date: Fri, 5 Oct 2018 09:20:01 +0000	[thread overview]
Message-ID: <F7CD281DE3E379468C6D07993EA72F84D172A2BC@RTITMBSVM01.realtek.com.tw> (raw)
In-Reply-To: <20181004131908.GD16819@redhat.com>



> -----Original Message-----
> From: Stanislaw Gruszka [mailto:sgruszka@redhat.com]
> Sent: Thursday, October 04, 2018 9:19 PM
> To: Tony Chuang
> Cc: kvalo@codeaurora.org; Larry.Finger@lwfinger.net; Pkshih; Andy Huang;
> linux-wireless@vger.kernel.org
> Subject: Re: [RFC v2 04/12] rtw88: trx files
> 
> On Wed, Oct 03, 2018 at 04:02:20PM +0800, yhchuang@realtek.com wrote:
> > +static void rtw_rx_rssi_add(struct rtw_dev *rtwdev,
> > +			    struct rtw_rx_pkt_stat *pkt_stat,
> > +			    struct ieee80211_hdr *hdr)
> > +{
> > +	struct ieee80211_vif *vif;
> > +	struct rtw_vif *rtwvif;
> > +	struct rtw_sta_info *si;
> > +	__le16 fc = hdr->frame_control;
> > +	u8 *bssid;
> > +	u8 macid = RTW_BC_MC_MACID;
> > +	bool match_bssid = false;
> > +	bool is_packet_match_bssid;
> > +	bool if_addr_match;
> > +	bool hw_err;
> > +	bool ctl;
> > +
> > +	rcu_read_lock();
> > +
> > +	bssid = get_hdr_bssid(hdr);
> > +	rtwvif = get_hdr_vif(rtwdev, hdr);
> > +	vif = rtwvif ? rtwvif->vif : NULL;
> > +	pkt_stat->vif = vif;
> > +	if (unlikely(is_broadcast_ether_addr(hdr->addr1) ||
> > +		     is_multicast_ether_addr(hdr->addr1)))
> > +		match_bssid = get_hdr_match_bssid(rtwdev, hdr, bssid);
> > +	else if (vif)
> > +		match_bssid = ether_addr_equal(vif->bss_conf.bssid, bssid);
> > +	si = get_hdr_sta(rtwdev, vif, hdr);
> > +	macid = si ? si->mac_id : RTW_BC_MC_MACID;
> > +	pkt_stat->mac_id = macid;
> > +	pkt_stat->si = si;
> > +
> > +	if_addr_match = !!vif;
> > +	hw_err = pkt_stat->crc_err || pkt_stat->icv_err;
> > +	ctl = ieee80211_is_ctl(fc);
> > +	is_packet_match_bssid = !hw_err && !ctl && match_bssid;
> > +
> > +	if (((match_bssid && if_addr_match) || ieee80211_is_beacon(fc)) &&
> > +	    (!hw_err && !ctl) && (pkt_stat->phy_status && pkt_stat->si))
> > +		ewma_rssi_add(&pkt_stat->si->avg_rssi, pkt_stat->rssi);
> > +
> > +	rcu_read_unlock();
> 
> What for rcu_read_lock/unlock is here ? Maybe is needed,
> but perhaps not to protect entire function ?
> 

I thought that the entire function uses pointer si and vif, and hence should be
protected by rcu read lock, am I using the lock in a wrong way?

> > +static u8 get_tx_ampdu_factor(struct ieee80211_sta *sta)
> > +{
> > +	u8 exp = sta->ht_cap.ampdu_factor;
> > +
> > +	/* the least ampdu factor is 8K, and the value in the tx desc is the
> > +	 * max aggregation num, which represents val * 2 packets can be
> > +	 * aggregated in an AMPDU, so here we should use 8/2=4 as the base
> > +	 */
> > +	return (BIT(2) << exp) - 1;
> Using 4 whould be much more readable.
> 

OK

> > +static void rtw_tx_data_pkt_info_update(struct rtw_dev *rtwdev,
> > +					struct rtw_tx_pkt_info *pkt_info,
> > +					struct ieee80211_tx_control *control,
> > +					struct sk_buff *skb)
> > +{
> <snip>
> > +	if (sta->vht_cap.vht_supported)
> > +		rate = get_highest_vht_tx_rate(rtwdev, sta);
> > +	else if (sta->ht_cap.ht_supported)
> > +		rate = get_highest_ht_tx_rate(rtwdev, sta);
> > +	else if (sta->supp_rates[0] <= 0xf)
> > +		rate = DESC_RATE11M;
> > +	else
> > +		rate = DESC_RATE54M;
> No rate control, just use highest possible rate for each standard ?
> 

The major rate control system is in firmware, this is just a hint for it.

> > +
> > +	pkt_info->bmc = bmc;
> > +	pkt_info->sec_type = sec_type;
> > +	pkt_info->tx_pkt_size = skb->len;
> > +	pkt_info->offset = chip->tx_pkt_desc_sz;
> > +	pkt_info->qsel = skb->priority;
> 
> Shouldn't be qsel somehow mapped from skb->priority ?

Firmware handles it.

> 
> Thanks
> Stanislaw


Thanks
Yan-Hsuan Chuang

  reply	other threads:[~2018-10-05  9:20 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03  8:02 [RFC v2 00/12] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips yhchuang
2018-10-03  8:02 ` [RFC v2 01/12] rtw88: main files yhchuang
2018-10-03  8:02 ` [RFC v2 02/12] rtw88: core files yhchuang
2018-10-04 11:42   ` Stanislaw Gruszka
2018-10-04 13:52     ` Stanislaw Gruszka
2018-10-08  8:22     ` Tony Chuang
2018-10-03  8:02 ` [RFC v2 03/12] rtw88: hci files yhchuang
2018-10-04 13:02   ` Stanislaw Gruszka
2018-10-04 13:25     ` Stanislaw Gruszka
2018-10-05 12:07     ` Tony Chuang
2018-10-06 12:29       ` Kalle Valo
2018-10-08  9:03         ` Tony Chuang
2018-10-08  9:34       ` Stanislaw Gruszka
2019-03-25 14:33         ` Brian Norris
2018-10-03  8:02 ` [RFC v2 04/12] rtw88: trx files yhchuang
2018-10-04 13:19   ` Stanislaw Gruszka
2018-10-05  9:20     ` Tony Chuang [this message]
2018-10-06 12:32       ` Kalle Valo
2018-10-08  9:19         ` Stanislaw Gruszka
2018-10-08  9:35           ` Tony Chuang
2018-10-08  9:25       ` Stanislaw Gruszka
2018-10-03  8:02 ` [RFC v2 05/12] rtw88: mac files yhchuang
2018-10-03  8:02 ` [RFC v2 06/12] rtw88: fw and efuse files yhchuang
2018-10-04 10:49   ` Stanislaw Gruszka
2018-10-05  9:19     ` Tony Chuang
2018-10-08  9:15       ` Stanislaw Gruszka
2018-10-06 12:34     ` Kalle Valo
2018-10-03  8:02 ` [RFC v2 07/12] rtw88: phy files yhchuang
2018-10-03  8:02 ` [RFC v2 08/12] rtw88: debug files yhchuang
2018-10-03  8:02 ` [RFC v2 09/12] rtw88: chip files yhchuang
2018-10-03  8:02 ` [RFC v2 10/12] rtw88: 8822B init table yhchuang
2018-10-03  8:02 ` [RFC v2 11/12] rtw88: 8822C " yhchuang
2018-10-03  8:02 ` [RFC v2 12/12] rtw88: Kconfig & Makefile yhchuang
2018-10-03 16:15 ` [RFC v2 00/12] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips Sid Hayn
2018-10-03 16:52   ` Larry Finger
2018-10-03 16:57     ` Sid Hayn
2018-10-03 17:38       ` Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F7CD281DE3E379468C6D07993EA72F84D172A2BC@RTITMBSVM01.realtek.com.tw \
    --to=yhchuang@realtek.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=sgruszka@redhat.com \
    --cc=tehuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.