From 8ca4b705ac0c3917fa8e207e232df7528f37f5b4 Mon Sep 17 00:00:00 2001 From: Ahmad Masri Date: Wed, 18 Sep 2019 13:49:55 +0300 Subject: [PATCH] wil6210: enable access category queues Set ac_queues default to enabled. Change wil_select_ac_queue to return higher priority queue for EAPOL, ARP and ICMP packets. These special packets are critical to maintain the link with the AP and guarantee healthy operations and diagnostics in the network. Special packets will get the higher priority to ensure early transmission when access category is enabled. Change-Id: Ic03a810c303f614174f9f10c72e339ee32a6f023 Signed-off-by: Ahmad Masri --- drivers/net/wireless/ath/wil6210/netdev.c | 8 +++++--- drivers/net/wireless/ath/wil6210/txrx.c | 4 ++-- drivers/net/wireless/ath/wil6210/txrx.h | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index 3e9c3081c976..97b787cedcdb 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c @@ -19,9 +19,9 @@ module_param(alt_ifname, bool, 0444); MODULE_PARM_DESC(alt_ifname, " use an alternate interface name wigigN instead of wlanN"); /* enable access category for transmit packets, this parameter may be controlled - * via wigig.ini config file, default disabled + * via wigig.ini config file, default enabled */ -bool ac_queues; +bool ac_queues = true; bool wil_has_other_active_ifaces(struct wil6210_priv *wil, struct net_device *ndev, bool up, bool ok) @@ -114,7 +114,9 @@ static u16 wil_select_queue(struct net_device *ndev, return 0; /* determine the priority */ - if (skb->priority == 0 || skb->priority > 7) + if (wil_is_special_packet(skb)) + skb->priority = 7; + else if (skb->priority == 0 || skb->priority > 7) skb->priority = cfg80211_classify8021d(skb, NULL); qid = wil_1d_to_queue[skb->priority]; diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 406beb73cec4..ced6751f2def 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -2042,7 +2042,7 @@ err_exit: return rc; } -static inline bool is_special_packet(const struct sk_buff *skb) +bool wil_is_special_packet(const struct sk_buff *skb) { if (skb->protocol == cpu_to_be16(ETH_P_ARP) || skb->protocol == cpu_to_be16(ETH_P_RARP) || @@ -2073,7 +2073,7 @@ static int __wil_tx_ring(struct wil6210_priv *wil, struct wil6210_vif *vif, bool mcast = (ring_index == vif->bcast_ring); uint len = skb_headlen(skb); bool special_packet = (wil->tx_reserved_entries != 0 && - is_special_packet(skb)); + wil_is_special_packet(skb)); int avail = wil_ring_avail_tx(ring) - (special_packet ? 0 : txdata->tx_reserved_count); u8 ctx_flags = special_packet ? WIL_CTX_FLAG_RESERVED_USED : 0; diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h index 7aa1afe902d5..d9e116ba8dce 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.h +++ b/drivers/net/wireless/ath/wil6210/txrx.h @@ -696,5 +696,6 @@ void wil_init_txrx_ops_legacy_dma(struct wil6210_priv *wil); void wil_tx_latency_calc(struct wil6210_priv *wil, struct sk_buff *skb, struct wil_sta_info *sta); int wil_get_cid_by_ring(struct wil6210_priv *wil, struct wil_ring *ring); +bool wil_is_special_packet(const struct sk_buff *skb); #endif /* WIL6210_TXRX_H */