This information is also printed to dmesg(8) on attach.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45771
(cherry picked from commit 3402d474ceb8541d07689bad6960f90739129997)
Opening /dev/sequencer after a clean reboot yields:
lock order reversal: (sleepable after non-sleepable)
1st 0xfffffe004a2c2c08 seqflq (seqflq, sleep mutex) @ /mnt/src/sys/dev/sound/midi/sequencer.c:754
2nd 0xffffffff84197ed8 midistat lock (midistat lock, sx) @ /mnt/src/sys/dev/sound/midi/midi.c:1478
lock order seqflq -> midistat lock attempted at:
0xffffffff811c9029 at witness_checkorder+0x12b9
0xffffffff810f18a7 at _sx_xlock+0xf7
0xffffffff8417f992 at midimapper_open+0x22
0xffffffff84182770 at mseq_open+0xf0
0xffffffff80e3380f at devfs_open+0x30f
0xffffffff81b8b4b7 at VOP_OPEN_APV+0x57
0xffffffff812da1e7 at vn_open_vnode+0x397
0xffffffff812d96b3 at vn_open_cred+0xb23
0xffffffff812c2c6b at openatfp+0x52b
0xffffffff812c2711 at sys_openat+0x81
0xffffffff84110579 at filemon_wrapper_openat+0x19
0xffffffff81a223ae at amd64_syscall+0x39e
0xffffffff819dd0eb at fast_syscall_common+0xf8
Expose midistat_lock to midi/midi.c so that we can acquire the lock from
mseq_open() before we lock seq_lock, and introduce _locked variants of
midimapper_open() and midimapper_fetch_synth().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45770
(cherry picked from commit fc76e24e583d45a3a59fd7ad4e603c0679eaf572)
The snd_sb16 driver was removed in 716924cb48 ("Retire snd_sbc ISA
sound card driver").
While here, simplify sample rate assignment a bit.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj, emaste
Differential Revision: https://reviews.freebsd.org/D45662
(cherry picked from commit d6d4586b0b7e3b01812e6c26818af78bf9b680a3)
Currently, we are skipping physical channels when servicing
SNDCTL_AUDIOINFO, and VCHANs when servicing SNDCTL_AUDIOINFO_EX.
However, if we call SNDCTL_AUDIOINFO with VCHANs disabled, we'll
eventually skip all channels, resulting in some of oss_audioinfo's
fields containing wrong information (e.g min/max_channels).
Fix this by adding an exception to SNDCTL_AUDIOINFO not to skip physical
channels when VCHANs are disabled.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45722
(cherry picked from commit f30af1f037a68947edbabebc7ab495cd1b7a4ec8)
On clone creating, either failure from vxlan_set_user_config() or
ifc_copyin() will result in leaking previous allocated counters.
Since counter_u64_alloc(M_WAITOK) never fails, make vxlan_stats_alloc()
void and move the allocation for counters below checking ifd->params to
avoid memory leak.
Reviewed by: kp, glebius
Fixes: b092fd6c97 if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45822
(cherry picked from commit 087f5e08ab5f0384163f76f73b9a91c98a3ba450)
The encapsulated (original) frame does not count in FCS as per Section 5
of RFC 7348.
Reviewed by: afedorov, bryanv, #network
Fixes: b7592822d5 Allow set MTU more than 1500 bytes
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45195
(cherry picked from commit d6963b9ed3287e91db3d1df153861591faff0007)
Since change [1], if_bpf will not be detached by the interface departure
eventhandler and will not be NULL. Then the logic to re-attach if_bpf
becomes dead and serves no purpose any more.
This partially reverts commit 05fc416403.
1. 9ce40d321d bpf: Fix incorrect cleanup
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45599
(cherry picked from commit 9738277b5c662a75347efa6a58daea485d30f895)
While here remove a pointless static local variable lo_cloner.
No functional change intended.
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45728
(cherry picked from commit 2cb7605a2415a1c0dd35374a88f815ef00e31de9)
This improves readability a little. As a side effect, a redundant
CURVNET_RESTORE is removed.
No functional change intended.
Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45595
(cherry picked from commit ef4f4a44d9134ddadede0e2e6e658d0688c5ab3c)
This makes it easier to grep the usage.
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45715
(cherry picked from commit 71f8fbf9bda43e3ca2f26d0499b7a88d0f2f7352)
This makes it easier to grep the usage.
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45715
(cherry picked from commit 08a98731ddf4459bcee25074bdbc21d6fa5ce4ca)
For NFSv4.1/4.2, an atomic upgrade of a delegation from a
read delegation to a write delegation is allowed and can
result in signoficantly improved performance.
This patch adds support for this atomic upgrade, plus fixes
a couple of other delegation related bugs. Since there were
three cases where delegations were being issued, the patch
factors this out into a separate function called
nfsrv_issuedelegations().
This patch should only affect the NFSv4.1/4.2 behaviour
when delegations are enabled, which is not the default.
(cherry picked from commit e2c9fad2e0ae3f7049831bf7f2be1a3573363cdc)
gen_encap() always calls bus_dmamap_load_mbuf_sg() into 'map' (which is
the current tx_queue). If the tx_queue is full, it will load with a
'map' that already has a currently active mapping. This violates the
busdma(9) KPI.
Checking for a full queue and returning ENOBUFS will allow
gen_start_locked() to set the IFF_DRV_OACTIVE faster without having to
needlessly check if the mbuf will fit (it won't).
PR: 256482
Reviewed by: mhorne
MFC after: 1 week
Submitted by: ghuckriede@blackberry.com
(cherry picked from commit a35f66510917f5ac21c11e9642174cda7718fbc6)
State keys are trivially const in lookup routines, so annotate them as
such. No functional change intended.
Reviewed by: kp
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Modirum
Differential Revision: https://reviews.freebsd.org/D45671
(cherry picked from commit 66b8cac8d837c0ca3fd38d0a66259ca932a1c430)
Commit bf454ca88bdf made wg_transmit() defined only when "device netmap"
is configured, as if_wg's if_transmit implementation should never be
called otherwise, but this breaks a requirement that interfaces
implement both or neither of if_transmit and if_qflush.
Restore the old behaviour of unconditionally defining wg_transmit(). It
contains an assertion that the interface is in netmap mode.
Reported by: peterj
MFC after: 2 weeks
Fixes: bf454ca88bdf ("wg: Add netmap support")
(cherry picked from commit 5515e8874a8d85a8d961fca64c494dfc1bea4bd0)
Make sure that the transmit traffic is tagged correctly or else the
firmware will refuse to transmit and will report an ACL violation.
On receive the hardware will make sure that tagged traffic is delivered
to the appropriate VM. The driver only asserts that the VLAN id that
was extracted from the wire traffic matches the VF's configuration.
All this works when associating a specific VLAN id with a VF. The
'trunk' setting likely needs more work.
MFC after: 1 week
Sponsored by: Chelsio Communications
(cherry picked from commit 2d0a01271223ce623c78f5c8236f8f3f4b6ef104)
hw.cxgbe.doorbells_allowed="0xf"
The adapter's doorbells bitmap is clipped to the value specified in the
tunable, which is meant for debug and workarounds only. There is no
change in default behavior.
MFC after: 1 week
Sponsored by: Chelsio Communications
(cherry picked from commit ba95b4aea78909bca972239afcbd51538c4b37c1)
It is pointless to attempt an operation that is not permitted. It spams
the firmware devlog with "insufficient caps" errors that distract from
real errors.
78 2463625358 ERR CORE insufficient caps to process mailbox cmd: pfn 0x0 vfn 0x1; r_caps 0x86 wx_caps 0x82 required r_caps 0x81 w_caps 0x5
MFC after: 1 week
Sponsored by: Chelsio Communications
(cherry picked from commit d72db09005e53160d6c89b5221169efaac74cd55)
Allow iovctl to create VFs that are restricted to specific VLAN IDs.
Reviewed by: kib, np
MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D45402
(cherry picked from commit c57c26179033f64c2011a2d2a904ee3fa62e826a)
The allocation call could result in sleep lock violation if it is in
smp_rendezvous. Move it out. Also move the pcpu memory pointer to
vmbus_pcpu_data since it is only used on Hyper-V.
PR: 279738
Reported by: gbe
Fixes: 2b887687edc25bb4553f0d8a1183f454a85d413d
MFC after: 2 weeks
Sponsored by: Microsoft
(cherry picked from commit d0cb4674df97aa638d5d17861c364b1625f79401)
Add boot parameter hw.vmbus.tlb_hcall for tlb flush hypercall.
By default it is set to 1 to allow hyercall tlb flush. It can be
set to 0 in loader.conf to turn off hypercall and use system
provided tlb flush routine.
The change also changes flag in the per cpu contiguous memory
allocation to no wait to avoid panic happened some cases which there
are no enough contiguous memery available at boot time.
Reported by: gbe
Tested by: whu
MFC after: 1 week
Fixes: 2b887687edc25bb4553f0d8a1183f454a85d413d
Sponsored by: Microsoft
(cherry picked from commit e02d20ddff7f9f9509b28095459327bc183dab8a)
Currently FreeBSD uses IPI based TLB flushing for remote
TLB flushing. Hyper-V allows hypercalls to flush local and
remote TLB. The use of Hyper-V hypercalls gives significant
performance improvement in TLB operations.
This patch set during test has shown near to 40 percent
TLB performance improvement.
Also this patch adds rep hypercall implementation as well.
Reviewed by: whu, kib
Tested by: whu
Authored-by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Co-Authored-by: Erni Sri Satya Vennela <ernis@microsoft.com>
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D45521
(cherry picked from commit 2b887687edc25bb4553f0d8a1183f454a85d413d)
Fixes: bec000c9c1ef409989685bb03ff0532907befb4aESC
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 9c5d7e4a0c02bc45b61f565586da2abcc65d70fa)
Make the tlb shootdown function as a pointer. By default, it still
points to the system function smp_targeted_tlb_shootdown(). It allows
other implemenations to overwrite in the future.
Reviewed by: kib
Tested by: whu
Authored-by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Co-Authored-by: Erni Sri Satya Vennela <ernis@microsoft.com>
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D45174
(cherry picked from commit bec000c9c1ef409989685bb03ff0532907befb4a)
Prevent kernel panic by not running ISPCTL_FCLINK_TEST after a
failed ISPCTL_ABORT_CMD.
Reviewed by: mav
Tested by: Arne Steinkamm <arne@steinkamm.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45718
(cherry picked from commit 8aa9192ce98aec07b24f8279c709237dd2c4421b)
It seems that there are still some applications that use ftime(3)
(for example, science/siconos and sysutils/lcdproc). The issue
is that we don't build libcompat as a shared library anymore.
The easiest solution is to move it to libutil, until we
deprecate it for good.
This solution was proposed by kib@ in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789.
PR: 257789
MFC after: 1 month
Reviewed by: kib (ages ago)
Differential Revision: https://reviews.freebsd.org/D39994
(cherry picked from commit bb421be6c1174fad837973acc5e4a7bade4489db)
Make sure we do this BEFORE pmap_bootstrap().
Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45325
(cherry picked from commit 0e4e77072f65df71644140e41229b868a73f3371)
The parse_bias method returns a signed int, with a value of -1 when
the device tree reports nothing of the bias configuration. Convert the
local 'bias' from unsigned to signed to properly check this condition.
PR: 229721
Reviewed by: mhorne
MFC after: 3 days
(cherry picked from commit 97ab935d566c85458bc7cab99c402f026d704eff)
CTASSERT is defined in kassert.h, so include that here. No functional
change intended.
MFC after: 1 week
(cherry picked from commit aede0d3badd1be92b57deb14c494785ab61022d4)
Note that it is ok to use device_get_desc() as one of the format string
parameters because it is set using device_set_desc() (not
device_set_desc_copy()) and so won't be freed when the description is
updated.
No functional change intended.
MFC after: 1 week
(cherry picked from commit 83caa244bc9eef6949a1250a875ad1409775a46e)