Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0645469a authored by Dedy Lansky's avatar Dedy Lansky Committed by Maya Erez
Browse files

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: default avatarDedy Lansky <dlansky@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Git-commit: 0439a5e035f7180f7ed68ce2face1b7c77be0c6a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git


[merez@codeaurora.org: SPDX license conflict]
Change-Id: I115cb0e406c45766050aff4a4ab847a1378a7e69
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent 45849db3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2551,6 +2551,7 @@ static const struct dbg_off dbg_statics[] = {
	{"led_polarity", 0644, (ulong)&led_polarity, doff_u8},
	{"status_index", 0644, (ulong)&dbg_status_msg_index, doff_u32},
	{"sring_index",	0644, (ulong)&dbg_sring_index, doff_u32},
	{"drop_if_ring_full", 0644, (ulong)&drop_if_ring_full, doff_u8},
	{},
};

+9 −0
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@ module_param_cb(headroom_size, &headroom_ops, &headroom_size, 0644);
MODULE_PARM_DESC(headroom_size,
		 " headroom size for rx skb allocation, default - 0");

/* Drop Tx packets in case Tx ring is full */
bool drop_if_ring_full;

static inline uint wil_rx_snaplen(void)
{
	return rx_align_2 ? 6 : 0;
@@ -1989,6 +1992,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 && drop_if_ring_full)
		/* no need to stop/wake net queues */
		return;

	if (check_stop == vif->net_queue_stopped)
		/* net queues already in desired state */
		return;
@@ -2114,6 +2121,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 (drop_if_ring_full)
			goto drop;
		return NETDEV_TX_BUSY;
	default:
		break; /* goto drop; */
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ extern bool debug_fw;
extern bool disable_ap_sme;
extern bool ftm_mode;
extern ushort headroom_size;
extern bool drop_if_ring_full;

struct wil6210_priv;
struct wil6210_vif;