Commit graph

42641 commits

Author SHA1 Message Date
prateek sethi
b57229a804 mps/mpr: Add workaround for firmware not responding to IOC_FACTS or IOC_INIT
Sometimes, especially with older firmware, mps(4) would have trouble
initializing the card in one of these two steps. Add in a retry after a
short delay. Sean Bruno and Stephen McConnell thought this was OK in the
bug discussions, but never committed it.  Steve indicated the delay
might not be necessary, but the OP clearly needed to make it longer to
make things work. I've kept the delay, and added the suggested comment.

Ported the iocfacts part to mpr as well, since we see similar errors
about once every month or two over a few thousand controllers at
work. We've not seen it with IOC_INIT as far back as I can query the
error log database, so I didn't port that forward. We'll see if this
helps, but won't know for sure until next year (so I'm committing it now
since it won't hurt and might help). We usually see this failure in
connection with complicated recovery operations with a drive that's
failing, though, at least in the last year's worth of failures. It's
not clear this is the same as OP or not.

PR: 212841
Sponsored by: Netflix
Co-authored-by: imp

(cherry picked from commit c0e0e530ced057502f51d7a6086857305e08fae0)
2024-10-16 08:19:21 -06:00
Roger Pau Monné
11432d8f07 xen/blk{front,back}: fix usage of sector sizes different than 512b
The units of the size reported in the 'sectors' xenbus node is always 512b,
regardless of the value of the 'sector-size' node.  The sector offsets in
the ring requests are also always based on 512b sectors, regardless of the
'sector-size' reported in xenbus.

Fix both blkfront and blkback to assume 512b sectors in the required fields.

The blkif.h public header has been recently updated in upstream Xen repository
to fix the regressions in the specification introduced by later modifications,
and clarify the base units of xenstore and shared ring fields.

PR: 280884
Reported by: Christian Kujau
MFC after: 1 week
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D46756

(cherry picked from commit e7fe85643735ffdcf18ebef81343eaac9b8d2584)
2024-10-15 10:12:19 +02:00
Roger Pau Monné
c1782c2d28 xen-netfront: attempt to make cleanup idempotent
Current cleanup code assumes that all the fields are allocated and/or setup by
the time cleanup is called, but this is not always true: a failure in mid-setup
of the device will cause the functions to be called with possibly uninitialized
fields.

Fix the functions to cope with such sate, while also attempting to make the
cleanup idempotent.

Finally fix an error path during setup that would not mark the device as
closed, and hence prevents the kernel from finishing booting.

Fixes: 96375eac94 ("xen-netfront: add multiqueue support")
Sponsored by: Citrix Systems R&D

(cherry picked from commit 318bbb6d5a1eae77eb5dc687bcc63c0f99558e21)
2024-10-11 09:06:25 +02:00
Roger Pau Monné
329a3b0844 xen: fix initialization of grant table frame array
The current sizing of the array used to store grant table frames is broken, as
the calculation:

       max_nr_glist_frames = (boot_max_nr_grant_frames *
                              GREFS_PER_GRANT_FRAME /
                              (PAGE_SIZE / sizeof(grant_ref_t)));

Is plain bogus, for once grant_ref_t is the type of the grant reference, but
not the entry used to store such references in the grant frames.  But even if
the above calculation is switched to use grant_entry_v1_t, it would end up as:

       max_nr_glist_frames = (boot_max_nr_grant_frames *
                              (PAGE_SIZE / sizeof(grant_entry_v1_t)) /
                              (PAGE_SIZE / sizeof(grant_entry_v1_t)));

Which is pointless (note GREFS_PER_GRANT_FRAME has been expanded to (PAGE_SIZE
/ sizeof(grant_entry_v1_t))).

Just use boot_max_nr_grant_frames directly to size the grant table frames
array.

Fixes: 30d1eefe39 ("Import OS interfaces to Xen services.")
Sponsored by: Citrix Systems R&D

(cherry picked from commit 1a12f0aea81b57d0dd2374047b8f4c97a037a8df)
2024-10-11 09:06:13 +02:00
Bjoern A. Zeeb
6a931f050b sdiodevs: add more vendors and devices
Add IDs for Realtek, Atheros (QCA), and Mediatek.
While I am not sure we'll ever support the ath10k and possibly mt76
SDIO devices, rtw88 ones can be found with SoCs (e.g. r2s-plus) and
are actively being worked on.

Update Broadcom/Cypress entries.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46460

(cherry picked from commit a800b5bcd1b6638530d3a0759b17cd8d93b7e7ca)
2024-10-09 19:18:43 +00:00
Kevin Bowling
013d817b53 igc: Add NVM/firmware prints and sysctl
This chipset suffered an (un)usual number of bugs and iterations. Let's
add our NVM/firmware code from e1000 and the similar igc_nvm function
from DPDK to keep track of issues.

Sponsored by:	BBOX.io

(cherry picked from commit 33ed9bdca307bedb3d66a50ed7d4d7b4bf4acf39)
2024-10-05 20:49:08 -07:00
Kevin Bowling
f75c75d948 igc: Remove non-existent legacy absolute and packet timers
igc, derived from igb, does not use these registers. All interrupt
timing is governed by EITR or LLI and driven by write-back.

Sponsored by:	BBOX.io

(cherry picked from commit a40ecb6f740530fb7e6a95e702113aa3fe24d975)
2024-10-05 20:48:55 -07:00
Kevin Bowling
941833b9bb ixgbe: Switch if_sriov read/write back to ixgbe_mbx APIs
These are more succinct than jumping through the function pointers
directly and add some additional error handling.

(cherry picked from commit 1e3b1870ad2a426de6e3f5445211b698f20f7f1f)
2024-10-05 20:48:42 -07:00
Konstantin Belousov
a67cc4b031 hyperv: call smp_targeted_tlb_shootdown_native() with pin
(cherry picked from commit 6dcffb980fa3026092f79107ee7668918c9f5490)
2024-10-05 10:08:57 +03:00
Konstantin Belousov
0c7e13cfe2 iommu: extend iommu_map_entry to store the list of associated freed page table pages
(cherry picked from commit f713ed6694d949ec37365533afbb47c04f919572)
2024-10-05 10:08:56 +03:00
Konstantin Belousov
a5943b6e50 iommu: change iommu_domain_map_ops to take iommu_map_entry
(cherry picked from commit bdd5eb33cacdbf174980b999c77847d0903fc12e)
2024-10-05 10:08:56 +03:00
Konstantin Belousov
5e70f9aa9e iommu: add per-unit sysctls reporting the state of DMA and interrupt remapping
(cherry picked from commit d50403a6919a641abfb0da4d60eb58ce42302de5)
2024-10-05 10:08:56 +03:00
Mark Johnston
893caa2ab1 netmap: Make the memory ops function pointer table const
No functional change intended.

Reviewed by:	vmaffione
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D46664

(cherry picked from commit 1ae4951ba7bb203d9a29892792960f0869759d35)
2024-10-04 15:56:42 +00:00
Kevin Bowling
88cd12ec42 e1000: Clean up ITR/EITR in preparation for AIM
Provide macros to derive the various needed values and make it a bit
more clear the differences between em and igb.

The igb default EITR was not landing at the right offset.

Respect the 'max_interrupt_rate' tunable.

Sponsored by:	BBOX.io

(cherry picked from commit 9bf9164fc8aad1ca828c725413e06462aef1e4dd)
2024-10-03 23:41:34 -07:00
Kevin Bowling
e31c5d3981 e1000: Clean up legacy absolute and packet timers
The absolute and packet timers only apply to lem and em with some only
applying to the later.

This cleans up the sysctl tree to only show these where applicable and
stops writing to unexpected registers for igb.

Sponsored by:	BBOX.io

(cherry picked from commit 1c578f1c93112d3d53820f8b6b411488b83f0ab2)
2024-10-03 23:41:20 -07:00
Pierre Pronchery
ed03c30990 bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon()
Avoid a race condition when accessing guest memory, by reading memory
contents only once.

This has also been applied to _vq_record() in
sys/dev/beri/virtio/virtio.c, as per markj@'s suggestion.

Reported by:	Synacktiv
Reviewed by:	markj
Security:	HYP-10
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45735

(cherry picked from commit 869d760cb9d7a307faa2fbe8c1c2b238a81b74d4)
2024-10-02 16:37:09 -04:00
Val Packett
b383430657 pci_iov: Add a device_printf if out of bus numbers
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D20591

(cherry picked from commit 6a4f0c063718781c5e3eddbeff0da7b89d290d1e)
2024-10-02 12:52:53 -07:00
Joyu Liao
e0a44adb80 e1000: Delay safe_pause switch until SI_SUB_CLOCKS
Based on sysinit_sub_id, SI_SUB_CLOCKS is after SI_SUB_CONFIGURE.

SI_SUB_CONFIGURE  = 0x3800000,  /* Configure devices */  
At this stage, the variable “cold” will be set to 0.

SI_SUB_CLOCKS    = 0x4800000,  /* real-time and stat clocks*/
At this stage, the clock configuration will be done, and the real-time
clock can be used.

In the e1000 driver, if the API safe_pause_* are called between
SI_SUB_CONFIGURE and SI_SUB_CLOCKS stages, it will choose the wrong
clock source. The API safe_pause_* uses “cold” the value of which is
updated in SI_SUB_CONFIGURE, to decide if the real-time clock source is
ready. However, the real-time clock is not ready til the SI_SUB_CLOCKS
routines are done.

Obtained from:	Juniper Networks
Differential Revision:	https://reviews.freebsd.org/D42920

(cherry picked from commit 930a1e6f3d2dd629774f1b48b1acf7ba482ab659)
2024-10-02 12:52:27 -07:00
Kevin Bowling
262f8dd614 e1000: Add sysctl for igb(4) DMA Coalesce
This feature can increase efficiency at the expense of latency

It does not work well with the default interrupt delay, but expose
the otherwise unconnected code in the driver in case people want to
experiment.

See
https://www.intel.com/content/dam/support/us/en/documents/network/adapter/pro100/sb/466827_intel_r__dma_coalescing_white_paper_v003.pdf

Sponsored by:	Blue Box Systems

(cherry picked from commit c9021340a3266f924bf721182f14f2d265d8a82c)
2024-10-02 12:52:13 -07:00
Kevin Bowling
4ce45606ad e1000: Handle igb EEE sysctl
Sponsored by:	Blue Box Systems

(cherry picked from commit 2e78e568c268e4ba846ab140d9ac6b42886f8ec7)
2024-10-02 12:52:02 -07:00
Kevin Bowling
2726df2762 e1000: Add sysctls for some missing MAC stats
Sponsored by:	Blue Box Systems

(cherry picked from commit aa7d086ad94642fa40375db9976177fc9e54a2cf)
2024-10-02 12:51:43 -07:00
Zhenlei Huang
70280bc71d mxge(4): Stop checking for failures from taskqueue_create(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit 7ea3fd3bb5f4039c372fd72aeef004fe12454537)
2024-09-30 12:44:30 +08:00
Zhenlei Huang
518e138448 liquidio(4): Stop checking for failures from malloc/taskqueue_create/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit 57cd8f27b727e7a87312f6f141cfa13807dc81a0)
2024-09-30 12:44:30 +08:00
Zhenlei Huang
6b25a8f079 jme(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit 3fdef8e855027d5c9bec06e2a53e8f99f7d5694b)
2024-09-30 12:44:30 +08:00
Zhenlei Huang
f6c8db29aa dpaa2: Stop checking for failures from malloc/taskqueue_create(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit 36ef39831fe0e89f0b1672340a44c4ac1183158e)
2024-09-30 12:44:29 +08:00
Zhenlei Huang
e78770d62f cas(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit af28fc3c191cf572f7def767c60fff59d48947df)
2024-09-30 12:44:29 +08:00
Zhenlei Huang
f5cbe8ce89 bge(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit d44bc2f07b971fe1f451a1fff0389650a2502422)
2024-09-30 12:44:29 +08:00
Zhenlei Huang
39c35f6c54 axgbe: Stop checking for failures from taskqueue_create(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit b29adaaf44f6cf9433c782bbeeefd12d74d395a5)
2024-09-30 12:44:28 +08:00
Zhenlei Huang
7ae7006224 ale(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit f5524be39e26e3d7fb774ffe7711602c676a8b9e)
2024-09-30 12:44:28 +08:00
Zhenlei Huang
a6c873a822 alc(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit 0cd3976d076218ea10761dc3f38ecf8549768ad5)
2024-09-30 12:44:28 +08:00
Zhenlei Huang
ea86e323e5 age(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit 5cece2c24bfa618091e778df488fb2380fcecafe)
2024-09-30 12:44:27 +08:00
Zhenlei Huang
5de9286b9a ae(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853

(cherry picked from commit 3f3f3ca25bc453315c6a1f5d16bfcc1189d41bdd)
2024-09-30 12:44:27 +08:00
Zhenlei Huang
5a7db2ff56 sdhci(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit f80483cdd58a032ae2cfb2b9119824e9badc2c91)
2024-09-30 12:44:27 +08:00
Zhenlei Huang
bfcaaff418 sound: Stop checking for failures from malloc(M_WAITOK)
Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 59121599bbda1e4c3fc3c6e887cd48cd5e3afc70)
2024-09-30 12:44:26 +08:00
Zhenlei Huang
140a0c8f39 sume(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 761339c5544a360df9d3bab70675fea246eb6a83)
2024-09-30 12:44:26 +08:00
Zhenlei Huang
a1075ea2a3 qat(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 866dc4bd81398b478daefe4b7447b92422b4a06c)
2024-09-30 12:44:26 +08:00
Zhenlei Huang
025c475494 pms(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 4fb8a80a78aa65e0b30bd5a74373512c678841c9)
2024-09-30 12:44:25 +08:00
Zhenlei Huang
3e51da3495 mrsas(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit a38d9ad473123dca86108651ba10740055720777)
2024-09-30 12:44:25 +08:00
Zhenlei Huang
ae8388f726 mpi3mr(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 849f9ac370bd66993ce5cc6fca0d2ef9bd03c2c9)
2024-09-30 12:44:25 +08:00
Zhenlei Huang
cf44738feb mlx(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 556cd18fb07604e3442819b221afb2a19b924dbd)
2024-09-30 12:44:24 +08:00
Zhenlei Huang
4fee8d3e92 mfi(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 701308ef404f552034f8c3e3e912b41bfef28ee6)
2024-09-30 12:44:24 +08:00
Zhenlei Huang
0fa8566510 mana: Stop checking for failures from malloc/mallocarray/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 1dc7a7b74b5ad37ff7c8dc22f1a710460a5f1dcd)
2024-09-30 12:44:24 +08:00
Zhenlei Huang
ec68da0a7e iser(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 40a6bbc4284111790d9240f8a24ef11a9a9ecb07)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
bb8c6f4325 ice(4): Stop checking for failures from malloc(M_WAITOK)
As a consequence now ice_alloc_vsi_qmap() does not fail. Remove unneeded
error checks.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 5f97656fa334b494d70866cb1bfff406d3efd92d)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
e4de0a965f hptrr(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 92b0370ec65d5287a1deec84fd513e320a8da736)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
c860df902b hptnr(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit a3ec5d3ee7579a26790a86ca4c074512946ab964)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
0341c77f20 hpt27xx(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 28e413a699838df6fa5b0504c9ceb92a515037d9)
2024-09-30 12:44:22 +08:00
Zhenlei Huang
f3af527260 fwip(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 4d47c7ca7baa1ae76cc1fc72ec85b475f1efd41d)
2024-09-30 12:44:22 +08:00
Zhenlei Huang
6515ef4d2b flexspi: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit d1a89bd9b6eb1524902b619fa092c7d6de63e623)
2024-09-30 12:44:22 +08:00
Zhenlei Huang
e78c315e89 etherswitch: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 48741f4ceca71523aa1fa8da3bb78b184fad4aca)
2024-09-30 12:44:21 +08:00