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

Commit 975095de authored by stalel's avatar stalel
Browse files

msm: rndis_ipa: flow control change



IPA driver processing of Tx-complete event is done
in a workqueue, that workqueue is responsible
for the bottom half processing of the Tx-complete interrupt.
In case this workqueue is blocked by some work, further
Tx-complete processing will be processed.
Tx-complete events are being transfer to the network
device interface, upon Tx-complete event it is possible
that the network stack Tx queue is started.
Using netif_wake_queue to start the queue causes Linux
network stack to start sending packets from the workqueue context,
doing so, blocks the workqueue, thus, no more Tx-complete events
can be received anymore.
netif_start_queue implementation make sure that the Network stack
won't start sending packets from the workqueue context.
Outstanding packets numbers were decreased in order
to allow IPA driver to free the memory of the Tx-complete buffers.

Change-Id: I16b493a7530afbe73d1b09988553e3a5aea777f7
Signed-off-by: default avatarstalel <tatias@codeaurora.org>
parent 47d53bf2
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@
#define IPV6_HDR_NAME "rndis_eth_ipv6"
#define IPA_TO_USB_CLIENT IPA_CLIENT_USB_CONS
#define INACTIVITY_MSEC_DELAY 1000
#define DEFAULT_OUTSTANDING_HIGH 64
#define DEFAULT_OUTSTANDING_LOW 32
#define DEFAULT_OUTSTANDING_HIGH 8
#define DEFAULT_OUTSTANDING_LOW 4
#define DEBUGFS_TEMP_BUF_SIZE 4
#define RNDIS_IPA_PKT_TYPE 0x00000001
#define RNDIS_IPA_DFLT_RT_HDL 0
@@ -828,8 +828,9 @@ static netdev_tx_t rndis_ipa_start_xmit(struct sk_buff *skb,

	net->trans_start = jiffies;

	RNDIS_IPA_DEBUG("packet Tx, len=%d, skb->protocol=%d\n",
		skb->len, skb->protocol);
	RNDIS_IPA_DEBUG("Tx, len=%d, skb->protocol=%d, outstanding=%d\n",
		skb->len, skb->protocol,
		atomic_read(&rndis_ipa_ctx->outstanding_pkts));

	if (unlikely(netif_queue_stopped(net))) {
		RNDIS_IPA_ERROR("interface queue is stopped\n");
@@ -914,8 +915,9 @@ static void rndis_ipa_tx_complete_notify(void *private,

	NULL_CHECK_NO_RETVAL(private);

	RNDIS_IPA_DEBUG("packet Tx-complete, len=%d, skb->protocol=%d",
		skb->len, skb->protocol);
	RNDIS_IPA_DEBUG("Tx-complete, len=%d, skb->prot=%d, outstanding=%d\n",
		skb->len, skb->protocol,
		atomic_read(&rndis_ipa_ctx->outstanding_pkts));

	if (unlikely((evt != IPA_WRITE_DONE))) {
		RNDIS_IPA_ERROR("unsupported event on TX call-back\n");
@@ -937,7 +939,7 @@ static void rndis_ipa_tx_complete_notify(void *private,
					(rndis_ipa_ctx->outstanding_low)) {
		RNDIS_IPA_DEBUG("outstanding low boundary reached (%d)",
				rndis_ipa_ctx->outstanding_low);
		netif_wake_queue(rndis_ipa_ctx->net);
		netif_start_queue(rndis_ipa_ctx->net);
		RNDIS_IPA_DEBUG("send queue was awaken");
	}

@@ -1045,7 +1047,7 @@ static void rndis_ipa_packet_receive_notify(void *private,
	struct rndis_ipa_dev *rndis_ipa_ctx = private;
	int result;

	RNDIS_IPA_DEBUG("packet Rx, len=%d",
	RNDIS_IPA_DEBUG("packet Rx, len=%d\n",
		skb->len);

	if (unlikely(rndis_ipa_ctx->rx_dump_enable))