Commit graph

38769 commits

Author SHA1 Message Date
Wei Hu
2fbdbfaa0c Hyper-V: hn: Initialize the internal field of per packet info on tx path
The RSC support feature introduced a bit field "rm_internal" in
struct rndis_pktinfo with total size unchanged.

The guest does not use this field in the tx path. However we need to
initialize it to zero in case older hosts which are not aware of this
field.

Fixes:		a491581f ("Hyper-V: hn: Enable vSwitch RSC support")
MFC after:	2 weeks
Sponsored by:	Microsoft

(cherry picked from commit 805dbff6c3)
2021-03-29 03:21:30 -07:00
Wei Hu
cdc59163ff Hyper-V: hn: Enable vSwitch RSC support in hn netvsc driver
Receive Segment Coalescing (RSC) in the vSwitch is a feature available in
Windows Server 2019 hosts and later. It reduces the per packet processing
overhead by coalescing multiple TCP segments when possible. This happens
mostly when TCP traffics are among different guests on same host.
This patch adds netvsc driver support for this feature.

The patch also updates NVS version to 6.1 as needed for RSC
enablement.

MFC after:	2 weeks
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D29075

(cherry picked from commit a491581f3f)
2021-03-29 03:20:03 -07:00
Wei Hu
a86be0da9a Hyper-V: hn: Store host hash value in flowid
When rx packet contains hash value sent from host, store it in
the mbuf's flowid field so when the same mbuf is on the tx path,
the hash value can be used by the host to determine the outgoing
network queue.

MFC after:	2 weeks
Sponsored by:	Microsoft

(cherry picked from commit 80f39bd95f)
2021-03-29 03:18:20 -07:00
Ed Maste
a66e75d9e2 mn: report that this driver is removed in 14, not 13 2021-03-24 22:35:38 -04:00
Hans Petter Selasky
ff2e2bca31 MFC 1acf24a044:
Implement pci_get_relaxed_ordering_enabled() helper function.

Discussed with:	kib@
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 1acf24a044)
2021-03-24 08:54:52 +01:00
Alexander Motin
ed407c92e4 nvme: Replace potentially long DELAY() with pause().
In some cases like broken hardware nvme(4) may wait minutes for
controller response before timeout.  Doing so in a tight spin loop
made whole system unresponsive.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29309
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 4fbbe52365)
2021-03-23 21:26:00 -04:00
Vincenzo Maffione
3e4127f8f2 netmap: fix issues in nm_os_extmem_create()
- Call vm_object_reference() before vm_map_lookup_done().
- Use vm_mmap_to_errno() to convert vm_map_* return values to errno.
- Fix memory leak of e->obj.

Reported by:	markj
Reviewed by:	markj
MFC after:	1 week

(cherry picked from commit ee7ffaa2e6)
2021-03-23 21:17:23 +00:00
Michal Vanco
395e612b7b pchtherm: fix a wrong bit and a wrong register use
Probably just copy-paste errors that slipped in.

(cherry picked from commit 5084dde5f0)

PR:		253915
Reported by:	Michal Vanco <michal.vanco@gmail.com>
2021-03-23 13:01:20 +02:00
John Baldwin
6a1dbc8ba9 iscsi: Mark iSCSI CAM sims as non-pollable.
Previously, iscsi_poll() just panicked.  This meant if you got a panic
on a box when using the iSCSI initiator, the attempt to shutdown would
trigger a nested panic and never write out a core.  Now, CCB's sent to
iSCSI devices (such as the sychronize-cache request in dashutdown())
just fail with a timeout during a panic shutdown.

Sponsored by:	Chelsio

(cherry picked from commit 47769bc557)
2021-03-22 13:37:46 -07:00
Mark Johnston
46f44865e3 iflib: Make if_shared_ctx_t a pointer to const
This structure is shared among multiple instances of a driver, so we
should ensure that it doesn't somehow get treated as if there's a
separate instance per interface.  This is especially important for
software-only drivers like wg.

DEVICE_REGISTER() still returns a void * and so the per-driver sctx
structures are not yet defined with the const qualifier.

Reviewed by:	gallatin, erj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29102

(cherry picked from commit ffe3def903)
2021-03-22 11:42:18 -04:00
Leandro Lupori
3aa6cc000f ofwfb: fix boot on LE
Some framebuffer properties obtained from the device tree were not being
properly converted to host endian.
Replace OF_getprop calls by OF_getencprop where needed to fix this.

This fixes boot on PowerPC64 LE, when using ofwfb as the system console.

Reviewed by:    bdragon
Sponsored by:   Eldorado Research Institute (eldorado.org.br)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D27475

(cherry picked from commit 043577b721)
2021-03-22 10:48:46 -03:00
Michael Tuexen
6064ea8172 vtnet: fix TSO for TCP/IPv6
The decision whether a TCP packet is sent over IPv4 or IPv6 was
based on ethertype, which works correctly. In D27926 the criteria
was changed to checking if the CSUM_IP_TSO flag is set in the
csum-flags and then considering it to be TCP/IPv4.
However, the TCP stack sets the flag to CSUM_TSO for IPv4 and IPv6,
where CSUM_TSO is defined as CSUM_IP_TSO|CSUM_IP6_TSO.
Therefore TCP/IPv6 packets gets mis-classified as TCP/IPv4,
which breaks TSO for TCP/IPv6.
This patch bases the check again on the ethertype.
This fix is instantly MFCed.

Approved by:		re(gjb)
PR:			254366
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D29331

(cherry picked from commit d4697a6b56)
2021-03-18 21:33:32 +01:00
Vincenzo Maffione
120a4bd4e9 netmap: fix memory leak in NETMAP_REQ_PORT_INFO_GET
The netmap_ioctl() function has a reference counting bug in case of
NETMAP_REQ_PORT_INFO_GET command. When `hdr->nr_name[0] == '\0'`,
the function does not decrease the refcount of "nmd", which is
increased by netmap_mem_find(), causing a refcount leak.

Reported by:	Xiyu Yang <sherllyyang00@gmail.com>
Submitted by:	Carl Smith <carl.smith@alliedtelesis.co.nz>
MFC after: 3 days
PR:	254311

(cherry picked from commit 0ab5902e8a)
2021-03-18 16:40:23 +00:00
Scott Long
b65d2c31b1 base: remove if_wg(4) and associated utilities, manpage
After length decisions, we've decided that the if_wg(4) driver and
   related work is not yet ready to live in the tree.  This driver has
   larger security implications than many, and thus will be held to
   more scrutiny than other drivers.

Requested by: secteam
Approved by: re
2021-03-18 07:07:56 +00:00
Mark Johnston
10e8aac9bb ath_hal: Stop printing messages during boot
ath_hal is compiled into the kernel by default and so always prints a
message to dmesg even when the system has no ath hardware.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 0e72eb4602)
2021-03-15 11:39:08 -04:00
Mark Johnston
d18a65a535 wg: Style
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d8cebef50e)
2021-03-15 11:38:15 -04:00
Mitchell Horne
17d301f7b5 ns8250: don't drop IER_TXRDY on bus_grab/ungrab
It has been observed that some systems are often unable to resume from
ddb after entering with debug.kdb.enter=1. Checking the status further
shows the terminal is blocked waiting in tty_drain(), but it never makes
progress in clearing the output queue, because sc->sc_txbusy is high.

I noticed that when entering polling mode for the debugger, IER_TXRDY is
set in the failure case. Since this bit is never tracked by the softc,
it will not be restored by ns8250_bus_ungrab(). This creates a race in
which a TX interrupt can be lost, creating the hang described above.
Ensuring that this bit is restored is enough to prevent this, and resume
from ddb as expected.

The solution is to track this bit in the sc->ier field, for the same
lifetime that TX interrupts are enabled.

PR:		223917, 240122
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7e7f7beee7)
2021-03-15 11:22:17 -03:00
Alexander Motin
aae8e02dfc Move ic_check_send_space clear to the actual check.
It closes tiny race when the flag could be set between being cleared
and the space is checked, that would create us some more work.  The
flag setting is protected by both locks, so we can clear it in either
place, but in between both locks are dropped.

MFC after:	1 week

(cherry picked from commit afc3e54eee)
2021-03-14 22:36:21 -04:00
Alexander Motin
8b0101da80 Restore condition removed in df3747c660.
I think it allowed to avoid some TX thread wakeups while the socket
buffer is full.  But add there another options if ic_check_send_space
is set, which means socket just reported that new space appeared, so
it may have sense to pull more data from ic_to_send for better TX
coalescing.

MFC after:	1 week

(cherry picked from commit aff9b9ee89)
2021-03-14 22:36:13 -04:00
Alexander Motin
2f77e2810a Replace STAILQ_SWAP() with simpler STAILQ_CONCAT().
Also remove stray STAILQ_REMOVE_AFTER(), not causing problems only
because STAILQ_SWAP() fixed corrupted stqh_last.

MFC after:	1 week

(cherry picked from commit df3747c660)
2021-03-14 22:36:04 -04:00
Alexander Motin
fb419e0ffb Fix initiator panic after 6895f89fe5.
There are sessions without socket that are not disconnecting yet.

MFC after:	3 weeks

(cherry picked from commit 06e9c71099)
2021-03-14 22:35:47 -04:00
Alexander Motin
6b409a8b32 Optimize TX coalescing by keeping pointer to last mbuf.
Before m_cat() each time traversed through all the coalesced chain.

MFC after:	1 week

(cherry picked from commit b85a67f54a)
2021-03-14 22:35:37 -04:00
Alexander Motin
31d41a6a9b Coalesce socket reads in software iSCSI.
Instead of 2-4 socket reads per PDU this can do as low as one read
per megabyte, dramatically reducing TCP overhead and lock contention.

With this on iSCSI target I can write more than 4GB/s through a
single connection.

MFC after:	1 month

(cherry picked from commit 6895f89fe5)
2021-03-14 22:34:28 -04:00
Alexander Motin
a4bea2f2a6 Refactor CTL datamove KPI.
- Make frontends call unified CTL core method ctl_datamove_done()
to report move completion.  It allows to reduce code duplication
in differerent backends by accounting DMA time in common code.
 - Add to ctl_datamove_done() and be_move_done() callback samethr
argument, reporting whether the callback is called in the same
context as ctl_datamove().  It allows for some cases like iSCSI
write with immediate data or camsim frontend write save one context
switch, since we know that the context is sleepable.
 - Remove data_move_done() methods from struct ctl_backend_driver,
unused since forever.

MFC after:	 1 month

(cherry picked from commit 2c7dc6bae9)
2021-03-14 22:34:08 -04:00
Mark Johnston
2b0aa5833c netmap: Stop printing a line to the dmesg in netmap_init()
netmap is compiled into the kernel by default so initialization was
always reported, and netmap uses a formatting convention not used in the
rest of the kernel.

Reviewed by:	vmaffione
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29099

(cherry picked from commit fef8450971)
2021-03-12 12:20:59 -05:00
Mark Johnston
47495bf648 wg: Avoid leaking mbufs when the input handshake queue is full
Reviewed by:	grehan
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29011

(cherry picked from commit a11009dccb)
2021-03-11 10:53:12 -05:00
Eric Joyner
1da549169d ice(4): Update to version 0.28.1-k
This updates the driver to align with the version included in
the "Intel Ethernet Adapter Complete Driver Pack", version 25.6.

There are no major functional changes; this mostly contains
bug fixes and changes to prepare for new features. This version
of the driver uses the previously committed ice_ddp package
1.3.19.0.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Tested by:	jeffrey.e.pieper@intel.com
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D28640

(cherry picked from commit d08b8680e1)
2021-03-09 14:35:54 -08:00
Alfredo Dal'Ava Junior
c80a1c1072 mpr: big-endian support
This fixes mpr driver on big-endian devices.
Tested on powerpc64 and powerpc64le targets using a SAS9300-8i card
(LSISAS3008 pci vendor=0x1000 device=0x0097)

Submitted by:	Andre Fernando da Silva <andre.silva@eldorado.org.br>
Reviewed by:	luporl, alfredo, Sreekanth Reddy <sreekanth.reddy@broadcom.com> (by email)
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25785

(cherry picked from commit 71900a794d)
2021-03-09 21:09:24 -03:00
Jessica Clarke
e3394851b5 if_vtbe: Add missing includes to fix build
PR:		254137
Reported by:	Mina Galić <me@igalic.co>
Fixes:		f8bc74e2f4 ("tap: add support for virtio-net offloads")

(cherry picked from commit f2f8405cf6)
2021-03-08 21:04:40 +00:00
Xin LI
e298c1c3c2 arcmsr(4): Fixed no action of hot plugging device on type_F adapter.
Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	黃清隆 <ching2048 areca com tw>
MFC after:	3 days

(cherry picked from commit 5842073a9b)
2021-03-05 17:46:04 -08:00
Peter Grehan
96aabea8bd Import wireguard fixes from pfSense 2.5
Merge the following fixes from https://github.com/pfsense/FreeBSD-src
 1940e7d3  Save	address	of ingress packets to allow wg to work on HA
 8f5531f1  Fix connection to IPv6 endpoint
 825ed9ee  Fix tcpdump for wg IPv6 rx tunnel traffic
 2ec232d3  Fix issue with replying to INITIATION messages in server mode
 ec77593a  Return immediately in wg_init if in DETACH'd state
 0f0dde6f  Remove unnecessary wg debug printf on transmit
 2766dc94  Detect and fix case in wg_init() where sockets weren't cleaned up
 b62cc7ac  Close the UDP tunnel sockets when the interface has been stopped

Obtained from:	pfSense 2.5
Relnotes:	yes
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 95331c228a)
2021-03-05 11:23:14 +10:00
Krzysztof Galazka
2b94bda05a ixl(4): Add ability to control link state on ifconfig down
Add sysctl link_active_on_if_down, which allows user to control
if interface is kept in active state when it is brought
down with ifconfig. Set it to enabled by default to preserve
backwards compatibility.

Reviewed by:	erj
Tested by:	gowtham.kumar.ks@intel.com
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D28028

(cherry picked from commit 21802a127d)
2021-03-04 17:23:19 -08:00
Krzysztof Galazka
b149f7c23d ixl(4): Report RX errors as sum of all RX error counters
HW keeps track of RX errors using several counters, each for
specific type of errors. Report RX errors to OS as sum
of all those counters: CRC errors, illegal bytes, checksum,
length, undersize, fragment, oversize and jabber errors.

There is no HW counter for frames with invalid L3/L4 checksums
so add a SW one.

Also add a "rx_errors" sysctl with a copy of netstat IERRORS
counter value to make it easier accessible from scripts.

Reviewed By:	erj
Tested By:	gowtham.kumar.ks@intel.com
Sponsored By:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D27639

(cherry picked from commit 9f99061ef9)
2021-03-04 17:23:18 -08:00
Piotr Pietruszewski
8fa11f8922 ix(4): Report RX errors as sum of all RX error counters
HW keeps track of RX errors using several counters, each for
specific type of errors. Report RX errors to OS as sum
of all those counters: CRC errors, illegal bytes, checksum,
length, undersize, fragment, oversize and jabber errors.

Also, add new "rx_errs" sysctl in the dev.ix.N.mac_stats tree. This is
to provide an another way to display the sum of RX errors.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>

Reviewed By: erj
Tested By: gowtham.kumar.ks@intel.com
Sponsored By: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D27191

(cherry picked from commit afb1aa4e6d)
2021-03-04 17:23:18 -08:00
Krzysztof Galazka
7e166d608e ixl(4): Fix VLAN HW filtering
X700 family of controllers has limited number of available VLAN
HW filters. Driver did not handle properly a case when user
assigned more VLANs to the interface which had all filters
already in use. Fix that by disabling HW filtering when
it is impossible to create filters for all requested VLANs.
Keep track of registered VLANs using bitstring to be able
to re-enable HW filtering when number of requested VLANs
drops below the limit.

Also switch all allocations to use M_IXL malloc type
to ease detecting memory leaks in the driver.

Reviewed by:	erj
Tested by:	gowtham.kumar.ks@intel.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28137

(cherry picked from commit 7d4dceec10)
2021-03-04 17:23:18 -08:00
Alexander Motin
a00bf7d9bb Make DataSN counter of solicited Data-Out local.
DataSN for solicited Data-Out is per-R2T.  Since we handle whole R2T
in one go, we don't need to store it anywhere, especially in global
per-command structure.  This may allow us to handle multiple R2T per
command at once, if we decide, or may be relax locking.

Rename the second use of that field to io_referenced_task_tag.

MFC after:	1 month

(cherry picked from commit 3dd2a7a5ea)
2021-03-04 09:39:43 -05:00
Brett Mastbergen
135fa1610f pwm_backlight: Add MODULE_DEPEND on backlight
Make the pwm_backlight module depend on backlight, so it
has access to the backlight interface symbols.  Otherwise you'll
get an error like:

link_elf: symbol backlight_get_info_desc undefined

Signed-off-by: Brett Mastbergen <brett.mastbergen@gmail.com>
MFC after:	3 days
PR: 		253765
(cherry picked from commit 43d4dfac96)
2021-03-02 14:02:13 +01:00
Warner Losh
b22315c798 cardbus: Be sure to acquire Giant when calling into newbus
Acquire Giant in cardbus_detach_card. This used to be done above us, but no
more.

Tested by: kargl@
MFC After: 3 days

(cherry picked from commit c01da939b0)
2021-03-01 18:07:50 -07:00
Alexander Motin
1f3cff343b cxgb(4): Rework my commit 9dc7c250.
The previous implementation was reported to try to coalesce packets
in situations when it should not, that resulted in assertion later.
This implementation better checks the first packet of the chain for
the coallescing elligibility.

(cherry picked from commit d510bf133d)
2021-02-24 20:40:29 -05:00
Warner Losh
0b90164992 nvme: Make nvme_ctrlr_hw_reset static
nvme_ctrlr_hw_reset is no longer used outside of nvme_ctrlr.c, so
make it static. If we need to change this in the future we can.

(cherry picked from commit dd2516fc07)
2021-02-24 11:10:51 -07:00
Warner Losh
4f4f44f70f nvme: use NVME_GONE rather than hard-coded 0xffffffff
Make it clearer that the value 0xfffffff is being used to detect the device is
gone. We use it other places in the driver for other meanings.

(cherry picked from commit 9600aa31aa)
2021-02-24 11:10:45 -07:00
Warner Losh
ef1f205608 uart: only use MSI on devices that advertise 1 MSI vector
This updates r311987/fb1d9b7f4113d which allowed any number of vectors to be
used. Since we're just attaching one instance, the meaning of more than one
vector is not clear and seems to cause problems. Fall back to old methods for
these cards.

PR: 235016
Submitted by: David Cross

(cherry picked from commit 955b6109bb)
2021-02-24 10:57:07 -07:00
Vladimir Kondratyev
98b3658c4e hkbd: Fix handling of keyboard ErrorRollOver reports
Ignore fantom keyboard state reports entirelly rather than ignore
RollOver states for each key separatelly.  Latter results in spurious
release/push pairs of events on each fantom keyboard state report.

Reported by:	Jan Martin Mikkelsen <janm_AT_transactionware_DOT_com>
Submitted by:	Jan Martin Mikkelsen (initial version)
PR:		253249
MFC after:	1 week

(cherry picked from commit 812c59ed61)
2021-02-24 02:41:49 +03:00
Vladimir Kondratyev
e7211ca03a ukbd: Fix handling of keyboard ErrorRollOver reports
Ignore fantom keyboard state reports entirelly rather than ignore
RollOver states for each key separatelly.  Latter results in spurious
release/push pairs of events on each fantom keyboard state report.

Reported by:	Jan Martin Mikkelsen <janm_AT_transactionware_DOT_com>
Submitted by:	Jan Martin Mikkelsen (initial version)
PR:		253249
MFC after:	1 week

(cherry picked from commit 032d315387)
2021-02-24 02:41:49 +03:00
Vladimir Kondratyev
9262a9ce06 hidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size
defined by hardware rather than cached one to match HIDIOCGRDESC ioctl.
This fixes errors reported by hid-tools being run against /dev/hidraw#
device node belonging to driver which overloads report descriptor.

MFC after:	1 week

(cherry picked from commit f988d7fa05)
2021-02-24 02:41:49 +03:00
Alfredo Dal'Ava Junior
07656628fd ofwfb: fix incorrect colors on powerpc* and add new tunable parameters
- Implements little-endian support (powerpc64le)
- Adds 'hw.ofwfb.physaddr' kernel parameter so user can manually
  provide correct address if it's not detected correctly
- Adds 'hw.ofwfb.argb32_pixel' so user can set it manually if
  colors are inverted due to incorrect pixel format (default = 1)
- Automatically selects RGBA32 pixel format if NVidia graphic adapter
  is detected (sets hw.ofwfb.argb32_pixel=0)

Machines equipped with NVidia graphic adapters tend to use RGBA32
pixel format. By default ARGB32 pixel format is used, proved to work
on machines equipped with ATI graphic adapter and the onboard adapter
used on Talos II and Blackbird machines from Raptor Computing Systems.

Original patch developed by bdragon

Reviewed by:	bdragon, luporl
MFC after:	3 days
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D28604

(cherry picked from commit 50b7c1f530)
2021-02-23 21:00:56 -03:00
Mitchell Horne
007101f87d cgem: improve usage of busdma(9) KPI
BUS_DMA_NOCACHE should only be used when one needs to guarantee the
created mapping has uncached memory attributes, usually as a result
of buggy hardware. Normal use cases should pass BUS_DMA_COHERENT, to
create an appropriate mapping based on the flags passed to
bus_dma_tag_create().

This should have no functional change, since the DMA tags in this driver
are created without the BUS_DMA_COHERENT flag.

Reported by:	mmel
Reviewed by:	mmel, Thomas Skibo <thomas-bsd@skibo.net>

(cherry picked from commit 04d2d2d7fd)
2021-02-23 10:31:43 -04:00
Roger Pau Monné
ab3e1bd3c2 xen-blkback: fix leak of grant maps on ring setup failure
Multi page rings are mapped using a single hypercall that gets passed
an array of grants to map. One of the grants in the array failing to
map would lead to the failure of the whole ring setup operation, but
there was no cleanup of the rest of the grant maps in the array that
could have likely been created as a result of the hypercall.

Add proper cleanup on the failure path during ring setup to unmap any
grants that could have been created.

This is part of XSA-361.

Sponsored by:	Citrix Systems R&D

(cherry picked from commit 808d4aad10)
2021-02-22 19:55:14 -05:00
Alexander Motin
49f4b33f9e Exclude reserved iSCSI Initiator Task Tag.
RFC 7143 (11.2.1.8):
   An ITT value of 0xffffffff is reserved and MUST NOT be assigned for a
   task by the initiator.  The only instance in which it may be seen on
   the wire is in a target-initiated NOP-In PDU (Section 11.19) and in
   the initiator response to that PDU, if necessary.

MFC after:	1 month
2021-02-22 19:31:52 -05:00
Alexander Motin
c930816b76 cxgbe(4): Save proper zone index on low memory in refill_fl().
When refill_fl() fails to allocate large (9/16KB) mbuf cluster, it
falls back to safe (4KB) ones.  But it still saved into sd->zidx
the original fl->zidx instead of fl->safe_zidx.  It caused problems
with the later use of that cluster, including memory and/or data
corruption.

While there, make refill_fl() to use the safe zone for all following
clusters for the call, since it is unlikely that large succeed.

MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Reviewed by:	np, jhb
Differential Revision:	https://reviews.freebsd.org/D28716

(cherry picked from commit 294e62bebf)
2021-02-22 15:51:58 -08:00