lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <TYCPR01MB843770121E6576BB3807CD0A98D32@TYCPR01MB8437.jpnprd01.prod.outlook.com>
Date: Thu, 13 Mar 2025 20:43:18 +0800
From: Shengyu Qu <wiagn233@...look.com>
To: Felix Fietkau <nbd@....name>, Ping-Ke Shih <pkshih@...ltek.com>,
 "lorenzo@...nel.org" <lorenzo@...nel.org>,
 "ryder.lee@...iatek.com" <ryder.lee@...iatek.com>,
 "shayne.chen@...iatek.com" <shayne.chen@...iatek.com>,
 "sean.wang@...iatek.com" <sean.wang@...iatek.com>,
 "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "linux-arm-kernel@...ts.infradead.org"
 <linux-arm-kernel@...ts.infradead.org>,
 "linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>
Cc: wiagn233@...look.com,
 "johannes@...solutions.net" <johannes@...solutions.net>,
 "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
 "angelogioacchino.delregno@...labora.com"
 <angelogioacchino.delregno@...labora.com>,
 Peter Chiu <chui-hao.chiu@...iatek.com>
Subject: Re: [PATCH v1] mt76: mt7915: wed: find rx token by physical address

Hi Felix,

I'm not sure about the token ID incorrect frequency, this is just a port
of downstream patch, sorry.

Best regards,
Shengyu

在 2025/3/12 17:09, Felix Fietkau 写道:
> On 12.03.25 02:41, Ping-Ke Shih wrote:
>> Shengyu Qu <wiagn233@...look.com> wrote:
>>>
>>> Hi Shih,
>>>
>>> Can you also give this patch a review? Seems I also need to convert to
>>> reverse Xmas tree order for this patch, will do it in next version.
>>
>> Yes. Please do it.
>>
>>>
>>> Best regards,
>>> Shengyu
>>>
>>> 在 2025/2/22 19:38, Shengyu Qu 写道:
>>> > The token id in RxDMAD may be incorrect when it is not the last frame
>>> > due to WED HW bug. Lookup correct token id by physical address in 
>>> sdp0.
>>> >
>>> > Downstream patch link:
>>> https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt- 
>>> feeds/+/737340322ab22b138fd200e02
>>> 0d61ffdbe3e36a9/autobuild/autobuild_5.4_mac80211_release/ 
>>> mt7988_wifi7_mac80211_mlo/package/kernel/mt76
>>> /patches/0062-mtk-wifi-mt76-mt7915-wed-find-rx-token-by-physical-a.patch
>>> >
>>> > Signed-off-by: Peter Chiu <chui-hao.chiu@...iatek.com>
>>> > Signed-off-by: Shengyu Qu <wiagn233@...look.com>
>>> > ---
>>> >   drivers/net/wireless/mediatek/mt76/dma.c | 25 +++++++++++++++++++ 
>>> ++++-
>>> >   1 file changed, 24 insertions(+), 1 deletion(-)
>>> >
>>> > diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/ 
>>> net/wireless/mediatek/mt76/dma.c
>>> > index 844af16ee551..5bf63014263c 100644
>>> > --- a/drivers/net/wireless/mediatek/mt76/dma.c
>>> > +++ b/drivers/net/wireless/mediatek/mt76/dma.c
>>> > @@ -444,9 +444,32 @@ mt76_dma_get_buf(struct mt76_dev *dev, struct 
>>> mt76_queue *q, int idx,
>>> >       mt76_dma_should_drop_buf(drop, ctrl, buf1, desc_info);
>>> >
>>> >       if (mt76_queue_is_wed_rx(q)) {
>>> > +        u32 id, find = 0;
>>> >           u32 token = FIELD_GET(MT_DMA_CTL_TOKEN, buf1);
>>> > -        struct mt76_txwi_cache *t = mt76_rx_token_release(dev, 
>>> token);
>>> > +        struct mt76_txwi_cache *t;
>>> > +
>>> > +        if (*more) {
>>
>> Because of scope, should define 'find' (or 'found'?) as bool here.
>>
>>> > +            spin_lock_bh(&dev->rx_token_lock);
>>> > +
>>> > +            idr_for_each_entry(&dev->rx_token, t, id) {
>>
>> idr_find() can only get a pointer associated with the ID. Not sure if 
>> it can
>> have a reverse way -- get ID from pointer. With sequential search in 
>> data path,
>> cost is higher.
>>
>> Maybe you can consider to build association between argument 'idx' and
>> pointer/token by another patch.
>>
>> But logic is okay to me.
> 
> Adding to that, it matters how frequently the token ID is incorrect. If 
> the token ID is correct most of the time, then it's worth optimizing for 
> that as the default case. In that case you should avoid the extra idr 
> scan if the pointer for the provided token id already matches.
> 
> - Felix


Download attachment "OpenPGP_0xE3520CC91929C8E7.asc" of type "application/pgp-keys" (6869 bytes)

Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ