linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt76: fix 802.3 RX fail by hdr_trans
@ 2021-12-02  7:40 Deren Wu
  2021-12-02  8:37 ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Deren Wu @ 2021-12-02  7:40 UTC (permalink / raw)
  To: Felix Fietkau, Lorenzo Bianconi
  Cc: Sean Wang, Soul Huang, YN Chen, Leon Yen, Eric-SY Chang,
	Deren Wu, KM Lin, Robin Chiu, CH Yeh, Posh Sun, Eric Liang,
	Stella Chang, Evelyn Tsai, Ryder Lee, Shayne Chen,
	linux-wireless, linux-mediatek, Deren Wu

From: Deren Wu <deren.wu@mediatek.com>

Should not run hdr_trans process for 802.3 packets,
this would cause all data frame RX fail.

Fixes: d9930ec65b9f ("mt76: only set rx radiotap flag from within decoder functions")
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +-
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 6c14cb1cfd5a..5757284b24a5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -794,7 +794,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb)
 		status->flag |= RX_FLAG_8023;
 	}
 
-	if (rxv && mode >= MT_PHY_TYPE_HE_SU)
+	if (rxv && mode >= MT_PHY_TYPE_HE_SU && !(status->flag & RX_FLAG_8023))
 		mt7915_mac_decode_he_radiotap(skb, rxv, mode);
 
 	if (!status->wcid || !ieee80211_is_data_qos(fc))
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index e17c8f4c9747..eaffe665cb28 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -780,7 +780,6 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
 			mt76_insert_ccmp_hdr(skb, key_id);
 		}
 
-		hdr = mt76_skb_get_hdr(skb);
 		fc = hdr->frame_control;
 		if (ieee80211_is_data_qos(fc)) {
 			seq_ctrl = le16_to_cpu(hdr->seq_ctrl);
@@ -792,7 +791,7 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
 
 	mt7921_mac_assoc_rssi(dev, skb);
 
-	if (rxv && mode >= MT_PHY_TYPE_HE_SU)
+	if (rxv && mode >= MT_PHY_TYPE_HE_SU && !(status->flag & RX_FLAG_8023))
 		mt7921_mac_decode_he_radiotap(skb, rxv, mode);
 
 	if (!status->wcid || !ieee80211_is_data_qos(fc))
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mt76: fix 802.3 RX fail by hdr_trans
  2021-12-02  7:40 [PATCH] mt76: fix 802.3 RX fail by hdr_trans Deren Wu
@ 2021-12-02  8:37 ` Felix Fietkau
  2021-12-02 10:08   ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2021-12-02  8:37 UTC (permalink / raw)
  To: Deren Wu, Lorenzo Bianconi
  Cc: Sean Wang, Soul Huang, YN Chen, Leon Yen, Eric-SY Chang, KM Lin,
	Robin Chiu, CH Yeh, Posh Sun, Eric Liang, Stella Chang,
	Evelyn Tsai, Ryder Lee, Shayne Chen, linux-wireless,
	linux-mediatek


On 2021-12-02 08:40, Deren Wu wrote:
> From: Deren Wu <deren.wu@mediatek.com>
> 
> Should not run hdr_trans process for 802.3 packets,
> this would cause all data frame RX fail.
> 
> Fixes: d9930ec65b9f ("mt76: only set rx radiotap flag from within decoder functions")
> Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> ---
>   drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +-
>   drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 3 +--
>   2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index 6c14cb1cfd5a..5757284b24a5 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -794,7 +794,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb)
>   		status->flag |= RX_FLAG_8023;
>   	}
>   
> -	if (rxv && mode >= MT_PHY_TYPE_HE_SU)
> +	if (rxv && mode >= MT_PHY_TYPE_HE_SU && !(status->flag & RX_FLAG_8023))
>   		mt7915_mac_decode_he_radiotap(skb, rxv, mode);
>   
>   	if (!status->wcid || !ieee80211_is_data_qos(fc))
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> index e17c8f4c9747..eaffe665cb28 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> @@ -780,7 +780,6 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
>   			mt76_insert_ccmp_hdr(skb, key_id);
>   		}
>   
> -		hdr = mt76_skb_get_hdr(skb);
This line is not safe to remove, since mt76_insert_ccmp_hdr moves the 
header. However, there is a redundant call to mt76_skb_get_hdr above 
this part, which you can remove. Please do that in a separate patch 
though, since it has nothing to do with the rest of the changes.

Thanks,

- Felix

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mt76: fix 802.3 RX fail by hdr_trans
  2021-12-02  8:37 ` Felix Fietkau
@ 2021-12-02 10:08   ` Felix Fietkau
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2021-12-02 10:08 UTC (permalink / raw)
  To: Deren Wu, Lorenzo Bianconi
  Cc: Sean Wang, Soul Huang, YN Chen, Leon Yen, Eric-SY Chang, KM Lin,
	Robin Chiu, CH Yeh, Posh Sun, Eric Liang, Stella Chang,
	Evelyn Tsai, Ryder Lee, Shayne Chen, linux-wireless,
	linux-mediatek


On 2021-12-02 09:37, Felix Fietkau wrote:
> 
> On 2021-12-02 08:40, Deren Wu wrote:
>> From: Deren Wu <deren.wu@mediatek.com>
>> 
>> Should not run hdr_trans process for 802.3 packets,
>> this would cause all data frame RX fail.
>> 
>> Fixes: d9930ec65b9f ("mt76: only set rx radiotap flag from within decoder functions")
>> Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
>> Signed-off-by: Deren Wu <deren.wu@mediatek.com>
>> ---
>>   drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +-
>>   drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 3 +--
>>   2 files changed, 2 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
>> index 6c14cb1cfd5a..5757284b24a5 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
>> @@ -794,7 +794,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb)
>>   		status->flag |= RX_FLAG_8023;
>>   	}
>>   
>> -	if (rxv && mode >= MT_PHY_TYPE_HE_SU)
>> +	if (rxv && mode >= MT_PHY_TYPE_HE_SU && !(status->flag & RX_FLAG_8023))
>>   		mt7915_mac_decode_he_radiotap(skb, rxv, mode);
>>   
>>   	if (!status->wcid || !ieee80211_is_data_qos(fc))
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>> index e17c8f4c9747..eaffe665cb28 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>> @@ -780,7 +780,6 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
>>   			mt76_insert_ccmp_hdr(skb, key_id);
>>   		}
>>   
>> -		hdr = mt76_skb_get_hdr(skb);
> This line is not safe to remove, since mt76_insert_ccmp_hdr moves the
> header. However, there is a redundant call to mt76_skb_get_hdr above
> this part, which you can remove. Please do that in a separate patch
> though, since it has nothing to do with the rest of the changes.
I folded this patch into the commit that it fixes (excluding the
mt76_skb_get_hdr bit).

- Felix

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-02 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02  7:40 [PATCH] mt76: fix 802.3 RX fail by hdr_trans Deren Wu
2021-12-02  8:37 ` Felix Fietkau
2021-12-02 10:08   ` Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).