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

Commit 3114b049 authored by Akshay Pandit's avatar Akshay Pandit Committed by Gerrit - the friendly Code Review server
Browse files

msm: veth_ipa: Throughput improvements



Added flow control checks. Used net_if_receive_skb for submitting
packets to network stack.

Change-Id: Icb45d90772ef06186d94a726de5d4813853a95e7
Acked-by: default avatarKaushik P E <kpe@codeaurora.org>
Signed-off-by: default avatarAkshay Pandit <pandit@codeaurora.org>
parent fe26c474
Loading
Loading
Loading
Loading
+24 −25
Original line number Diff line number Diff line
@@ -1772,38 +1772,29 @@ static netdev_tx_t veth_ipa_start_xmit

	if (unlikely(netif_queue_stopped(net))) {
		VETH_IPA_ERROR("interface queue is stopped\n");
		goto out;
		status = NETDEV_TX_BUSY;
		goto fail_tx_packet;
	}

	if (unlikely(veth_ipa_ctx->state != VETH_IPA_CONNECTED_AND_UP))
		return NETDEV_TX_BUSY;

#ifdef VETH_PM_ENB
	ret = resource_request(veth_ipa_ctx);

	if (ret) {
		VETH_IPA_DEBUG("Waiting to resource\n");
	if (atomic_read(&veth_ipa_ctx->outstanding_pkts) >=
			veth_ipa_ctx->outstanding_high) {
		VETH_IPA_DEBUG("outstanding high (%d)- stopping\n",
			veth_ipa_ctx->outstanding_high);
		netif_stop_queue(net);
		goto resource_busy;
		status = NETDEV_TX_BUSY;
		goto fail_tx_packet;
	}

/*
 *	if (atomic_read(&veth_ipa_ctx->outstanding_pkts) >=
 *		veth_ipa_ctx->outstanding_high) {
 *		VETH_IPA_DEBUG("outstanding high (%d)- stopping\n",
 *		veth_ipa_ctx->outstanding_high);
 *		netif_stop_queue(net);
 *		status = NETDEV_TX_BUSY;
 *		goto out;
 *       }
 */
	if (veth_ipa_ctx->is_vlan_mode)
		if (unlikely(skb->protocol != htons(ETH_P_8021Q)))
			VETH_IPA_DEBUG(
				"ether_type != ETH_P_8021Q && vlan, prot = 0x%X\n",
				skb->protocol);

#endif


	ret = ipa_tx_dp(IPA_CLIENT_ETHERNET_CONS, skb, NULL);

@@ -1818,9 +1809,8 @@ static netdev_tx_t veth_ipa_start_xmit
	goto out;

fail_tx_packet:
	return status;
out:

	status = NETDEV_TX_OK;
	return status;

}
@@ -1860,13 +1850,22 @@ static void veth_ipa_packet_receive_notify
		return;
	}

	if (evt != IPA_RECEIVE) {
		VETH_IPA_ERROR(
			"%s: A none IPA_RECEIVE event in VETH_ipa_receive\n",
			__func__);
	if (evt == IPA_WRITE_DONE) {
		atomic_dec(&veth_ipa_ctx->outstanding_pkts);
		if
		(netif_queue_stopped(veth_ipa_ctx->net) &&
			netif_carrier_ok(veth_ipa_ctx->net) &&
			atomic_read(&veth_ipa_ctx->outstanding_pkts) <
					(veth_ipa_ctx->outstanding_low)) {
			netif_wake_queue(veth_ipa_ctx->net);
		}
		kfree_skb(skb);
		return;
	}
	if (evt != IPA_WRITE_DONE && evt != IPA_RECEIVE) {
		VETH_IPA_ERROR("Non TX_complete or Receive Event");
		return;
	}

	skb->dev = veth_ipa_ctx->net;
	skb->protocol = eth_type_trans(skb, veth_ipa_ctx->net);