msm: ipa: allow dtsi based lan rx ring size

Add support for specifying the size of LAN RX buffer pool.
Once this specified in dtsi, it will override the default value.

Change-Id: I60ff9ecf7e27aa9cd20dbc693e2ac392c401dfb9
CRs-Fixed: 1050748
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
This commit is contained in:
Skylar Chang 2016-08-16 16:54:26 -07:00
parent c5984ec85c
commit 55d1eb491e
7 changed files with 38 additions and 7 deletions

View file

@ -24,7 +24,8 @@ IPA node:
Optional:
- qcom,wan-rx-ring-size: size of WAN rx ring, default is 32
- qcom,wan-rx-ring-size: size of WAN rx ring, default is 1000
- qcom,lan-rx-ring-size: size of LAN rx ring, default is 1000
- qcom,arm-smmu: SMMU is present and ARM SMMU driver is used
- qcom,msm-smmu: SMMU is present and QSMMU driver is used
- qcom,smmu-s1-bypass: Boolean context flag to set SMMU to S1 bypass

View file

@ -3613,6 +3613,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,
ipa_ctx->ipa_bam_remote_mode = resource_p->ipa_bam_remote_mode;
ipa_ctx->modem_cfg_emb_pipe_flt = resource_p->modem_cfg_emb_pipe_flt;
ipa_ctx->wan_rx_ring_size = resource_p->wan_rx_ring_size;
ipa_ctx->lan_rx_ring_size = resource_p->lan_rx_ring_size;
ipa_ctx->skip_uc_pipe_reset = resource_p->skip_uc_pipe_reset;
ipa_ctx->use_dma_zone = resource_p->use_dma_zone;
ipa_ctx->tethered_flow_control = resource_p->tethered_flow_control;
@ -4150,6 +4151,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
ipa_drv_res->ipa_bam_remote_mode = false;
ipa_drv_res->modem_cfg_emb_pipe_flt = false;
ipa_drv_res->wan_rx_ring_size = IPA_GENERIC_RX_POOL_SZ;
ipa_drv_res->lan_rx_ring_size = IPA_GENERIC_RX_POOL_SZ;
smmu_info.disable_htw = of_property_read_bool(pdev->dev.of_node,
"qcom,smmu-disable-htw");
@ -4172,16 +4174,27 @@ 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 */
/* Get IPA WAN / LAN RX pool sizes */
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");
IPADBG("using default for wan-rx-ring-size = %u\n",
ipa_drv_res->wan_rx_ring_size);
else
IPADBG(": found ipa_drv_res->wan-rx-ring-size = %u",
ipa_drv_res->wan_rx_ring_size);
result = of_property_read_u32(pdev->dev.of_node,
"qcom,lan-rx-ring-size",
&ipa_drv_res->lan_rx_ring_size);
if (result)
IPADBG("using default for lan-rx-ring-size = %u\n",
ipa_drv_res->lan_rx_ring_size);
else
IPADBG(": found ipa_drv_res->lan-rx-ring-size = %u",
ipa_drv_res->lan_rx_ring_size);
ipa_drv_res->use_ipa_teth_bridge =
of_property_read_bool(pdev->dev.of_node,
"qcom,use-ipa-tethering-bridge");

View file

@ -3142,7 +3142,7 @@ static int ipa_assign_policy_v2(struct ipa_sys_connect_params *in,
ipa_replenish_rx_cache;
}
sys->rx_pool_sz =
IPA_GENERIC_RX_POOL_SZ;
ipa_ctx->lan_rx_ring_size;
in->ipa_ep_cfg.aggr.aggr_byte_limit =
IPA_GENERIC_AGGR_BYTE_LIMIT;
in->ipa_ep_cfg.aggr.aggr_pkt_limit =

View file

@ -1102,6 +1102,7 @@ struct ipa_context {
struct ipa_uc_wdi_ctx uc_wdi_ctx;
struct ipa_uc_ntn_ctx uc_ntn_ctx;
u32 wan_rx_ring_size;
u32 lan_rx_ring_size;
bool skip_uc_pipe_reset;
bool smmu_present;
bool smmu_s1_bypass;
@ -1171,6 +1172,7 @@ struct ipa_plat_drv_res {
bool ipa_bam_remote_mode;
bool modem_cfg_emb_pipe_flt;
u32 wan_rx_ring_size;
u32 lan_rx_ring_size;
bool skip_uc_pipe_reset;
bool use_dma_zone;
bool tethered_flow_control;

View file

@ -3953,6 +3953,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
ipa3_ctx->ipa_wdi2 = resource_p->ipa_wdi2;
ipa3_ctx->use_64_bit_dma_mask = resource_p->use_64_bit_dma_mask;
ipa3_ctx->wan_rx_ring_size = resource_p->wan_rx_ring_size;
ipa3_ctx->lan_rx_ring_size = resource_p->lan_rx_ring_size;
ipa3_ctx->skip_uc_pipe_reset = resource_p->skip_uc_pipe_reset;
ipa3_ctx->tethered_flow_control = resource_p->tethered_flow_control;
ipa3_ctx->transport_prototype = resource_p->transport_prototype;
@ -4432,6 +4433,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
ipa_drv_res->ipa_wdi2 = false;
ipa_drv_res->use_64_bit_dma_mask = false;
ipa_drv_res->wan_rx_ring_size = IPA_GENERIC_RX_POOL_SZ;
ipa_drv_res->lan_rx_ring_size = IPA_GENERIC_RX_POOL_SZ;
ipa_drv_res->apply_rg10_wa = false;
ipa_drv_res->gsi_ch20_wa = false;
@ -4461,16 +4463,27 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
IPADBG(": found ipa_drv_res->ipa3_hw_mode = %d",
ipa_drv_res->ipa3_hw_mode);
/* Get IPA WAN RX pool size */
/* Get IPA WAN / LAN RX pool size */
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");
IPADBG("using default for wan-rx-ring-size = %u\n",
ipa_drv_res->wan_rx_ring_size);
else
IPADBG(": found ipa_drv_res->wan-rx-ring-size = %u",
ipa_drv_res->wan_rx_ring_size);
result = of_property_read_u32(pdev->dev.of_node,
"qcom,lan-rx-ring-size",
&ipa_drv_res->lan_rx_ring_size);
if (result)
IPADBG("using default for lan-rx-ring-size = %u\n",
ipa_drv_res->lan_rx_ring_size);
else
IPADBG(": found ipa_drv_res->lan-rx-ring-size = %u",
ipa_drv_res->lan_rx_ring_size);
ipa_drv_res->use_ipa_teth_bridge =
of_property_read_bool(pdev->dev.of_node,
"qcom,use-ipa-tethering-bridge");

View file

@ -3171,7 +3171,7 @@ static int ipa3_assign_policy(struct ipa_sys_connect_params *in,
sys->free_rx_wrapper =
ipa3_recycle_rx_wrapper;
sys->rx_pool_sz =
IPA_GENERIC_RX_POOL_SZ;
ipa3_ctx->lan_rx_ring_size;
in->ipa_ep_cfg.aggr.aggr_byte_limit =
IPA_GENERIC_AGGR_BYTE_LIMIT;
in->ipa_ep_cfg.aggr.aggr_pkt_limit =

View file

@ -1202,6 +1202,7 @@ struct ipa3_context {
struct ipa3_uc_wdi_ctx uc_wdi_ctx;
struct ipa3_uc_ntn_ctx uc_ntn_ctx;
u32 wan_rx_ring_size;
u32 lan_rx_ring_size;
bool skip_uc_pipe_reset;
enum ipa_transport_type transport_prototype;
unsigned long gsi_dev_hdl;
@ -1259,6 +1260,7 @@ struct ipa3_plat_drv_res {
bool ipa_wdi2;
bool use_64_bit_dma_mask;
u32 wan_rx_ring_size;
u32 lan_rx_ring_size;
bool skip_uc_pipe_reset;
enum ipa_transport_type transport_prototype;
bool apply_rg10_wa;