Commit Graph

145312 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Mark Johnston
2c10be9e06 arm64: Handle translation faults for thread structures
The break-before-make requirement poses a problem when promoting or
demoting mappings containing thread structures: a CPU may raise a
translation fault while accessing curthread, and data_abort() accesses
the thread again before pmap_fault() can translate the address and
return.

Normally this isn't a problem because we have a hack to ensure that
slabs used by the thread zone are always accessed via the direct map,
where promotions and demotions are rare.  However, this hack doesn't
work properly with UMA_MD_SMALL_ALLOC disabled, as is the case with
KASAN configured (since our KASAN implementation does not shadow the
direct map and so tries to force the use of the kernel map wherever
possible).

Fix the problem by modifying data_abort() to handle translation faults
in the kernel map without dereferencing "td", i.e., curthread, and
without enabling interrupts.  pmap_klookup() has special handling for
translation faults which makes it safe to call in this context.  Then,
revert the aforementioned hack.

Reviewed by:	kevans, alc, kib, andrew
MFC after:	1 month
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37231
2022-11-02 13:46:25 -04:00
Mark Johnston
c036339ddf ddb: Don't flag breakpoint/watchpoint commands as MEMSAFE
They could potentially be abused to overwrite kernel memory, so
shouldn't be accessible when mac_ddb is loaded.

Reviewed by:	mhorne
Fixes:	bc4ea61d55cb ("ddb: tag core commands with DB_CMD_MEMSAFE")
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37105
2022-11-02 13:46:24 -04:00
Mark Johnston
d93ec8cb13 inpcb: Allow SO_REUSEPORT_LB to be used in jails
Currently SO_REUSEPORT_LB silently does nothing when set by a jailed
process.  It is trivial to support this option in VNET jails, but it's
also useful in traditional jails.

This patch enables LB groups in jails with the following semantics:
- all PCBs in a group must belong to the same jail,
- PCB lookup prefers jailed groups to non-jailed groups

This is a straightforward extension of the semantics used for individual
listening sockets.  One pre-existing quirk of the lbgroup implementation
is that non-jailed lbgroups are searched before jailed listening
sockets; that is preserved with this change.

Discussed with:	glebius
MFC after:	1 month
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37029
2022-11-02 13:46:24 -04:00
Mark Johnston
0d5d356b36 in6: Consolidate IN6_ARE_ADDR_EQUAL definitions
It is ok to use memcmp() in the kernel.  No functional change intended.

Reviewed by:	glebius, melifaro
MFC after:	1 week
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37028
2022-11-02 13:46:24 -04:00
Mark Johnston
a152dd8634 inpcb: Remove a PCB from its LB group upon a subsequent error
If a memory allocation failure causes bind to fail, we should take the
inpcb back out of its LB group since it's not prepared to handle
connections.

Reviewed by:	glebius
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37027
2022-11-02 13:46:24 -04:00
Mark Johnston
ac1750dd14 inpcb: Remove NULL checks of credential references
Some auditing of the code shows that "cred" is never non-NULL in these
functions, either because all callers pass a non-NULL reference or
because they unconditionally dereference "cred".  So, let's simplify the
code a bit and remove NULL checks.  No functional change intended.

Reviewed by:	glebius
MFC after:	1 week
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37025
2022-11-02 13:46:24 -04:00
Alan Somers
002c47bade [skip ci] Remove obsolete references in crypto_request(9)
They were missed by 68f6800ce0.

Sponsored by:	Axcient
MFC with:	68f6800ce0
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D37239
2022-11-02 11:09:06 -06:00
Ed Maste
35548e48a4 linux64: improve linux_support.s make rules
Previously we relied on the .s.o rule in share/mk/bsd.suffixes.mk to
tell make that linux_support.o is built from linux_support.s, even
though we do not use the .s.o rule to assemble it.

Reviewed by:	sjg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35864
2022-11-02 11:37:43 -04:00
Elliott Mitchell
21cc0918c7 sys: Nuke double-semicolons
A distinct number of double-semicolons have ended up in FreeBSD.  Take a
pass at getting rid of many of these harmless typos.

Reviewed by: emaste, rrs
Pull Request: https://github.com/freebsd/freebsd-src/pull/609
Differential Revision: https://reviews.freebsd.org/D31716
2022-11-02 09:34:20 -06:00
Wentao Wang
923704f7b8 vmw_pvscsi: Expand vcpuHint to 16 bit to aliagn with host side change.
vcpuHint has been expanded to 16 bit on host side to enable
interruptions to be routed to more CPUs. Guest side should align with
the change.

This change has been tested with hosts with 8-bit and 16-bit vcpuHint,
on both platforms host side can get correct value.

This driver is for ESXi product which only supports x86/x64. They are
little-endian. So there is no need to consider big-endian system.

PR:		264840
Reviewed by:	imp@, Zhenlei Huang
2022-11-02 09:14:52 -06:00
Kristof Provost
8a8af94240 pf: bridge-to
Allow pf (l2) to be used to redirect ethernet packets to a different
interface.

The intended use case is to send 802.1x challenges out to a side
interface, to enable AT&T links to function with pfSense as a gateway,
rather than the AT&T provided hardware.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D37193
2022-11-02 15:45:23 +01:00
Elliott Mitchell
ccd9b49f20 sys: use .S for assembly language files that use the preprocessor
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/609
Differential Revision: https://reviews.freebsd.org/D35908
2022-11-02 10:29:00 -04:00
Kristof Provost
9f8f3a8e9a ipsec: add support for CHACHA20POLY1305
Based on a patch by ae@.

Reviewed by:	gbe (man page), pauamma (man page)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D37180
2022-11-02 14:19:04 +01:00
Jung-uk Kim
f443d0802a OpenSSL: Regen assembly file for OpenSSSL 1.1.1s 2022-11-01 19:12:09 -04:00
Konstantin Belousov
4d447b30f7 vmm: do not leak halted_cpus bit after suspension
Reported by:	bz
PR:	267468
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37227
2022-11-01 20:44:42 +02:00
Ed Maste
05c0c99ea3 ng_hci: handle NG_HCI_M_PULLUP failure in le_advertizing_report
PR:		267396
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	takawata
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37228
2022-11-01 14:33:37 -04:00