Commit graph

86 commits

Author SHA1 Message Date
Jose Luis Duran 00bc86a9a6 isci: Fix typo (triple S)
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/955
2023-12-27 20:24:31 -07:00
Warner Losh fdafd315ad sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:00 -07:00
Warner Losh 685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh 95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Gordon Bergling be51810f8d isci(4): Fix common typos in source code comments
- s/reuqest/request/
- s/requst/request/

MFC after:	3 days
2023-01-11 10:45:08 +01:00
Gordon Bergling 816d5c1e98 isci(4): Fix common typos in source code comments
- s/assinged/assigned/

MFC after:	3 days
2022-11-01 08:34:11 +01:00
Gordon Bergling 5014dc958f isci(4): Fix a typo in a source code comment
- s/interrutp/interrupt/

MFC after:3 days
2022-11-01 07:58:26 +01:00
Gordon Bergling 13604a80f7 iscsi(4): Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 13:04:42 +02:00
Gordon Bergling 0702f4f040 isci(4): Fix a typo in a source code comment
- s/paramater/parameter/

MFC after:	3 days
2022-08-07 16:05:08 +02:00
John Baldwin c59cc8f801 isci: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:46:58 -07:00
Gordon Bergling 10df4dc724 iscsi(4): Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:01:43 +02:00
John Baldwin bbfec32d15 isci: Propagate error from bus_dma_tag_create.
Return error from isci_controller_allocate_memory if bus_dma_tag_create
fails instead of ignoring the error.
2022-04-06 16:45:28 -07:00
Gordon Bergling 01d74e5c7a iscsi(4): Fix a typo in a source code comment
- s/commmand/command/

MFC after:	3 days
2022-04-02 15:20:59 +02:00
Gordon Bergling b61c7c2dfb isci(4): Fix a typo in a source code comment
- s/initialzied/initialized/

MFC after:	3 days
2022-04-02 14:29:34 +02:00
Gordon Bergling 011e6016d0 isci(4): Fix a typo in a source code comment
- s/differnt/different/

MFC after:	3 days
2022-04-02 13:35:30 +02:00
Gordon Bergling e4c1b3f060 isci(4): Fix a typo in a source code comment
- s/recored/recorded/

MFC after:	3 days
2022-03-28 19:30:31 +02:00
Gordon Bergling 5e21882bb4 iscsi(4): Fix a typo in a source code comment
- s/conditon/condition/

MFC after:	3 days
2021-11-19 19:29:21 +01:00
betterentley f7c32ed617 Fix 'take effect' spelling in menus and comments.
Signed-off-by: John Bentley <johnbentley.public@gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/559
2021-11-18 23:22:12 -07:00
Gordon Bergling 2dfcc3a91d isci(4): Fix a common typo in src comments
- s/exlusive/exclusive/

MFC after:	3 days
2021-08-29 09:55:10 +02:00
Gordon Bergling b1603638e3 Fix a common typo in man pages and src comments
- s/desciptor/descriptor/

MFC after:	5 days
2021-08-28 19:24:27 +02:00
Gordon Bergling 17db4b52fb Fix some common typos in source code comments
- s/struture/structure/
- s/structre/structure/

MFC after:	5 days
2021-08-14 08:55:58 +02:00
Edward Tomasz Napierala b9353e0b44 isci: clear CCBs allocated on the stack
Reviewed By:	gallatin, imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D30303
2021-05-21 08:10:22 +01:00
Andrew Gallatin a2fc8ade10 isci: use maxphys rather than 128KB to size s/g list
In the conversion into a tunable, we converted the
size of the s/g list used by the driver to be based
off of a hardcoded size of 128k rather than maxphys,
this caused performance problems for us.  Revert this
to use the maxphys tunable.

Note that this constant is used to size dynamically allocated
things, and not static data structs, so this is safe.

Reviewed By:    imp, kib, mav
Tested By:i     dhw
Differential Revision: https://reviews.freebsd.org/D28023
Sponsored by: Netflix
2021-01-07 12:45:46 -05:00
Konstantin Belousov cd85379104 Make MAXPHYS tunable. Bump MAXPHYS to 1M.
Replace MAXPHYS by runtime variable maxphys. It is initialized from
MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys.

Make b_pages[] array in struct buf flexible.  Size b_pages[] for buffer
cache buffers exactly to atop(maxbcachebuf) (currently it is sized to
atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1.
The +1 for pbufs allow several pbuf consumers, among them vmapbuf(),
to use unaligned buffers still sized to maxphys, esp. when such
buffers come from userspace (*).  Overall, we save significant amount
of otherwise wasted memory in b_pages[] for buffer cache buffers,
while bumping MAXPHYS to desired high value.

Eliminate all direct uses of the MAXPHYS constant in kernel and driver
sources, except a place which initialize maxphys.  Some random (and
arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted
straight.  Some drivers, which use MAXPHYS to size embeded structures,
get private MAXPHYS-like constant; their convertion is out of scope
for this work.

Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs,
dev/siis, where either submitted by, or based on changes by mav.

Suggested by: mav (*)
Reviewed by:	imp, mav, imp, mckusick, scottl (intermediate versions)
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27225
2020-11-28 12:12:51 +00:00
Warner Losh fb2e3c49e1 Remove support for FreeBSD 8 systems. These workarounds and ways of rescanning
devices are no longer done.
2020-03-01 17:27:35 +00:00
Pawel Biernacki 7029da5c36 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by:	kib (mentor, blanket)
Commented by:	kib, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D23718
2020-02-26 14:26:36 +00:00
Warner Losh f6ccd325fc Enforce a 4GB DMA boundary on isci(4)
This device cannot cross a 4GB boundary with DMA.  Removing the
boundary in r346386 resulted in low frequency memory corruption on
machines with isci(4) controllers.

Submitted by: gallatin@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20910
2019-07-10 22:23:59 +00:00
Konstantin Belousov dad0dd21cc isci(4): Use controller->lock for busdma tags.
isci(4) uses deferred loading.  Typically on amd64 and i386 non-PAE
the tag does not create any restrictions, but on i386 PAE-tables but
non-PAE configs callbacks might be used.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2019-03-12 16:49:08 +00:00
Ed Maste 5e246cb89b Correct typo in ATA_WRITE_UNCORRECTABLE_PSEUDO
Also correct a typo in the comment for these values, noted by jimharris.

Reviewed by:	jimharris
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3715
2018-02-23 20:01:42 +00:00
Eitan Adler caa7e52f3f kernel: Fix several typos and minor errors
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
2017-12-27 03:23:21 +00:00
Pedro F. Giffuni 718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 14:52:40 +00:00
Warner Losh 4e38d89520 Include opt files in the kernel with "" instead of <>. 2017-07-10 05:08:01 +00:00
Conrad Meyer da1d1cd3fe scif_sas_controller: Fix inverted logic range check
PR:		217742
Submitted by:	Svyatoslav <razmyslov at viva64.com>
Sponsored by:	Viva64 (PVS-Studio)
2017-03-13 17:58:08 +00:00
Alan Somers 4195c7de24 Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)
The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR:		215474
Reported by:	Coverity
CID:		1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:		1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:		1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:		1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:		1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:		1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:		1010035 1010036 1010042 1010041 1010040 1010039
Reviewed by:	imp, sephe, slm
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9037
Differential Revision:	https://reviews.freebsd.org/D9038
2017-01-04 20:26:42 +00:00
Alexander Motin dc55467f7e Pass proper arguments (handles, not directly structure pointers) to
scif_cb_domain_device_removed().

This should fix NULL dereference on task management function timeout.

Reviewed by:	jimharris
MFC after:	2 weeks
2016-12-28 14:50:39 +00:00
Bryan Drewery 28323add09 Fix improper use of "its".
Sponsored by:	Dell EMC Isilon
2016-11-08 23:59:41 +00:00
Jim Harris 8a0ddeb828 isci: fix ATA PASSTHROUGH fixed sense data format
PR: kern/191717
Submitted by: martin@lispworks.com
Approved by: re (gjb)
MFC after: 3 days
2016-07-06 20:48:42 +00:00
Pedro F. Giffuni 453130d9bf sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
2016-05-03 03:41:25 +00:00
Pedro F. Giffuni b790c1938d etc: minor spelling fixes.
Mostly comments but also some user-visible strings.

MFC after:	2 weeks
2016-05-02 16:47:28 +00:00
Ravi Pokala 06152bf0e1 Storage Controller Interface driver - typo in unimplemented macro in
scic_sds_controller_registers.h

s/contoller/controller/

PR:		207336
Submitted by:	Tony Narlock <tony @ git-pull.com>
2016-04-06 04:50:28 +00:00
Warner Losh 4aa947cb70 Make sure we check for CAM_CDB_POINTER for all drivers. Also, for the
drivers I've touched, filter out CAM_CDB_PHYS.

Differential Revision: https://reviews.freebsd.org/D5585
2016-03-15 05:17:29 +00:00
Svatopluk Kraus a1e1814d76 As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
include it explicitly when <vm/pmap.h> is already included.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D5373
2016-02-22 09:02:20 +00:00
Justin Hibbits 43cd61606b Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any()
Since these calls only use default arguments, bus_alloc_resource_any() is the
right call.

Differential Revision: https://reviews.freebsd.org/D5306
2016-02-19 03:37:56 +00:00
Kevin Lo ddb1359877 Fix typo (s/harware/hardware/) 2015-12-25 14:51:36 +00:00
Jim Harris 854c31980e isci: check return value of pci_alloc_msix()
Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix()
always fails.  isci(4) was not properly detecting the allocation failure,
and would try to proceed with MSIx resource initialization rather than
reverting to INTx.

Reported and tested by: Bradley W. Dutton (brad-fbsd-stable@duttonbros.com)
MFC after:	3 days
Sponsored by:	Intel
2015-09-08 16:05:18 +00:00
Jim Harris c16120409b isci: explicitly enable/disable PCI busmaster
BIOS always enables PCI busmaster on the isci device, which effectively
worked around this omission.  But when passing the isci device through
to a guest VM, the hypervisor will disable busmaster and isci will not
work without calling pci_enable_busmaster().

MFC after:	3 days
Sponsored by:	Intel
2015-09-08 15:59:55 +00:00
Jung-uk Kim fd90e2ed54 CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten
years for head.  However, it is continuously misused as the mpsafe argument
for callout_init(9).  Deprecate the flag and clean up callout_init() calls
to make them more consistent.

Differential Revision:	https://reviews.freebsd.org/D2613
Reviewed by:	jhb
MFC after:	2 weeks
2015-05-22 17:05:21 +00:00
Scott Long 23059fc77f Fix tunable and sysctl handling of the fail_on_task_timeout knob.
Reviewed by:	emax
Obtained from:	Netflix, Inc.
MFC after:	3 days
2014-12-24 07:04:04 +00:00
Steven Hartland 85c9dd9d89 Prevent overflow issues in timeout processing
Previously, any timeout value for which (timeout * hz) will overflow the
signed integer, will give weird results, since callout(9) routines will
convert negative values of ticks to '1'. For unsigned integer overflow we
will get sufficiently smaller timeout values than expected.

Switch from callout_reset, which requires conversion to int based ticks
to callout_reset_sbt to avoid this.

Also correct isci to correctly resolve ccb timeout.

This was based on the original work done by Eygene Ryabinkin
<rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid
the overlow.

Differential Revision:	https://reviews.freebsd.org/D1157
Reviewed by:	mav, davide
MFC after:	1 month
Sponsored by:	Multiplay
2014-11-21 21:01:24 +00:00