linux/drivers/net
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
..
appletalk
arcnet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-30 12:43:08 -04:00
bonding Bonding: Convert multiple netdev_info messages to netdev_dbg 2017-06-29 12:21:37 -04:00
caif net: add netlink_ext_ack argument to rtnl_link_ops.changelink 2017-06-26 23:13:22 -04:00
can net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
cris net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
dsa net: dsa: mv88e6xxx: fix error code in mv88e6390_serdes_power() 2017-06-25 11:42:33 -04:00
ethernet qed: Add iWARP support for physical queue allocation 2017-07-03 01:43:45 -07:00
fddi
fjes networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hamradio networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hippi networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-30 12:43:08 -04:00
ieee802154 networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
ipvlan net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
irda networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-30 12:43:08 -04:00
plip
ppp net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
slip networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
team net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
usb net: cdc_ncm: Reduce memory use when kernel memory low 2017-07-03 01:50:49 -07:00
vmxnet3
wan networking: make skb_pull & friends return void pointers 2017-06-16 11:48:39 -04:00
wimax networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
wireless Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2017-06-28 22:10:48 +03:00
xen-netback xen-netback: correctly schedule rate-limited queues 2017-06-22 11:15:42 -04:00
dummy.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
eql.c
geneve.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
gtp.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
ifb.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
Kconfig
LICENSE.SRC
loopback.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
macsec.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-30 12:43:08 -04:00
macvtap.c net: add netlink_ext_ack argument to rtnl_link_ops.newlink 2017-06-26 23:13:21 -04:00
Makefile
mdio.c
mii.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
netconsole.c netconsole: Remove duplicate "netconsole: " logging prefix 2017-06-13 12:57:40 -04:00
nlmon.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
ntb_netdev.c
rionet.c net: convert sk_buff.users from atomic_t to refcount_t 2017-07-01 07:39:07 -07:00
sb1000.c
Space.c
sungem_phy.c drivers/net/sungem: add const to mii_phy_ops structures 2017-06-08 15:32:47 -04:00
tap.c
tun.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
veth.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-30 12:43:08 -04:00
virtio_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-30 12:43:08 -04:00
vrf.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
vsockmon.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
vxlan.c vxlan: fix incorrect nlattr access in MTU check 2017-06-27 14:40:35 -04:00
xen-netfront.c