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

Commit 226cf034 authored by Sunil Paidimarri's avatar Sunil Paidimarri
Browse files

msm: ipa: Add support to configure WAN RX desc size



Embedded tputs depend on WAN RX desc size, but, every target
has its own limitations of memory and embedded tputs goals.
So, add parameter to configure WAN RX desc size through device tree.

Change-Id: I28c550058dd990c9c8cd368a2677097c7f057ccd
CRs-Fixed: 1081543
Signed-off-by: default avatarSunil Paidimarri <hisunil@codeaurora.org>
parent 79d42bd7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -10,9 +10,13 @@ Optional:
- qcom,ipa-loaduC: indicate that ipa uC should be loaded
- qcom,ipa-advertise-sg-support: determine how to respond to a query
regarding scatter-gather capability
- qcom,ipa-napi-enable: Boolean context flag to indicate whether
                        to enable napi framework or not
- qcom,wan-rx-desc-size: size of WAN rx desc fifo ring, default is 256

Example:
	qcom,rmnet-ipa {
		compatible = "qcom,rmnet-ipa";
		qcom,wan-rx-desc-size = <256>;
	}
+4 −0
Original line number Diff line number Diff line
@@ -10,9 +10,13 @@ Optional:
- qcom,ipa-loaduC: indicate that ipa uC should be loaded
- qcom,ipa-advertise-sg-support: determine how to respond to a query
regarding scatter-gather capability
- qcom,ipa-napi-enable: Boolean context flag to indicate whether
                        to enable napi framework or not
- qcom,wan-rx-desc-size: size of WAN rx desc fifo ring, default is 256

Example:
	qcom,rmnet-ipa3 {
		compatible = "qcom,rmnet-ipa3";
		qcom,wan-rx-desc-size = <256>;
	}
+8 −10
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "ipa_i.h"
#include "ipa_trace.h"

#define IPA_WAN_AGGR_PKT_CNT 5
#define IPA_LAST_DESC_CNT 0xFFFF
#define POLLING_INACTIVITY_RX 40
#define POLLING_INACTIVITY_TX 40
@@ -1099,16 +1100,18 @@ int ipa2_rx_poll(u32 clnt_hdl, int weight)
			break;

		ipa_wq_rx_common(ep->sys, iov.size);
		cnt += 5;
		cnt += IPA_WAN_AGGR_PKT_CNT;
	};

	if (cnt == 0) {
	if (cnt == 0 || cnt < weight) {
		ep->inactive_cycles++;
		ep->client_notify(ep->priv, IPA_CLIENT_COMP_NAPI, 0);

		if (ep->inactive_cycles > 3 || ep->sys->len == 0) {
			ep->switch_to_intr = true;
			delay = 0;
		} else if (cnt < weight) {
			delay = 0;
		}
		queue_delayed_work(ep->sys->wq,
			&ep->sys->switch_to_intr_work, msecs_to_jiffies(delay));
@@ -3176,14 +3179,9 @@ static int ipa_assign_policy_v2(struct ipa_sys_connect_params *in,
				sys->repl_hdlr =
				   ipa_replenish_rx_cache;
			}
			if (in->napi_enabled) {
				sys->rx_pool_sz =
					   IPA_WAN_NAPI_CONS_RX_POOL_SZ;
				if (in->recycle_enabled) {
			if (in->napi_enabled && in->recycle_enabled)
				sys->repl_hdlr =
					ipa_replenish_rx_cache_recycle;
				}
			}
			sys->ep->wakelock_client =
			   IPA_WAKELOCK_REF_CLIENT_WAN_RX;
			in->ipa_ep_cfg.aggr.aggr_sw_eof_active
+0 −2
Original line number Diff line number Diff line
@@ -51,8 +51,6 @@
#define IPA_UC_FINISH_MAX 6
#define IPA_UC_WAIT_MIN_SLEEP 1000
#define IPA_UC_WAII_MAX_SLEEP 1200
#define IPA_WAN_NAPI_CONS_RX_POOL_SZ (IPA_GENERIC_RX_POOL_SZ*3)
#define IPA_WAN_CONS_DESC_FIFO_SZ (IPA_SYS_DESC_FIFO_SZ*3)

#define IPA_MAX_STATUS_STAT_NUM 30

+19 −4
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@
#define IPA_UEVENT_NUM_EVNP 4 /* number of event pointers */

#define NAPI_WEIGHT 60
#define IPA_WWAN_CONS_DESC_FIFO_SZ 1024

static struct net_device *ipa_netdevs[IPA_WWAN_DEVICE_COUNT];
static struct ipa_sys_connect_params apps_to_ipa_ep_cfg, ipa_to_apps_ep_cfg;
@@ -102,6 +103,7 @@ struct ipa_rmnet_plat_drv_res {
	bool ipa_loaduC;
	bool ipa_advertise_sg_support;
	bool ipa_napi_enable;
	u32 wan_rx_desc_size;
};

static struct ipa_rmnet_plat_drv_res ipa_rmnet_res;
@@ -1310,10 +1312,8 @@ static int handle_ingress_format(struct net_device *dev,
	ipa_to_apps_ep_cfg.priv = dev;

	ipa_to_apps_ep_cfg.napi_enabled = ipa_rmnet_res.ipa_napi_enable;
	if (ipa_to_apps_ep_cfg.napi_enabled)
		ipa_to_apps_ep_cfg.desc_fifo_sz = IPA_WAN_CONS_DESC_FIFO_SZ;
	else
		ipa_to_apps_ep_cfg.desc_fifo_sz = IPA_SYS_DESC_FIFO_SZ;
	ipa_to_apps_ep_cfg.desc_fifo_sz =
		ipa_rmnet_res.wan_rx_desc_size * sizeof(struct sps_iovec);

	mutex_lock(&ipa_to_apps_pipe_handle_guard);
	if (atomic_read(&is_ssr)) {
@@ -1944,6 +1944,9 @@ static struct notifier_block ssr_notifier = {
static int get_ipa_rmnet_dts_configuration(struct platform_device *pdev,
		struct ipa_rmnet_plat_drv_res *ipa_rmnet_drv_res)
{
	int result;

	ipa_rmnet_drv_res->wan_rx_desc_size = IPA_WWAN_CONS_DESC_FIFO_SZ;
	ipa_rmnet_drv_res->ipa_rmnet_ssr =
			of_property_read_bool(pdev->dev.of_node,
			"qcom,rmnet-ipa-ssr");
@@ -1966,6 +1969,18 @@ static int get_ipa_rmnet_dts_configuration(struct platform_device *pdev,
			"qcom,ipa-napi-enable");
	pr_info("IPA Napi Enable = %s\n",
		ipa_rmnet_drv_res->ipa_napi_enable ? "True" : "False");

	/* Get IPA WAN RX desc fifo size */
	result = of_property_read_u32(pdev->dev.of_node,
			"qcom,wan-rx-desc-size",
			&ipa_rmnet_drv_res->wan_rx_desc_size);
	if (result)
		pr_info("using default for wan-rx-desc-size = %u\n",
				ipa_rmnet_drv_res->wan_rx_desc_size);
	else
		IPAWANDBG(": found ipa_drv_res->wan-rx-desc-size = %u\n",
				ipa_rmnet_drv_res->wan_rx_desc_size);

	return 0;
}

Loading