android_kernel_samsung_sm8650/include/linux/usb
Jim Baxter e1069bbfcf net: cdc_ncm: Reduce memory use when kernel memory low
The CDC-NCM driver can require large amounts of memory to create
skb's and this can be a problem when the memory becomes fragmented.

This especially affects embedded systems that have constrained
resources but wish to maximise the throughput of CDC-NCM with 16KiB
NTB's.

The issue is after running for a while the kernel memory can become
fragmented and it needs compacting.
If the NTB allocation is needed before the memory has been compacted
the atomic allocation can fail which can cause increased latency,
large re-transmissions or disconnections depending upon the data
being transmitted at the time.
This situation occurs for less than a second until the kernel has
compacted the memory but the failed devices can take a lot longer to
recover from the failed TX packets.

To ease this temporary situation I modified the CDC-NCM TX path to
temporarily switch into a reduced memory mode which allocates an NTB
that will fit into a USB_CDC_NCM_NTB_MIN_OUT_SIZE (default 2048 Bytes)
sized memory block and only transmit NTB's with a single network frame
until the memory situation is resolved.
Each time this issue occurs we wait for an increasing number of
reduced size allocations before requesting a full size one to not
put additional pressure on a low memory system.

Once the memory is compacted the CDC-NCM data can resume transmitting
at the normal tx_max rate once again.

Signed-off-by: Jim Baxter <jim_baxter@mentor.com>
Reviewed-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-07-03 01:50:49 -07:00
..
association.h
atmel_usba_udc.h
audio-v2.h
audio.h
c67x00.h
cdc_ncm.h net: cdc_ncm: Reduce memory use when kernel memory low 2017-07-03 01:50:49 -07:00
cdc-wdm.h
cdc.h
ch9.h
chipidea.h usb: chipidea: msm: Handle phy power states 2017-01-20 15:27:35 +08:00
composite.h usb: composite.h: fix two warnings when building docs 2017-04-11 14:41:01 -06:00
ehci_def.h
ehci_pdriver.h
ehci-dbgp.h
ezusb.h
functionfs.h
g_hid.h
gadget_configfs.h
gadget.h usb: gadget.h: be consistent at kernel doc macros 2017-04-11 14:41:13 -06:00
gpio_vbus.h
hcd.h usb: host: xhci-ring: don't need to clear interrupt pending for MSI enabled hcd 2017-05-18 15:19:41 +02:00
input.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
isp1362.h
isp1760.h
m66592.h
msm_hsusb_hw.h
musb-ux500.h
musb.h
net2280.h
of.h usb: of: add functions to bind a companion controller 2017-03-17 13:24:48 +09:00
ohci_pdriver.h
otg-fsm.h usb: otg-fsm: Prevent build warning "VDBG" redefined 2017-04-11 10:58:23 +03:00
otg.h
phy_companion.h
phy.h
quirks.h usb-core: Add LINEAR_FRAME_INTR_BINTERVAL USB quirk 2017-03-14 17:07:31 +08:00
r8a66597.h
renesas_usbhs.h
rndis_host.h
samsung_usb_phy.h
serial.h USB: serial: add calc_num_ports callback to generic driver 2017-03-28 10:54:39 +02:00
sl811.h
storage.h
tegra_usb_phy.h
tilegx.h
typec.h usb: USB Type-C connector class 2017-03-23 13:48:44 +01:00
uas.h
ulpi.h
usb338x.h
usb_phy_generic.h
usbnet.h cdc-ether: divorce initialisation with a filter reset and a generic method 2017-05-23 11:01:28 -04:00
wusb-wa.h
wusb.h
xhci-dbgp.h usb/early: Add driver for xhci debug capability 2017-03-21 12:30:05 +01:00