Commit Graph

275730 Commits

Author SHA1 Message Date
Konrad Sewiłło-Jopek
c9a5c48ae8 arp: Implement sticky ARP mode for interfaces.
Provide sticky ARP flag for network interface which marks it as the
"sticky" one similarly to what we have for bridges. Once interface is
marked sticky, any address resolved using the ARP will be saved as a
static one in the ARP table. Such functionality may be used to prevent
ARP spoofing or to decrease latencies in Ethernet networks.

The drawbacks include potential limitations in usage of ARP-based
load-balancers and high-availability solutions such as carp(4).

The implemented option is disabled by default, therefore should not
impact the default behaviour of the networking stack.

Sponsored by:		Conclusive Engineering sp. z o.o.
Reviewed By:		melifaro, pauamma_gundo.com
Differential Revision: https://reviews.freebsd.org/D35314
MFC after:		2 weeks
2022-05-27 12:41:30 +00:00
Alexander Motin
18054d0220 libpmc: Another update of x86 event definitions.
MFC after:	1 month
2022-05-26 22:07:42 -04:00
John Baldwin
8020c05683 cxgbei: Adjust the calculation for the maximum ISO payload.
Round down the maximim ISO payload by the current MSS.  Otherwise the
round up by MSS when calculating the 16-bit maximum payload len passed
along in the FLOWC work request can overflow.

Discussed with:	np
Sponsored by:	Chelsio Communications
2022-05-26 14:32:54 -07:00
Gleb Smirnoff
75e7e3ce34 unix: fix incorrect assertion in 4682ac697c
Pointy hat to:	glebius
Fixes:		4682ac697c
2022-05-26 11:35:05 -07:00
Dimitry Andric
442bf90e52 Add newline after 20220524 entry in ObsoleteFiles.inc 2022-05-26 16:31:51 +02:00
Ed Maste
20b2b464eb syscons: note incompatibility with UEFI
PR:		264226
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-05-25 20:25:41 -04:00
John-Mark Gurney
35dc7f8f5d
dhclient: test against a real (ISC) dhcp server
This tests both both normal (untagged), and pcp tagged (VLAN 0)
networks which are now common for fiber ISPs.

Reviewed by: markj, kp
Differential Revision: https://reviews.freebsd.org/D35178
2022-05-25 17:02:38 -07:00
John Baldwin
f8287caae4 etcupdate: Preserve permissions when installing a resolved file.
Similar to the change in 1a04446f08, use
cat to overwrite the contents of the existing file rather than cp so
that metadata of the existing file such as permissions and ownership
is preserved.

PR:		255514
Reported by:	uqs
MFC after:	1 week
2022-05-25 14:20:40 -07:00
John Baldwin
431944fb5f etcupdate: Don't rotate trees for a dry run.
When performing a dry run, remove the temporary tree created rather
than rotating the trees.  Rotating the trees meant that etcupdate
thought the latest changes were already merged and would not merge
them on the next real run.

PR:		260281
Reported by:	Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
Fixes:		0611aec3cf etcupdate: Always extract to a temporary tree.
MFC after:	1 week
2022-05-25 14:02:51 -07:00
Gleb Smirnoff
4682ac697c unix: turn check in unp_externalize() into assertion
In this function we always work with mbufs that we previously
created ourselves in unp_internalize().  They must be valid.

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35319
2022-05-25 13:29:20 -07:00
Gleb Smirnoff
579b45e203 unix/*: check new control size in unp_internalize()
Now that we call sbcreatecontrol() with M_WAITOK, we are expected to
pass a valid size.  Return same error code, we are returning for an
oversized control from sockargs().

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35317
2022-05-25 13:29:13 -07:00
Gleb Smirnoff
d60ea9a10a sockets: return EMSGSIZE if control part of message is too large
Specification doesn't list an explicit error code for the control
size specified by msg_control being too large.  But it does list
EMSGSIZE as error code for "message is too large to be sent all at
once (as the socket requires)".  It also lists EINVAL as code for
the "The sum of the iov_len values overflows an ssize_t."  Given
how generic and uninformative EINVAL is, the EMSGSIZE is more
appropriate.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendmsg.html

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35316
2022-05-25 13:29:04 -07:00
Gleb Smirnoff
23402c83f4 tests/unix_passfd: sending many and too many SCM_RIGHTS
o Exercise bounds checking when sending large set of file descriptors,
  that can't fit into single control mbuf.
o Exercise resource limits checks when receiving a large sets.
o Check that socket isn't left in a completely stuck state when we can't
  receive SCM_RIGHTS due to limits.  Current SOCK_STREAM socket would
  free the control, but leave the data in.  This seems to be a legit
  behavior for a stream socket, as we don't want holes in the data.

PR:			239250
Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35315
2022-05-25 13:28:40 -07:00
Emmanuel Vadot
e26ef41f79 backlight: Update cached value when getting the brightness
External events can cause the backlight level to change (AC adapter
plug/unplug for example) so cache the value there too.

PR:		257796
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	1 week
2022-05-25 16:50:25 +02:00
Tom Jones
3ddd6eb688 diff3: Add help and version options
Add help and version flags. Exit values in these paths are set to match
the behaviour of gnu diff3.
2022-05-25 14:53:06 +01:00
Tom Jones
59f6408d8d diff3: Copy line into debug information
Sponsored by:	Klara Inc.
2022-05-25 14:45:51 +01:00
Tom Jones
7d975c7f93 diff3: Don't perform a bitwise OR when comparing diffs
This fixes the build now that it uses -Wbitwise-instead-of-logical

Sponsored by:	Klara Inc.
2022-05-25 14:43:14 +01:00
Dapeng Gao
e605b87a9e Save only callee-saved registers in pcb
On AArch64, registers x9-x18 are not callee-saved, yet they are
preserved at many placed in swtch.S. This patch removes code that
preserves these registers.
2022-05-25 11:26:30 +01:00
Andrew Turner
9e0716f461 Add arm64 CnP support
Set the Common not Private bit in the ttbr registers when supported on
arm64. This tells the hardware it can share the translation table
entries on multiple CPUs.

Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation
2022-05-25 10:56:13 +01:00
Mateusz Piotrowski
d46d907a26 sleep.1: Fix mdoc style
Fixes:	be038c3afc bin/sleep: add support for multiple delay values
MFC after:	1 week
2022-05-25 10:11:33 +02:00
Emmanuel Vadot
25d21a8452 linuxkpi: Rework detach function
We need to detach the matching i2c adapter so look for the right one.
While here add some locks to protect multiple add/del at the same time.

Fixes:	1961a14a47 ("linuxkpi: Add i2c support")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-05-25 09:57:10 +02:00
Gleb Smirnoff
ad51c47fb4 sockbuf: fix assertion in sbcreatecontrol()
Fixes:	6890b58814
2022-05-25 00:19:41 -07:00
Eric Joyner
a6e275af46
irdma(4): Fix previous commit that broke build on amd64
Changing the printf specifier to %p fixed the build on powerpc64, but it
actually broke the amd64 build since the type of the value to be printed
is uint64_t on amd64.

Instead, keep the new %p specifier but cast the printed argument to a
uintptr_t and then to a void * in order for it to be valid type for
%p.

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

Reported by:	jrtc27@
MFC after:	5 days
MFC-with:	e602a30bb9
Sponsored by:	Intel Corporation
2022-05-25 00:05:19 -07:00
Eric Joyner
e602a30bb9
irdma(4): Fix compile error on powerpc64
Jenkins reports that the type used in a printf() specifier is
incorrect, so fix it in order to use the appropriate type.

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

Reported by:	Jenkins CI
MFC after:	6 days
MFC-with:	cdcd52d41e
Sponsored by:	Intel Corporation
2022-05-24 17:30:46 -07:00
Mark Johnston
68fe988a40 kqueue tests: Simplify the test runner
Just invoke the test program directly instead of trying to convert its
output to TAP format.  The test suite is all or nothing; there's no way
to enumerate individual test cases, so there's no advantage in trying to
massage its output, and doing so throws away information that's useful
when diagnosing test failures.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-05-24 20:17:41 -04:00
Mark Johnston
d6d4f9b45e kqueue tests: Add new EVFILT_TIMER regression tests from upstream
One of the tests exposes the regression reported in PR 264131.

One test is disabled because FreeBSD does not support setting EV_ONESHOT
on an already-added periodic timer.  Though, in this case the flag is
simply ignored, which isn't ideal.

One test is slightly modified to set EV_ADD when reconfiguring a
disabled timer per some commentary in PR 258412.

Ideally we would re-import the test suite from libkqueue but there is a
fair bit of divergence so this will require some effort.  This just gets
us one small step closer while increasing test coverage.

PR:		258412
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-05-24 20:16:32 -04:00
Mark Johnston
524dadf7a8 kevent: Fix an off-by-one in filt_timerexpire_l()
Suppose a periodic kevent timer fires close to its deadline, so that
now - kc->next is small.  Then delta ends up being 1, and the next timer
deadline is set to (delta + 1) * kc->to, where kc->to is the timer
period.  This means that the timer fires at half of the requested rate,
and the value returned in kn_data is similarly inaccurate.

PR:		264131
Fixes:		7cb40543e9 ("filt_timerexpire: do not iterate over the interval")
Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35313
2022-05-24 20:14:33 -04:00
Mark Johnston
c728c56c87 kqueue tests: Add file and line info to some test failure output
This brings us slightly closer to upstream and is useful when debugging
test failures.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-05-24 20:14:20 -04:00
Mark Johnston
bc7512cc58 kqueue tests: Re-enable kqueue proc tests
- Some EVFILT_PROC bugs were fixed around the time that the tests were
  disabled.
- I can't reproduce any failures locally.
- Jenkins logs referenced from the PR are gone, so let's re-enable the
  tests and see whether a problem persists.

PR:		233586
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-05-24 20:14:10 -04:00
Konstantin Belousov
3aaed4cb8c Fix conflict between libnvpair and libnv when building rescue binaries.
Submitted by:	hselasky
Reviewed by:	jhb
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
4f79bd4a1a src.libnames.mk: add more lib variables
Submitted by:	hselasky
Reviewed by:	jhb
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
d72ea9fb3f ifconfig: Use SIOCGIFCAPNV if supported
Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
277b9588fd ifconfig: add rxtls and -rxtls commands
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
6ca418e481 ifconfig: add setifcapnv()
which uses SIOCSIFCAPNV to set arbitrary string-named interface
capability.

Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
42d5cb0927 ifconfig: add glue for specifying functions taking static string parameter
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
7aecd12d9c ifconfig: use c99 designated initializers for DEF_CMD
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
7541a95a54 ifconfig: some style
wrap several too long lines

Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
3a364a6b91 mlx5en: formally declare supoort for RXTLS
Reviewed by:	hselasky
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
6a311e6fa5 Add ifcap2 names for RXTLS4 and RXTLS6 interface capabilities
and corresponding nvlist capabilities name strings.

Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
f7ea19958b Convert mlx5_en to SIOCSIFCAPNV
Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
883c726a39 Document nvlist-based set/get ifcaps
Reviewed by:	debdrup, hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
051e7d78b0 Kernel-side infrastructure to implement nvlist-based set/get ifcaps
Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
b96549f057 struct ifnet: add if_capabilities2 and if_capenable2 bitmasks
We are running out of bits in if_capabilities.

Suggested by:	jhb
Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Ed Maste
daed785d6f Cirrus-CI: Switch to llvm14 toolchain package
Follow base system update to LLVM 14

Sponsored by:	The FreeBSD Foundation
2022-05-24 16:58:20 -04:00
Warner Losh
f5dcfbe36e stty: Remove stray '-'.
There's a stray '-' that causes Fl to double the dash, but that's not
how the command works.

MFC After:		2 days
Sponsored by:		Netflix
2022-05-24 14:31:28 -06:00
Alan Somers
7919c76dbd bsdinstall: use gpt/efiboot0 label in /etc/fstab
Otherwise, boot will hang if the numbering of disks has changed since
initial install.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	brd
Differential Revision: https://reviews.freebsd.org/D35309
2022-05-24 13:17:10 -06:00
Krzysztof Galazka
b7b40e4a38
ixl(4): Add support for I710 devices and remove non-inclusive language
Intel introduces a new line of 1G Ethernet adapters
with Device ID 0x0DD2. While at that also remove
non-inclusive language.

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

Reviewed by:	kbowling@
Tested by:	gowtham.kumar.ks@intel.com
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D34924
2022-05-24 09:12:49 -07:00
Brad Davis
cc42ef5328 bsdinstall: allow whitelabeling the scripts
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35197
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:49:06 -06:00
Brad Davis
33005c89c6 bsdinstall: break list of scripts out to one per line to make adding/removing entries easier
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35249
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:30:31 -06:00
Mateusz Piotrowski
9e4cd857ac Remove referenes to net.inet.tcp.local_slowstart_flightsize
Fixes:	9ec4a4cca5 Remove the ss_fltsz and ss_fltsz_local
2022-05-24 16:04:57 +02:00