Just use a typedef for spinlock_t, no need to create a useless
structure.
Reviewed by: bz, emaste
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D45205
(cherry picked from commit ae38a1a1bfdf320089c254e4dbffdf4769d89110)
linuxkpi: Fix spin_lock_init
Some linux code re-init some spinlock so add MTX_NEW to mtx_init.
Reported by: David Wolfskill <david@catwhisker.org>
Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")
(cherry picked from commit cff79fd02636f34010d8b835cc9e55401fa76e74)
This patch introduces the RoCE driver for the
Broadcom NetXtreme-E 10/25/50/100/200G RoCE HCAs.
The RoCE driver is a two part driver that relies
on the bnxt_en NIC driver to operate. The changes
needed in the bnxt_en driver is included through
another patch "L2-RoCE driver communication interface"
in this set.
Presently, There is no user space support, Hence
recommendation to use the krping kernel module for
testing. User space support will be incorporated in
subsequent patch submissions.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45011
(cherry picked from commit acd884dec99adcf8c4cdd0aa8a50be79c216f8e8)
This file is automatically generated from the firmware code to
export the driver interfaces.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45009
(cherry picked from commit 3d8bbe001115f3e9742c128716335e654729ce1a)
Implement firmware error recovery support for Thor adapters.
This entails enabling the capability for the firmware to initiate
error recovery. Specifically, the firmware will send the reset notify
asynchronous event to notify the driver of an error and impending reset.
Subsequently, the driver will queue a task to execute the following steps.
1. Deactivate the allocated resources.
2. Await completion of the firmware's recovery process.
3. Configure the resources and reactivate the network interface.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45008
(cherry picked from commit c9965974a52b5dfad1737706b7f2623d999fb569)
- Added Aux bus support for RoCE.
- Implemented the ulp ops that are required by RoCE driver.
- Restructure context memory data structures
- DBR pacing support
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45006
(cherry picked from commit 050d28e13cdede7528944c0abf8d0455729c63fd)
Created new directory "bnxt_en" in /dev/bnxt and /modules/bnxt
and moved source files and Makefile into respective directory.
ETS support:
- Added new files bnxt_dcb.c & bnxt_dcb.h
- Added sysctl node 'dcb' and created handlers 'ets' and
'dcbx_cap'
- Add logic to validate user input and configure ETS in
the firmware
- Updated makefile to include bnxt_dcb.c & bnxt_dcb.h
PFC support:
- Created sysctl handlers 'pfc' under node 'dcb'
- Added logic to validate user input and configure PFC in
the firmware.
App TLV support:
- Created 3 new sysctl handlers under node 'dcb'
- set_apptlv (write only): Sets a specified TLV
- del_apptlv (write only): Deletes a specified TLV
- list_apptlv (read only): Lists all APP TLVs configured
- Added logic to validate user input and configure APP TLVs
in the firmware.
Added Below DCB ops for management interface:
- Set PFC, Get PFC, Set ETS, Get ETS, Add App_TLV, Del App_TLV
Lst App_TLV
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45005
(cherry picked from commit 35b53f8c989f62286aad075ef2e97bba358144f8)
The firmware lacks support for manually setting 1G and 10G baseT speeds.
However, the driver can enable auto speed masks to achieve automatic configuration
at these speeds.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42960
(cherry picked from commit 770e7ba3ebe87ba7ffc872c87de72707757b4e25)
Add support for 50G, 100G and 200G PAM4 support
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42959
(cherry picked from commit c63d67e137f353f4bc4d0d56bd793f83204a3e1e)
This update enables the display of pluggable module information
to users via the ifconfig utility.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42958
(cherry picked from commit 3320f0f69f06df5c36daa8ff71e0c07908ff0f1a)
The newly added port extended hardware statistics are now accessible to
users through the sysctl interface. Also, Few obsolete stats are removed
and few stats are renamed.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42957
(cherry picked from commit d36b36621a9c0f785ebea495c57e975b8a526b67)
Increasing the maximum configurable MTU from 9000 to 9600 to
align with the firmware's capability of handling an MTU up to 9600.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42954
(cherry picked from commit 8a3aab53e335dadb3c95c0eb0664143a955f1ab7)
Enabled User Configuration of 1G Speed on Wh+ SFP28 Port with AOC
cable.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42953
(cherry picked from commit 0f8d1a9e0cd26bf4dd0b2fe2d28c1ab15d03cce4)
The 1G speed on DAC medium is incorrectly labeled as 1000baseT, it
should be 1000baseCX. Updated the label accordingly.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42952
(cherry picked from commit c5108e37fbf93a538c76325766b8a3d76a72f119)
Currently, if a media type (e.g., DAC) is hot-plugged out and another type
(e.g., optical cable) is hot-plugged in, the new speed is not reflected in
ifconfig. This occurs when the driver fails to update speeds with unchanged
tx and rx flow control.
To fix, a phy_type check ensures update of phy speeds upon detecting the new
phy.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42951
(cherry picked from commit 7cbffbfcd9a5185be61bec65790674159bb7c0a8)
The firmware package version currently appears as "Unknown" through
the sysctl interface. The parsing logic for extracting the firmware
package version from the package log has been modified to ensure
compatibility with all controllers.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42950
(cherry picked from commit e436cb79666db3c8bb167d47ca9803c36013e32c)
Move all handlng of struct sndstioc_nv_arg(32) to sndstat_ioctl() and
make the functions that actually do the work take a buffer and size or
size pointer. The 32-bit compat work is minimal so just inline it.
Remove checks that we've got a 32-bit process for 32-bit ioctls. We
don't check that default ioctls are from 64-bit processes on 64-bit
systems.
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D45307
(cherry picked from commit fb9013f215211f013eccc54786f299e39a1f8773)
The current implementation (incorrectly) passes the channel encoding
value to AFMT_CHANNEL(), which will always return 0, since the channel
number bits are masked out by AFMT_ENCODING().
Also add missing fmts initialization and aggregate encoding formats into
it directly.
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45312
(cherry picked from commit 425a7bc465d4a6393c88c2e79c5ad77befda2a97)
mixer(8)'s -a option is used to print information about all mixer
devices in the system. To do this, it loops from 0 to
mixer_get_nmixers(), and tries to open "/dev/mixer%d". However, this
approach doesn't work when there are disabled/unregistered mixers in the
system, or when an audio device simply doesn't have a mixer.
mixer_get_nmixers() calls SNDCTL_SYSINFO and returns
oss_sysinfo->nummixers, whose value is the number of currently _enabled_
mixers only. Taking the bug report mentioned below (277615) as an
example, suppose a system with 8 mixer devices total, but 3 of them are
either disabled or non-existent, which means they will not show up under
/dev, meaning we have 5 enabled mixer devices, which is also what the
value of oss_sysinfo->nummixers will be. What mixer(8) will do is loop
from 0 to 5 (instead of 8), and start calling mixer_open() on
/dev/mixer0, up to /dev/mixer4, and as is expected, the first call will
fail right away, hence the error shown in the bug report.
To fix this, modify oss_sysinfo->nummixers to hold the value of the
maximum unit in the system, which, although not necessarily "correct",
is more intuitive for applications that will want to use this value to
loop through all mixer devices.
Additionally, notify applications that a device is
unavailable/unregistered instead of skipping it. The current
implementations of SNDCTL_AUDIOINFO, SNDCTL_MIXERINFO and
SNDCTL_CARDINFO break applications that expect to get information about
a device that is skipped. Related discussion can be found here:
https://reviews.freebsd.org/D45135#1029526
It has to be noted, that other applications, apart from mixer(8), suffer
from this.
PR: 277615
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45256
(cherry picked from commit 5d980fadf73df64a1e0eda40a93170ed76ce6f14)
FreeBSD's implementation of SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO
does not exactly work as intended. The problem is essentially that both
IOCTLs return the same information, while in fact the information
returned currently by dsp_oss_audioinfo() is what _only_
SNDCTL_ENGINEINFO is meant to return.
This behavior is also noted in the OSS manual [1] (see bold paragraph in
"Audio engines and device files" section), but since e8c0d15a64fa
("sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)") we can
actually fix this, because we now expose only a single device for each
soundcard, and create the engines (channels) internally.
SNDCTL_ENGINEINFO will now report info about all channels in a given
device, and SNDCTL_AUDIOINFO[_EX] will only report information about
/dev/dspX.
To make this work, we also have to modify the SNDCTL_SYSINFO IOCTL to
report the number of audio devices and audio engines correctly.
While here, modernize the minimum and maximum channel counting in both
SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO. Currently these IOCTLs will
report only up to 2 channels, which is no longer the case.
[1] http://manuals.opensound.com/developer/SNDCTL_AUDIOINFO.html
PR: 246231, 252761
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45164
(cherry picked from commit e07f9178502b7cbc0769fc10e99ad0d013f437fd)
Several users with alc(4)-based "Killer" Ethernet cards have reported
issues with this driver not passing traffic, which are solved by
disabling MSI-X using the provided tunable.
To work around this issue, disable MSI-X by default on this card.
This is done by having msix_disable default to 2, which means
"auto-detect". The user can still override this to either 0 or 1 as
desired.
Since these are slow (1Gbps) Ethernet ICs used in low-end systems, it's
unlikely this will cause any practical performance issues; on the other
hand, the card not working by default likely causes issues for many new
FreeBSD users who find their network port doesn't work and have no idea
why.
PR: 230807
MFC after: 1 week
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1185
(cherry picked from commit 05a95d19cb248203acdd4e069d3eedfe597c3b49)
The current check is never false and if nvlist_unpack() fails, we might
panic later down the road.
PR: 266144
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45237
(cherry picked from commit 64f4e2db6d19d8ab520903a197fcaa8cc7ab9f9a)
SNDSTIOC_ADD_USER_DEVS* expects a user-supplied sndstioc_nv_arg->nbytes,
however we currently do not check whether this size is actually valid,
which results in a panic when SNDSTIOC_ADD_USER_DEVS* is called with an
invalid size. sndstat_add_user_devs() calls
sndstat_unpack_user_nvlbuf(), which then calls malloc() with that size.
PR: 266142
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D45236
(cherry picked from commit 074d337ad618f9cc2a1d5ab18b484928e57bd72b)
If dsp_unit2name() fails, we'll get to out2 with b, bs and devinfo
uninitialized, which will result in a panic.
Reported by: Pierre Pronchery <pierre@freebsdfoundation.org>
Reported by: Coverity Scan
CID: 1545029, 1545025
Pull-request: https://github.com/freebsd/freebsd-src/pull/1240
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45272
(cherry picked from commit 5d1a5d6f1f599a4fbea9634cbe5c77f7370e1a5d)
c is allocated with M_ZERO.
Reported by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45273
(cherry picked from commit 2db2292dac7331be5414f86c3ef7863c7b6a4ac6)
irdma_get_vlan_ipv4() calls ip_ifp_find() even if INET isn't defined, in
which case this function isn't available.
Stub this out for the non-INET case to return an error (0xffff) instead.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1156
(cherry picked from commit 0478a0356272ab3907af9d97711f0bb8b14bf38b)
When in netmap (emulated) mode, wireguard interfaces prepend or strip a
dummy ethernet header when interfacing with netmap. The netmap
application thus sees unencrypted, de-encapsulated frames with a fixed
header.
In this mode, netmap hooks the if_input and if_transmit routines of the
ifnet. Packets from the host TX ring are handled by wg_if_input(),
which simply hands them to the netisr layer; packets which would
otherwise be tunneled are intercepted in wg_output() and placed in the
host RX ring.
The "physical" TX ring is processed by wg_transmit(), which behaves
identically to wg_output() when netmap is not enabled, and packets
appear in the "physical" RX ring by hooking wg_deliver_in().
Reviewed by: vmaffione
MFC after: 1 month
Sponsored by: Klara, Inc.
Sponsored by: Zenarmor
Differential Revision: https://reviews.freebsd.org/D43460
(cherry picked from commit bf454ca88bdf4acfa873386e876ff5e772e6a830)
The loop counter is also the card's index, so ncards is redundant.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45144
(cherry picked from commit 305db91d4b92a5d53826dcb6df39fc8a1f3b427e)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D45105
(cherry picked from commit 278953360e0e6187c3f7c688cb49254df1567f0b)
The OSS manual now documents this field as "legacy_device".
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45138
(cherry picked from commit 24d5cc14dd60b49553ff3ee7830305621f782ff1)
They are missing from soundcard.h and are in fact used by some
applications, such as OSS' ossinfo(1):
http://manuals.opensound.com/developer/ossinfo.c.html
The new size for filler is chosen according to the most recent official
version of soundcard.h, which includes those 2 fields.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45137
(cherry picked from commit e6df8c379b0cf2f6d715d4903fcb1f279e38173e)
According to the OSS manual, oss_sysinfo->numcards holds the number of
detected audio devices in the system, while the current ncards variable,
whose value is assigned to oss_sysinfo->numcards, holds the number of
currently registered devices only.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45136
(cherry picked from commit 59d98edae3e1a6fffd292e4393c49862d624f25f)
nmix is used to compare against oss_mixerinfo->dev, which is a
user-supplied value to select the mixer device (if not -1, in which case
we'll select the default one) we want to fetch the information of. It is
also used to set oss_mixerinfo->dev in case it is -1.
However, nmix is at best redundant, since we have the loop counter
already (i), and confusing at worst.
For example, suppose a system with 3 mixer devices. We call
SNDCTL_MIXERINFO with oss_mixerinfo->dev=1, meaning we want to get
information for /dev/mixer1. Suppose /dev/mixer0 detaches while inside
the loop, so we'll hit the loop's "continue" case, and nmix won't get
incremented (i.e will stay 0 for now). At this point nmix counts 1
device less, so when it reaches 1, we'll be fetching /dev/mixer2's
information instead of /dev/mixer1's.
This is also true in case the mixer device disappears prior to the call
to mixer_oss_mixerinfo().
Simply remove nmix and use the loop counter to both set
oss_mixerinfo->dev and check against it in case a non -1 value is
supplied.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45135
(cherry picked from commit 2f31a5eb75f1e47b5c49f574e8ce48d2c863e9d3)
Follow the rest of the vchan.c naming convention.
No functional change intended.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45016
(cherry picked from commit 77ab4263bc42a5dcc102bbea39ce4f7f46b8d4f8)
pcm/sound.* contains code that should be part of pcm/vchan.*.
Changes:
- pcm_setvchans() -> vchan_setnew()
- pcm_setmaxautovchans() -> vchan_setmaxauto()
- hw.snd.maxautovchans moved to pcm/vchan.c
- snd_maxautovchans declaration moved to pcm/vchan.h and definition to
pcm/vchan.c
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45015
(cherry picked from commit 7ad5f383fcb507482d5606c8eb7a324b3621a9db)
These fields and devices are unused as of e8c0d15a64fa ("sound: Get rid
of snd_clone and use DEVFS_CDEVPRIV(9)").
While here, remove unused SND_DEV_* defines from pcm/sound.h and convert
the list to an enum.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45013
(cherry picked from commit 72cbd381075a2eb22a070505334d1ce92ec2d7ad)
hw.snd.version and SND_DRV_VERSION define the sound driver version and
are meant to be used in bug reports, but because these values are
constant, there is not much useful information we can extract from them.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D44996
(cherry picked from commit 7398d1ece5cfa2e6ce4997234a95115b49c9e818)
We should normally never enter these cases.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D44994
(cherry picked from commit 76f95bae092b7353ff82b7a0056ca5801bb98f76)
Follow-up of b3ea087c05d8c75978a302cbb3fa92ce1afa3e49 ("sound: Merge
pcm_chn_destroy() and chn_kill()")
While here, add device_printf()'s to all failure points. Also fix an
existing bug where we'd unlock an already unlocked channel, in case we
went to "out" (now "out2") before locking the channel.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D44993
(cherry picked from commit 2e9962ef57044b191431fe9228841e1415574d82)