Tell mac80211 that the AP, AP VLAN and station netdevs may pass TCP batches with fragments (NETIF_F_SG, TSO and TSO6, up to 16 segments) when frames go out with Ethernet encap on a device whose TCL takes them (IPQ8074). mac80211 segments them in software on every other path, and when the airtime of the whole batch would not fit AQL's estimate. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Signed-off-by: Julius Bairaktaris --- drivers/net/wireless/ath/ath11k/dp_tx.c | 6 ++++++ drivers/net/wireless/ath/ath11k/dp_tx.h | 1 + drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c index 4fbdd15d1ce0..6d950afb90f1 100644 --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c @@ -15,6 +15,12 @@ #include "peer.h" #include "mac.h" +/* Whether the netdevs of this device offer TSO and scatter-gather */ +bool ath11k_dp_tx_tso_wanted(struct ath11k_base *ab) +{ + return ab->hw_params.tx_tso; +} + static enum hal_tcl_encap_type ath11k_dp_tx_get_encap_type(struct ath11k_vif *arvif, struct sk_buff *skb) { diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.h b/drivers/net/wireless/ath/ath11k/dp_tx.h index 967f212d33db..a73b5197fac2 100644 --- a/drivers/net/wireless/ath/ath11k/dp_tx.h +++ b/drivers/net/wireless/ath/ath11k/dp_tx.h @@ -22,6 +22,7 @@ int ath11k_dp_tx_htt_h2t_ver_req_msg(struct ath11k_base *ab); int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif, struct ath11k_sta *arsta, struct sk_buff *skb, int held_ring); bool ath11k_dp_tx_idr_has_room(struct dp_tx_ring *tx_ring, int n); +bool ath11k_dp_tx_tso_wanted(struct ath11k_base *ab); int ath11k_dp_tx_gso(struct ath11k *ar, struct ath11k_vif *arvif, struct ath11k_sta *arsta, struct sk_buff *skb, int held_ring); diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 5f2086bf6c5d..1076e3b09cd3 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -10727,6 +10727,18 @@ static int __ath11k_mac_register(struct ath11k *ar) if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET) { ieee80211_hw_set(ar->hw, SUPPORTS_TX_ENCAP_OFFLOAD); ieee80211_hw_set(ar->hw, SUPPORTS_RX_DECAP_OFFLOAD); + + /* + * The TCL takes a TCP batch whole, with its payload in + * fragments, when the frame goes out with Ethernet encap. + */ + if (ath11k_dp_tx_tso_wanted(ab)) { + ar->hw->encap_netdev_features = NETIF_F_SG | + NETIF_F_TSO | + NETIF_F_TSO6; + ar->hw->encap_gso_max_segs = + ATH11K_DP_TX_TSO_MAX_SEGS; + } } if (cap->nss_ratio_enabled) -- 2.53.0