Commit Graph

279232 Commits

Author SHA1 Message Date
Kyle Evans
2cb43631ab Merge commit '93bf91b4012a28610672d2266366dfa0a663b70f' into HEAD
This fixes a warning in wireguard-tools, as well as two issues pointed out by
FreeBSD's Coverity instance.

CID:		1500405, 1500421
2022-11-04 22:46:21 -05:00
Kyle Evans
93bf91b401 Update wireguard-tools to 139aac59a5ab7
This includes fixes for two issues pointed out by FreeBSD's Coverity,
as well as a -Wcast-qual complaint.

While we're here, ignore build artifacts as well upon import.
2022-11-04 22:43:12 -05:00
Warner Losh
269865a8ee stand: Update comment about devdesc
How devdesc is used is opaque until much code is read. Give a more
useful description of the theory behind it here.

Sponsored by:		Netflix
2022-11-04 19:46:44 -06:00
Ed Maste
9c231325e7 Clang: Add Diags for targets pre to i686 for -fcf-protection
Intel Control-flow Enforcement Technology (CET) provides new
instructions `endbr32/64` for the indirect branch control.
They are NOPs on i686 and new targets.  We need to check for that
in case it crashes on older targets.

PR:		264497
Reviewed by:	dim
MFC after:	1 week
Obtained from:	LLVM commit 52516782972730ff065a34123a9d8876da08c254
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37268
2022-11-04 20:42:26 -04:00
Warner Losh
75217c2b47 bnxt: Only build on 64-bit platforms
The driver uses bus_space_read_8 and friends, which do not exist on
32-bit i386 and break the build.

Sponsored by:		Netflix
2022-11-04 16:49:10 -06:00
Sumit Saxena
58d84ef870 if_bnxt: Added support for mgmt interface for passthrough hwrms
Added support for application management interface. There are two types of commands supported:

1. Firmware IOCTLs: These ioctls are meant for firmware
   consumption. Driver acts as a transport for these.
2. Driver only IOCTLs: These ioctls are meant for driver
   consumption. Driver will serve these ioctls without sending them down
   to firmware.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36448
2022-11-04 16:40:29 -06:00
Sumit Saxena
2ed061f08d if_bnxt: Add support for smaller backing_store_cfg message size
Add compat logic to fallback to the older/smaller backing_store_cfg
message size.

Reviewed by: imp
Differentil Revision: https://reviews.freebsd.org/D36447
2022-11-04 16:33:21 -06:00
Sumit Saxena
19a57f85ba if_bnxt: Fix the PORT_PHY_CFG HWRM requests while setting Pause
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36446
2022-11-04 16:31:24 -06:00
Sumit Saxena
baef1301a2 if_bnxt: Fix the issue when kernel invokes _init() again without _stop()
Fixed the issue when kernel invokes _init() when it is already in
_init() state by invoking _stop() in such case.

Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D36445
2022-11-04 16:28:51 -06:00
Sumit Saxena
72e9dbb58c if_bnxt: Remove sysctl node vlan_only which is not being used
Removed sysctl node vlan_only which is not being used after migrating
from l2_set_rx_mask to l2_filter_alloc.

Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D36444
2022-11-04 16:26:03 -06:00
Sumit Saxena
91fcacc355 if_bnxt: Add support for VLAN on Thor
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36443
2022-11-04 16:24:32 -06:00
Sumit Saxena
cfdca95f78 if_bnxt: Add support for RSS on Thor
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36442
2022-11-04 16:21:20 -06:00
Sumit Saxena
6033382aab if_bnxt: Display firmware version along with SIT package version
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36441
2022-11-04 16:18:38 -06:00
Sumit Saxena
fb4b7e02d2 if_bnxt: Add support for async link status update
Reivewed by: imp
Differential Revision: https://reviews.freebsd.org/D36440
2022-11-04 16:14:49 -06:00
Sumit Saxena
055196a7d7 if_bnxt: Add support for admin down/up and jumbo
Make ifconfig up/down work, as well as adding support for jumbo frames.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36439
2022-11-04 16:11:10 -06:00
Sumit Saxena
8945584f93 if_bnxt: add support for Thor controller
Added support for Thor controller.
Below are the supported operations:

1. IPv4 ping (ICMP)
2. iperf / netperf (IPv4 TCP)
3. Promiscuous (tcpdump)
4. Can achieve 20 Gbps on a 25 G link (Uni-Di)
5. Can achieve 60 Gbps on a 100 G link (Uni-Di)
6. Port level and queue level driver stats.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36438
2022-11-04 16:05:57 -06:00
Sumit Saxena
49a3df78c7 if_bnxt: Convert all doorbell writes into function pointers
This is preparatory patch for making a base for Broadcom's Thor
controller support. It converts all doorbell writes into function
pointers.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36437
2022-11-04 16:02:29 -06:00
Sumit Saxena
97315f68fe if_bnxt: update hsi_struct_def.h headers
Updates the drivers to Broadcom's latest:
	HWRM Version 1.10.2.34 using HSI definition version 1.8.4

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36436
2022-11-04 15:58:43 -06:00
Warner Losh
0e3b0045a8 sys/disk.h: Transition period for sys/conf.h over
There's no need to ever include sys/conf.h here anymore, so remove
it. It was added years ago as a transition and everything has been
updated.

Sponsored by:		Netflix
2022-11-04 15:40:12 -06:00
Warner Losh
c9ee39a3f2 stand: Remove unused enum
enum disk_ioctl is unused.  It's only ever defined. All of the stand
code uses DIOCGSECTORSIZE and DIOCGMEDIASIZE instead, both to query and
to implement ioctl.

Sponsored by:		Netflix
2022-11-04 15:40:12 -06:00
Florian Walpen
ad370f7658 sound(4): Fix memory map of /dev/dsp devices when buffer size is not a multiple of PAGE_SIZE.
By using sndbuf_getallocsize() instead of sndbuf_getsize() in dsp_mmap_single().

PR:		267555
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-11-04 19:05:34 +01:00
Dag-Erling Smørgrav
eb4d86d529 getty: Avoid NULL deref if stdin is not a tty.
Sponsored by:	Klara, Inc.
Obtained from:	Apple OSS Distributions
Differential Revision: https://reviews.freebsd.org/D37265
2022-11-04 15:54:01 +01:00
Dag-Erling Smørgrav
f285f41498 getty: code cleanup, part 2
* Clean up whitespace
* Reindent

Sponsored by:	Klara, Inc.
2022-11-04 15:22:04 +01:00
Dag-Erling Smørgrav
8ad7a14ab4 getty: code cleanup, part 1
* Avoid unnecessary use of `unsigned char *`
* Use explicit casts when assigning `unsigned char *` to `char *` or vice versa
* Drop unused global variables (and fix memory leak in `gettable()`)
* Use `snprintf()` instead of `strcpy()` + `strcat()`
* Drop spurious braces in switch

Sponsored by:	Klara, Inc.
Obtained from:	Apple OSS Distributions (in part)
Differential Revision: https://reviews.freebsd.org/D37263
2022-11-04 15:19:27 +01:00
Dag-Erling Smørgrav
f9349d4274 gzip: Add support for decompressing zstd files.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37236
2022-11-04 13:42:09 +01:00
Souradeep Chakrabarti
602861820d arm64: Hyper-V: making INTR MP Safe
Makeing the interrupt MP safe.

Reviewed by:	andrew
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D37222
2022-11-04 10:20:16 +00:00
Richard Scheffenegger
3708c3d370 tcp: reserve tcp_info counters for AccECN
Marking all new fields unused (__xxx).

No functional change.

Reviewed By:		tuexen, rrs, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D37016
2022-11-04 10:18:53 +01:00
Wanpeng Qian
b631954ff0
bhyve: initial PowerCycles value
Currently PowerCycles field of Log Page is 0 and it is an invalid value.
This patch will initial the PowerCycles data to 1.

MFC after:		1 week
Approved by:		manu (mentor)
Reviewed By:		grehan (older version), chuck, corvink
Differential Revision:	https://reviews.freebsd.org/D32558
2022-11-04 10:13:01 +01:00
Li-Wen Hsu
d0b5e4a30a
mana(4): Make the code cross-platform
Discussed with:	whu
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36388
2022-11-04 11:45:35 +08:00
Li-Wen Hsu
c711f3b453
release/azure: Don't use azure-agent deprovision to build image
Deprovision feature of waagent is used for preparing to capture a
running VM and turn it into a VM image.  Using it in the process of
building a VM image from scratch will cause some side effects such as
the hostname of the building host getting reset.

Remove calling the deprovision command and use a simpler way to fulfill
the requirements of the Azure VM image.

Sponsored by:	The FreeBSD Foundation
2022-11-04 03:17:43 +08:00
Alexander V. Chernikov
4dfd380e06 netlink: allow more than 64 groups per netlink socket. 2022-11-03 17:05:34 +00:00
Alexander V. Chernikov
669d63eb85 netlink: remove private netlink_var.h header from the non-netlink core files. 2022-11-03 17:04:18 +00:00
Andrew Turner
b6a72a9f90 Enable hyperv in the arm64 NOTES
It now builds with all arm64 LINT kernels.

Sponsored by:	The FreeBSD Foundation
2022-11-03 15:49:49 +00:00
Andrew Turner
d98911f690 Hyper-V depends on ACPI, mark as such in files.arm64
Sponsored by:	The FreeBSD Foundation
2022-11-03 15:11:25 +00:00
Andrew Turner
4343f4019f Place the hyperv files with other dev files
Move the files enabled by hyperv with others under sys/dev rather than
at the end of the file.

Sponsored by:	The FreeBSD Foundation
2022-11-03 15:05:04 +00:00
Andrew Turner
f98c118e2e Clean up "optional hyperv" indentation in files.arm64
Make them all align and use a space after "optional"

Sponsored by:	The FreeBSD Foundation
2022-11-03 15:03:27 +00:00
Andrew Turner
7046ff4974 Revert "Disable Hyper-V on arm64"
This reverts commit fe36346a89.

The arm64 Hyper-v code now checks it is running under Hyper-v before
calling into the hypervisor.

Sponsored by:	The FreeBSD Foundation
2022-11-03 14:59:31 +00:00
Jose Luis Duran
d481443acb ping_test: Fix tests ping_46 and ping6_46
If no IPv4-host, IPv4-mcast-group or IPv6-host is passed, it will
display the usage.  The tests are passing because they are just checking
that the exit code is 1.

Fix the tests by checking the appropriate output message.

While here, change the description to match the output and add the
missing requirements.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37250
2022-11-03 10:39:32 -04:00
Jose Luis Duran
fcae0b54d1 ping_test: Code cleanup
Mostly style fixes.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37248
2022-11-03 10:39:32 -04:00
Jose Luis Duran
909e2e1b6c ping: Remove a vestigial notdef
It was once a function on 4.3BSD, pr_type() [1], used to convert an ICMP
"type" field to a printable string.  In 4.4BSD it was superseded by
pr_icmph() [2].

NetBSD [3] and OpenBSD [4] have already removed it.

[1]: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD/usr/src/etc/ping.c
[2]: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/src/sbin/ping/ping.c
[3]: 203dfd3486
[4]: 9bbbbbb75d

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37247
2022-11-03 10:39:32 -04:00
Jose Luis Duran
526e8a7d5d ping: main.c: Consistent use of white space/tabs
If a user has tabs set at a value other than 8, the output of the usage
may not be consistently aligned.

    % tabs -2

Before:
    % ping
    usage:
      ping [-4AaDdfHnoQqRrv] [-C pcp] [-c count] [-G sweepmaxsize]
          [-g sweepminsize] [-h sweepincrsize] [-i wait] [-l preload]
          [-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr]
          [-s packetsize] [-t timeout] [-W waittime] [-z tos] IPv4-host
      ping [-4AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] [-i wait]
          [-l preload] [-M mask | time] [-m ttl] [-P policy] [-p pattern]
          [-S src_addr] [-s packetsize] [-T ttl] [-t timeout] [-W waittime]
                [-z tos] IPv4-mcast-group
      ping [-6AaDdfHnNoOquvyY] [-b bufsiz] [-c count] [-e gateway]
                [-I interface] [-i wait] [-k addrtype] [-l preload] [-m hoplimit]
                [-p pattern] [-P policy] [-S sourceaddr] [-s packetsize] [-t timeout]
          [-W waittime] [-z tclass] [IPv6-hops ...] IPv6-host

After:
    % ping
    usage:
      ping [-4AaDdfHnoQqRrv] [-C pcp] [-c count] [-G sweepmaxsize]
          [-g sweepminsize] [-h sweepincrsize] [-i wait] [-l preload]
          [-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr]
          [-s packetsize] [-t timeout] [-W waittime] [-z tos] IPv4-host
      ping [-4AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] [-i wait]
          [-l preload] [-M mask | time] [-m ttl] [-P policy] [-p pattern]
          [-S src_addr] [-s packetsize] [-T ttl] [-t timeout] [-W waittime]
          [-z tos] IPv4-mcast-group
      ping [-6AaDdfHnNoOquvyY] [-b bufsiz] [-c count] [-e gateway]
          [-I interface] [-i wait] [-k addrtype] [-l preload] [-m hoplimit]
          [-p pattern] [-P policy] [-S sourceaddr] [-s packetsize] [-t timeout]
          [-W waittime] [-z tclass] [IPv6-hops ...] IPv6-host

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37246
2022-11-03 10:39:32 -04:00
Ed Maste
0657b2325d ssh: correct parse_cert_times case for hex "to" time
This appeared to be a copy-paste error from the "from" time case above.

Reported by:	Coverity Scan
CID:		1500407
Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37252
2022-11-03 10:10:28 -04:00
Roger Pau Monné
dabb3db7a8 xen/netfront: deal with mbuf data crossing a page boundary
There's been a report recently of mbufs with data that crosses a page
boundary. It seems those mbufs are generated by the iSCSI target
system:

https://lists.xenproject.org/archives/html/xen-devel/2021-12/msg01581.html

In order to handle those mbufs correctly on netfront use the bus_dma
interface and explicitly request that segments must not cross a page
boundary. No other requirements are necessary, so it's expected that
bus_dma won't need to bounce the data and hence it shouldn't
introduce a too big performance penalty.

Using bus_dma requires some changes to netfront, mainly in order to
accommodate for the fact that now ring slots no longer have a 1:1
match with mbufs, as a single mbuf can use two ring slots if the data
buffer crosses a page boundary. Store the first packet of the mbuf
chain in every ring slot that's used, and use a mbuf tag in order to
store the bus_dma related structures and a refcount to keep track of
the pending slots before the mbuf chain can be freed.

Reported by: G.R.
Tested by: G.R.
MFC: 1 week
Differential revision: https://reviews.freebsd.org/D33876
2022-11-03 13:32:21 +01:00
Andrew Turner
402c04af1b Add more SOC options to the arm64 NOTES file
These are found in other config files. Include them in NOTES so they
are used in the LINT configs.
2022-11-03 09:45:47 +00:00
Andrew Turner
4c52da33a2 Mark ar64 drivers that depend on fdt as such
These drivers all attach to one of the OFW/FDT busses. check for fdt
in the kernel config before building.
2022-11-03 09:45:47 +00:00
Andrew Turner
81bdc9ebe3 Include sys/malloc.h directly in the qoriq clock
We depend on header pollution to include sys/malloc.h. Include it
directly to fix the no-FDT build.
2022-11-03 09:45:47 +00:00
Andrew Turner
cc72012d42 Make all options lower case in files.arm64
Some of the SOC options were upper case. Make them lower to be
consistent with the rest of the file.
2022-11-03 09:45:47 +00:00
Andrew Turner
19db791d6b Mark soc_intel_stratix10 drivers as needing FDT
These files all need FDT so check for it before building.
2022-11-03 09:45:47 +00:00
Andrew Turner
2222b0e713 Sort the SOC options in the arm64 NOTES config 2022-11-03 09:45:47 +00:00
Colin Percival
75549de770 vtblk: Fix dumping
Now that vtblk uses busdma, it keeps important information inside its
request structures.  The functions used for kernel dumps synthesize
their own request structures rather than using structures initialized
with the necessary bits for busdma.

Add busdma-bypass paths.  Since dumping writes contiguous blocks of
physical memory, vtblk doesn't need busdma in that case.

Reported by:	glebius
Tested by:	glebius
Differential Revision:	https://reviews.freebsd.org/D37243
2022-11-03 00:52:43 -07:00