| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
scsi is the only transport to do tag_action, so is the only one that
needs that support in devstat. Make a note of that. nvme and ata do
support some ordering, but that's done in the [an]da driver for each of
these devices and not for passthru commands and not via these tags.
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Take a pointer to the ccb header in a few places where it's not
ambiguous (eg we have multiple ccbs in the routine). The code is a
little shorter this way. In places we had mulitple ccbs, I refrained
from doing this since that's more complex to manage. This also means
that we're making a stronger guarantee to the compiler we're only
accessing this part of the ccb, which reduces a few warnings from gcc
with picky settings we normally disable for CAM).
This makes the driver slightly less SCSI specific where csio was used to
do this needlessly.
There's no functional change.
Sponsored by: Netflix
|
|
Nothing from scsi_all.h is used here, so don't include it.
Sponsored by: Netflix
|
|
"pass" is in several places, but should be a #define. Make it one. This
also lets folks with particular needs that copy this driver to reduce
diffs.
Sponsored by: Netflix
|
|
It is not used anymore...
Reviewed by: rscheff, Peter Lei
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50900
|
|
Reviewed by: glebius
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50889
|
|
Use MSEC_2_TICKS() to make clearer, which values are used and to
ensure that the value stored is at least one tick.
This also avoids the need of some protection code.
Reviewed by: cc, glebius
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50840
|
|
Revert b44147bb1245. It doesn't work right since it doesn't bootstrap
things quite right. It doesn't look trivial to fix, so revert until a
proper solution is done (though maybe that solution is just do `make
update-packages` and not document/support these other targets).
Suggested by: bapt, emaste
Sponsored by: Netflix
|
|
Add UFS Host Controller Itnerface driver to the build.
Sponsored by: Netflix
|
|
The sysctl-variable net.inet.tcp.nolocaltimewait should affect
TCP connections where the remote endpoint is on the local host and
not on the local area network.
Reported by: cc
Reviewed by: cc
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50830
|
|
The sysctl-variable net.inet.udp.blackhole_local should affect
UDP packets from an IPv6 address of the local host, not of a host on
the local area network.
Thanks to cc@ for pointing me to the issue.
Reviewed by: cc
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50829
|
|
The sysctl-variable net.inet.tcp.blackhole_local should affect
TCP segments from an IPv6 address of the local host, not of a host
on the local area network.
Thanks to cc@ for pointing me to the issue.
Reviewed by: cc
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50828
|
|
Markup CLOCK_REALTIME better.
Noticed by: kib
Fixes: 7b7ba7857ce8
Sponsored by: Netflix
|
|
Typically we spell error values 'error' not 'err'. And fix EINVAL markup
nit.
Suggested by: kib
Fixes: 7b7ba7857ce8
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
|
| |
We only define SIG2STR_MAX with careful visibility, but define the
fortified version unconditionally. It needs to have the same visibility
both places.
Fixes: 3d12567133bf
Reviewed by: jrtc27, kevans
Sponsored by: Netflix
|
|
'device crypto' is now required for 'device pf' so add it.
Sponsored by: Netflix
|
|
Fixes: a62c6b0de48a ("ddb: add optional printing of BBLog entries")
MFC after: 1 week
Sponsored by: Netflix, Inc.
|
|
Add a /b option to show tcpcb and show all tcpcbs to print BBLog
entries. Right now this supports the entries generated by the
FreeBSD default TCP stack. It should help in debugging issues
reported by syzkaller.
The syntax for printing sent and received packets is similar to the
one used by packetdrill, since the output of ddb will be used to
create packetdrill scripts for debugging.
Reviewed by: thj
Tested by: thj
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50629
|
|
This file depends on sys/types.h being included before it, which isn't
the best assumption. Include it here since we have no namespace
pollution concerns.
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
| |
Create a command that just quits out of the loader. Useful for
debugging.
Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D50589
|
|
|
|
|
|
|
|
|
|
|
| |
C doesn't require that we have static on both the declaration and
definition of a function. But stylistically, FreeBSD does. Make that
so. Also make a function static that wasn't because, it seems, that
static and struct look a lot alike in a column of text.
Sponsored by: Netflix
Reviewed by: tsoome, jhibbits
Differential Revision: https://reviews.freebsd.org/D50588
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
arch_loadaddr() is inconsistently used. In fact, I removed it entirely
from kboot because its interface wasn't wide enough (though I broke
powerpc kboot several years ago, and this commit might fix that). For
now, modify uboot to put it into copyin like all the other loaders
do. This might break arm ubldr.
In its place, use the new md_align() and any replacement will be called
from there, or via some explicit init() function.
These changes allow me to load a amd64 kernel via UEFI with all the
modules aligned to 16k.
Sponsored by: Netflix
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D50587
|
|
|
|
|
|
| |
Sponsored by: Netflix
Reviewed by: chs, tsoome
Differential Revision: https://reviews.freebsd.org/D50586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we're loading metadata, we need to align it in a certain way. Right
now that way is hard-coded to be PAGE_SIZE. Rather than do the actual
physical thing in all these places, move this into a wrapper routine. We
may want to load a 16k kernel and align all these on 16k or a 4k kernel
and align on 4k on aarch64 (today you have to compile the loader with
the right page size). This will also reduce the number of places we
might have to touch to do that.
Sponsored by: Netflix
Reviewed by: tsoome, jhibbits
Differential Revision: https://reviews.freebsd.org/D50585
|
|
No functional change: We're allocating a page from EFI, which is always
4k on amd64. So, this should always be 4k. PAGE_SIZE usually is this,
but might not be in some cases. For the end of the stack pointer in the
ist1, it should point the architecture's physical page past where we've
allocated. EFI_PAGE_SIZE more faithfully reflects that here since
PAGE_SIZE might not be exactly that in the future (if we had a larger
logical page than physical page). Since the AllocPage interface is in
EFI_PAGE_SIZE pages always, this seems safer. No functional change since
they are both 2096 today.
Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D50584
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a command to show all TCP control blocks. Also provide an option
to limit the output to TCP control blocks, which are locked.
The plan is to run show all tcpcbs/l when syzkaller triggers a panic.
If a TCP control block is affected, it is most likely locked and
therefore the command shows the information of the affected TCP
control block.
Reviewed by: markj, thj
Tested by: thj
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50516
|
|
Print the name of the TCP function block and the name of the
congestion control algorithm. Furthermore, print some information
related to Black Box Logging.
Reviewed by: thj
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50535
|
|
Some routines are necessary, so note that.
Sponsored by: Netflix
|
|
|
|
|
|
| |
We don't need/use it.
Sponsored by: Netflix
|
|
|
|
| |
Sponsored by: Netflix
|
|
|
|
|
|
|
|
| |
Also, add a comment about the weird reason we even have an archsw here
at all. tl;dr: zfs code uses archsw when it aught not, but this hack
here is easier than fixing that code properly.
Sponsored by: Netflix
|
|
|
|
| |
Sponsored by: Netflix
|
|
|
|
|
|
| |
There's no real reason to do this at runtime.
Sponsored by: Netflix
|
|
|
|
| |
Sponsored by: Netflix
|
|
|
|
|
|
|
| |
No need to initialize this at runtime. This trades .bss space + code in
.text for just .data and is net smaller by 4 bytes.
Sponsored by: Netflix
|
|
|
|
|
|
|
| |
No need to initialize this at runtime. This trades .bss space + code in
.text for just .data and is net smaller.
Sponsored by: Netflix
|
|
This likely used to be needed for some code here, or maybe it's been
here since it was copied from elsewhere that did neeed it. Remove it.
Sponsored by: Netflix
|
|
Also, remove the trailing white space that was introduced in the same
commit as the nitems fallback definition.
Sponsored by: Netflix
|
|
Sponsored by: Netflix
|
|
Improve the consistency of the formatting.
Reviewed by: ziaee
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50514
|
|
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we have a safe way to detect the vast majority of problems
with SYNCHRONIEZ CACHE, and since I have devices from many of these
vendors that work just fine (one of which will hang if you send it a
SYNCHROMIZE CACHE), I think these should all be reverted. The details
of when they were added are sketchy, the age of the devices in
question means these vendors have many generations of products after
and the general over-quirking of SYNCHRONIZE CACHE all point to just
removing them and adding back specific quirks should any need arise
after trying other means to debug.
The APPLE quirk was added because the autoquirk code would hang an ipod
with RockBox with a reset loop in the firmware. Since it was quirked, it
disabled the autoprobe and started working. Now that we've disabled the
autoprobe, we can remove it for sure.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49478
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are significant problems with the current autoquirk code. This
results in quite a bit of bogus over-quirking.
Most commands don't do the proper "sense" dance to get the scsi sense
codes to see if the failures are interesting or not. A number of
'sleeps' are used to try to get around this, but they are racy. Rather
than fix these, use better hueristics just introduced to catch
SYNCHRONIZE CACHE problems, etc.
The test for getting max lun number was bogus. It would set this quirk
both on errors and when 0 was returned. It appears to be an attempt to
filter our REPORT LUNS error messages that are actually benign (we
ignore the errors properly). These errors are also only filtered
sometimes, so the test is unreliable. In addition, it's doing exactly
the same test that the umass driver is doing and recovering in the
same way. There's no value add here.
The TEST UNIT READY almost always fails because the drive is becoming
ready. The SENSE is usually UNIT ATTENTION 28/0 "Drive went from
not ready to ready" which is a normal condition.
The crazy looping to get INQUIRY data is odd. It shouldn't be needed
and rarely actually fails (I've not seen any, despite using this code
on some really sketchy drives). It should set a NO_INQUIRY quirk if it
fails, but instead sets a whole bunch of other, mostly unrelated
quirks if it fails.
The INQUIRY code also doesn't recognie RBC devices as well as DIRECT
devices. This means it fails on some older generations of cameras that
could actually benefit from this code.
The SYNCHRONIZE CACHE test is flawed. It will do the same failed test
over and over again in the event the command succeeds. There are
better ways to detect probelms.
The START STOP test is useless. It doesn't really help on any of the
devices I've tested on. It appears to be another result of the failure
to properly obtain the SENSE code and do appropriate things with it.
The PREVENT ALLOW test is useless. It is overwhelmingly used to
prevent an error message later. However, after it was added the error
message was changed to be informative and not scary. We properly
probe this at runtime on all the devices I tested on.
At the end of the tests, we try to clear the SENSE errors, but
do so imperfectly. Only one is cleared and we use INQUIRY rather
than the better TEST UNIT READY.
Attempted re-write to fix this caused additional problems as the reset
code was not at all robust (the same sequnce in umass / CAM worked when
we disabled this code).
In addition, the over-quirking and hair-triggered declaration that
SYNCHRONIE CACHE is bad would mean that some working drives that have
cache wouldn't flush the cache when WCE=1, leading to
corruption. Thankfully, nearly all (but not all) the USB sticks I have
default to WCE=0. One, however, did default to WCE=1 and some allow
setting it (despite the fact this is a bad idea on removeable
devices). However, for real disks attached via USB could be tripped up
over this.
When we do reset, some small subset of drives are now failing to
probe. There are reports on the FreeBSD forums that at least one ebook
reader no longer works. A different ebook reads is affected as well
(one of my long-time friends has htis). in my collection, one USB memory
stick, one SD card reader and one USB to generic PATA adapter no longer
work. All of them are pretty obscure (you could literally say they were
found in my junk drawer), but are troubling. These problems appear to
disappear if we stop doing the auto-quirk code.
For all these reasons, I'm turning this off and will likely remove
it entirely in the future once the alternative SYNC CACHE code
has provent itself.
Differential Revision: https://reviews.freebsd.org/D49477
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mode page 8 is the 'cache' mode page. It's used to control the cache,
if one is present, on a device. When it is absent, that's a very
strong hint that SYNCHRONIZED CACHE willl not be necessary. Set the
NO_SYNC_CACHE quirk for this situation.
SBC defines the 2010 Profile which specifies that both SYNCRHONIZE CACHE
and Cache Mode Page must be supported. There are additional vague
statements tieing these two together, but nothing that explicitly
requires Cache Mode Page support when SYNCHRONIZE CACHE is needed for
cache coherency. However, when the Cace Mode Page is present, that's a
very strong hint SYNCHRONIZE CACHE is supported (or at the very least
won't hang the firmware). Given the diversity of implementations, it's
hard to say this is 100% safe. However, many devices known to hang or
worse on a SYNCHRONIZE CACHE tolerate querying an unsupported mode page
well. If there's any devices that have a valid Cache page, but where
SYNCHRONIZE CACHE actually hangs can be dealt with by specific quirks.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49476
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When completing a request for UFI, don't fail the request on
non-zero asc/ascq values if we've done a request sense.
This idea is from umass.c 1.100 by mycroft. He used it to help
elminate the INQUIRY_SHORT quirk that we still have. However, it will
make little difference because we treat both return values the same
for CBI. And it appears we have (maybe bogusly) some devices that
specify this quirk that aren't CBI.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49475
|
|
|
|
|
|
|
|
|
|
| |
Call umass_std_transform instead of following the sc_transform member to
get the standard transforms now that has moved to
umass_std_transform. Pass NULL as the CCB so that we don't stomp on the
status that was just set (and allow that in std_transform).
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49474
|
|
|
|
|
|
|
|
| |
Elsewhere, if we fail a command, we use SCSI code ILLEGAL REQUEST/24/00,
but here we were using the CAM code for illegal request.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49473
|
|
|
|
|
|
|
|
| |
Only doing a short inquiry and converting TUR to START STOP UNIT are the
same everywhere, so move those quirks to umass_std_transform.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49472
|
|
|
|
|
|
|
|
|
|
| |
Move the length checks, and byte copying into umass_std_transform. The
copies are typically small and this simplifies the code a lot. Move
zeroing the buffer now to only when we change TEST UNIT READY to START
STOP.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49471
|
|
|
|
|
|
|
| |
These are now boolean, so make them return a boolean.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49470
|