Commit Graph

142866 Commits

Author SHA1 Message Date
Hans Petter Selasky
9f580526e4 ibcore: Remove set, but not used variable.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-05 12:32:30 +02:00
Kristof Provost
27407a6adc pf: clear PF_TAG_DUMMYNET for dummynet fast path
ip_dn_io_ptr() (i.e. dummynet_io()) can return the mbuf immediately (as
opposed to owning it and later passing it through dummynet_send(), which
returns it to pf_test()). In that case we must clear the PF_TAG_DUMMYNET
flag to ensure we don't skip any subsequent firewall passes.

This can happen if we process a packet in PFIL_IN, set PF_TAG_DUMMYNET
on it, pass it to ip_dn_io_ptr() but have it returned immediately. The
packet continues its normal path, eventually hitting
pf_test(dir=PFIL_OUT), where we'd skip when we're not supposed to.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-05-05 09:21:32 +02:00
Warner Losh
a85fea31c5 iosched: remove stray debug
This printf was designed to catch misqueued bio requests. Prior to
supporting read_bias == 0, we couldn't get anything but reads and writes
in this queue. However, for read_bias == 0 we queue everything except
BIO_DELETE to this queue, so remove the printf. We don't need to update
any statistics.

Sponsored by:		Netflix
2022-05-04 20:28:00 -06:00
Warner Losh
1907e1c07c ada: Move comment
Move the comment about releasing ccb before periph to adaprobedone()
where it belongs.

Sponsored by:		Netflix
2022-05-04 16:54:38 -06:00
Rick Macklem
ef4edb70c9 nfsd: Add a sanity check for Owner/OwnerGroup string length
Robert Morris reported that, if a client sends an absurdly
large Owner/OwnerGroup string, the kernel malloc() for the
large size string can block forever.

This patch adds a sanity limit for Owner/OwnerGroup string
length.  Since the RFCs do not specify any limit and FreeBSD
can handle a group name greater than 1Kbyte, the limit is
set at a generous 10Kbytes.

Reported by:	rtm@lcs.mit.edu
PR:	260546
MFC after:	2 weeks
2022-05-04 13:58:22 -07:00
Rick Macklem
f32bf50d43 nfsd: Fix handling of Open/Create for the pNFS server
When the MDS of a pNFS service receives an Open/Create
and the file already exists, it must do a Setattr of
size == 0.  Without this patch, this was eroneously
done via a VOP_SETAATR() call, which would set the
length of the MDS file to 0 (which is already is,
since all data lives on the DSs).

This patch fixes the problem by doing a nfsvno_setattr()
instead of VOP_SETATTR(), which knows to do a proxied
Setattr on the DSs.

For a non-pNFS server, the change has no effect, since
nfsvno_setattr() only does a VOP_SETATTR() for that case.

This was found during a recent IETF NFSv4 testing event.

MFC after:	2 weeks
2022-05-04 13:52:33 -07:00
Trev
601abb300c asmc: Add support for Macmini 5,1 (2011) and 5,3 and 7,1 (2014) models
PR:		262456
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Mark Johnston
a31b0c0c47 asmc: Style
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Daniel W. Delâtre
79291c9baf asmc: Add support for MacBook Pro 9,1 (mid 2012)
PR:		261981
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Mark Johnston
27d4c6f86e asmc: Make the model table const and local to asmc.c
No functional change intended.

MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Adam S
7d5fef1837 asmc: Add support for MacPro 6,1 (2013)
PR:		260781
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Mark Johnston
308340cce2 asmc: Add support for MacBook Air 4,1 and 4,2 (2011)
PR:		218574
Submitted by:	NapoleonWils0n <t43InvisibleMan@gmail.com>
Submitted by:	John Hay <john@sanren.ac.za>
MFC after:	2 weeks
2022-05-04 11:30:47 -04:00
Mark Johnston
8d20f1560d stand/zfs: Fix const-qual warnings
The input buffer is read-only, update casts to match.

No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-05-04 10:06:21 -04:00
Greg V
12905b7d50 bwn: eliminate dead writes in BWN_GPL_PHY
This fixes the newly Werror'ed useless write warnings with options
BWN_GPL_PHY.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35105
2022-05-04 09:32:59 -04:00
Dmitry Chagin
1744f14e26 linux(4): Implement recvmmsg_time64 syscall.
MFC after:		2 weeks
2022-05-04 13:06:53 +03:00
Dmitry Chagin
79695e9585 linux(4): Regen for recvmmsg_time64 syscall.
MFC after:	2 weeks
2022-05-04 13:06:52 +03:00
Dmitry Chagin
17ccda0039 linux(4): Change recvmmsg_time64 syscall definition to match Linux actual one.
MFC after:		2 weeks
2022-05-04 13:06:52 +03:00
Dmitry Chagin
ce9f8d6ab0 linux(4): Implement timerfd_gettime64 syscall.
MFC after:		2 weeks
2022-05-04 13:06:52 +03:00
Dmitry Chagin
ac80ae9313 linux(4): Regen for timerfd_gettime64 syscall.
MFC after:	2 weeks
2022-05-04 13:06:51 +03:00
Dmitry Chagin
16aefe5ba3 linux(4): Change timerfd_gettime64 syscall definition to match Linux actual one.
MFC after:		2 weeks
2022-05-04 13:06:51 +03:00
Dmitry Chagin
b1f0b08d93 linux(4): Implement timerfd_settime64 syscall.
MFC after:		2weeks
2022-05-04 13:06:50 +03:00
Dmitry Chagin
f4228fbb4e linux(4): Regen for timerfd_settime64 syscall.
MFC after:	2 weeks
2022-05-04 13:06:50 +03:00
Dmitry Chagin
8545bcff31 linux(4): Change timerfd_settime64 syscall definition to match Linux actual one.
MFC after:		2 weeks
2022-05-04 13:06:50 +03:00
Dmitry Chagin
a1fd2911dd linux(4): Implement timer_settime64 syscall.
MFC after:		2 weeks
2022-05-04 13:06:49 +03:00
Dmitry Chagin
9038a0b74c linux(4): Regen for timer_settime64 syscall.
MFC after:	2 weeks
2022-05-04 13:06:49 +03:00
Dmitry Chagin
1508b1b6a0 linux(4): Change timer_settime64 syscall definition to match Linux actual one.
MFC after:		2 weeks
2022-05-04 13:06:48 +03:00
Dmitry Chagin
783c1bd8cb linux(4): Implement timer_gettime64 syscall.
MFC after:		2 weeks
2022-05-04 13:06:48 +03:00
Dmitry Chagin
1cccef6dff linux(4): Regen for timer_gettime64 syscall.
MFC after:	2 weeks
2022-05-04 13:06:48 +03:00
Dmitry Chagin
ccec96033c linux(4): Change timer_gettime64 syscall definition to match Linux actual one.
MFC after:		2 weeks
2022-05-04 13:06:47 +03:00
Dmitry Chagin
8c84ca657b linux(4): Implement sched_rr_get_interval_time64 syscall.
MFC after:		2 weeks
2022-05-04 13:06:47 +03:00
Dmitry Chagin
cdddbb77c3 linux(4): Regen for sched_rr_get_interval_time64 syscall.
MFC after:	2 weeks
2022-05-04 13:06:46 +03:00
Dmitry Chagin
7b520c0b3c linux(4): Change sched_rr_get_interval_time64 syscall definition to match Linux actual one.
MFC after:		2 weeks
2022-05-04 13:06:45 +03:00
Hans Petter Selasky
a1c0442b41 xhci(4): Tweak USB port speed checks to allow newer super speed generations.
This allows setting the U1 and U2 port timeout values.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-04 09:26:39 +02:00
Hans Petter Selasky
d730333c80 xhci(4): Properly define all basic USB port speeds.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-04 09:26:38 +02:00
Marko Zec
d461deeaa4 VNET: Revert "ifnet: make if_index global"
This reverts commit 91f44749c6.

Devirtualization of V_if_index and V_ifindex_table was rushed into
the tree lacking proper context, discussion, and declaration of intent,
so I'm backing it out as harmful to VNET on the following grounds:

1) The change repurposed the decades-old and stable if_index KBI for
new, unclear goals which were omitted from the commit note.

2) The change opened up a new resource exhaustion vector where any vnet
could starve the system of ifnet indices, including vnet0.

3) To circumvent the newly introduced problem of separating ifnets
belonging to different vnets from the globalized ifindex_table, the
author introduced sysctl_ifcount() which does a linear traversal over
the (potentially huge) global ifnet list just to return a simple upper
bound on existing ifnet indices.

4) The change effectively led to nonuniform ifnet index allocation
among vnets.

5) The commit note clearly stated that the patch changed the implicit
if_index ABI contract where ifnet indices were assumed to be starting
from one.  The commit note also included a correct observation that
holes in interface indices were always allowed, but failed to declare
that the userland-observable ifindex tables could now include huge
empty spans even under modest operating conditions.

6) The author had an earlier proposal in the works which did not
affect per-vnet ifnet lists (D33265) but which he abandoned without
providing the rationale behind his decision to do so, at the expense
of sacrificing the vnet isolation contract and if_index ABI / KBI.

Furthermore, the author agreed to back out his changes himself and
to follow up with a proposal for a less intrusive alternative, but
later silently declined to act.  Therefore, I decided to resolve the
status-quo by backing this out myself.  This in no way precludes a
future proposal aiming to mitigate ifnet-removal related system
crashes or panics to be accepted, provided it would not unnecessarily
compromise the goal of as strict as possible isolation between vnets.

Obtained from: github.com/glebius/FreeBSD/commits/backout-ifindex
2022-05-03 19:27:57 +02:00
Marko Zec
6c741ffbfa Revert "mbuf: do not restore dying interfaces"
This reverts commit 703e533da5.

Revert "ifnet/mbuf: provide KPI to serialize/restore m->m_pkthdr.rcvif"

This reverts commit e1882428dc.

Obtained from: github.com/glebius/FreeBSD/commits/backout-ifindex
2022-05-03 19:11:40 +02:00
Marko Zec
894c574ed2 Revert "dummynet: use m_rcvif_serialize/restore when queueing packets"
This reverts commit 165746f4e4.

Obtained from: github.com/glebius/FreeBSD/commits/backout-ifindex
2022-05-03 19:11:40 +02:00
Marko Zec
0fa5636966 Revert "netisr: serialize/restore m_pkthdr.rcvif when queueing mbufs"
This reverts commit 6871de9363.

Obtained from: github.com/glebius/FreeBSD/commits/backout-ifindex
2022-05-03 19:11:39 +02:00
Hans Petter Selasky
09dd1adfa4 xhci(4): Always add and evaluate the slot context.
Because the maximum number of endpoint contexts is stored there.

Tested by:	ehaupt@
PR:		262882
MFC after:	3 hours
Sponsored by:	NVIDIA Networking
2022-05-03 18:13:53 +02:00
Hans Petter Selasky
e276d28150 xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.
Only drop BULK and INTERRUPT endpoints, to reset the data toggle,
because for other endpoint types this is not critical.

Tested by:	ehaupt@
PR:		262882
MFC after:	3 hours
Sponsored by:	NVIDIA Networking
2022-05-03 18:13:53 +02:00
Rick Macklem
70910e4b55 nfscl: Acquire a refcount on "cred" for mirrored pNFS RPCs
When the NFSv4.1/4.2 client is doing a pnfs mount to
mirrored DS(s), asynchronous threads are used to do the
RPCs against the DS(s) concurrently.  If a DS is slow
to reply, it is possible for the "cred" to be free'd
before the asynchronous thread is done with it, causing
a panic/crash.

This patch fixes the problem by acquiring a refcount on
the "cred" while it is being used by the asynchronous thread
for a DS RPC.  This bug was found during a recent IETF
NFSv4 testing event.

This bug only affects "pnfs" mounts to mirrored pNFS
servers.

MFC after:	2 weeks
2022-05-03 07:22:15 -07:00
Hans Petter Selasky
d735d604f0 mlx5en(4): Use hard-coded 4K page size for RQ/SQ/CQ.
The page size specified for RQ, SQ and CQ is always in units of 4KBytes.
Make sure we subtract MLX5_ADAPTER_PAGE_SHIFT, 12, instead of PAGE_SHIFT
which may vary. This fixes support for using the mlx5en driver on systems
having non-4K page size.

Linux commit:
68cdf5d6e91068c98d6091b193dc7a5ab7dcf5eb

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-03 13:48:43 +02:00
Rick Macklem
271f6d52a6 nfsd: Fix session slot freeing for NFSv4.1/4.2
Without this patch the NFSv4.1/4.2 server erroneously
always frees session slot zero for callbacks.  This only
affects 4.1/4.2 mounts if the server has delegations
enabled or is a pNFS configuration.  Even for those
cases, the effect is mainly to only use slot 0 for
callbacks, serializing all of them.  There is a slight
chance that callbacks will fail if the client performs
them in a different order than received on the TCP
connection.

If this bug affects your server, you will see console
messages like:
  newnfs_request: Bad session slot

This patch fixes the problem.  Found during a recent
IETF NFSv4 testing event.

PR:	263728
MFC after:	2 weeks
2022-05-02 12:47:43 -07:00
Warner Losh
6f78dae849 cam: Remove redunant static __inline forward decls
Sponsored by:		Netflix
2022-05-02 09:30:07 -06:00
Eugene Grosbein
28903f396a ng_pppoe: introduce new sysctl net.graph.pppoe.lcp_pcp
This fixes incomplete commit 2e547442ab

New sysctl allows to mark transmitted PPPoE LCP Control
ethernet frames with needed 3-bit Priority Code Point (PCP) value.
Confirming driver like if_vlan(4) uses the value to fill
IEEE 802.1p class of service field.

This is similar to Cisco IOS "control-packets vlan cos priority"
command.

It helps to avoid premature disconnection of user sessions
due to control frame drops (LCP Echo etc.)
if network infrastructure has a botteleck at a switch
or the xdsl DSLAM.

See also:
https://sourceforge.net/p/mpd/discussion/44692/thread/c7abe70e3a/

Tested by:      Klaus Fokuhl at SourceForge
MFC after:      2 weeks
2022-05-02 21:57:12 +07:00
Hans Petter Selasky
6244b53e16 ibcore: Allow passing NULL-pointers to ib_umem_release()
FreeBSD commit b633e08c70 removed the
NULL-checks from the mlx4ib-driver.

This fixes the following NULL-pointer panic when unloading mlx4ib:
ib_umem_release()
mlx4_ib_destroy_qp()
ib_destroy_qp_user()
ipoib_transport_dev_cleanup()
ipoib_dev_cleanup()
ipoib_remove_one()
ib_unregister_client()
ipoib_cleanup_module()
linker_file_sysuninit()
linker_file_unload()
kern_kldunload()
amd64_syscall()

Linux commit:
836a0fbb3e76f704ad65ddfb57f00725245e509b

MFC after:	1 week
Submitted by:	dandan@lysator.liu.se
Sponsored by:	Lysator ACS
Sponsored by:	NVIDIA Networking
2022-05-02 13:11:06 +02:00
Warner Losh
1599fc904d iosched: Move bio_next() inside of the CAM_IOSCHED_DYNAMIC ifdef
bio_next() is only used by the dynamic scheduler, so move it under that
ifdef.

Sponsored by:		Netflix
2022-05-01 16:54:15 -06:00
Rick Macklem
47d75c29f5 nfsd: Add a sanity check to SecinfoNoname for file type
Robert Morris reported that, for the case of SecinfoNoname
with the Parent option, providing a non-directory could
cause a crash.

This patch adds a sanity check for v_type == VDIR for
this case, to avoid the crash.

Reported by:	rtm@lcs.mit.edu
PR:	260300
MFC after:	2 weeks
2022-05-01 13:41:31 -07:00
Warner Losh
d095d6a34c cam_xpt: Prefer bool to int where it's a boolean
In the places where we set an integer to 0 or 1 and then use it like a
boolean, replace int with bool and 0/1 with false/true. Left alone
places where this is a function argument or return value. No functional
changes intended.

Sponsored by:		Netflix
2022-05-01 12:09:42 -06:00
Warner Losh
d592c0db8b cam: add hw.cam.iosched.read_bias
Allow a global setting for the read_bias for the dynamic io
scheduler. This allows global policy to be set, in addition to the
existing per-drive policy. kern.cam.iosched.read_bias is a new tunable.

Sponsored by:		Netflix
Reviewed by:		chs
Differential Revision:	https://reviews.freebsd.org/D34365
2022-05-01 11:27:34 -06:00