Skip to contentSkip to conversation

ath11k: add tx hw 802.11 encapusaltion offloading support

PATCH Superseded John Crispin 1 participant 1 message Jul 14, 2019 Qualcomm Atheros ATH11K wireless driver

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: add tx hw 802.11 encapusaltion offloading support

This patch adds support for ethernet rxtx mode to the driver. The feature is enabled via a new module parameter. If enabled to driver will enable the feature on a per vif basis if all other requirements were met.

---
This patch depends on https://patchwork.kernel.org/patch/11003671/

 drivers/net/wireless/ath/ath11k/core.h  |  5 +++
 drivers/net/wireless/ath/ath11k/dp_tx.c | 19 ++++++++---
 drivers/net/wireless/ath/ath11k/mac.c   | 42 ++++++++++++++++++++-----
 3 files changed, 55 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +5 -0
index 7a0f306f2a9e..abf7ff016b6f 100644
@@ -54,9 +54,14 @@ static inline enum wme_ac ath11k_tid_to_ac(u32 tid)
 		WME_AC_VO);
 }
 
+enum ath11k_skb_flags {
+	ATH11K_SKB_HW_80211_ENCAP = BIT(0),
+};
+
 struct ath11k_skb_cb {
 	dma_addr_t paddr;
 	u8 eid;
+	u8 flags;
 	struct ath11k *ar;
 	struct ieee80211_vif *vif;
 } __packed;
drivers/net/wireless/ath/ath11k/dp_tx.c +15 -4
index 8c5db3c88a87..80b0fd380d81 100644
@@ -16,7 +16,11 @@ ath11k_txq_tcl_ring_map[ATH11K_HW_MAX_QUEUES] = { 0x0, 0x1, 0x2, 0x2 };
 static enum hal_tcl_encap_type
 ath11k_dp_tx_get_encap_type(struct ath11k_vif *arvif, struct sk_buff *skb)
 {
-	/* TODO: Determine encap type based on vif_type and configuration */
+	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
+
+	if (tx_info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)
+		return HAL_TCL_ENCAP_TYPE_ETHERNET;
+
 	return HAL_TCL_ENCAP_TYPE_NATIVE_WIFI;
 }
 
@@ -40,8 +44,11 @@ static void ath11k_dp_tx_encap_nwifi(struct sk_buff *skb)
 static u8 ath11k_dp_tx_get_tid(struct sk_buff *skb)
 {
 	struct ieee80211_hdr *hdr = (void *)skb->data;
+	struct ath11k_skb_cb *cb = ATH11K_SKB_CB(skb);
 
-	if (!ieee80211_is_data_qos(hdr->frame_control))
+	if (cb->flags & ATH11K_SKB_HW_80211_ENCAP)
+		return skb->priority % IEEE80211_QOS_CTL_TID_MASK;
+	else if (!ieee80211_is_data_qos(hdr->frame_control))
 		return HAL_DESC_REO_NON_QOS_TID;
 	else
 		return skb->priority & IEEE80211_QOS_CTL_TID_MASK;
@@ -89,7 +96,8 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
 	if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags))
 		return -ESHUTDOWN;
 
-	if (!ieee80211_is_data(hdr->frame_control))
+	if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) &&
+	    !ieee80211_is_data(hdr->frame_control))
 		return -ENOTSUPP;
 
 	pool_id = skb_get_queue_mapping(skb) & (ATH11K_HW_MAX_QUEUES - 1);
@@ -142,12 +150,14 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
 	case HAL_TCL_ENCAP_TYPE_NATIVE_WIFI:
 		ath11k_dp_tx_encap_nwifi(skb);
 		break;
+	case HAL_TCL_ENCAP_TYPE_ETHERNET:
+		/* no need to encap */
+		break;
 	case HAL_TCL_ENCAP_TYPE_RAW:
 		/*  TODO: for CHECKSUM_PARTIAL case in raw mode, HW checksum offload
 		 *	  is not applicable, hence manual checksum calculation using
 		 *	  skb_checksum_help() is needed
 		 */
-	case HAL_TCL_ENCAP_TYPE_ETHERNET:
 	case HAL_TCL_ENCAP_TYPE_802_3:
 		/* TODO: Take care of other encap modes as well */
 		ret = -EINVAL;
@@ -433,6 +443,7 @@ static void ath11k_dp_tx_complete_msdu(struct ath11k *ar,
 	status.info = info;
 	status.rate = &arsta->last_txrate;
 	rcu_read_unlock();
+
 	ieee80211_tx_status_ext(ar->hw, &status);
 	spin_unlock_bh(&ab->data_lock);
 	return;
drivers/net/wireless/ath/ath11k/mac.c +35 -7

90 lines not on this page · raw message

Signature · 7 lines
2.20.1


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k