Commit Graph

259075 Commits

Author SHA1 Message Date
Lutz Donnerhacke
bec0a5dca7 libalias: Remove LibAliasCheckNewLink
Finally drop the function in 14-CURRENT.

Discussed with: kp
Differential Revision: https://reviews.freebsd.org/D30275
2021-05-31 13:04:11 +02:00
Lutz Donnerhacke
bfd41ba1fe libalias: Remove unused function LibAliasCheckNewLink
The functionality to detect a newly created link after processing a
single packet is decoupled from the packet processing.  Every new
packet is processed asynchronously and will reset the indicator, hence
the function is unusable.  I made a Google search for third party code,
which uses the function, and failed to find one.

That's why the function should be removed: It unusable and unused.
A much simplified API/ABI will remain in anything below 14.

Discussed with:	kp
Reviewed by:	manpages (bcr)
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30275
2021-05-31 12:53:57 +02:00
Wojciech Macek
d40cd26a86 ip_mroute: rework ip_mroute
Approved by:     mw
Obtained from:   Semihalf
Sponsored by:    Stormshield
Differential Revision: https://reviews.freebsd.org/D30354

Changes:
1. add spinlock to bw_meter

If two contexts read and modify bw_meter values
it might happen that these are corrupted.
Guard only code fragments which do read-and-modify.
Context which only do "reads" are not done inside
spinlock block. The only sideffect that can happen is
an 1-p;acket outdated value reported back to userspace.

2. replace all locks with a single RWLOCK

Multiple locks caused a performance issue in routing
hot path, when two of them had to be taken. All locks
were replaced with single RWLOCK which makes the hot
path able to take only shared access to lock most of
the times.
All configuration routines have to take exclusive lock
(as it was done before) but these operation are very rare
compared to packet routing.

3. redesign MFC expire and UPCALL expire

Use generic kthread and cv_wait/cv_signal for deferring
work. Previously, upcalls could be sent from two contexts
which complicated the design. All upcall sending is now
done in a kthread which allows hot path to work more
efficient in some rare cases.

4. replace mutex-guarded linked list with lock free buf_ring

All message and data is now passed over lockless buf_ring.
This allowed to remove some heavy locking when linked
lists were used.
2021-05-31 05:48:15 +02:00
Rick Macklem
947bd2479b nfsd: Add support for the NFSv4.1/4.2 Secinfo_no_name operation
The Linux client is now attempting to use the Secinfo_no_name
operation for NFSv4.1/4.2 mounts.  Although it does not seem to
mind the NFSERR_NOTSUPP reply, adding support for it seems
reasonable.

I also noticed that "savflag" needed to be 64bits in
nfsrvd_secinfo() since nd_flag in now 64bits, so I changed
the declaration of it there.  I also added code to set "vp" NULL
after performing Secinfo/Secinfo_no_name, since these
operations consume the current FH, which is represented
by "vp" in nfsrvd_compound().

Fixing when the server replies NFSERR_WRONGSEC so that
it conforms to RFC5661 Sec. 2.6 still needs to be done
in a future commit.

MFC after:	2 weeks
2021-05-30 17:52:43 -07:00
Alan Somers
f0d577fd2d [skip ci] volunteer to maintain POSIX AIO
MFC after:	2 weeks
2021-05-30 17:21:12 -06:00
Alan Somers
425bbe9e64 fusefs: reenable the WriteCluster.cluster_write_err test
The underlying panic was just fixed by
revision 27006229f7

PR:		238565
MFC after:	1 week
MFC with:	27006229f7
2021-05-30 16:51:56 -06:00
Alan Somers
5a20c351ea [skip ci] add a CODEOWNERS file
Summary:
Convert MAINTAINERS into a Github CODEOWNERS file.  This will
automatically assign reviewers to some GH pull requests.  The conversion
is not 1:1; some committers don't have Github accounts (e.g. adrian),
some functional areas don't neatly correspond to a set of files (e.g.
kqueue), and mailing lists can't be assigned as a reviewer (e.g.
secteam@).  But it's a start.

MFC after:	2 weeks
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D30559
2021-05-30 16:49:07 -06:00
Konstantin Belousov
27006229f7 vinvalbuf: do not panic if we were unable to flush dirty buffers
Return EBUSY instead and let caller to handle the issue.

For vgone()/vnode reclamation, caller first does vinvalbuf(V_SAVE),
which return EBUSY in case dirty buffers where not flushed. Then caller
calls vinvalbuf(0) due to non-zero return, which gets rid of all dirty
buffers without dependencies.

PR:	238565
Reviewed by:	asomers, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30555
2021-05-31 01:20:53 +03:00
Jason A. Harmening
a4b07a2701 VFS_QUOTACTL(9): allow implementation to indicate busy state changes
Instead of requiring all implementations of vfs_quotactl to unbusy
the mount for Q_QUOTAON and Q_QUOTAOFF, add an "mp_busy" in/out param
to VFS_QUOTACTL(9).  The implementation may then indicate to the caller
whether it needed to unbusy the mount.

Also, add stbool.h to libprocstat modules which #define _KERNEL
before including sys/mount.h.  Otherwise they'll pull in sys/types.h
before defining _KERNEL and therefore won't have the bool definition
they need for mp_busy.

Reviewed By:	kib, markj
Differential Revision: https://reviews.freebsd.org/D30556
2021-05-30 14:53:47 -07:00
Sean Eric Fagan
505dc43562 The zone(9) man page had two entries for uma_reclaim(), one with
an argument (correct), and one without (incorrect).  Pointed out
by Allan Jude.
2021-05-30 13:02:11 -07:00
Mateusz Guzik
284cf3f18b ext2: add missing uio_td initialization to ext2_htree_append_block
Reported by:	pho
2021-05-30 17:19:31 +00:00
Lutz Donnerhacke
b03a41befe libalias: Fix nameing and initialization of a constant
The commit 189f8eea contains a refactorisation of a constant.  During
later review D30283 the naming of the constant was improved and the
initialization became explicit.  Put this into the tree, in order to
MFC the correct naming.
2021-05-30 15:47:29 +02:00
Gordon Bergling
66e2a5803b iwn(4): Remove duplicate device entry
'Intel Centrino Wireless-N 6250' is listed twice in the description
section of the manual page.

PR:	256257
Reported by:	Daniel Cervus <danielthedeer at outlook dot com>
MFC after:	3 days
2021-05-30 15:40:33 +02:00
Alexander V. Chernikov
8e55a80e0c [netflow] fix gateway reporting in ng_netflow
Reported by:	Guy Yur <guyyur at gmail.com>
MFC after:	3 days
2021-05-30 10:12:49 +00:00
Justin Hibbits
2b9a828c99 Set default SPE FP environment 2021-05-29 21:53:35 -05:00
Justin Hibbits
66b2b71df8 Wrap the default SPE config in its own #define
No functional change.  Cleans up the code a little.
2021-05-29 21:53:26 -05:00
Justin Hibbits
0137a09d6e Clean up spr.h
Remove SPRs for CPUs FreeBSD doesn't run on
Add debug register SPRs from the Freescale EREF
2021-05-29 21:53:16 -05:00
Jason A. Harmening
271fcf1c28 Revert commits 6d3e78ad6c and 54256e7954
Parts of libprocstat like to pretend they're kernel components for the
sake of including mount.h, and including sys/types.h in the _KERNEL
case doesn't fix the build for some reason.  Revert both the
VFS_QUOTACTL() change and the follow-up "fix" for now.
2021-05-29 17:48:02 -07:00
Mateusz Guzik
331a7601c9 tmpfs: save on common case relocking in tmpfs_reclaim 2021-05-29 22:04:10 +00:00
Mateusz Guzik
439d942b9e tmpfs: drop a redundant NULL check in tmpfs_alloc_vp 2021-05-29 22:04:10 +00:00
Mateusz Guzik
7fbeaf33b8 tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent
The id field is immutable until the node gets freed.
2021-05-29 22:04:10 +00:00
Mateusz Guzik
3cf75ca220 vfs: retire unused vn_seqc_write_begin_unheld* 2021-05-29 22:04:09 +00:00
Mateusz Guzik
d81aefa8b7 vfs: use the sentinel trick in locked lookup path parsing 2021-05-29 22:04:09 +00:00
Mateusz Guzik
478c52f1e3 vfs: slightly rework vn_rlimit_fsize 2021-05-29 22:04:09 +00:00
Mateusz Guzik
dde5c031ed Fix up macro use in lim_cur 2021-05-29 22:04:09 +00:00
Mateusz Guzik
9bfddb3ac4 fd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd 2021-05-29 22:04:09 +00:00
Mateusz Guzik
528f8f3895 proc: add PROC_WAIT_UNLOCKED 2021-05-29 22:04:09 +00:00
Jason A. Harmening
54256e7954 Fix userspace build after commit 6d3e78ad6c
Reported by: jenkins
2021-05-29 14:45:42 -07:00
Jason A. Harmening
6d3e78ad6c VFS_QUOTACTL(9): allow implementation to indicate busy state changes
Instead of requiring all implementations of vfs_quotactl to unbusy
the mount for Q_QUOTAON and Q_QUOTAOFF, add an "mp_busy" in/out param
to VFS_QUOTACTL(9).  The implementation may then indicate to the caller
whether it needed to unbusy the mount.

Reviewed By:	kib, markj
Differential Revision: https://reviews.freebsd.org/D30218
2021-05-29 14:05:39 -07:00
Justin Hibbits
811e645d28 Apply r350463(43ded0a321) to powerpc64 radix pmap
Invalidate the last page of a demoted superpage mapping, instead of the
first page, as it results in slightly more promotions and fewer
failures.  While here, replace 'boolean_t's with 'bool's in
mmu_radix_advise().
2021-05-29 15:14:33 -05:00
Justin Hibbits
09947faee8 Apply r350335(5d18382b72) to powerpc64 radix pmap
Simplify pmap_clear_modify() a bit, by assuming that since the superpage
demotion succeeded, all 4k mappings from it are valid.  Deindent the
surrounding code, as there are no 'else' branches in the code anyway.
2021-05-29 15:14:32 -05:00
Justin Hibbits
b40538683a Apply r355991(50079417a5) to powerpc64
Micro-optimize control flow in _pmap_unwire_ptp(), and eliminate
unnecessary parentheses.
2021-05-29 15:14:26 -05:00
Edward Tomasz Napierala
83043a741d linux: deduplicate DUMMY() entries
No functional changes.

Reviewed By:	emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30524
2021-05-29 17:51:36 +00:00
Konstantin Belousov
d81f999ac2 rtld direct exec: add option to ignore LD_ variables
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-05-29 17:59:09 +03:00
Navdeep Parhar
e0fa04e257 cxgbe(4): Update firmwares to 1.25.6.0.
Changes since 1.25.0.0 are listed here.  This list comes from the
Release Notes for the "Chelsio Unified Wire v3.14.0.3 for Linux"
release dated 2021-05-21.

Fixes
-----

BASE:
- Fixed Back to back T6 100G-CR4 link coming up with NO FEC sometimes.
- [T5] Try to bring up link in 1G speed if link doesn't come up on 10G.
- Fixed a bug to not allow BaseR fec in 100G speed.
- Fixed linkup issues on BT adapter in 1G and 100M speed.
- Fixed an issue to allow driver to send VI_ENABLE multiple times (once
  with rx disable and then later rx enable).
- Fixed rate limiting not working on class number 16 to 30.
- Fixed backward compatibility issue in port type interpretation with vpd
  version 0x80.

ETH:
- Fixed a case when firmware failed to deliver NIC WR completion to host.
- No rate limit support for WR ETH_TX_PKTS2 due to performance reasons.

OFLD
- Fixed a connection hang in SO adapters when tp_plen_max (set by driver)
  is more than the window size.
- Added fw_filter_vnic_mode to firmware API file (t4fw_interface.h)
- Use correct rx channel in coprocessor crypto completion (CPL_FW6_PLD). This
  was causing out of order completion to host.

FOiSCSI
- Fixed a crash due to unaligned access of ipv6 address.
- Fixed a crash during lun reset.

Enhancements
------------

ETH:
- Rate limiting support added for encapsulated (vxlan, nvgre, geneve) NIC TCP
  packets.

OFLD:
- More than 128 SGLs supported in FW_RI_FR_NSMR_WR. Now, more than 16GB
  (upto 64GB) of PBLs can be written with single FW_RI_FR_NSMR_WR.

Obtained from:	Chelsio Communications
MFC after:	1 month
Sponsored by:	Chelsio Communications
2021-05-29 01:00:20 -07:00
Edward Tomasz Napierala
aa462cab60 linux: fix architecture returned for uname on aarch64
Previously it would return "arm64", which was breaking build
for Linux kernel.  While here, reshuffle entries in the auxv
vector to match real Linux.

Reviewed By:	emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30500
2021-05-28 23:02:02 +00:00
Warner Losh
f0f4712165 nvme: fix a race between failing the controller and failing requests
Part of the nvme recovery process for errors is to reset the
card. Sometimes, this results in failing the entire controller. When nda
is in use, we free the sim, which will sleep until all the I/O has
completed. However, with only one thread, the request fail task never
runs once the reset thread sleeps here. Create two threads to allow I/O
to fail until it's all processed and the reset task can proceed.

This is a temporary kludge until I can work out questions that arose
during the review, not least is what was the race that queueing to a
failure task solved. The original commit is vague and other error paths
in the same context do a direct failure. I'll investigate that more
completely before committing changing that to a direct failure. mav@
raised this issue during the review, but didn't otherwise object.

Multiple threads, though, solve the problem in the mean time until other
such means can be perfected.

Reviewed by:		jhb@
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30366
2021-05-28 23:05:40 -06:00
Jessica Clarke
e5f5b6a75c .github: Attempt to un-break Clang 9 action
GitHub removed Clang 9 from the 20.04 image[1], breaking this build.
Thus, manually add the specific versioned packages we need for the
Ubuntu jobs to ensure they're installed. Note that we don't do the same
for macOS, as Homebrew does not allow multiple llvm@N to co-exist,
giving an error if you attempt to install a second one. In practice we
don't actually use the compiler field here for anything other than the
build name, it's only the cross-bindir that matters, so when it
eventually moves to 12 the name will get confusing but the job will
still work.

MFC after:	immediately

[1] 15a610677b
2021-05-29 04:36:36 +01:00
Robert Wing
9b0f1d64b0 Revert "Fix fsck_ufs segfaults with gjournal (SU+J)"
Fix fsck for 32-bit platforms.

This reverts commit f190f9193b.
2021-05-28 18:59:07 -08:00
Robert Wing
871291c8d4 Revert "fsdb: add missing bufinit() call"
This reverts commit 84768d1149.
2021-05-28 18:51:25 -08:00
Kirk McKusick
5c9e9eb7a2 Fix fsck_ufs segfault when it needs to rerun.
The segfault was being hit in the rerun of Pass 1 in ginode() when
trying to get an inode that needs to be repaired. When the first run
of fsck_ffs finishes it clears the inode cache, but ginode() was
failing to check properly and tried to access the deallocated cache entry.

Reported by:  Peter Holm
Reviewed by:  Chuck Silvers
Tested by:    Peter Holm and Chuck Silvers
MFC after:    3 days
Sponsored by: Netflix
2021-05-28 19:41:50 -07:00
John Baldwin
677cb9722a cxgbe tom: Free pending iSCSI mbufs on connection shutdown.
If an iSCSI connection is shutdown abruptly (e.g. by a RST from the
peer), pending iSCSI PDUs and page pod work requests can be in the
ulp_pduq when the final CPL is received indicating the death of the
connection.

Reported by:	Jithesh Arakkan @ Chelsio
2021-05-28 16:47:31 -07:00
John Baldwin
f949967c8e cxgbei: Fix a race between transfer setup and a peer reset.
In 4427ac3675, the TOM driver stopped sending work requests to
program iSCSI page pods directly and instead queued them to be written
asynchronously with iSCSI PDUs.  The queue of mbufs to send is
protected by the inp lock.  However, the inp cannot be safely obtained
from the toep since a RST from the remote peer might have cleared
toep->inp asynchronously in an ithread.  To fix, obtain the inp from
the socket as is already done in icl_cxgbei_conn_pdu_queue_cb() and
fail the new transfer setup with ECONNRESET if the connection has been
reset.

To avoid passing sockets or inps into the page pod routines, pull the
mbufq out of the two relevant page pod routines such that the routines
queue new work request mbufs to a caller-supplied mbufq.

Reported by:	Jithesh Arakkan @ Chelsio
Fixes:		4427ac3675
2021-05-28 16:47:04 -07:00
John Baldwin
67360f7bb0 cxgbei: Support iSCSI offload on T6.
T6 makes several changes relative to T5 for receive of iSCSI PDUs.

First, earlier adapters issue either 2 or 3 messages to the host for
each PDU received: CPL_ISCSI_HDR contains the BHS of the PDU,
CPL_ISCSI_DATA (when DDP is not used for zero-copy receive) contains
the PDU data as buffers on the freelist, and CPL_RX_ISCSI_DDP with
status of the PDU such as result of CRC checks.  In T6, a new
CPL_RX_ISCSI_CMP combines CPL_ISCSI_HDR and CPL_RX_ISCSI_DDP.  Data
PDUs which are directly placed via DDP only report a single
CPL_RX_ISCSI_CMP message.  Data PDUs received on the free lists are
reported as CPL_ISCSI_DATA followed by CPL_RX_ISCSI_CMP.  Control PDUs
such as R2T are still reported via CPL_ISCSI_HDR and CPL_RX_ISCSI_DDP.

Supporting this requires changing the CPL_ISCSI_DATA handler to
allocate a PDU structure if it is not preceded by a CPL_ISCSI_HDR as
well as support for the new CPL_RX_ISCSI_CMP.

Second, when using DDP for zero-copy receive, T6 will only issue a
CPL_RX_ISCSI_CMP after a burst of PDUs have been received (indicated
by the F flag in the BHS).  In this case, the CPL_RX_ISCSI_CMP can
reflect the completion of multiple PDUs and the BHS and TCP sequence
number included in the message are from the last PDU received in the
burst.  Notably, the message does not include any information about
earlier PDUs received as part of the burst.  Instead, the driver must
track the amount of data already received for a given transfer and use
this to compute the amount of data received in a burst.  In addition,
the iSCSI layer currently has no way to permit receiving a logical PDU
which spans multiple PDUs.  Instead, the driver presents each burst as
a single, "large" PDU to the iSCSI target and initiators.  This is
done by rewriting the buffer offset and data length fields in the BHS
of the final PDU as well as rewriting the DataSN so that the received
PDUs appear to be in order.

To track all this, cxgbei maintains a hash table of 'cxgbei_cmp'
structures indexed by transfer tags for each offloaded iSCSI
connection.  When a SCSI_DATA_IN message is received, the ITT from the
received BHS is used to find the necessary state in the hash table,
whereas SCSI_DATA_OUT replies use the TTT as the key.  The structure
tracks the expected starting offset and DataSN of the next burst as
well as the rewritten DataSN value used for the previously received
PDU.

Discussed with:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D30458
2021-05-28 16:45:29 -07:00
Bryan Drewery
55baee8cdb Correct location for KTR masks.
MFC after:	3 days
Sponsored by:	Dell EMC
2021-05-28 16:29:18 -07:00
Edward Tomasz Napierala
e20e60be50 smartpqi: clear CCBs allocated on the stack
Differential Revision:		https://reviews.freebsd.org/D30299

Sponsored by:		Netflix
2021-05-28 16:40:24 -06:00
PAPANI SRIKANTH
9fac68fc38 Newly added features and bug fixes in latest Microchip SmartPQI driver
It includes:

1)Newly added TMF feature.
2)Added newly Huawei & Inspur PCI ID's
3)Fixed smartpqi driver hangs in Z-Pool while running on FreeBSD12.1
4)Fixed flooding dmesg in kernel while the controller is offline during in ioctls.
5)Avoided unnecessary host memory allocation for rcb sg buffers.
6)Fixed race conditions while accessing internal rcb structure.
7)Fixed where Logical volumes exposing two different names to the OS it's due to the system memory is overwritten with DMA stale data.
8)Fixed dynamically unloading a smartpqi driver.
9)Added device_shutdown callback instead of deprecated shutdown_final kernel event in smartpqi driver.
10)Fixed where Os is crashed during physical drive hot removal during heavy IO.
11)Fixed OS crash during controller lockup/offline during heavy IO.
12)Fixed coverity issues in smartpqi driver
13)Fixed system crash while creating and deleting logical volume in a continuous loop.
14)Fixed where the volume size is not exposing to OS when it expands.
15)Added HC3 pci id's.

Reviewed by:		Scott Benesh (microsemi), Murthy Bhat (microsemi), imp
Differential Revision:	https://reviews.freebsd.org/D30182

Sponsored by:		Netflix
2021-05-28 16:40:23 -06:00
John Baldwin
7ad70d22c6 libcrypto: Add symbol versions for symbols added since 1.1.1d.
While here, trim a spurious local: I missed when added SSL_sendfile.

PR:		255277
Reported by:	yuri
Reviewed by:	jkim
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30483
2021-05-28 15:18:15 -07:00
Michael Zhilin
91abbc4993 [mips/broadcom] set sysctl "hw.model" by SoC ChipCommon ID
Small patch to set "hw.model" by SoC ChipCommon ID. On BCM4718 it will be BCM4716, because 4716 is core for 4716,4717 & 4718.

Tested on Netgear WNR3500L (BCM4718) and Asus RT-N53 (BCM5357).

Reviewed by: landonf, yamori813@yahoo.co.jp
Sponsored by: Postgres Professional
Differential revision: https://reviews.freebsd.org/D12737
2021-05-28 23:35:37 +03:00
Vladimir Kondratyev
9aa0e5af75 usbhid(4): Add second set of USB transfers to work in polled mode.
The second set of USB transfer is requested by hkbd(4) and
should improve HID keyboard handling in kdb and panic contexts.

MFC after:	1 week
Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D30486
2021-05-28 23:29:42 +03:00