wifi: ath12k: correctly handle mcast packets for clients
authorSarika Sharma <quic_sarishar@quicinc.com>
Fri, 11 Apr 2025 06:15:23 +0000 (11:45 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 17 Apr 2025 22:49:34 +0000 (15:49 -0700)
Currently, RX is_mcbc bit is set for packets sent from client as
destination address (DA) is multicast/broadcast address, but packets
are actually unicast as receiver address (RA) is not multicast address.
Hence, packets are not handled properly due to this is_mcbc bit.

Therefore, reset the is_mcbc bit if interface type is AP.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250411061523.859387-3-quic_sarishar@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_rx.c
drivers/net/wireless/ath/ath12k/peer.c
drivers/net/wireless/ath/ath12k/peer.h

index 37a82419aaf2b50ca93e16b30abdfd0847ce1c8e..40feaa6d512d72c7f80f5c4ef21583d9309899f2 100644 (file)
@@ -2282,6 +2282,11 @@ static void ath12k_dp_rx_h_mpdu(struct ath12k *ar,
        spin_lock_bh(&ar->ab->base_lock);
        peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu, rx_info);
        if (peer) {
+               /* resetting mcbc bit because mcbc packets are unicast
+                * packets only for AP as STA sends unicast packets.
+                */
+               rxcb->is_mcbc = rxcb->is_mcbc && !peer->ucast_ra_only;
+
                if (rxcb->is_mcbc)
                        enctype = peer->sec_type_grp;
                else
index 792cca8a3fb1b06e6beb9f42ff47e6b1c01192c2..ec7236bbccc0feef66d787efdf896e6a1656695c 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022, 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include "core.h"
@@ -383,6 +383,9 @@ int ath12k_peer_create(struct ath12k *ar, struct ath12k_link_vif *arvif,
                arvif->ast_idx = peer->hw_peer_id;
        }
 
+       if (vif->type == NL80211_IFTYPE_AP)
+               peer->ucast_ra_only = true;
+
        if (sta) {
                ahsta = ath12k_sta_to_ahsta(sta);
                arsta = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy,
index 5870ee11a8c7ec112d81e8a9b04cb8727c946499..f3a5e054d2b556374c0560b322e36fb26c3da3c2 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef ATH12K_PEER_H
@@ -62,6 +62,7 @@ struct ath12k_peer {
 
        /* for reference to ath12k_link_sta */
        u8 link_id;
+       bool ucast_ra_only;
 };
 
 struct ath12k_ml_peer {