public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support
@ 2025-07-18  2:55 Nithyanantham Paramasivam
  2025-07-18  2:55 ` [PATCH ath-next v2 1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode Nithyanantham Paramasivam
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Nithyanantham Paramasivam @ 2025-07-18  2:55 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Nithyanantham Paramasivam

Currently, the mac80211 layer handles construction and parsing
of 802.11 headers during packet transmission and reception.
Offloading encapsulation and decapsulation to hardware can
significantly enhance performance. This can be achieved by
having the driver advertise hardware support to mac80211 to
bypass 802.11 header processing

v1 -> v2:
- Rebased on ToT
- Firmware service bit check added for EAPOL ETH offload support
- skb free handled in tx completion station negetive case

Nithyanantham Paramasivam (3):
  wifi: ath12k: Fix the handling of TX packets in Ethernet mode
  wifi: ath12k: Fix TX status reporting to mac80211 when offload is
    enabled
  wifi: ath12k: Advertise encapsulation/decapsulation offload support to
    mac80211

 drivers/net/wireless/ath/ath12k/dp_tx.c | 102 +++++++++++++++++++++---
 drivers/net/wireless/ath/ath12k/mac.c   |   6 ++
 drivers/net/wireless/ath/ath12k/wmi.h   |   1 +
 3 files changed, 98 insertions(+), 11 deletions(-)


base-commit: 45bbd91fc41b7cb6319e45e6fd732c5c8a0c44e3
prerequisite-patch-id: 1d3bf121aa8bf03dd29436bd0df63de74f753027
prerequisite-patch-id: 0847395767a6f49458db6b857a9be81d12dc534c
-- 
2.17.1


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

* [PATCH ath-next v2 1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode
  2025-07-18  2:55 [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Nithyanantham Paramasivam
@ 2025-07-18  2:55 ` Nithyanantham Paramasivam
  2025-07-18 17:16   ` Jeff Johnson
  2025-07-18  2:55 ` [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled Nithyanantham Paramasivam
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Nithyanantham Paramasivam @ 2025-07-18  2:55 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Nithyanantham Paramasivam

Currently, in the transmit (TX) direction, EAPOL, QoS NULL,
and multicast frames are sent in native Wi-Fi (802.11) format.
However, when the virtual interface is configured in Ethernet
mode, transmission fails for packets enqueued in native Wi-fi format.

To address this issue, the firmware should be instructed to
treat these packets as RAW type packets, ensuring proper
handling even when the interface operates in Ethernet mode.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00217-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/dp_tx.c | 38 ++++++++++++++++++++-----
 drivers/net/wireless/ath/ath12k/mac.c   |  1 +
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index 1fa37cda1046..e8d3bcc90a2d 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -244,6 +244,8 @@ int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
 	bool msdu_ext_desc = false;
 	bool add_htt_metadata = false;
 	u32 iova_mask = ab->hw_params->iova_mask;
+	bool is_diff_encap = false;
+	bool is_null_frame = false;
 
 	if (test_bit(ATH12K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags))
 		return -ESHUTDOWN;
@@ -334,7 +336,19 @@ int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
 
 	switch (ti.encap_type) {
 	case HAL_TCL_ENCAP_TYPE_NATIVE_WIFI:
-		ath12k_dp_tx_encap_nwifi(skb);
+		is_null_frame = ieee80211_is_nullfunc(hdr->frame_control);
+		if (ahvif->vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) {
+			if (skb->protocol == cpu_to_be16(ETH_P_PAE) || is_null_frame)
+				is_diff_encap = true;
+
+			/* Firmware expects msdu ext descriptor for nwifi/raw packets
+			 * received in ETH mode. Without this, observed tx fail for
+			 * Multicast packets in ETH mode.
+			 */
+			msdu_ext_desc = true;
+		} else {
+			ath12k_dp_tx_encap_nwifi(skb);
+		}
 		break;
 	case HAL_TCL_ENCAP_TYPE_RAW:
 		if (!test_bit(ATH12K_FLAG_RAW_MODE, &ab->dev_flags)) {
@@ -378,15 +392,25 @@ int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
 		goto fail_remove_tx_buf;
 	}
 
-	if (!test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) &&
-	    !(skb_cb->flags & ATH12K_SKB_HW_80211_ENCAP) &&
-	    !(skb_cb->flags & ATH12K_SKB_CIPHER_SET) &&
-	    ieee80211_has_protected(hdr->frame_control)) {
-		/* Add metadata for sw encrypted vlan group traffic */
+	if ((!test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) &&
+	     !(skb_cb->flags & ATH12K_SKB_HW_80211_ENCAP) &&
+	     !(skb_cb->flags & ATH12K_SKB_CIPHER_SET) &&
+	     ieee80211_has_protected(hdr->frame_control)) ||
+	     is_diff_encap) {
+		/* Firmware is not expecting meta data for qos null
+		 * nwifi packet received in ETH encap mode.
+		 */
+		if (is_null_frame && msdu_ext_desc)
+			goto skip_htt_meta;
+
+		/* Add metadata for sw encrypted vlan group traffic
+		 * and EAPOL nwifi packet received in ETH encap mode.
+		 */
 		add_htt_metadata = true;
 		msdu_ext_desc = true;
-		ti.flags0 |= u32_encode_bits(1, HAL_TCL_DATA_CMD_INFO2_TO_FW);
 		ti.meta_data_flags |= HTT_TCL_META_DATA_VALID_HTT;
+skip_htt_meta:
+		ti.flags0 |= u32_encode_bits(1, HAL_TCL_DATA_CMD_INFO2_TO_FW);
 		ti.encap_type = HAL_TCL_ENCAP_TYPE_RAW;
 		ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN;
 	}
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 42eb9e8e14d1..3a33eccc0d1d 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -8869,6 +8869,7 @@ static void ath12k_mac_op_tx(struct ieee80211_hw *hw,
 		is_dvlan = true;
 
 	if (!vif->valid_links || !is_mcast || is_dvlan ||
+	    (skb_cb->flags & ATH12K_SKB_HW_80211_ENCAP) ||
 	    test_bit(ATH12K_FLAG_RAW_MODE, &ar->ab->dev_flags)) {
 		ret = ath12k_dp_tx(ar, arvif, skb, false, 0, is_mcast);
 		if (unlikely(ret)) {
-- 
2.17.1


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

* [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18  2:55 [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Nithyanantham Paramasivam
  2025-07-18  2:55 ` [PATCH ath-next v2 1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode Nithyanantham Paramasivam
@ 2025-07-18  2:55 ` Nithyanantham Paramasivam
  2025-07-18  9:12   ` Ping-Ke Shih
  2025-07-18  2:55 ` [PATCH ath-next v2 3/3] wifi: ath12k: Advertise encapsulation/decapsulation offload support to mac80211 Nithyanantham Paramasivam
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Nithyanantham Paramasivam @ 2025-07-18  2:55 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Nithyanantham Paramasivam

Currently, the ath12k driver supports only the native Wi-Fi
frame format. In this mode, the ieee80211_tx_status() function
works correctly to report transmission status to mac80211, as
it retrieves station information using sta_info_get_by_addrs().

However, this method is not applicable for Ethernet-converted
packets, since sta_info_get_by_addrs() cannot extract station
information from such formats.

Retrieve station information using ath12k_peer_find_by_id() to
support all frame formats, including native Wi-Fi, raw, and Ethernet.
Report transmission status using ieee80211_tx_status_ext(), and
include rate information as part of the datapath TX status report.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00217-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/dp_tx.c | 64 +++++++++++++++++++++++--
 1 file changed, 60 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index e8d3bcc90a2d..c102628c2e5f 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -568,7 +568,8 @@ static void
 ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
 				 struct ath12k_tx_desc_params *desc_params,
 				 struct dp_tx_ring *tx_ring,
-				 struct ath12k_dp_htt_wbm_tx_status *ts)
+				 struct ath12k_dp_htt_wbm_tx_status *ts,
+				 u16 peer_id)
 {
 	struct ieee80211_tx_info *info;
 	struct ath12k_link_vif *arvif;
@@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
 	struct ath12k *ar;
 	struct sk_buff *msdu = desc_params->skb;
 	s32 noise_floor;
+	struct ieee80211_tx_status status = { 0 };
+	struct ath12k_peer *peer;
 
 	skb_cb = ATH12K_SKB_CB(msdu);
 	info = IEEE80211_SKB_CB(msdu);
@@ -629,8 +632,25 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
 			info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
 		}
 	}
+	rcu_read_lock();
+	spin_lock_bh(&ab->base_lock);
+	peer = ath12k_peer_find_by_id(ab, peer_id);
+	if (!peer || !peer->sta) {
+		ath12k_dbg(ab, ATH12K_DBG_DATA,
+			   "dp_tx: failed to find the peer with peer_id %d\n", peer_id);
+		spin_unlock_bh(&ab->base_lock);
+		ieee80211_free_txskb(ath12k_ar_to_hw(ar), msdu);
+		goto exit;
+	} else {
+		status.sta = peer->sta;
+	}
+	spin_unlock_bh(&ab->base_lock);
 
-	ieee80211_tx_status_skb(ath12k_ar_to_hw(ar), msdu);
+	status.info = info;
+	status.skb = msdu;
+	ieee80211_tx_status_ext(ath12k_ar_to_hw(ar), &status);
+exit:
+	rcu_read_unlock();
 }
 
 static void
@@ -641,6 +661,7 @@ ath12k_dp_tx_process_htt_tx_complete(struct ath12k_base *ab, void *desc,
 	struct htt_tx_wbm_completion *status_desc;
 	struct ath12k_dp_htt_wbm_tx_status ts = {0};
 	enum hal_wbm_htt_tx_comp_status wbm_status;
+	u16 peer_id;
 
 	status_desc = desc;
 
@@ -653,7 +674,11 @@ ath12k_dp_tx_process_htt_tx_complete(struct ath12k_base *ab, void *desc,
 		ts.acked = (wbm_status == HAL_WBM_REL_HTT_TX_COMP_STATUS_OK);
 		ts.ack_rssi = le32_get_bits(status_desc->info2,
 					    HTT_TX_WBM_COMP_INFO2_ACK_RSSI);
-		ath12k_dp_tx_htt_tx_complete_buf(ab, desc_params, tx_ring, &ts);
+
+		peer_id = le32_get_bits(((struct hal_wbm_completion_ring_tx *)desc)->
+				info3, HAL_WBM_COMPL_TX_INFO3_PEER_ID);
+
+		ath12k_dp_tx_htt_tx_complete_buf(ab, desc_params, tx_ring, &ts, peer_id);
 		break;
 	case HAL_WBM_REL_HTT_TX_COMP_STATUS_DROP:
 	case HAL_WBM_REL_HTT_TX_COMP_STATUS_TTL:
@@ -805,6 +830,12 @@ static void ath12k_dp_tx_complete_msdu(struct ath12k *ar,
 	struct ath12k_vif *ahvif;
 	struct sk_buff *msdu = desc_params->skb;
 	s32 noise_floor;
+	struct ieee80211_tx_status status = { 0 };
+	struct ieee80211_rate_status status_rate = { 0 };
+	struct ath12k_peer *peer;
+	struct ath12k_link_sta *arsta;
+	struct ath12k_sta *ahsta;
+	struct rate_info rate;
 
 	if (WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) {
 		/* Must not happen */
@@ -896,7 +927,32 @@ static void ath12k_dp_tx_complete_msdu(struct ath12k *ar,
 
 	ath12k_dp_tx_update_txcompl(ar, ts);
 
-	ieee80211_tx_status_skb(ath12k_ar_to_hw(ar), msdu);
+	spin_lock_bh(&ab->base_lock);
+	peer = ath12k_peer_find_by_id(ab, ts->peer_id);
+	if (!peer || !peer->sta) {
+		ath12k_err(ab,
+			   "dp_tx: failed to find the peer with peer_id %d\n",
+			   ts->peer_id);
+		spin_unlock_bh(&ab->base_lock);
+		ieee80211_free_txskb(ath12k_ar_to_hw(ar), msdu);
+		goto exit;
+	}
+	ahsta = ath12k_sta_to_ahsta(peer->sta);
+	arsta = &ahsta->deflink;
+
+	spin_unlock_bh(&ab->base_lock);
+
+	status.sta = peer->sta;
+	status.info = info;
+	status.skb = msdu;
+	rate = arsta->last_txrate;
+
+	status_rate.rate_idx = rate;
+	status_rate.try_count = 1;
+
+	status.rates = &status_rate;
+	status.n_rates = 1;
+	ieee80211_tx_status_ext(ath12k_ar_to_hw(ar), &status);
 
 exit:
 	rcu_read_unlock();
-- 
2.17.1


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

* [PATCH ath-next v2 3/3] wifi: ath12k: Advertise encapsulation/decapsulation offload support to mac80211
  2025-07-18  2:55 [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Nithyanantham Paramasivam
  2025-07-18  2:55 ` [PATCH ath-next v2 1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode Nithyanantham Paramasivam
  2025-07-18  2:55 ` [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled Nithyanantham Paramasivam
@ 2025-07-18  2:55 ` Nithyanantham Paramasivam
  2025-07-18 16:11 ` [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Vasanthakumar Thiagarajan
  2025-07-19 16:22 ` Jeff Johnson
  4 siblings, 0 replies; 14+ messages in thread
From: Nithyanantham Paramasivam @ 2025-07-18  2:55 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Nithyanantham Paramasivam

Currently, the mac80211 layer handles construction and parsing
of 802.11 headers during packet transmission and reception.
Offloading encapsulation and decapsulation to hardware can
significantly enhance performance. Check the service bit to determine
if the firmware supports Ethernet offload. If supported, advertise the
capability to mac80211 to bypass software-based 802.11 header
processing.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00217-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 5 +++++
 drivers/net/wireless/ath/ath12k/wmi.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 3a33eccc0d1d..93ae76daa549 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -13726,6 +13726,11 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
 	ieee80211_hw_set(hw, REPORTS_LOW_ACK);
 	ieee80211_hw_set(hw, NO_VIRTUAL_MONITOR);
 
+	if (test_bit(WMI_TLV_SERVICE_ETH_OFFLOAD, ar->wmi->wmi_ab->svc_map)) {
+		ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
+		ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
+	}
+
 	if (cap->nss_ratio_enabled)
 		ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
 
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index ed9b4324a7b8..f1283b8444f9 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -2254,6 +2254,7 @@ enum wmi_tlv_service {
 	WMI_TLV_SERVICE_WMSK_COMPACTION_RX_TLVS = 361,
 
 	WMI_TLV_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT = 365,
+	WMI_TLV_SERVICE_ETH_OFFLOAD = 461,
 
 	WMI_MAX_EXT2_SERVICE,
 };
-- 
2.17.1


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

* RE: [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18  2:55 ` [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled Nithyanantham Paramasivam
@ 2025-07-18  9:12   ` Ping-Ke Shih
  2025-07-18 12:56     ` Nithyanantham Paramasivam
  0 siblings, 1 reply; 14+ messages in thread
From: Ping-Ke Shih @ 2025-07-18  9:12 UTC (permalink / raw)
  To: Nithyanantham Paramasivam, ath12k@lists.infradead.org
  Cc: linux-wireless@vger.kernel.org

> @@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
>         struct ath12k *ar;
>         struct sk_buff *msdu = desc_params->skb;
>         s32 noise_floor;
> +       struct ieee80211_tx_status status = { 0 };

With '= {}', no matter how the struct changes, you don't need to change the
code accordingly. 

> +       struct ath12k_peer *peer;
> 
>         skb_cb = ATH12K_SKB_CB(msdu);
>         info = IEEE80211_SKB_CB(msdu);

[...]

> @@ -805,6 +830,12 @@ static void ath12k_dp_tx_complete_msdu(struct ath12k *ar,
>         struct ath12k_vif *ahvif;
>         struct sk_buff *msdu = desc_params->skb;
>         s32 noise_floor;
> +       struct ieee80211_tx_status status = { 0 };
> +       struct ieee80211_rate_status status_rate = { 0 };

ditto.

> +       struct ath12k_peer *peer;
> +       struct ath12k_link_sta *arsta;
> +       struct ath12k_sta *ahsta;
> +       struct rate_info rate;
> 
>         if (WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) {
>                 /* Must not happen */




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

* Re: [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18  9:12   ` Ping-Ke Shih
@ 2025-07-18 12:56     ` Nithyanantham Paramasivam
  2025-07-18 13:28       ` Ping-Ke Shih
  0 siblings, 1 reply; 14+ messages in thread
From: Nithyanantham Paramasivam @ 2025-07-18 12:56 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org

On Fri, Jul 18, 2025 at 2:45 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
>
> > @@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
> >         struct ath12k *ar;
> >         struct sk_buff *msdu = desc_params->skb;
> >         s32 noise_floor;
> > +       struct ieee80211_tx_status status = { 0 };
>
> With '= {}', no matter how the struct changes, you don't need to change the
> code accordingly.
>

Both ={} and = {0} achieve the same result, right?

> > +       struct ath12k_peer *peer;
> >
> >         skb_cb = ATH12K_SKB_CB(msdu);
> >         info = IEEE80211_SKB_CB(msdu);
>
> [...]
>
> > @@ -805,6 +830,12 @@ static void ath12k_dp_tx_complete_msdu(struct ath12k *ar,
> >         struct ath12k_vif *ahvif;
> >         struct sk_buff *msdu = desc_params->skb;
> >         s32 noise_floor;
> > +       struct ieee80211_tx_status status = { 0 };
> > +       struct ieee80211_rate_status status_rate = { 0 };
>
> ditto.
>
> > +       struct ath12k_peer *peer;
> > +       struct ath12k_link_sta *arsta;
> > +       struct ath12k_sta *ahsta;
> > +       struct rate_info rate;
> >
> >         if (WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) {
> >                 /* Must not happen */
>
>
>

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

* Re: [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18 12:56     ` Nithyanantham Paramasivam
@ 2025-07-18 13:28       ` Ping-Ke Shih
  2025-07-18 13:47         ` Nithyanantham Paramasivam
  0 siblings, 1 reply; 14+ messages in thread
From: Ping-Ke Shih @ 2025-07-18 13:28 UTC (permalink / raw)
  To: Nithyanantham Paramasivam
  Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org


Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com> wrote:
> On Fri, Jul 18, 2025 at 2:45 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
> >
> > > @@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
> > >         struct ath12k *ar;
> > >         struct sk_buff *msdu = desc_params->skb;
> > >         s32 noise_floor;
> > > +       struct ieee80211_tx_status status = { 0 };
> >
> > With '= {}', no matter how the struct changes, you don't need to change the
> > code accordingly.
> >
> 
> Both ={} and = {0} achieve the same result, right?

Yes. 

However, in some cases, it might cause compiler error. But I forgot the cases,
even I can't reproduce the error now. Sorry for the noise.


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

* Re: [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18 13:28       ` Ping-Ke Shih
@ 2025-07-18 13:47         ` Nithyanantham Paramasivam
  2025-07-18 13:55           ` Jeff Johnson
  0 siblings, 1 reply; 14+ messages in thread
From: Nithyanantham Paramasivam @ 2025-07-18 13:47 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org

On Fri, Jul 18, 2025 at 7:01 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
>
>
> Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com> wrote:
> > On Fri, Jul 18, 2025 at 2:45 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
> > >
> > > > @@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
> > > >         struct ath12k *ar;
> > > >         struct sk_buff *msdu = desc_params->skb;
> > > >         s32 noise_floor;
> > > > +       struct ieee80211_tx_status status = { 0 };
> > >
> > > With '= {}', no matter how the struct changes, you don't need to change the
> > > code accordingly.
> > >
> >
> > Both ={} and = {0} achieve the same result, right?
>
> Yes.
>
> However, in some cases, it might cause compiler error. But I forgot the cases,
> even I can't reproduce the error now. Sorry for the noise.
>
No worries at all. If you happen to recall the scenario later, I’d be
curious to know. For now, since we have been following the same style,
we'll continue with it.

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

* Re: [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18 13:47         ` Nithyanantham Paramasivam
@ 2025-07-18 13:55           ` Jeff Johnson
  2025-07-18 14:05             ` Nithyanantham Paramasivam
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Johnson @ 2025-07-18 13:55 UTC (permalink / raw)
  To: Nithyanantham Paramasivam, Ping-Ke Shih
  Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org

On 7/18/2025 6:47 AM, Nithyanantham Paramasivam wrote:
> On Fri, Jul 18, 2025 at 7:01 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
>>
>>
>> Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com> wrote:
>>> On Fri, Jul 18, 2025 at 2:45 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
>>>>
>>>>> @@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
>>>>>         struct ath12k *ar;
>>>>>         struct sk_buff *msdu = desc_params->skb;
>>>>>         s32 noise_floor;
>>>>> +       struct ieee80211_tx_status status = { 0 };
>>>>
>>>> With '= {}', no matter how the struct changes, you don't need to change the
>>>> code accordingly.
>>>>
>>>
>>> Both ={} and = {0} achieve the same result, right?
>>
>> Yes.
>>
>> However, in some cases, it might cause compiler error. But I forgot the cases,
>> even I can't reproduce the error now. Sorry for the noise.
>>
> No worries at all. If you happen to recall the scenario later, I’d be
> curious to know. For now, since we have been following the same style,
> we'll continue with it.
> 

{} is preferable to { 0 } since the 2nd one causes a compilation failure if
the first member of the struct is not a scalar

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

* Re: [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18 13:55           ` Jeff Johnson
@ 2025-07-18 14:05             ` Nithyanantham Paramasivam
  2025-07-18 16:30               ` Jeff Johnson
  0 siblings, 1 reply; 14+ messages in thread
From: Nithyanantham Paramasivam @ 2025-07-18 14:05 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Ping-Ke Shih, ath12k@lists.infradead.org,
	linux-wireless@vger.kernel.org

On Fri, Jul 18, 2025 at 7:25 PM Jeff Johnson
<jeff.johnson@oss.qualcomm.com> wrote:
>
> On 7/18/2025 6:47 AM, Nithyanantham Paramasivam wrote:
> > On Fri, Jul 18, 2025 at 7:01 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
> >>
> >>
> >> Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com> wrote:
> >>> On Fri, Jul 18, 2025 at 2:45 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
> >>>>
> >>>>> @@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
> >>>>>         struct ath12k *ar;
> >>>>>         struct sk_buff *msdu = desc_params->skb;
> >>>>>         s32 noise_floor;
> >>>>> +       struct ieee80211_tx_status status = { 0 };
> >>>>
> >>>> With '= {}', no matter how the struct changes, you don't need to change the
> >>>> code accordingly.
> >>>>
> >>>
> >>> Both ={} and = {0} achieve the same result, right?
> >>
> >> Yes.
> >>
> >> However, in some cases, it might cause compiler error. But I forgot the cases,
> >> even I can't reproduce the error now. Sorry for the noise.
> >>
> > No worries at all. If you happen to recall the scenario later, I’d be
> > curious to know. For now, since we have been following the same style,
> > we'll continue with it.
> >
>
> {} is preferable to { 0 } since the 2nd one causes a compilation failure if
> the first member of the struct is not a scalar

Thanks for the clarification! I’ll follow the same approach going
forward. I’ll make the change and update the code accordingly.

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

* Re: [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support
  2025-07-18  2:55 [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Nithyanantham Paramasivam
                   ` (2 preceding siblings ...)
  2025-07-18  2:55 ` [PATCH ath-next v2 3/3] wifi: ath12k: Advertise encapsulation/decapsulation offload support to mac80211 Nithyanantham Paramasivam
@ 2025-07-18 16:11 ` Vasanthakumar Thiagarajan
  2025-07-19 16:22 ` Jeff Johnson
  4 siblings, 0 replies; 14+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-07-18 16:11 UTC (permalink / raw)
  To: Nithyanantham Paramasivam, ath12k; +Cc: linux-wireless



On 7/18/2025 8:25 AM, Nithyanantham Paramasivam wrote:
> Currently, the mac80211 layer handles construction and parsing
> of 802.11 headers during packet transmission and reception.
> Offloading encapsulation and decapsulation to hardware can
> significantly enhance performance. This can be achieved by
> having the driver advertise hardware support to mac80211 to
> bypass 802.11 header processing
> 
> v1 -> v2:
> - Rebased on ToT
> - Firmware service bit check added for EAPOL ETH offload support
> - skb free handled in tx completion station negetive case
> 
> Nithyanantham Paramasivam (3):
>    wifi: ath12k: Fix the handling of TX packets in Ethernet mode
>    wifi: ath12k: Fix TX status reporting to mac80211 when offload is
>      enabled
>    wifi: ath12k: Advertise encapsulation/decapsulation offload support to
>      mac80211
> 
>   drivers/net/wireless/ath/ath12k/dp_tx.c | 102 +++++++++++++++++++++---
>   drivers/net/wireless/ath/ath12k/mac.c   |   6 ++
>   drivers/net/wireless/ath/ath12k/wmi.h   |   1 +
>   3 files changed, 98 insertions(+), 11 deletions(-)

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>

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

* Re: [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
  2025-07-18 14:05             ` Nithyanantham Paramasivam
@ 2025-07-18 16:30               ` Jeff Johnson
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2025-07-18 16:30 UTC (permalink / raw)
  To: Nithyanantham Paramasivam
  Cc: Ping-Ke Shih, ath12k@lists.infradead.org,
	linux-wireless@vger.kernel.org

On 7/18/2025 7:05 AM, Nithyanantham Paramasivam wrote:
> On Fri, Jul 18, 2025 at 7:25 PM Jeff Johnson
> <jeff.johnson@oss.qualcomm.com> wrote:
>>
>> On 7/18/2025 6:47 AM, Nithyanantham Paramasivam wrote:
>>> On Fri, Jul 18, 2025 at 7:01 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
>>>>
>>>>
>>>> Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com> wrote:
>>>>> On Fri, Jul 18, 2025 at 2:45 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
>>>>>>
>>>>>>> @@ -578,6 +579,8 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
>>>>>>>         struct ath12k *ar;
>>>>>>>         struct sk_buff *msdu = desc_params->skb;
>>>>>>>         s32 noise_floor;
>>>>>>> +       struct ieee80211_tx_status status = { 0 };
>>>>>>
>>>>>> With '= {}', no matter how the struct changes, you don't need to change the
>>>>>> code accordingly.
>>>>>>
>>>>>
>>>>> Both ={} and = {0} achieve the same result, right?
>>>>
>>>> Yes.
>>>>
>>>> However, in some cases, it might cause compiler error. But I forgot the cases,
>>>> even I can't reproduce the error now. Sorry for the noise.
>>>>
>>> No worries at all. If you happen to recall the scenario later, I’d be
>>> curious to know. For now, since we have been following the same style,
>>> we'll continue with it.
>>>
>>
>> {} is preferable to { 0 } since the 2nd one causes a compilation failure if
>> the first member of the struct is not a scalar
> 
> Thanks for the clarification! I’ll follow the same approach going
> forward. I’ll make the change and update the code accordingly.

Since there are a lot of these already in the driver I'm going to take this
patch as-is. I'll separately fix all of these across the ath1[0-2]k drivers.

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

* Re: [PATCH ath-next v2 1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode
  2025-07-18  2:55 ` [PATCH ath-next v2 1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode Nithyanantham Paramasivam
@ 2025-07-18 17:16   ` Jeff Johnson
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2025-07-18 17:16 UTC (permalink / raw)
  To: Nithyanantham Paramasivam, ath12k; +Cc: linux-wireless

On 7/17/2025 7:55 PM, Nithyanantham Paramasivam wrote:
...
> +	if ((!test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) &&
> +	     !(skb_cb->flags & ATH12K_SKB_HW_80211_ENCAP) &&
> +	     !(skb_cb->flags & ATH12K_SKB_CIPHER_SET) &&
> +	     ieee80211_has_protected(hdr->frame_control)) ||
> +	     is_diff_encap) {

nit: this last term is aligned on the wrong (

i'll fix this in pending, and since I'm touching the patches, i'll go ahead
and change the { 0 } => {} as well

/jeff

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

* Re: [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support
  2025-07-18  2:55 [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Nithyanantham Paramasivam
                   ` (3 preceding siblings ...)
  2025-07-18 16:11 ` [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Vasanthakumar Thiagarajan
@ 2025-07-19 16:22 ` Jeff Johnson
  4 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2025-07-19 16:22 UTC (permalink / raw)
  To: ath12k, Nithyanantham Paramasivam; +Cc: linux-wireless


On Fri, 18 Jul 2025 08:25:10 +0530, Nithyanantham Paramasivam wrote:
> Currently, the mac80211 layer handles construction and parsing
> of 802.11 headers during packet transmission and reception.
> Offloading encapsulation and decapsulation to hardware can
> significantly enhance performance. This can be achieved by
> having the driver advertise hardware support to mac80211 to
> bypass 802.11 header processing
> 
> [...]

Applied, thanks!

[1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode
      commit: 192c8e9a131f1772a635c3c5df4cb592bd7b3e8b
[2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled
      commit: 981050b918fc4c36e0ef3bd7392b39d7304ef09b
[3/3] wifi: ath12k: Advertise encapsulation/decapsulation offload support to mac80211
      commit: d29591d5b52eaa62bc8c07ec83fe63018b5546ea

Best regards,
-- 
Jeff Johnson <jeff.johnson@oss.qualcomm.com>


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

end of thread, other threads:[~2025-07-19 16:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18  2:55 [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Nithyanantham Paramasivam
2025-07-18  2:55 ` [PATCH ath-next v2 1/3] wifi: ath12k: Fix the handling of TX packets in Ethernet mode Nithyanantham Paramasivam
2025-07-18 17:16   ` Jeff Johnson
2025-07-18  2:55 ` [PATCH ath-next v2 2/3] wifi: ath12k: Fix TX status reporting to mac80211 when offload is enabled Nithyanantham Paramasivam
2025-07-18  9:12   ` Ping-Ke Shih
2025-07-18 12:56     ` Nithyanantham Paramasivam
2025-07-18 13:28       ` Ping-Ke Shih
2025-07-18 13:47         ` Nithyanantham Paramasivam
2025-07-18 13:55           ` Jeff Johnson
2025-07-18 14:05             ` Nithyanantham Paramasivam
2025-07-18 16:30               ` Jeff Johnson
2025-07-18  2:55 ` [PATCH ath-next v2 3/3] wifi: ath12k: Advertise encapsulation/decapsulation offload support to mac80211 Nithyanantham Paramasivam
2025-07-18 16:11 ` [PATCH ath-next v2 0/3] wifi: ath12k: Add 802.11 encap/decap offload support Vasanthakumar Thiagarajan
2025-07-19 16:22 ` Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox