]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoif_firewire: fixing panic upon packet reception for VNET build
Tai-hwa Liang [Sat, 10 Apr 2021 15:32:27 +0000 (15:32 +0000)]
if_firewire: fixing panic upon packet reception for VNET build

netisr_dispatch_src() needs valid VNET pointer or firewire_input() will panic
when receiving a packet.

Reviewed by: glebius
MFC after: 2 weeks

(cherry picked from commit d9b61e7153c64b141436b4d9619b166c6d35a0a6)

3 years agoe1000: Fix register name in reg_dump sysctl
Kevin Bowling [Mon, 26 Apr 2021 16:30:54 +0000 (09:30 -0700)]
e1000: Fix register name in reg_dump sysctl

The correct name of this register is CTRL_EXT.

Approved by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29967

(cherry picked from commit ba7b31b3e967a57c0269330d4e5aacf541d1b479)

3 years agoe1000: Add support for [Tiger, Alder, Meteor] Lake
Kevin Bowling [Mon, 19 Apr 2021 02:11:27 +0000 (19:11 -0700)]
e1000: Add support for [Tiger, Alder, Meteor] Lake

Add support for current and future client platform PCI IDs. These are
all I219 variants and have no known driver changes versus previous
generation client platform I219 variants.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29801

(cherry picked from commit 59690eab572dde1176886bff7ed0c506df974e5e)

3 years agoamd64: disable LA57 by default for now
Konstantin Belousov [Wed, 28 Apr 2021 15:50:16 +0000 (18:50 +0300)]
amd64: disable LA57 by default for now

(cherry picked from commit 72a42ec63b4a98f812f5f6164415eeb9a55e1933)

3 years agoO_PATH: disable kqfilter for fifos
Konstantin Belousov [Wed, 28 Apr 2021 15:45:36 +0000 (18:45 +0300)]
O_PATH: disable kqfilter for fifos

(cherry picked from commit 2082565798041ceb9fb77137f00ea6b0ff50fe5e)

3 years agoconnectat(2): clarify that the s argument is socket
Konstantin Belousov [Wed, 28 Apr 2021 15:47:31 +0000 (18:47 +0300)]
connectat(2): clarify that the s argument is socket

(cherry picked from commit 07f229d20c0cd6285c5ddf1df45eb69bbea4445b)

3 years agotcp: stop spurious rescue retransmissions and potential asserts
Richard Scheffenegger [Wed, 28 Apr 2021 12:56:14 +0000 (14:56 +0200)]
tcp: stop spurious rescue retransmissions and potential asserts

Reported by: pho@
MFC after: 3 days
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29970

(cherry picked from commit 48be5b976e34022862da3be69350d60e969d39e5)

3 years agoparam.h: bump __FreeBSD_version for commits efe7f12cd37b and 9781105bea58
Neel Chauhan [Sat, 1 May 2021 00:56:57 +0000 (17:56 -0700)]
param.h: bump __FreeBSD_version for commits efe7f12cd37b and 9781105bea58

Both commits update the linuxkpi to accommodate the drm-kmod 5.5 update.

3 years agolinuxkpi: Introduce tasklet_disable_nosync()
Neel Chauhan [Wed, 28 Apr 2021 15:05:57 +0000 (08:05 -0700)]
linuxkpi: Introduce tasklet_disable_nosync()

This is needed for the drm-kmod 5.5 update.

Reviewed by: hselasky (src)
Differential Revision: https://reviews.freebsd.org/D30024

(cherry picked from commit 9781105bea58b8bce53ba766850c5f023b34c43c)

3 years agolinuxkpi: Implement rcu_replace_pointer() macro
Neel Chauhan [Wed, 28 Apr 2021 15:04:52 +0000 (08:04 -0700)]
linuxkpi: Implement rcu_replace_pointer() macro

This is needed for the drm-kmod 5.5 update.

Reviewed by: hselasky (src)
Differential Revision: https://reviews.freebsd.org/D30025

(cherry picked from commit efe7f12cd37bf8f2538df387d565e7849112a598)

3 years agohkbd: Fix typo which disables keyboard input in kdb
Vladimir Kondratyev [Sat, 24 Apr 2021 18:49:27 +0000 (21:49 +0300)]
hkbd: Fix typo which disables keyboard input in kdb

Reported by: Greg V

3 years agong_ubt: Block attachment of uninitialized Intel Wireless 7265
Vladimir Kondratyev [Thu, 15 Apr 2021 14:26:32 +0000 (17:26 +0300)]
ng_ubt: Block attachment of uninitialized Intel Wireless 7265

As this controller requires firmware patch downloading to operate.
"Intel Wireless 7265" support in iwmbtfw(8) is yet to be done.

Tested by: arrowd et al
PR: 228787

3 years agong_ubt: Use DEFINE_CLASS_1 macro for kobj inheritance.
Vladimir Kondratyev [Thu, 15 Apr 2021 14:25:50 +0000 (17:25 +0300)]
ng_ubt: Use DEFINE_CLASS_1 macro for kobj inheritance.

3 years agong_ubt: Do not clear stall before receiving of HCI command response.
Vladimir Kondratyev [Thu, 15 Apr 2021 14:25:00 +0000 (17:25 +0300)]
ng_ubt: Do not clear stall before receiving of HCI command response.

Unconditional execution of "clear feature" request at SETUP stage was
workaround for probe failures on ng_ubt.ko re-kldloading which is
unnecessary now.

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D29775

3 years agohidmap: add missing opt_hid.h to module Makefile
Vladimir Kondratyev [Wed, 14 Apr 2021 19:55:52 +0000 (22:55 +0300)]
hidmap: add missing opt_hid.h to module Makefile

Reported by: pstef

3 years agoichsmb: Add PCI ID for Intel Gemini Lake SMBus controller
Vladimir Kondratyev [Tue, 13 Apr 2021 22:10:13 +0000 (01:10 +0300)]
ichsmb: Add PCI ID for Intel Gemini Lake SMBus controller

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

3 years agopchtherm: Add IDs for CannonLake-H, CometLake and Lewisburg controllers
Vladimir Kondratyev [Wed, 14 Apr 2021 10:03:18 +0000 (13:03 +0300)]
pchtherm: Add IDs for CannonLake-H, CometLake and Lewisburg controllers

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

3 years agoUPDATING: dereference portupgrade(8)
Glen Barber [Fri, 9 Apr 2021 00:26:41 +0000 (20:26 -0400)]
UPDATING: dereference portupgrade(8)

Make the UPDATING file less tool-specific regarding upgrading
third-party software.

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 6dadf78f115cbdcb17dff8974a2044dd5129f7dc)

3 years agodtrace tests: Fix tst.system.d after ping/ping6 unification
Mark Johnston [Fri, 23 Apr 2021 14:28:09 +0000 (10:28 -0400)]
dtrace tests: Fix tst.system.d after ping/ping6 unification

Sponsored by: The FreeBSD Foundation

(cherry picked from commit d500a85e640d1cd270747c12e17c511b53864436)

3 years agoAdd an UPDATING entry for commit 5a45802b3c8c
Rick Macklem [Fri, 30 Apr 2021 01:40:04 +0000 (18:40 -0700)]
Add an UPDATING entry for commit 5a45802b3c8c

3 years agoparam.h: bump __FreeBSD_version for commit 5a45802b3c8c
Rick Macklem [Fri, 30 Apr 2021 01:29:25 +0000 (18:29 -0700)]
param.h: bump __FreeBSD_version for commit 5a45802b3c8c

Commit 5a45802b3c8c changed the internal KAPI between the krpc
and NFS.  As such, the krpc, nfscommon and nfscl modules must
all be rebuilt from sources.

3 years agonfsv4 client: do the BindConnectionToSession as required
Rick Macklem [Sun, 11 Apr 2021 21:34:57 +0000 (14:34 -0700)]
nfsv4 client: do the BindConnectionToSession as required

During a recent testing event, it was reported that the NFSv4.1/4.2
server erroneously bound the back channel to a new TCP connection.
RFC5661 specifies that the fore channel is implicitly bound to a
new TCP connection when an RPC with Sequence (almost any of them)
is done on it.  For the back channel to be bound to the new TCP
connection, an explicit BindConnectionToSession must be done as
the first RPC on the new connection.

Since new TCP connections are created by the "reconnect" layer
(sys/rpc/clnt_rc.c) of the krpc, this patch adds an optional
upcall done by the krpc whenever a new connection is created.
The patch also adds the specific upcall function that does a
BindConnectionToSession and configures the krpc to call it
when required.

This is necessary for correct interoperability with NFSv4.1/NFSv4.2
servers when the nfscbd daemon is running.

If doing NFSv4.1/NFSv4.2 mounts without this patch, it is
recommended that the nfscbd daemon not be running and that
the "pnfs" mount option not be specified.

PR: 254840

(cherry picked from commit 7763814fc9c27a98fefcbf582d7a936ea43af23a)

3 years agopass UNAME_r to fix building 14.x ports on 13.x
Glen Barber [Thu, 18 Feb 2021 23:52:39 +0000 (18:52 -0500)]
pass UNAME_r to fix building 14.x ports on 13.x

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 80ab50e1de19ca125f05a13937c796d48c4edd4a)

3 years agorelease: fix VMSIZE following 1ca8842f3ad9
Glen Barber [Thu, 4 Mar 2021 13:39:43 +0000 (08:39 -0500)]
release: fix VMSIZE following 1ca8842f3ad9

truncate(1) is not case-sensitive with regard to setting the size
of a file.  makefs(8), however, does not honor upper-case values.
Update release-specific files and the release(7) manual page to
reflect this.

Submitted by: ehem_freebsd_m5p.com (original)
Differential Review: https://reviews.freebsd.org/D28979
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit fa04db476201c4cad5f6a5f67da8f2ef1e1cdad3)

3 years agorelease: do not set __MAKE_CONF and SRCCONF for the chroot build
Glen Barber [Tue, 16 Mar 2021 16:01:48 +0000 (12:01 -0400)]
release: do not set __MAKE_CONF and SRCCONF for the chroot build

PR: 254319
Submitted by: truckman
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 0af8a2db34cff008d4f48f357da48b7379b18893)

3 years agorelease: sync 'git count' logic with newvers.sh
Glen Barber [Wed, 17 Mar 2021 14:57:32 +0000 (10:57 -0400)]
release: sync 'git count' logic with newvers.sh

Sync determining the git count with newvers.sh by adding the
--first-parent argument.  This ensures uname(1) reflects the
file name for snapshots.

Reported by: Mark Millard
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit e5c6913a8d23ebe49c9e8f95c5236c7a0d8dbac5)

3 years agorelease.sh: Skip installing textproc/docproj when NODOC is set
Glen Barber [Wed, 3 Feb 2021 00:04:11 +0000 (19:04 -0500)]
release.sh: Skip installing textproc/docproj when NODOC is set

PR: 253192
Submitted by: Yasuhiro Kimura
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 805e2876ec20f89e45f0f9f4164f31b6711ff0ea)

3 years agoAdd some regression tests for O_PATH and AT_EMPTY_PATH
Mark Johnston [Thu, 15 Apr 2021 13:40:57 +0000 (09:40 -0400)]
Add some regression tests for O_PATH and AT_EMPTY_PATH

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29719

(cherry picked from commit 3a248c84419d4f7d6617d30744ab56d0b456fe03)

3 years agopmcstat: fix the usage message for -t
Mitchell Horne [Wed, 21 Apr 2021 20:44:52 +0000 (17:44 -0300)]
pmcstat: fix the usage message for -t

A slight mix-up of the flags means this case isn't triggered when it
should be. Now, `pmcstat -s event -t 1234` will print the correct
error message.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c4473add1d3d588d8747cab86796d2f2d4c8847c)

3 years agopmcstat: set initial counter value to zero
Mitchell Horne [Wed, 21 Apr 2021 20:28:12 +0000 (17:28 -0300)]
pmcstat: set initial counter value to zero

For an infrequent event, pmcstat may report (u_long)-1 for CPUs where
the counter was never incremented. Just set this to zero, instead.

ev->ev_count is passed as the 'count' argument to pmc_allocate(3), but
this wasn't always the case.

Reviewed by: gnn
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29887

(cherry picked from commit edcf9e59c356525632dd2546d72916aeca609a2b)

3 years agopmc_allocate(3): document the count argument
Mitchell Horne [Wed, 21 Apr 2021 20:27:49 +0000 (17:27 -0300)]
pmc_allocate(3): document the count argument

This was added in b2ca2e50b9aa, and serves to provide an initial value
to the PMC, eliminating the need for a second syscall via pmc_set(3).

Reviewed by: gnn, 0mp (manpages)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29885

(cherry picked from commit 50f6c139970084adeefec98c658645c34b72209e)

3 years ago[fib algo] always commit static routes synchronously.
Alexander V. Chernikov [Tue, 27 Apr 2021 08:23:29 +0000 (08:23 +0000)]
[fib algo] always commit static routes synchronously.

Modular fib lookup framework features logic that allows
 route update batching for the algorithms that cannot easily
 apply the routing change without rebuilding. As a result,
 dataplane lookups may return old data until the the sync
 takes place. With the default sync timeout of 50ms, it is
 possible that new binary like ping(8) executed exactly after
 route(8) will still use the old fib data.

To address some aspects of the problem, framework executes
 all rtable changes without RTF_GATEWAY synchronously.

To fix the aforementioned problem, this diff extends sync
 execution for all RTF_STATIC routes (e.g. ones maintained by
 route(8).
This fixes a bunch of tests in the networking space.

Reported by: ci, arichardson
MFC after: 2 weeks

(cherry picked from commit 439d087d0b55574db81f4a2799a411c1236d95e3)

3 years agoFix NOINET[6],!VIMAGE builds after FIB_ALGO addition to GENERIC
Alexander V. Chernikov [Wed, 21 Apr 2021 04:52:38 +0000 (05:52 +0100)]
Fix NOINET[6],!VIMAGE builds after FIB_ALGO addition to GENERIC

Reported by: jbeich
PR: 255390

(cherry picked from commit 7d222ce3c10bdc23c8dc92d6b13e376ede5840d5)

3 years agoFix NOINET[6] build after enabling FIB_ALGO in GENERIC.
Alexander V. Chernikov [Wed, 21 Apr 2021 01:45:49 +0000 (02:45 +0100)]
Fix NOINET[6] build after enabling FIB_ALGO in GENERIC.

Submitted by: jbeich
PR: 255389

(cherry picked from commit 67372fb3e06ebaccfe7c093aa78009d161fa58e6)

3 years agoFix rib generation count for fib algo.
Alexander V. Chernikov [Sat, 17 Apr 2021 18:58:12 +0000 (18:58 +0000)]
Fix rib generation count for fib algo.

Currently, PCB caching mechanism relies on the rib generation
 counter (rnh_gen) to invalidate cached nhops/LLE entries.

With certain fib algorithms, it is now possible that the
 datapath lookup state applies RIB changes with some delay.
In that scenario, PCB cache will invalidate on the RIB change,
 but the new lookup may result in the same nexthop being returned.
When fib algo finally gets in sync with the RIB changes, PCB cache
 will not receive any notification and will end up caching the stale data.

To fix this, introduce additional counter, rnh_gen_rib, which is used
 only when FIB_ALGO is enabled.
This counter is incremented by the control plane. Each time when fib algo
 synchronises with the RIB, it updates rnh_gen to the current rnh_gen_rib value.

Differential Revision: https://reviews.freebsd.org/D29812
Reviewed by: donner
MFC after: 2 weeks

(cherry picked from commit 33cb3cb2e3212705b10e7885b37f70a3c2987c9e)

3 years agoAdd batched update support for the fib algo.
Alexander V. Chernikov [Fri, 9 Apr 2021 21:30:10 +0000 (22:30 +0100)]
Add batched update support for the fib algo.

Initial fib algo implementation was build on a very simple set of
 principles w.r.t updates:

1) algorithm is ether able to apply the change synchronously (DIR24-8)
 or requires full rebuild (bsearch, lradix).
2) framework falls back to rebuild on every error (memory allocation,
 nhg limit, other internal algo errors, etc).

This changes brings the new "intermediate" concept - batched updates.
Algotirhm can indicate that the particular update has to be handled in
 batched fashion (FLM_BATCH).
The framework will write this update and other updates to the temporary
 buffer instead of pushing them to the algo callback.
Depending on the update rate, the framework will batch 50..1024 ms of updates
 and submit them to a different algo callback.

This functionality is handy for the slow-to-rebuild algorithms like DXR.

Differential Revision: https://reviews.freebsd.org/D29588
Reviewed by: zec
MFC after: 2 weeks

(cherry picked from commit 6b8ef0d428c93c970c1951a52c72f9e99c9e4279)

3 years agoFix build with gcc
Stefan Eßer [Sun, 25 Apr 2021 08:15:17 +0000 (10:15 +0200)]
Fix build with gcc

Correctly declare function without arguments as f(void) instead of f().

(cherry picked from commit 6409e594272f66ce3896706ac705bbd465ce233e)

3 years agofib algo: do not reallocate datapath index for datapath ptr update.
Alexander V. Chernikov [Sun, 18 Apr 2021 15:03:58 +0000 (16:03 +0100)]
fib algo: do not reallocate datapath index for datapath ptr update.

Fib algo uses a per-family array indexed by the fibnum to store
 lookup function pointers and per-fib data.

Each algorithm rebuild currently requires re-allocating this array
 to support atomic change of two pointers.

As in reality most of the changes actually involve changing only
 data pointer, add a shortcut performing in-flight pointer update.

MFC after: 2 weeks

(cherry picked from commit 0abb6ff590842114c74e5d52e1af65605bd9d960)

3 years agoImplement better rebuild-delay fib algo policy.
Alexander V. Chernikov [Fri, 9 Apr 2021 20:25:47 +0000 (21:25 +0100)]
Implement better rebuild-delay fib algo policy.

The intent is to better handle time intervals with large amount of RIB
updates (e.g. BGP peer going up or down), while still keeping low sync
delay for the rest scenarios.

The implementation is the following: updates are bucketed into the
buckets of size 50ms. If the number of updates within a current bucket
 exceeds the threshold of 500 routes/sec (e.g. 10 updates per bucket
interval), the update is delayed for another 50ms. This can be repeated
 until the maximum update delay (1 sec) is reached.

All 3 variables are runtime tunables:

* net.route.algo.fib_max_sync_delay_ms: 1000
* net.route.algo.bucket_change_threshold_rate: 500
* net.route.algo.bucket_time_ms: 50

Differential Review: https://reviews.freebsd.org/D29588
MFC after: 2 weeks

(cherry picked from commit ee2cf2b3609ee179f39080e0ebe8bf79dcb13461)

3 years agoAppease -Wsign-compare in radix.c
Alexander V. Chernikov [Sat, 10 Apr 2021 13:48:25 +0000 (13:48 +0000)]
Appease -Wsign-compare in radix.c

Differential Revision: https://reviews.freebsd.org/D29661
Submitted by: zec
MFC after 2 weeks

(cherry picked from commit 63dceebe68569c3a7ebd07d0a6123264da625149)

3 years agoAllow to specify debugnet fib in sysctl/tunable.
Alexander V. Chernikov [Mon, 5 Apr 2021 19:48:07 +0000 (19:48 +0000)]
Allow to specify debugnet fib in sysctl/tunable.

Differential Revision: https://reviews.freebsd.org/D29593
Reviewed by: donner
MFC after: 2 weeks

(cherry picked from commit caf2f62765f9087a6e0002b1c47c3c6f65a8ae0b)

3 years agoAlways use inp fib in the inp_lookup_mcast_ifp().
Alexander V. Chernikov [Mon, 5 Apr 2021 19:58:57 +0000 (19:58 +0000)]
Always use inp fib in the inp_lookup_mcast_ifp().

inp_lookup_mcast_ifp() is static and is only used in the inp_join_group().
The latter function is also static, and is only used in the inp_setmoptions(),
 which relies on inp being non-NULL.

As a result, in the current code, inp_lookup_mcast_ifp() is always called
 with non-NULL inp. Eliminate unused RT_DEFAULT_FIB condition and always
 use inp fib instead.

Differential Revision: https://reviews.freebsd.org/D29594
Reviewed by: kp
MFC after: 2 weeks

(cherry picked from commit c3a456defaf28df8d6f47704d606248f6c22146c)

3 years agoe1000: Restore VF interface random MAC
Kevin Bowling [Thu, 15 Apr 2021 18:45:02 +0000 (11:45 -0700)]
e1000: Restore VF interface random MAC

Restore 525e07418c77 after the iflib conversion of igb(4). This
reenables random MAC address generation when attaching to a VF with a
zeroed MAC.

PR: 253535
Reported by: Balaev PA <mail@void.so>
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29785

(cherry picked from commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e)

3 years agolibfetch: Retry with proxy auth when server returns 407
Renato Botelho [Thu, 1 Apr 2021 21:02:57 +0000 (18:02 -0300)]
libfetch: Retry with proxy auth when server returns 407

PR: 220468
Submitted by: Egil Hasting <egil.hasting@higen.org> (based on)
Reviewed by: kevans, kp
Approved by: kp
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29533

(cherry picked from commit 345c30a94f6425954163f1e0b075a75f603d27cd)

3 years agopf tests: IPv6 test case for the 'kill state(s)' feature
Kristof Provost [Fri, 16 Apr 2021 15:47:47 +0000 (17:47 +0200)]
pf tests: IPv6 test case for the 'kill state(s)' feature

Reviewed by: donner
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29797

(cherry picked from commit 9af2317423f399b30ff028e078d01eef553efc7f)

3 years agopf tests: Test cases for the 'kill state(s)' feature
Kristof Provost [Fri, 16 Apr 2021 15:33:17 +0000 (17:33 +0200)]
pf tests: Test cases for the 'kill state(s)' feature

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29796

(cherry picked from commit 065b5c7fb26eb4239e9bd513dde5a55ef78e45c4)

3 years agopf: Refactor state killing
Kristof Provost [Fri, 16 Apr 2021 14:34:21 +0000 (16:34 +0200)]
pf: Refactor state killing

Extract the state killing code from pfioctl() and rephrase the filtering
conditions for readability.

No functional change intended.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29795

(cherry picked from commit 586aab9e0aa6c811758c19fb03831fc1e7305252)

3 years agouma: Introduce per-domain reclamation functions
Mark Johnston [Wed, 14 Apr 2021 16:57:24 +0000 (12:57 -0400)]
uma: Introduce per-domain reclamation functions

Make it possible to reclaim items from a specific NUMA domain.

- Add uma_zone_reclaim_domain() and uma_reclaim_domain().
- Permit parallel reclamations.  Use a counter instead of a flag to
  synchronize with zone_dtor().
- Use the zone lock to protect cache_shrink() now that parallel reclaims
  can happen.
- Add a sysctl that can be used to trigger reclamation from a specific
  domain.

Currently the new KPIs are unused, so there should be no functional
change.

Reviewed by: mav
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29685

(cherry picked from commit aabe13f1450bb4caba66ec2a7a41c0dfefff511d)

3 years agouma: Split bucket_cache_drain() to permit per-domain reclamation
Mark Johnston [Fri, 9 Apr 2021 13:47:09 +0000 (09:47 -0400)]
uma: Split bucket_cache_drain() to permit per-domain reclamation

Note that the per-domain variant does not shrink the target bucket size.

No functional change intended.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 54f421f9e84234c4313f2d636e4ebd74009a74d6)

3 years agodomainset: Define additional global policies
Mark Johnston [Wed, 14 Apr 2021 16:56:39 +0000 (12:56 -0400)]
domainset: Define additional global policies

Add global definitions for first-touch and interleave policies.  The
former may be useful for UMA, which implements a similar policy without
using domainset iterators.

No functional change intended.

Reviewed by: mav
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29104

(cherry picked from commit 29bb6c19f044274cc6693f0c2463ca22106cd3ab)

3 years agoAdd required checks for unmapped mbufs in ipdivert and ipfw
Mark Johnston [Wed, 21 Apr 2021 19:38:01 +0000 (15:38 -0400)]
Add required checks for unmapped mbufs in ipdivert and ipfw

Also add an M_ASSERTMAPPED() macro to verify that all mbufs in the chain
are mapped.  Use it in ipfw_nat, which operates on a chain returned by
m_megapullup().

PR: 255164
Reviewed by: ae, gallatin
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29838

(cherry picked from commit 652908599b6fa7285ee60cb567b97e70b648ac29)

3 years agoipfw: do not use sleepable malloc in callout context.
Andrey V. Elsukov [Fri, 16 Apr 2021 07:22:44 +0000 (10:22 +0300)]
ipfw: do not use sleepable malloc in callout context.

Use M_NOWAIT flag when hash growing is called from callout.

PR:             255041
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D29772

(cherry picked from commit 9bacbf1ae243de43d642c3ac0b7318ae0e5c5235)

3 years agoloader: do not output empty menu title
Toomas Soome [Wed, 21 Apr 2021 11:42:10 +0000 (14:42 +0300)]
loader: do not output empty menu title

As we output spaces around the menu title, we should also check,
if the title is actually empty string.

PR: 255299
Submitted by: Jose Luis Duran
Reported by: Jose Luis Duran

(cherry picked from 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69)

3 years agolibkiconv: address memory leak in not-found cases
Ed Maste [Wed, 21 Apr 2021 17:45:27 +0000 (13:45 -0400)]
libkiconv: address memory leak in not-found cases

Found in "Understanding and Detecting Disordered Error Handling with
Precise Function Pairing" by Qiushi Wu et al.

Reviewed by: imp, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29896

(cherry picked from commit 3cfd08c1c74058451a02bac35307bf7fa509c617)

3 years agoFix rtsock sockaddr alignment.
Alexander V. Chernikov [Tue, 27 Apr 2021 08:04:19 +0000 (08:04 +0000)]
Fix rtsock sockaddr alignment.

b31fbebeb3 introduced alloc_sockaddr_aligned() which, in fact,
 failed to produce aligned addresses.

Reported by: Oskar Holmlund <oskar.holmlund at yahoo.com>
MFC after: immediately

(cherry picked from commit 25682e6a495fc6669d799bb64acdaf14d653173e)

3 years agowlanstats: fix build
Sofian Brabez [Tue, 20 Apr 2021 18:31:48 +0000 (18:31 +0000)]
wlanstats: fix build

Add -Wno-cast-align to the CFLAGS to fix the build of wlanstats

Approved by: adrian
MFC after: 1 week

(cherry picked from commit b8be8094958a01255f5430bd6a36ff936bdd53c3)

3 years agoiwnstats: fix build with clang and allow install under /usr/local/sbin
Sofian Brabez [Tue, 20 Apr 2021 17:58:46 +0000 (17:58 +0000)]
iwnstats: fix build with clang and allow install under /usr/local/sbin

iwnstats was not compiling because of some issues raised by the clang
compiler due to -Werror. As a tool it is not connected to world build.

Add missing field "barker_mrc" initialization in struct
iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused
pointer *is on iwn_stats_*_print functions and unused variables for
-Wunused-parameter and -Wunused-variable.

The value for field "barker_mrc" of struct iwn2030_sensitivity_limits
was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115
.barker_corr_th_min_mrc = 390).

Also set BINDIR in Makefile to make it possible to install under
/usr/local/sbin/iwnstats as it require super user.

Reviewed by: adrian
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29800

(cherry picked from commit 561d34d70596b455c6a513431f8ad007076f90c5)

3 years agoFix race in case of device destruction.
Alexander Motin [Tue, 13 Apr 2021 15:19:10 +0000 (11:19 -0400)]
Fix race in case of device destruction.

During device destruction it is possible that open() succeed, but
fdevname() return NULL, that can't be assigned to string variable.
Fix that by adding explicit NULL check.

Also while there switch from fdevname() to fdevname_r().

Sponsored by: iXsystems, Inc.
MFC after: 2 weeks

(cherry picked from commit e49d3eb40324eaffaa13b93f2c4173dfa04dfa34)

3 years ago__FreeBSD_version: update the references to the doc tree
Ka Ho Ng [Thu, 22 Apr 2021 09:36:22 +0000 (17:36 +0800)]
__FreeBSD_version: update the references to the doc tree

Update the reference of which file to update in the doc tree when
bumping __FreeBSD_version.

This change is to catch up with commit f8fed61b80 in the doc repository.

Approved by: lwhsu (mentor), philip (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29920

(cherry picked from commit 7c707c7c25ad361f911716c31d22f5722f4dffc9)

3 years agovnode_pager_setsize.9: Some clarifications on the manpage
Ka Ho Ng [Sun, 11 Apr 2021 06:45:37 +0000 (14:45 +0800)]
vnode_pager_setsize.9: Some clarifications on the manpage

A number of changes:
- Clarifies the locking rules when calling the routine.
- Correct the description regarding the content range to be purged.
- Document the effects on page fault handler.

MFC with: 86a52e262a6f
Sponsored by: The FreeBSD Foundation
Reviewed by: bcr, kib
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D29637

(cherry picked from commit b77f5f5553e8ac7868b4b234a36bda3cf2db0907)

3 years agoDocument vnode_pager_setsize(9)
Ka Ho Ng [Wed, 7 Apr 2021 11:00:31 +0000 (19:00 +0800)]
Document vnode_pager_setsize(9)

Sponsored by: The FreeBSD Foundation
Reviewed by: bcr
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D29408

(cherry picked from commit 86a52e262a6faf75ee34eaa801f6d8ddaad20733)

3 years agoUse makefs(8) in release VM-image generation instead of md(4) and newfs.
Nathan Whitehorn [Thu, 25 Feb 2021 02:16:56 +0000 (21:16 -0500)]
Use makefs(8) in release VM-image generation instead of md(4) and newfs.

Using makefs instead reduces the privileges needed to build VM images,
simplifies the script (no need to copy files to a fresh image at the end),
and improves portability by allowing generation of cross-endian images.
As a result of the last, this patch also adds support for generation of
powerpc64 and powerpc64le VM images.

No other changes to the output. Tested and working for both amd64 and
powerpc64 targets.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D28912

(cherry picked from commit 1ca8842f3ad9725863c9affc044d1974a51818a9)

3 years agoAllocate extra inodes in makefs when leaving free space in UFS images.
Nathan Whitehorn [Tue, 6 Apr 2021 17:43:29 +0000 (13:43 -0400)]
Allocate extra inodes in makefs when leaving free space in UFS images.

By default, makefs(8) has very few spare inodes in its output images,
which is fine for static filesystems, but not so great for VM images
where many more files will be added. Make makefs(8) use the same
default settings as newfs(8) when creating images with free space --
there isn't much point to leaving free space on the image if you
can't put files there. If no free space is requested, use current
behavior of a minimal number of available inodes.

Reviewed by: manu
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D29492

(cherry picked from commit afb6a168f8ee08ac74769464726c396fbef83d0b)

3 years agocxgbe: Ignore doomed virtual interfaces when updating the clip table.
John Baldwin [Mon, 12 Apr 2021 21:36:40 +0000 (14:36 -0700)]
cxgbe: Ignore doomed virtual interfaces when updating the clip table.

A doomed VI does not have a valid ifnet.

Reported by: Jithesh Arakkan @ Chelsio
Sponsored by: Chelsio Communications

(cherry picked from commit 45d5c28439f2464dd5022abb0dd53f9da649686c)

3 years agoiscsi: Kick threads out of iscsi_ioctl() during unload.
John Baldwin [Mon, 12 Apr 2021 20:56:16 +0000 (13:56 -0700)]
iscsi: Kick threads out of iscsi_ioctl() during unload.

iscsid can be sleeping in iscsi_ioctl() causing the destroy_dev() to
sleep forever if iscsi.ko is unloaded while iscsid is running.

Reported by: Jithesh Arakkan @ Chelsio
Sponsored by: Chelsio Communications

(cherry picked from commit 89df484739efe93b52da467f35255ae538bb946b)

3 years agocxgbe: Add counters for iSCSI PDUs transmitted via TOE.
John Baldwin [Mon, 12 Apr 2021 20:56:04 +0000 (13:56 -0700)]
cxgbe: Add counters for iSCSI PDUs transmitted via TOE.

Sponsored by: Chelsio Communications

(cherry picked from commit 568e69e4eb0ad1a5c69d8ea4592a4314bd6b6679)

3 years agocxgbe: Make the TOE TLS stats per-queue instead of per-port.
John Baldwin [Fri, 26 Mar 2021 22:05:44 +0000 (15:05 -0700)]
cxgbe: Make the TOE TLS stats per-queue instead of per-port.

This avoids some atomics by using counter_u64 for TX and relying on
existing single-threading (single ithread per rxq) for RX.

Sponsored by: Chelsio Communications

(cherry picked from commit fe496dc02a9a276d940e72bbd155dc256a34076f)

3 years agocxgbe: Add a struct sge_ofld_txq type.
John Baldwin [Fri, 26 Mar 2021 22:05:31 +0000 (15:05 -0700)]
cxgbe: Add a struct sge_ofld_txq type.

This type mirrors struct sge_ofld_rxq and holds state for TCP offload
transmit queues.  Currently it only holds a work queue but will
include additional state in future changes.

Sponsored by: Chelsio Communications

(cherry picked from commit 077ba6a845fab8f1d3bd83e07f61730f202a46fc)

3 years agocxgbei: Enter network epoch and set vnet around t4_push_pdus().
John Baldwin [Mon, 22 Mar 2021 16:59:16 +0000 (09:59 -0700)]
cxgbei: Enter network epoch and set vnet around t4_push_pdus().

Sponsored by: Chelsio Communications

(cherry picked from commit 90c74b2b6004bc50f89378ac689fd179aa2d2ad6)

3 years agocxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED.
John Baldwin [Mon, 22 Mar 2021 16:59:09 +0000 (09:59 -0700)]
cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED.

This avoids mixing the use of two different enums which modern C
compilers warn about.

Sponsored by: Chelsio Communications

(cherry picked from commit 017902fc5f07114e7baba94bb4720c8b41ddea0f)

3 years agocxgbei: Pass ULP submode directly to set_ulp_mode_iscsi().
John Baldwin [Mon, 22 Mar 2021 16:59:02 +0000 (09:59 -0700)]
cxgbei: Pass ULP submode directly to set_ulp_mode_iscsi().

Sponsored by: Chelsio Communications

(cherry picked from commit 8855ed61b5b7de94744fc415e5f049fee342d6b5)

3 years agocxgbei: Move some function prototypes to cxgbei.h.
John Baldwin [Mon, 22 Mar 2021 16:58:54 +0000 (09:58 -0700)]
cxgbei: Move some function prototypes to cxgbei.h.

Sponsored by: Chelsio Communications

(cherry picked from commit 45eed2331e8f796a6c315374d85a9485a29e2536)

3 years agocxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp().
John Baldwin [Mon, 22 Mar 2021 16:58:28 +0000 (09:58 -0700)]
cxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp().

Sponsored by: Chelsio Communications

(cherry picked from commit 52c11c3f744c8a68fb71a1343e8ffb4a9f70072a)

3 years agoFix a typo in a comment: frame -> framework.
John Baldwin [Tue, 16 Mar 2021 22:33:20 +0000 (15:33 -0700)]
Fix a typo in a comment: frame -> framework.

Sponsored by: Chelsio Communications

(cherry picked from commit 86e352c934e5af49866d13a79ddb7c6fbf090cb9)

3 years agoccr: Disable requests on port 1 when needed to workaround a firmware bug.
John Baldwin [Fri, 12 Mar 2021 18:35:56 +0000 (10:35 -0800)]
ccr: Disable requests on port 1 when needed to workaround a firmware bug.

Completions for crypto requests on port 1 can sometimes return a stale
cookie value due to a firmware bug.  Disable requests on port 1 by
default on affected firmware.

Sponsored by: Chelsio Communications

(cherry picked from commit 5fe0cd6503d34d23c98e9e1ff7bf10340218a5ec)

3 years agoccr: Add per-port stats of queued and completed requests.
John Baldwin [Fri, 12 Mar 2021 18:35:32 +0000 (10:35 -0800)]
ccr: Add per-port stats of queued and completed requests.

Sponsored by: Chelsio Communications

(cherry picked from commit 9c5137beb5f28292410888d0770bdf24c15e1312)

3 years agoccr: Set the RX channel ID correctly in work requests.
John Baldwin [Fri, 12 Mar 2021 18:35:05 +0000 (10:35 -0800)]
ccr: Set the RX channel ID correctly in work requests.

These fixes are only relevant for requests on the second port.  In
some cases, the crypto completion data, completion message, and
receive descriptor could be written in the wrong order.

- Add a separate rx_channel_id that is a copy of the port's rx_c_chan
  and use it when an RX channel ID is required in crypto requests
  instead of using the tx_channel_id.

- Set the correct rx_channel_id in the CPL_RX_PHYS_ADDR used to write
  the crypto result.

- Set the FID to the first rx queue ID on the adapter rather than the
  queue ID of the first rx queue for the port.

- While here, use tx_chan to set the tx_channel_id though this is
  identical to the previous value.

Reported by: Chelsio QA
Sponsored by: Chelsio Communications

(cherry picked from commit 8f885fd1f38159a06db82d680fa259f358e9f872)

3 years agocxgbe(4): Read the rx 'c' channel for a port and make it available.
Navdeep Parhar [Fri, 26 Feb 2021 02:10:52 +0000 (18:10 -0800)]
cxgbe(4): Read the rx 'c' channel for a port and make it available.

Sponsored by: Chelsio Communications

(cherry picked from commit dfff1de729bd73004404863b7f9e8a9bda7b0f04)

3 years agoHandle negative return values from syncache_expand().
John Baldwin [Wed, 17 Feb 2021 21:28:04 +0000 (13:28 -0800)]
Handle negative return values from syncache_expand().

These errors do not clear so to NULL, so the existing check was
treating these failures as success.  The rest of do_pass_establish()
then tried to use the listen socket as if it was a connection socket
newly created by syncache_expand().

In addition, for negative return values, do not send a RST to the
peer.

Reported by: Sony Arpita Das @ Chelsio
Sponsored by: Chelsio Communications

(cherry picked from commit 1deaad936417ed2315476718fbd2648de08585bf)

3 years agolinuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave()
Neel Chauhan [Mon, 26 Apr 2021 15:25:33 +0000 (08:25 -0700)]
linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave()

(cherry picked from commit e657f3de6dc29147b5373d2cc2cc47e580931e30)

3 years agolinuxkpi: Elimiate brackets on return in spinlock.h
Neel Chauhan [Mon, 26 Apr 2021 15:16:48 +0000 (08:16 -0700)]
linuxkpi: Elimiate brackets on return in spinlock.h

(cherry picked from commit c8de6e20150a3c10575a27532a25b00342a7f452)

3 years agolinuxkpi: Implement atomic_dec_and_lock_irqsave()
Neel Chauhan [Mon, 26 Apr 2021 15:15:49 +0000 (08:15 -0700)]
linuxkpi: Implement atomic_dec_and_lock_irqsave()

This is needed by the drm-kmod 5.5 update.

Reviewed by: hselasky, manu
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29988

(cherry picked from commit ce65353ac1a17677bef03e96df8da967c9086743)

3 years agolinuxkpi: Implement the wait_event_interruptible macro
Neel Chauhan [Mon, 26 Apr 2021 15:12:18 +0000 (08:12 -0700)]
linuxkpi: Implement the wait_event_interruptible macro

This is needed by the drm-kmod 5.5 update and is similar in logic to the
existing wait_event_killable macro.

Reviewed by: hselasky, manu
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29987

(cherry picked from commit 057f145aae9a3528ccd722c8f566d740d5cafcbb)

3 years agoports.7: Add an example of setting variables for selected ports
Mateusz Piotrowski [Sat, 16 Jan 2021 23:10:44 +0000 (00:10 +0100)]
ports.7: Add an example of setting variables for selected ports

Reviewed by: crees
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28202

(cherry picked from commit c0e41dff700cf8a4a06000f19bd2342cd6fe284d)

3 years agoFix zgrep --version
Mateusz Piotrowski [Tue, 13 Apr 2021 10:12:53 +0000 (12:12 +0200)]
Fix zgrep --version

"zgrep --version" is expected to print the version information in the
same way as "zgrep -V". However, the case handling the --version flag
is never reached, so "zgrep --version" prints:
    zgrep: missing pattern
instead of:
    grep (BSD grep, GNU compatible) 2.6.0-FreeBSD

Reviewed by: yuripv
Approved by: yuripv (src)
Differential Revision: https://reviews.freebsd.org/D29813

(cherry picked from commit 16e0391f8e2124eb85af984204548cf841648db5)

3 years ago[fib algo] Do not print algo attach/detach message on boot
Alexander V. Chernikov [Sun, 25 Apr 2021 08:51:57 +0000 (08:51 +0000)]
[fib algo] Do not print algo attach/detach message on boot

MFC after: 1 day

(cherry picked from commit c23385612da5dd3195a9b73bfb22bd969dbd26c2)

3 years agoMake gcc happy by initializing error in rib_handle_ifaddr_info().
Alexander V. Chernikov [Sun, 25 Apr 2021 08:44:20 +0000 (08:44 +0000)]
Make gcc happy by initializing error in rib_handle_ifaddr_info().

(cherry picked from commit a81e2e7890c2fce2a74dbb859e6855e0414a6ea1)

3 years agoImprove debugging output on routing tests failure.
Alexander V. Chernikov [Fri, 23 Apr 2021 21:28:38 +0000 (21:28 +0000)]
Improve debugging output on routing tests failure.

Most of the routing tests create per-test VNET, making
 it harder to repeat the failure with CLI tools.
Provide an additional route/nexthop data on failure.

Differential Revision: https://reviews.freebsd.org/D29957
Reviewed by: kp
MFC after: 2 weeks

(cherry picked from commit bddae5c8a64dc6b292198945cbe676bb2158d438)

3 years agoRelax rtsock message restrictions.
Alexander V. Chernikov [Mon, 19 Apr 2021 20:49:18 +0000 (20:49 +0000)]
Relax rtsock message restrictions.

Address multiple issues with strict rtsock message validation.

D28668 "normalisation" approach was based on the assumption that
 we always have at least "standard" sockaddr len.
It turned out to be false - certain older applications like quagga
 or routed abuse sin[6]_len field and set it to the offset to the
 first fully-zero bit in the mask. It is impossible to normalise
 such sockaddrs without reallocation.

With that in mind, change the approach to use a distinct memory
 buffer for the altered sockaddrs. This allows supporting the older
 software while maintaining the guarantee on the "standard" sockaddrs.

PR: 255273,255089
Differential Revision: https://reviews.freebsd.org/D29826
MFC after: 3 days

(cherry picked from commit b31fbebeb3d59af359a3417cddfbcf666b2c56c9)

3 years agoImprove error reporting in rtsock.c
Alexander V. Chernikov [Mon, 19 Apr 2021 20:36:41 +0000 (20:36 +0000)]
Improve error reporting in rtsock.c

MFC after: 3 days

(cherry picked from commit 758c9d54d44f8ce957570b8c2ef6d1b3f28a792d)

3 years agoFix typo in rtsock_common.h
Alexander V. Chernikov [Mon, 19 Apr 2021 20:24:42 +0000 (20:24 +0000)]
Fix typo in rtsock_common.h

MFC after: 3 days

(cherry picked from commit 37c0f4a2077739e735732374d67525cf6de36d21)

3 years agoFib algo: extend KPI by allowing algo to set datapath pointers.
Alexander V. Chernikov [Thu, 15 Apr 2021 17:44:11 +0000 (18:44 +0100)]
Fib algo: extend KPI by allowing algo to set datapath pointers.

Some algorithms may require updating datapath and control plane
 algo pointers after the (batched) updates.

Export fib_set_datapath_ptr() to allow setting the new datapath
 function or data pointer from the algo.
Add fib_set_algo_ptr() to allow updating algo control plane
 pointer from the algo.
Add fib_epoch_call() epoch(9) wrapper to simplify freeing old
 datapath state.

Reviewed by: zec
Differential Revision: https://reviews.freebsd.org/D29799
MFC after: 1 week

(cherry picked from commit e2f79d9e518f885bf875f6613e70af39b7c397de)

3 years agolinuxkpi: reduce number of stray mm_struct allocations
Konstantin Belousov [Thu, 11 Mar 2021 06:48:22 +0000 (08:48 +0200)]
linuxkpi: reduce number of stray mm_struct allocations

(cherry picked from commit fad437ba612a7c19f5cf1633e2d0d1c44d4dd478)

3 years agolinuxkpi: guarantee allocations of task and mm for interrupt threads
Konstantin Belousov [Thu, 11 Mar 2021 06:34:42 +0000 (08:34 +0200)]
linuxkpi: guarantee allocations of task and mm for interrupt threads

(cherry picked from commit 165ba13fb806c8596f868981883631a5ee78d6c8)

3 years agolinuxkpi: some style, wrap too long lines
Konstantin Belousov [Thu, 11 Mar 2021 06:08:51 +0000 (08:08 +0200)]
linuxkpi: some style, wrap too long lines

(cherry picked from commit 4ce1f6162e9eb576ac40f24b8538f55e83ef5eb4)

3 years agoixgbe: Clarify index name in ixgbe_mc_filter_apply
Kevin Bowling [Sat, 17 Apr 2021 01:17:43 +0000 (18:17 -0700)]
ixgbe: Clarify index name in ixgbe_mc_filter_apply

"It looks like it would be less confusing to rename 'count' to
something like 'idx', since that's what it's used for in this
function."

Reviewed by: erj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29798

(cherry picked from commit 21afed4b1d18578aa8c9fa31e9e677971f8b4300)

3 years agonfsd: fix replies from session cache for multiple retries
Rick Macklem [Sat, 10 Apr 2021 22:50:25 +0000 (15:50 -0700)]
nfsd: fix replies from session cache for multiple retries

Recent testing of network partitioning a FreeBSD NFSv4.1
server from a Linux NFSv4.1 client identified problems
with both the FreeBSD server and Linux client.

Commit 05a39c2c1c18 fixed replying with the cached reply in
in the session slot if same session slot sequence#.
However, the code uses the reply and, as such,
will fail for a subsequent retry of the RPC.
A subsequent retry would be an extremely rare event,
but this patch fixes this, so long as m_copym(..M_NOWAIT)
does not fail, which should also be a rare event.

This fix affects the exceedingly rare case where a NFSv4
client retries a non-idempotent RPC, such as a lock
operation, multiple times.  Note that retries only occur
after the client has needed to create a new TCP connection,
with a new TCP connection for each retry.

(cherry picked from commit 22cefe3d8378f58adcdbb2c7589b9f30c2a38315)

3 years agompt(4): Remove incorrect S/G segments limits.
Alexander Motin [Sat, 17 Apr 2021 14:41:35 +0000 (10:41 -0400)]
mpt(4): Remove incorrect S/G segments limits.

First, two of those four checks are unreachable.
Second, I don't believe there should be ">=" instead of ">".
Third, bus_dma(9) already returns the same EFBIG if ">".

This fixes false I/O errors in worst S/G cases with maxphys >= 2MB.

MFC after: 1 week

(cherry picked from commit 0f29396e493bd87ffa6a63fcb602b12e79d21a1e)

3 years agoCirrus-CI: use FreeBSD 13.0 image for base system CI build
Ed Maste [Mon, 19 Apr 2021 18:36:21 +0000 (14:36 -0400)]
Cirrus-CI: use FreeBSD 13.0 image for base system CI build

We generally want to build and test on the highest release version, and
FreeBSD 13.0 also brings some performance benefits.

Reviewed by: lwhsu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29842

(cherry picked from commit 407abff2b91847e23711625ad7c69c17e99b3d1d)

3 years agolex: Use NULL instead of 0 for pointers
Jung-uk Kim [Thu, 11 Feb 2021 23:31:53 +0000 (18:31 -0500)]
lex: Use NULL instead of 0 for pointers

Note araujo tried to fix it in r298241 but he only touched generated
files for bootstrap.  This commit properly fixes the problem.

(cherry picked from commit 34e67bb5977049afb3e965b52b86ac12ea4899b4)