freebsd-nq/sys
Marcin Wojtas 04cf2b885d Optimize ENA Rx refill for low memory conditions
Sometimes, especially when there is not much memory in the system left,
allocating mbuf jumbo clusters (like 9KB or 16KB) can take a lot of time
and it is not guaranteed that it'll succeed. In that situation, the
fallback will work, but if the refill needs to take a place for a lot of
descriptors at once, the time spent in m_getjcl looking for memory can
cause system unresponsiveness due to high priority of the Rx task. This
can also lead to driver reset, because Tx cleanup routine is being
blocked and timer service could detect that Tx packets aren't cleaned
up. The reset routine can further create another unresponsiveness - Rx
rings are being refilled there, so m_getjcl will again burn the CPU.
This was causing NVMe driver timeouts and resets, because network driver
is having higher priority.

Instead of 16KB jumbo clusters for the Rx buffers, 9KB clusters are
enough - ENA MTU is being set to 9K anyway, so it's very unlikely that
more space than 9KB will be needed.

However, 9KB jumbo clusters can still cause issues, so by default the
page size mbuf cluster will be used for the Rx descriptors. This can have a
small (~2%) impact on the throughput of the device, so to restore
original behavior, one must change sysctl "hw.ena.enable_9k_mbufs" to
"1" in "/boot/loader.conf" file.

As a part of this patch (important fix), the version of the driver
was updated to v2.1.2.

Submitted by:   cperciva
Reviewed by:    Michal Krawczyk <mk@semihalf.com>
Reviewed by:    Ido Segev <idose@amazon.com>
Reviewed by:    Guy Tzalik <gtzalik@amazon.com>
MFC after:      3 days
PR:             225791, 234838, 235856, 236989, 243531
Differential Revision: https://reviews.freebsd.org/D24546
2020-05-07 11:28:39 +00:00
..
amd64 Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
arm arm: Don't enable interrupts in init_secondary(). 2020-05-06 15:10:05 +00:00
arm64 Simplify arm64's pmap_bootstrap() a bit. 2020-05-06 15:01:06 +00:00
bsm bsm: add AUE_CLOSERANGE 2020-04-24 01:27:25 +00:00
cam Add session locking in cfiscsi_ioctl_handoff(). 2020-05-03 16:14:55 +00:00
cddl Avoid the GEOM topology lock recursion when we automatically expand a pool. 2020-04-25 21:45:31 +00:00
compat Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI. 2020-05-04 10:10:07 +00:00
conf Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
contrib MFV: r360512 2020-05-01 01:26:36 +00:00
crypto ccp: add a new hardware ID, found on AMD Ryzen 3 3200U 2020-04-24 10:20:54 +00:00
ddb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
dev Optimize ENA Rx refill for low memory conditions 2020-05-07 11:28:39 +00:00
dts allwinner: aw_thermal: Cope with DTS changes 2020-04-14 19:05:17 +00:00
fs Delete unused function newnfs_trimleading. 2020-05-06 00:44:03 +00:00
gdb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
geom Add g_topology_locked() macro that returns true if we already hold the GEOM 2020-04-25 21:41:09 +00:00
gnu dts: Import DTS from Linux 5.6 2020-04-14 18:57:00 +00:00
i386 Remove an obsolete TODO comment from several minidump implementations. 2020-04-24 18:47:42 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern Step 4.2: start divorce of M_EXT and M_EXTPG 2020-05-03 00:37:16 +00:00
kgssapi Remove support for Kernel GSS algorithms deprecated in r348875. 2020-04-10 23:08:41 +00:00
libkern Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
mips Fix a race in pmap_emulate_modified(). 2020-04-24 21:21:49 +00:00
modules Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
net Add rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it. 2020-05-07 08:11:36 +00:00
net80211 Don't indirect user pointers directly in two 802.11s ioctls. 2020-04-24 22:10:02 +00:00
netgraph Add le_read_buffer_size command and manpage. 2020-04-28 16:00:34 +00:00
netinet NF has an internal option that changes the tcp_mcopy_m routine slightly (has 2020-05-07 10:46:02 +00:00
netinet6 Remove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields. 2020-05-04 14:31:45 +00:00
netipsec Don't pass bogus keys down for NULL algorithms. 2020-05-02 01:00:29 +00:00
netpfil pf: Improve DIOCADDRULE validation 2020-05-03 16:09:35 +00:00
netsmb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs Remove rtable dumping code from bootp. 2020-04-28 07:23:41 +00:00
nfsclient
nfsserver
nlm Make nfslockd depend on xdr. 2020-04-23 09:37:22 +00:00
ofed Convert OFED rtable interactions to the new routing KPI. 2020-04-15 13:06:55 +00:00
opencrypto Use a lookup table of algorithm types for alg_is_* helpers. 2020-05-04 22:31:38 +00:00
powerpc Remove an obsolete TODO comment from several minidump implementations. 2020-04-24 18:47:42 +00:00
riscv Use the HSM SBI extension to halt CPUs 2020-05-01 21:59:47 +00:00
rpc Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
security audit_canon_path_vp: don't panic if cdir == NULL 2020-04-17 02:09:31 +00:00
sys Step 4.2: start divorce of M_EXT and M_EXTPG 2020-05-03 00:37:16 +00:00
teken
tests Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
tools vfs: stop null checking routines in vop wrappers 2020-01-26 00:41:38 +00:00
ufs Retire two unused background fsck sysctls. 2020-04-21 17:42:32 +00:00
vm Re-check for wirings after busying the page in vm_page_release_locked(). 2020-04-28 13:51:41 +00:00
x86 Fix handling of NMIs from unknown sources (BMC, hypervisor) 2020-04-26 00:41:29 +00:00
xdr Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
xen Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many) 2020-02-25 19:04:39 +00:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00