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

Commit f5186172 authored by Talel Shenhar's avatar Talel Shenhar
Browse files

msm: rndis_ipa: set packet limit to 1 for downlink aggregation



This commit is for the cases were Hosts
requests small aggregation limit in downlink path.
Depends on how small the request is, the IPA core
aggregation byte limit can be set to 0.
Setting 0 as byte limit causes the IPA core to wait for
time limit or packet limit which causes great latency
and even impact throughput for device to host path.
This change make sure that the packet limits is used with
the value 1.

Change-Id: I530e3025d827cd0712a9daf91aaacae4981792d3
Signed-off-by: default avatarTalel Shenhar <tatias@codeaurora.org>
parent feb544b1
Loading
Loading
Loading
Loading
+26 −3
Original line number Diff line number Diff line
@@ -52,6 +52,9 @@
		(BAM_DMA_MAX_PKT_NUMBER*(sizeof(struct sps_iovec)))
#define TX_TIMEOUT (5 * HZ)
#define MIN_TX_ERROR_SLEEP_PERIOD 500
#define DEFAULT_AGGR_TIME_LIMIT 1
#define DEFAULT_AGGR_PKT_LIMIT 0


#define RNDIS_IPA_ERROR(fmt, args...) \
		pr_err(DRV_NAME "@%s@%d@ctx:%s: "\
@@ -369,8 +372,8 @@ static struct ipa_ep_cfg ipa_to_usb_ep_cfg = {
		.aggr_en = IPA_ENABLE_AGGR,
		.aggr = IPA_GENERIC,
		.aggr_byte_limit = 4,
		.aggr_time_limit = 1,
		.aggr_pkt_limit = 10,
		.aggr_time_limit = DEFAULT_AGGR_TIME_LIMIT,
		.aggr_pkt_limit = DEFAULT_AGGR_PKT_LIMIT
	},
	.deaggr = {
		.deaggr_hdr_len = 0,
@@ -1930,9 +1933,29 @@ static int rndis_ipa_ep_registers_cfg(u32 usb_to_ipa_hdl,
	}
	RNDIS_IPA_DEBUG("IPA<-USB end-point configured\n");

	ipa_to_usb_ep_cfg.aggr.aggr_pkt_limit = 0;
	ipa_to_usb_ep_cfg.aggr.aggr_byte_limit =
		(max_xfer_size_bytes_to_host - mtu)/1024;

	if (ipa_to_usb_ep_cfg.aggr.aggr_byte_limit == 0) {
		ipa_to_usb_ep_cfg.aggr.aggr_time_limit = 0;
		ipa_to_usb_ep_cfg.aggr.aggr_pkt_limit = 1;
	} else {
		ipa_to_usb_ep_cfg.aggr.aggr_time_limit =
			DEFAULT_AGGR_TIME_LIMIT;
		ipa_to_usb_ep_cfg.aggr.aggr_pkt_limit =
			DEFAULT_AGGR_PKT_LIMIT;
	}

	RNDIS_IPA_DEBUG("RNDIS aggregation param:"
			" en=%d"
			" byte_limit=%d"
			" time_limit=%d"
			" pkt_limit=%d\n",
			ipa_to_usb_ep_cfg.aggr.aggr_en,
			ipa_to_usb_ep_cfg.aggr.aggr_byte_limit,
			ipa_to_usb_ep_cfg.aggr.aggr_time_limit,
			ipa_to_usb_ep_cfg.aggr.aggr_pkt_limit);

	result = ipa_cfg_ep(ipa_to_usb_hdl, &ipa_to_usb_ep_cfg);
	if (result) {
		pr_err("failed to configure IPA to USB end-point\n");