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

Commit 28ec0fbd authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: stay in NAPI mode when default pipe has low credits"

parents 2cc0c10a 76a3eb92
Loading
Loading
Loading
Loading
+13 −3
Original line number Original line Diff line number Diff line
@@ -5009,10 +5009,12 @@ int ipa3_lan_rx_poll(u32 clnt_hdl, int weight)
int ipa3_rx_poll(u32 clnt_hdl, int weight)
int ipa3_rx_poll(u32 clnt_hdl, int weight)
{
{
	struct ipa3_ep_context *ep;
	struct ipa3_ep_context *ep;
	struct ipa3_sys_context *wan_def_sys;
	int ret;
	int ret;
	int cnt = 0;
	int cnt = 0;
	int num = 0;
	int num = 0;
	int remain_aggr_weight;
	int remain_aggr_weight;
	int ipa_ep_idx;
	struct ipa_active_client_logging_info log;
	struct ipa_active_client_logging_info log;
	struct gsi_chan_xfer_notify notify[IPA_WAN_NAPI_MAX_FRAMES];
	struct gsi_chan_xfer_notify notify[IPA_WAN_NAPI_MAX_FRAMES];


@@ -5024,6 +5026,13 @@ int ipa3_rx_poll(u32 clnt_hdl, int weight)
		return cnt;
		return cnt;
	}
	}


	ipa_ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS);
	if (ipa_ep_idx == IPA_EP_NOT_ALLOCATED) {
		IPAERR("Invalid client.\n");
		return cnt;
	}

	wan_def_sys = ipa3_ctx->ep[ipa_ep_idx].sys;
	remain_aggr_weight = weight / IPA_WAN_AGGR_PKT_CNT;
	remain_aggr_weight = weight / IPA_WAN_AGGR_PKT_CNT;


	if (remain_aggr_weight > IPA_WAN_NAPI_MAX_FRAMES) {
	if (remain_aggr_weight > IPA_WAN_NAPI_MAX_FRAMES) {
@@ -5063,10 +5072,11 @@ int ipa3_rx_poll(u32 clnt_hdl, int weight)
	/* call repl_hdlr before napi_reschedule / napi_complete */
	/* call repl_hdlr before napi_reschedule / napi_complete */
	ep->sys->repl_hdlr(ep->sys);
	ep->sys->repl_hdlr(ep->sys);


	/* When not able to replenish enough descriptors pipe wait
	/* When not able to replenish enough descriptors, keep in polling
	 * until minimum number descripotrs to replish.
	 * mode, wait for napi-poll and replenish again.
	 */
	 */
	if (cnt < weight && ep->sys->len > IPA_DEFAULT_SYS_YELLOW_WM) {
	if (cnt < weight && ep->sys->len > IPA_DEFAULT_SYS_YELLOW_WM &&
		wan_def_sys->len > IPA_DEFAULT_SYS_YELLOW_WM) {
		napi_complete(ep->sys->napi_obj);
		napi_complete(ep->sys->napi_obj);
		IPA_STATS_INC_CNT(ep->sys->napi_comp_cnt);
		IPA_STATS_INC_CNT(ep->sys->napi_comp_cnt);
		ret = ipa3_rx_switch_to_intr_mode(ep->sys);
		ret = ipa3_rx_switch_to_intr_mode(ep->sys);