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

Commit 1bd6ce94 authored by Ravi Gummadidala's avatar Ravi Gummadidala
Browse files

msm: ipa: add support to configure WAN_RX pool size



This parameter is target specific and should be configured
through device tree. This commit adds that support.

Change-Id: Ib6e6a64b7fd3ce0c544b7b4cb225ccb593877666
Signed-off-by: default avatarRavi Gummadidala <rgummadi@codeaurora.org>
parent db644c69
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ IPA node:

Optional:

- qcom,wan-rx-ring-size: size of WAN rx ring, default is 32
- qcom,use-a2-service: determine if A2 service will be used
- qcom,use-ipa-tethering-bridge: determine if tethering bridge will be used
- qcom,use-ipa-bamdma-a2-bridge: determine if a2/ipa hw bridge will be used
+12 −0
Original line number Diff line number Diff line
@@ -2961,6 +2961,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,
	ipa_ctx->ipa_hw_mode = resource_p->ipa_hw_mode;
	ipa_ctx->use_ipa_teth_bridge = resource_p->use_ipa_teth_bridge;
	ipa_ctx->ipa_bam_remote_mode = resource_p->ipa_bam_remote_mode;
	ipa_ctx->wan_rx_ring_size = resource_p->wan_rx_ring_size;

	/* default aggregation parameters */
	ipa_ctx->aggregation_type = IPA_MBIM_16;
@@ -3458,6 +3459,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
	ipa_drv_res->ipa_hw_type = 0;
	ipa_drv_res->ipa_hw_mode = 0;
	ipa_drv_res->ipa_bam_remote_mode = false;
	ipa_drv_res->wan_rx_ring_size = IPA_GENERIC_RX_POOL_SZ;

	/* Get IPA HW Version */
	result = of_property_read_u32(pdev->dev.of_node, "qcom,ipa-hw-ver",
@@ -3477,6 +3479,16 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
		IPADBG(": found ipa_drv_res->ipa_hw_mode = %d",
				ipa_drv_res->ipa_hw_mode);

	/* Get IPA WAN RX pool sizee */
	result = of_property_read_u32(pdev->dev.of_node,
			"qcom,wan-rx-ring-size",
			&ipa_drv_res->wan_rx_ring_size);
	if (result)
		IPADBG("using default for wan-rx-ring-size\n");
	else
		IPADBG(": found ipa_drv_res->wan-rx-ring-size = %u",
				ipa_drv_res->wan_rx_ring_size);

	ipa_drv_res->use_ipa_teth_bridge =
			of_property_read_bool(pdev->dev.of_node,
			"qcom,use-ipa-tethering-bridge");
+4 −2
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@
#define IPA_GENERIC_AGGR_BYTE_LIMIT 6
#define IPA_GENERIC_AGGR_TIME_LIMIT 1
#define IPA_GENERIC_AGGR_PKT_LIMIT 0
#define IPA_GENERIC_RX_POOL_SZ 32

#define IPA_GENERIC_RX_BUFF_BASE_SZ 8192
#define IPA_REAL_GENERIC_RX_BUFF_SZ (SKB_DATA_ALIGN(\
@@ -2494,7 +2493,6 @@ static int ipa_assign_policy(struct ipa_sys_connect_params *in,
				INIT_WORK(&sys->repl_work, ipa_wq_repl_rx);
				atomic_set(&sys->curr_polling_state, 0);
				sys->rx_buff_sz = IPA_GENERIC_RX_BUFF_SZ;
				sys->rx_pool_sz = IPA_GENERIC_RX_POOL_SZ;
				sys->get_skb = ipa_get_skb_ipa_rx;
				sys->free_skb = ipa_free_skb_rx;
				in->ipa_ep_cfg.aggr.aggr_en = IPA_ENABLE_AGGR;
@@ -2507,9 +2505,13 @@ static int ipa_assign_policy(struct ipa_sys_connect_params *in,
					IPA_GENERIC_AGGR_PKT_LIMIT;
				if (in->client == IPA_CLIENT_APPS_LAN_CONS) {
					sys->pyld_hdlr = ipa_lan_rx_pyld_hdlr;
					sys->rx_pool_sz =
						IPA_GENERIC_RX_POOL_SZ;
				} else if (in->client ==
						IPA_CLIENT_APPS_WAN_CONS) {
					sys->pyld_hdlr = ipa_wan_rx_pyld_hdlr;
					sys->rx_pool_sz =
						ipa_ctx->wan_rx_ring_size;
				}
				if (nr_cpu_ids > 1)
					sys->repl_hdlr =
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#define IPA_QMAP_HEADER_LENGTH (4)
#define IPA_DL_CHECKSUM_LENGTH (8)
#define IPA_NUM_DESC_PER_SW_TX (2)
#define IPA_GENERIC_RX_POOL_SZ 32

#define IPADBG(fmt, args...) \
	pr_debug(DRV_NAME " %s:%d " fmt, __func__, __LINE__, ## args)
@@ -1186,6 +1187,7 @@ struct ipa_context {
	struct ipa_uc_ctx uc_ctx;

	struct ipa_uc_wdi_ctx uc_wdi_ctx;
	u32 wan_rx_ring_size;
};

/**
@@ -1232,6 +1234,7 @@ struct ipa_plat_drv_res {
	enum ipa_hw_mode ipa_hw_mode;
	u32 ee;
	bool ipa_bam_remote_mode;
	u32 wan_rx_ring_size;
};

struct ipa_mem_partition {