aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorDedy Lansky <dlansky@codeaurora.org>2019-02-22 09:21:00 -0500
committerKalle Valo <kvalo@codeaurora.org>2019-02-28 04:24:19 -0500
commit0439a5e035f7180f7ed68ce2face1b7c77be0c6a (patch)
treee3d88ac816640b54eb661bc2ed96598b09cc565a /drivers/net/wireless/ath
parent387f3794b8cfbdfe6e627978ae4aec92b91b5fb8 (diff)
wil6210: add option to drop Tx packets when Tx ring is full
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 can be helpful to debug performance issues, to guarantee maximum utilization of net queues. New policy is disabled by default and can be enabled by debugfs: echo 1 > drop_if_ring_full Signed-off-by: Dedy Lansky <dlansky@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c3
-rw-r--r--drivers/net/wireless/ath/wil6210/txrx.c9
-rw-r--r--drivers/net/wireless/ath/wil6210/wil6210.h3
3 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 835c902b84c1..acbf2f0c440e 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc. 2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3 * Copyright (c) 2018, The Linux Foundation. All rights reserved. 3 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
4 * 4 *
5 * Permission to use, copy, modify, and/or distribute this software for any 5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above 6 * purpose with or without fee is hereby granted, provided that the above
@@ -2386,6 +2386,7 @@ static const struct dbg_off dbg_statics[] = {
2386 {"led_polarity", 0644, (ulong)&led_polarity, doff_u8}, 2386 {"led_polarity", 0644, (ulong)&led_polarity, doff_u8},
2387 {"status_index", 0644, (ulong)&dbg_status_msg_index, doff_u32}, 2387 {"status_index", 0644, (ulong)&dbg_status_msg_index, doff_u32},
2388 {"sring_index", 0644, (ulong)&dbg_sring_index, doff_u32}, 2388 {"sring_index", 0644, (ulong)&dbg_sring_index, doff_u32},
2389 {"drop_if_ring_full", 0644, (ulong)&drop_if_ring_full, doff_u8},
2389 {}, 2390 {},
2390}; 2391};
2391 2392
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index 4d286fbaa7b7..de259dc7404b 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -38,6 +38,9 @@ bool rx_large_buf;
38module_param(rx_large_buf, bool, 0444); 38module_param(rx_large_buf, bool, 0444);
39MODULE_PARM_DESC(rx_large_buf, " allocate 8KB RX buffers, default - no"); 39MODULE_PARM_DESC(rx_large_buf, " allocate 8KB RX buffers, default - no");
40 40
41/* Drop Tx packets in case Tx ring is full */
42bool drop_if_ring_full;
43
41static inline uint wil_rx_snaplen(void) 44static inline uint wil_rx_snaplen(void)
42{ 45{
43 return rx_align_2 ? 6 : 0; 46 return rx_align_2 ? 6 : 0;
@@ -1974,6 +1977,10 @@ static inline void __wil_update_net_queues(struct wil6210_priv *wil,
1974 wil_dbg_txrx(wil, "check_stop=%d, mid=%d, stopped=%d", 1977 wil_dbg_txrx(wil, "check_stop=%d, mid=%d, stopped=%d",
1975 check_stop, vif->mid, vif->net_queue_stopped); 1978 check_stop, vif->mid, vif->net_queue_stopped);
1976 1979
1980 if (ring && drop_if_ring_full)
1981 /* no need to stop/wake net queues */
1982 return;
1983
1977 if (check_stop == vif->net_queue_stopped) 1984 if (check_stop == vif->net_queue_stopped)
1978 /* net queues already in desired state */ 1985 /* net queues already in desired state */
1979 return; 1986 return;
@@ -2099,6 +2106,8 @@ netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev)
2099 dev_kfree_skb_any(skb); 2106 dev_kfree_skb_any(skb);
2100 return NETDEV_TX_OK; 2107 return NETDEV_TX_OK;
2101 case -ENOMEM: 2108 case -ENOMEM:
2109 if (drop_if_ring_full)
2110 goto drop;
2102 return NETDEV_TX_BUSY; 2111 return NETDEV_TX_BUSY;
2103 default: 2112 default:
2104 break; /* goto drop; */ 2113 break; /* goto drop; */
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index 0f3be3ffc6a2..ba833ac925c3 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc. 2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3 * Copyright (c) 2018, The Linux Foundation. All rights reserved. 3 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
4 * 4 *
5 * Permission to use, copy, modify, and/or distribute this software for any 5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above 6 * purpose with or without fee is hereby granted, provided that the above
@@ -38,6 +38,7 @@ extern bool rx_large_buf;
38extern bool debug_fw; 38extern bool debug_fw;
39extern bool disable_ap_sme; 39extern bool disable_ap_sme;
40extern bool ftm_mode; 40extern bool ftm_mode;
41extern bool drop_if_ring_full;
41 42
42struct wil6210_priv; 43struct wil6210_priv;
43struct wil6210_vif; 44struct wil6210_vif;