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

Commit 121221f9 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: add module params for outstanding on wan"

parents 6ae779bd 7ab238c1
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@

#define IPA_SEND_MAX_DESC (20)

#define IPA_EOT_THRESH 32

static struct sk_buff *ipa3_get_skb_ipa_rx(unsigned int len, gfp_t flags);
static void ipa3_replenish_wlan_rx_cache(struct ipa3_sys_context *sys);
static void ipa3_replenish_rx_cache(struct ipa3_sys_context *sys);
@@ -236,18 +238,19 @@ static void ipa3_send_nop_desc(struct work_struct *work)
	}
	list_add_tail(&tx_pkt->link, &sys->head_desc_list);
	sys->nop_pending = false;
	spin_unlock_bh(&sys->spinlock);

	memset(&nop_xfer, 0, sizeof(nop_xfer));
	nop_xfer.type = GSI_XFER_ELEM_NOP;
	nop_xfer.flags = GSI_XFER_FLAG_EOT;
	nop_xfer.xfer_user_data = tx_pkt;
	if (gsi_queue_xfer(sys->ep->gsi_chan_hdl, 1, &nop_xfer, true)) {
		spin_unlock_bh(&sys->spinlock);
		IPAERR("gsi_queue_xfer for ch:%lu failed\n",
			sys->ep->gsi_chan_hdl);
		queue_work(sys->wq, &sys->work);
		return;
	}
	spin_unlock_bh(&sys->spinlock);

	/* make sure TAG process is sent before clocks are gated */
	ipa3_ctx->tag_process_before_gating = true;
@@ -406,11 +409,14 @@ int ipa3_send(struct ipa3_sys_context *sys,
		}

		if (i == (num_desc - 1)) {
			if (!sys->use_comm_evt_ring) {
			if (!sys->use_comm_evt_ring ||
			    (sys->pkt_sent % IPA_EOT_THRESH == 0)) {
				gsi_xfer[i].flags |=
					GSI_XFER_FLAG_EOT;
				gsi_xfer[i].flags |=
					GSI_XFER_FLAG_BEI;
			} else {
				send_nop = true;
			}
			gsi_xfer[i].xfer_user_data =
				tx_pkt_first;
@@ -429,11 +435,12 @@ int ipa3_send(struct ipa3_sys_context *sys,
		goto failure;
	}


	if (sys->use_comm_evt_ring && !sys->nop_pending) {
	if (send_nop && !sys->nop_pending)
		sys->nop_pending = true;
		send_nop = true;
	}
	else
		send_nop = false;

	sys->pkt_sent++;
	spin_unlock_bh(&sys->spinlock);

	/* set the timer for sending the NOP descriptor */
+1 −0
Original line number Diff line number Diff line
@@ -693,6 +693,7 @@ struct ipa3_sys_context {
	struct work_struct repl_work;
	void (*repl_hdlr)(struct ipa3_sys_context *sys);
	struct ipa3_repl_ctx repl;
	u32 pkt_sent;

	/* ordering is important - mutable fields go above */
	struct ipa3_ep_context *ep;
+21 −16
Original line number Diff line number Diff line
@@ -40,6 +40,22 @@

#include "ipa_trace.h"

#define OUTSTANDING_HIGH_DEFAULT 256
#define OUTSTANDING_HIGH_CTL_DEFAULT (OUTSTANDING_HIGH_DEFAULT + 32)
#define OUTSTANDING_LOW_DEFAULT 128

static unsigned int outstanding_high = OUTSTANDING_HIGH_DEFAULT;
module_param(outstanding_high, uint, 0644);
MODULE_PARM_DESC(outstanding_high, "Outstanding high");

static unsigned int outstanding_high_ctl = OUTSTANDING_HIGH_CTL_DEFAULT;
module_param(outstanding_high_ctl, uint, 0644);
MODULE_PARM_DESC(outstanding_high_ctl, "Outstanding high control");

static unsigned int outstanding_low = OUTSTANDING_LOW_DEFAULT;
module_param(outstanding_low, uint, 0644);
MODULE_PARM_DESC(outstanding_low, "Outstanding low");

#define WWAN_METADATA_SHFT 24
#define WWAN_METADATA_MASK 0xFF000000
#define WWAN_DATA_LEN 2000
@@ -48,9 +64,6 @@
#define TAILROOM            0 /* for padding by mux layer */
#define MAX_NUM_OF_MUX_CHANNEL  15 /* max mux channels */
#define UL_FILTER_RULE_HANDLE_START 69
#define DEFAULT_OUTSTANDING_HIGH 128
#define DEFAULT_OUTSTANDING_HIGH_CTL (DEFAULT_OUTSTANDING_HIGH+32)
#define DEFAULT_OUTSTANDING_LOW 64

#define IPA_WWAN_DEV_NAME "rmnet_ipa%d"
#define IPA_UPSTEAM_WLAN_IFACE_NAME "wlan0"
@@ -102,8 +115,6 @@ struct ipa3_rmnet_plat_drv_res {
 * @net: network interface struct implemented by this driver
 * @stats: iface statistics
 * @outstanding_pkts: number of packets sent to IPA without TX complete ACKed
 * @outstanding_high: number of outstanding packets allowed
 * @outstanding_low: number of outstanding packets which shall cause
 * @ch_id: channel id
 * @lock: spinlock for mutual exclusion
 * @device_status: holds device status
@@ -114,9 +125,6 @@ struct ipa3_wwan_private {
	struct net_device *net;
	struct net_device_stats stats;
	atomic_t outstanding_pkts;
	int outstanding_high_ctl;
	int outstanding_high;
	int outstanding_low;
	uint32_t ch_id;
	spinlock_t lock;
	struct completion resource_granted_completion;
@@ -1085,7 +1093,7 @@ static int ipa3_wwan_xmit(struct sk_buff *skb, struct net_device *dev)
	if (netif_queue_stopped(dev)) {
		if (qmap_check &&
			atomic_read(&wwan_ptr->outstanding_pkts) <
					wwan_ptr->outstanding_high_ctl) {
					outstanding_high_ctl) {
			pr_err("[%s]Queue stop, send ctrl pkts\n", dev->name);
			goto send;
		} else {
@@ -1096,11 +1104,11 @@ static int ipa3_wwan_xmit(struct sk_buff *skb, struct net_device *dev)

	/* checking High WM hit */
	if (atomic_read(&wwan_ptr->outstanding_pkts) >=
					wwan_ptr->outstanding_high) {
					outstanding_high) {
		if (!qmap_check) {
			IPAWANDBG_LOW("pending(%d)/(%d)- stop(%d)\n",
				atomic_read(&wwan_ptr->outstanding_pkts),
				wwan_ptr->outstanding_high,
				outstanding_high,
				netif_queue_stopped(dev));
			IPAWANDBG_LOW("qmap_chk(%d)\n", qmap_check);
			netif_stop_queue(dev);
@@ -1203,10 +1211,9 @@ static void apps_ipa_tx_complete_notify(void *priv,
	__netif_tx_lock_bh(netdev_get_tx_queue(dev, 0));
	if (!atomic_read(&rmnet_ipa3_ctx->is_ssr) &&
		netif_queue_stopped(wwan_ptr->net) &&
		atomic_read(&wwan_ptr->outstanding_pkts) <
					(wwan_ptr->outstanding_low)) {
		atomic_read(&wwan_ptr->outstanding_pkts) < outstanding_low) {
		IPAWANDBG_LOW("Outstanding low (%d) - waking up queue\n",
				wwan_ptr->outstanding_low);
				outstanding_low);
		netif_wake_queue(wwan_ptr->net);
	}

@@ -2375,8 +2382,6 @@ static int ipa3_wwan_probe(struct platform_device *pdev)
		sizeof(*(rmnet_ipa3_ctx->wwan_priv)));
	IPAWANDBG("wwan_ptr (private) = %pK", rmnet_ipa3_ctx->wwan_priv);
	rmnet_ipa3_ctx->wwan_priv->net = dev;
	rmnet_ipa3_ctx->wwan_priv->outstanding_high = DEFAULT_OUTSTANDING_HIGH;
	rmnet_ipa3_ctx->wwan_priv->outstanding_low = DEFAULT_OUTSTANDING_LOW;
	atomic_set(&rmnet_ipa3_ctx->wwan_priv->outstanding_pkts, 0);
	spin_lock_init(&rmnet_ipa3_ctx->wwan_priv->lock);
	init_completion(