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

Commit 736f89e8 authored by Vamsi Krishna's avatar Vamsi Krishna
Browse files

usb: gadget: u_ether: add tx multipler module param



Usually tx rates are higher than rx rates and it deserve higher
number of requests. For LTE category 6 data rates of 300Mbps (about
30 1.5KB packets per milli-sec), the current maximum of 40 usb
request may not be sufficient. At this rate and with interrupt
moderation of interconnect, data can be very bursty. Add module
parameter to configure number of tx usb requests that can changed
for different driver configurations.

Change-Id: I2a380274b62bbcfa46d1147ff463b461229431cd
Signed-off-by: default avatarVamsi Krishna <vskrishn@codeaurora.org>
parent 6e4cab8c
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -154,6 +154,18 @@ static unsigned qmult = 20;
module_param(qmult, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(qmult, "queue length multiplier at high/super speed");

/*
 * Usually downlink rates are higher than uplink rates and it
 * deserve higher number of requests. For CAT-6 data rates of
 * 300Mbps (~30 packets per milli-sec) 40 usb request may not
 * be sufficient. At this rate and with interrupt moderation
 * of interconnect, data can be very bursty. tx_qmult is the
 * additional multipler on qmult.
 */
static unsigned tx_qmult = 1;
module_param(tx_qmult, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(tx_qmult, "Additional queue length multiplier for tx");

/* for dual-speed hardware, use deeper queues at high/super speed */
static inline int qlen(struct usb_gadget *gadget)
{
@@ -510,7 +522,7 @@ static int alloc_requests(struct eth_dev *dev, struct gether *link, unsigned n)
	int	status;

	spin_lock(&dev->req_lock);
	status = prealloc(&dev->tx_reqs, link->in_ep, n,
	status = prealloc(&dev->tx_reqs, link->in_ep, n * tx_qmult,
				dev->gadget->sg_supported,
				dev->header_len);
	if (status < 0)