History log of /freebsd-head/sys/geom/raid/md_intel.c
Revision Date Author Comments
246370ba36c98107f1782ef761d81a4d6b33391e 01-Sep-2020 mjg <mjg@FreeBSD.org> geom: clean up empty lines in .c and .h files
3249097b0a91c1659755bbbf122da7c99e45c3f3 09-Jul-2020 delphij <delphij@FreeBSD.org> sys/geom: consistently use _PATH_DEV instead of hardcoding "/dev/".

Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25565
10d53fcce8d03533ba3ded8380337cc79b974fad 07-Aug-2019 cem <cem@FreeBSD.org> GEOM: Reduce unnecessary log interleaving with sbufs

Similar to what was done for device_printfs in r347229.

Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an
sbuf; documented in g_bio.9.

Reviewed by: markj
Discussed with: rlibby
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21165
2e026938033ce5a0a5c7d8f69c54220fbcf6d4bd 05-Apr-2018 sbruno <sbruno@FreeBSD.org> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE.

Display attribute in future error strings and differentiate g_handleattr()
error messages for ease of debugging in the future.

"g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT"

Reported by: swills
Reviewed by: imp cem avg
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14962
a82e3a8b2430553d1a48209e110921023d727e45 27-Nov-2017 pfg <pfg@FreeBSD.org> sys/geom: 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.
30f99dbeefc844112679b1d34c674426abfb24c8 08-Nov-2016 bdrewery <bdrewery@FreeBSD.org> Fix improper use of "its".

Sponsored by: Dell EMC Isilon
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
fc01419148d065603607b1008d536431465f3bc3 26-Apr-2016 pfg <pfg@FreeBSD.org> sys: extend use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
2df02110ddf595cccfd0b423ec5a29edba11b3c9 14-Aug-2015 pfg <pfg@FreeBSD.org> MFC r286615:
Clean up some externally visible "more then" occurences
04e944197ed8cac9ab8ec518fc7f6d123cbb5f97 11-Aug-2015 pfg <pfg@FreeBSD.org> Clean out some externally visible "more then" grammar

MFC after: 3 days
fa6dbb5ad5277c7b4c8acbc94d1d0e7b4a4d208a 11-Mar-2015 mav <mav@FreeBSD.org> MFC r279278: Replace constant with proper sizeof().

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
15944be5bd5018ceeecc6638b05b7144b5f120b8 25-Feb-2015 mav <mav@FreeBSD.org> Replace constant with proper sizeof().

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
bed1ef29db1dc277bc748999891ce90a5bf1160c 18-Dec-2014 mav <mav@FreeBSD.org> MFC r275475:
Decode some binary fields of Intel metadata.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
173190c9f87be20e0cd6b88bad2ab4fdce0bd26f 04-Dec-2014 mav <mav@FreeBSD.org> Decode some binary fields of Intel metadata.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
df9f601cbcdbfe062c43e38da3dd1a4351c46fdf 08-May-2014 mav <mav@FreeBSD.org> MFC r265054:
Reduce number of opens by REOM RAID during provider taste.

Instead opening/closing provider by each of metadata classes, do it only
once in core code. Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

Sponsored by: iXsystems, Inc.
b384f8775fb9dac291a6c48827c9f7c4bd2bc455 28-Apr-2014 mav <mav@FreeBSD.org> Reduce number of opens by REOM RAID during provider taste.

Instead opening/closing provider by each of metadata classes, do it only
once in core code. Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
0a34594b9cd7c8b87f719ed058da6be2b756a8e5 07-Jan-2014 scottl <scottl@FreeBSD.org> MFC Alexander Motin's GEOM direct dispatch work:

r256603:
Introduce new function devstat_end_transaction_bio_bt(), adding new argument
to specify present time. Use this function to move binuptime() out of lock,
substantially reducing lock congestion when slow timecounter is used.

r256606:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.

r256607:
Fix passing uninitialized bio_resid argument to g_trace().

r256610:
Add unmapped I/O support to GEOM RAID.

r256830:
Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
temporary mapped buffer. That fixes double unmap if biodone() called twice
for the same BIO (but with different done methods).

r256880:
Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

r259247:
Fix bug introduced at r256607. We have to recalculate bp_resid here since
sizes of original and completed requests may differ due to end of media.

Testing of the stable/10 merge was done by Netflix, but all of the credit
goes to Alexander and iX Systems.

Submitted by: mav
Sponsored by: iX Systems
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
4219fc00741f40993b2047c0524fe87ad9bce077 22-Oct-2013 mav <mav@FreeBSD.org> Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

The defined now safety requirements are:
- caller should not hold any locks and should be reenterable;
- callee should not depend on GEOM dual-threaded concurency semantics;
- on the way down, if request is unmapped while callee doesn't support it,
the context should be sleepable;
- kernel thread stack usage should be below 50%.

To keep compatibility with GEOM classes not meeting above requirements
new provider and consumer flags added:
- G_CF_DIRECT_SEND -- consumer code meets caller requirements (request);
- G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done);
- G_PF_DIRECT_SEND -- provider code meets caller requirements (done);
- G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request).
Capable GEOM class can set them, allowing direct dispatch in cases where
it is safe. If any of requirements are not met, request is queued to
g_up or g_down thread same as before.

Such GEOM classes were reviewed and updated to support direct dispatch:
CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE,
VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL,
MAP, FLASHMAP, etc).

To declare direct completion capability disk(9) KPI got new flag equivalent
to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION. da(4) and ada(4) disk
drivers got it set now thanks to earlier CAM locking work.

This change more then twice increases peak block storage performance on
systems with manu CPUs, together with earlier CAM locking changes reaching
more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to
256 user-level threads).

Sponsored by: iXsystems, Inc.
MFC after: 2 months
1d08afc7e3c4418caf298c2e7e24eeb324d10811 14-Jan-2013 mav <mav@FreeBSD.org> Keep value of orig_config_id metadata field. Windows driver writes there
previous value of config_id when it is changed in some cases. I guess it
may be used do avoid some split-brain conditions.
7ed3ee172aa11cd143c08046767a78f1378e8cd6 14-Jan-2013 mav <mav@FreeBSD.org> Small cosmetic tuning of the IRRT status constants.
163aff2e8d27290d49539f29ea022390ed1c1875 14-Jan-2013 mav <mav@FreeBSD.org> Print some more metadata fields.
257051502affd96323d9712fa882d51ff3ac4538 14-Jan-2013 mav <mav@FreeBSD.org> Windows driver writes relative volume IDs to metadata field. Use that value
as a hint for raid/rX device number to make it persistent across reboots.
44f703ac3d31dd511c7634ef7390ce623d29629c 13-Jan-2013 mav <mav@FreeBSD.org> - Add checks for Intel metadata version and attributes. Ignore disks with
unsupported metadata types like Intel Smart Response to not corrupt them.
- Improve setting of these things during metadata writing to protect from
incapable BIOS'es and other implementations.
6157d3ce336dcb3c28c81507cac6d3daae7d87ff 13-Jan-2013 mav <mav@FreeBSD.org> Improve support for disabled disks. If disabled disk disconnected and then
reconnected back, leave it as disconnected. If new disk inserted instead of
disabled, rebuild it and leave as enabled.
8de7e6376516d3e9b28116150334515cc78459ed 12-Jan-2013 mav <mav@FreeBSD.org> Windows handles INIT and VERIFY as array-wide and it doesn't specify which
disks should be rebuilt. Our rebuild code is same time disk-centric. To
handle this situation properly check all disks for RBLD flags, and if no
disk specified try rebuild/resync all of them except newly inserted.
960e9d02c6524420c6a138200264b33a52d5d7eb 12-Jan-2013 mav <mav@FreeBSD.org> Implement migration from single disk to RAID1/IRRT for Intel metadata.
Windows driver uses such migration when it creates new arrays. While GEOM
RAID has no mechanism to implement migration in general case, this specifc
case still can be handled easily via degraded RAID1 creation followed by
regular rebuild.
2a61b082bf60afb1c45cb4c10fef641623e29664 12-Jan-2013 mav <mav@FreeBSD.org> Add basic support for Intel Rapid Recover Technology (Intel RRT).
It is alike to RAID1, but with dedicating master and recovery disks and
providing manual control over synchronization. It allows to use recovery
disk as snapshot of the master disk from the time of the last sync.

This implementation is not functionaly complete comparing to Windows,
but it is better then silent conversion to RAID1 on first boot.
a43d540d9efdfd22157e434662f6be55d1437f32 29-Oct-2012 mav <mav@FreeBSD.org> Add basic BIO_DELETE support to GEOM RAID class for all RAID levels.

If at least one subdisk in the volume supports it, BIO_DELETE requests
will be propagated down. Unfortunatelly, for RAID levels with redundancy
unmapped blocks will be mapped back during first rebuild/resync process.

Sponsored by: iXsystems, Inc.
MFC after: 1 month
bfb53c205cc5070309c8d61379cb48a0522ecade 07-Oct-2012 mav <mav@FreeBSD.org> Make graid command line a bit more friendly by allowing volume name or
provider name to be specified instead of geom name (first argument in all
subcommands except label). In most cases there is only one array used
any way, so it is not really useful to make user type ugly geom names like
Intel-f0bdf223 or SiI-732c2b9448cf. Though they can be used in some cases.

Sponsored by: iXsystems, Inc.
MFC after: 1 month
db9e01aca9af40e4b56657bc713041a28462e06b 13-Sep-2012 mav <mav@FreeBSD.org> Add global and per-module sysctls/tunables to enable/disable metadata taste.
That should help to handle some cases when disk has some RAID metadata that
should be ignored, especially during boot.

MFC after: 3 days
27867e6fc973bc518294dce41f6fd8add4e97dcf 27-Apr-2012 mav <mav@FreeBSD.org> Fix RAID5 level names changed at r234603.
c283985a30228d16a933ebadb71100f65caede2a 23-Apr-2012 mav <mav@FreeBSD.org> Add sos@ copyrights to RAID metadata modules, respecting his efforts in
decoding metadata formats in ataraid(4) code.
fdb56713f24f9603c0b1d9d04f819a450c247a91 19-Apr-2012 mav <mav@FreeBSD.org> Add to GEOM RAID class module for reading non-degraded RAID5 volumes and
some environment to differentiate 4 possible RAID5 on-disk layouts.

Tested with Intel and AMD RAID BIOSes.

MFC after: 2 weeks
7b24e933235fed8644759a8a95994a3e22dd0c2e 09-Jan-2012 jimharris <jimharris@FreeBSD.org> Add support for >2TB disks in GEOM RAID for Intel metadata format.

Reviewed by: mav
Approved by: scottl
MFC after: 1 week
a4f906fd74b17750c944eb3293e7c0fcf5698f46 26-Oct-2011 mav <mav@FreeBSD.org> Clarify disks/volumes above 2TiB support in geom_raid:
- add support for volumes above 2TiB with Promise metadata format;
- enforse and document other limitations:
- Intel and Promise metadata formats do not support disks above 2TiB;
- NVIDIA metadata format does not support volumes above 2TiB.

Sponsored by: iXsystems, Inc.
MFC after: 2 weeks
f19e4d3eda530abfc8bd12478bf6c2d358bb8e63 31-Mar-2011 mav <mav@FreeBSD.org> Bunch of small bugfixes and cleanups.

Found with: Clang Static Analyzer
8fca35a71a67ff324340e8a89c496eaef25f985a 31-Mar-2011 mav <mav@FreeBSD.org> Bunch of small bugfixes and cleanups.

Found with: Coverity Prevent(tm)
CID: 9656, 9658, 9693, 9705, 9706, 9707, 9808, 9809, 9810,
9711, 9712, 9713, 9714
8dab5b050118631ed065f01515a1e2617f8e98de 24-Mar-2011 mav <mav@FreeBSD.org> MFgraid/head:
Add new RAID GEOM class, that is going to replace ataraid(4) in supporting
various BIOS-based software RAIDs. Unlike ataraid(4) this implementation
does not depend on legacy ata(4) subsystem and can be used with any disk
drivers, including new CAM-based ones (ahci(4), siis(4), mvs(4), ata(4)
with `options ATA_CAM`). To make code more readable and extensible, this
implementation follows modular design, including core part and two sets
of modules, implementing support for different metadata formats and RAID
levels.

Support for such popular metadata formats is now implemented:
Intel, JMicron, NVIDIA, Promise (also used by AMD/ATI) and SiliconImage.

Such RAID levels are now supported:
RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT.

For any all of these RAID levels and metadata formats this class supports
full cycle of volume operations: reading, writing, creation, deletion,
disk removal and insertion, rebuilding, dirty shutdown detection
and resynchronization, bad sector recovery, faulty disks tracking,
hot-spare disks. For Intel and Promise formats there is support multiple
volumes per disk set.

Look graid(8) manual page for additional details.

Co-authored by: imp
Sponsored by: Cisco Systems, Inc. and iXsystems, Inc.