diff mbox series

[v2,05/12] wil6210: add option to drop Tx packets when tx ring is full

Message ID 1548689786-23288-6-git-send-email-merez@codeaurora.org (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series wil6210 patches | expand

Commit Message

Maya Erez Jan. 28, 2019, 3:36 p.m. UTC
From: Dedy Lansky <dlansky@codeaurora.org>

In AP mode with multiple clients, driver stops net queue
(netif_tx_stop_queue) upon first ring (serving specific client)
becoming full. This can have negative effect on transmission to
other clients which may still have room in their corresponding rings.

Implement new policy in which stop/wake net queue are not used. In
case there is no room in the ring for a transmitted packet, drop the
packet.
New policy is disabled by default and can be enabled with new
drop_if_ring_full module param.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
 drivers/net/wireless/ath/wil6210/txrx.c         | 6 ++++++
 drivers/net/wireless/ath/wil6210/wil_platform.h | 2 ++
 2 files changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index 51ff242..00996f1 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -2064,6 +2064,10 @@  static inline void __wil_update_net_queues(struct wil6210_priv *wil,
 		wil_dbg_txrx(wil, "check_stop=%d, mid=%d, stopped=%d",
 			     check_stop, vif->mid, vif->net_queue_stopped);
 
+	if (ring && wil->config.drop_if_ring_full)
+		/* no need to stop/wake net queues */
+		return;
+
 	if (ring && WIL_Q_PER_STA_USED(vif)) {
 		__wil_update_net_queues_per_sta(wil, vif, ring, check_stop);
 		return;
@@ -2227,6 +2231,8 @@  netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 		dev_kfree_skb_any(skb);
 		return NETDEV_TX_OK;
 	case -ENOMEM:
+		if (wil->config.drop_if_ring_full)
+			goto drop;
 		return NETDEV_TX_BUSY;
 	default:
 		break; /* goto drop; */
diff --git a/drivers/net/wireless/ath/wil6210/wil_platform.h b/drivers/net/wireless/ath/wil6210/wil_platform.h
index aca5d0d..986985c 100644
--- a/drivers/net/wireless/ath/wil6210/wil_platform.h
+++ b/drivers/net/wireless/ath/wil6210/wil_platform.h
@@ -64,6 +64,8 @@  struct wil_platform_config {
 	u8 ac_queues;
 	/* enable allocating tx queue(s) per station, default - no */
 	u8 q_per_sta;
+	/* drop Tx packets in case tx ring is full, default - no */
+	u8 drop_if_ring_full;
 };
 
 /**