Commit Graph

31 Commits

Author SHA1 Message Date
Mariusz Tkaczyk 8662f92d71 imsm: Limit support to the lowest namespace
First namespace existence is not quaranted by NVMe specification.
Instead first the smallest one shall be chosen.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2021-05-26 07:26:32 -04:00
Mariusz Tkaczyk fcebeb77b1 imsm: add devpath_to_char method
Add method for reading sysfs attributes and propagate it across IMSM code.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2021-05-26 07:26:30 -04:00
Mariusz Tkaczyk 7c798f8709 imsm: add generic method to resolve "device" links
Each virtual device is linked with parent by "device". This patch adds
possibility to get previous device in sysfs tree.

Depending on device type, there is a different amount of virutal
layers. The best we can do is allow to directly specify how many
"device" links need to be resolved. This approach also allows to get
previous virtual device, which may contain some attributes.

Simplify fd2devname, this function doesn't require new functionality and
shall use generic fd2kname.

For nvme drives represented via nvme-subystem when path to block
device if requested, then return it without translation.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2021-05-26 07:26:21 -04:00
Blazej Kucman d835518b6b imsm: nvme multipath support
Add support for nvme devices which are represented
via nvme-subsystem.
Print warning when multi-path disk is added to RAID.

Signed-off-by: Oleksandr Shchirskyi <oleksandr.shchirskyi@intel.com>
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2021-03-16 16:22:39 -04:00
Mariusz Tkaczyk a8f3cfd54e imsm: limit support to first NVMe namespace
Due to metadata limitations NVMe multinamespace support has to be removed.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
2020-11-25 18:09:47 -05:00
Xiao Ni 4b31846f3f Remove unused code
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2019-12-02 15:59:21 -05:00
Alexey Obitotskiy d3c1141658 imsm: count arrays under VMD HBAs correctly
OROM defines maximum number of arrays supported. On array creation mdadm
checks if number of arrays doesn't exceed that limit, however it is not
calculated correctly for VMD now.

The current code performs a lookup of HBA using the id. VMD HBAs have
the same id so each lookup returns the same structure (first
encountered). Take a different approach for VMD HBAs. As id is not
unique and cannot be used for lookups, iterate over all VMD HBAs and
compare both id and HBA path.

Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
2017-01-09 07:48:55 -05:00
Pawel Baldysiak 32716c51d9 IMSM: Add support for Non-Intel NVMe drives under VMD
This patch adds checking if platform (preOS) supports
non-Intel NVMe drives under VMD domain,
and - if so - allow creating IMSM Raid Volume
with those drives.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
2016-12-12 14:23:39 -05:00
Pawel Baldysiak 60f0f54d6f IMSM: Add support for VMD
The Intel Volume Management Device (VMD) is an integrated
endpoint on the platform's PCIe root complex that acts
as a host bridge to a secondary PCIe domain.

This patch adds proper handling of NVMe devices attached to VMD domain.
Each VMD domain is treated as a separate controller (HBA).
Spanning between domains is forbidden.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
2016-01-06 12:22:57 +11:00
Pawel Baldysiak 72a4577704 IMSM: Count arrays per orom
Active arrays with IMSM metadata are counted per hba so far.
This is bad due to new functionality of orom shared between multiple
controllers i.e. more arrays can be created than is supported by orom.
This patch changes the way of counting arrays, so the result will be
sum of arrays under every hba supported by specific orom.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2015-04-09 09:06:23 +10:00
Artur Paszkiewicz 5e1d612824 imsm: simplified multiple OROMs support
Replaced oroms array with list, add_orom() now only appends to this list
and add_orom_device_id() only appends devid_list node to an orom_entry.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2015-03-04 15:56:56 +11:00
NeilBrown 7a862a020f Don't break long strings onto multiple lines.
It is best to keep strings all together so that they
are easier to search for in the source code.
If a string is so long that it looks ugly one line,
them maybe it should be broken into multiple lines
for display too.

Only strings which contain a newline can be broken
into multiple lines:

 "It is OK to\n"
 "break this string\n"


Signed-off-by: NeilBrown <neilb@suse.de>
2015-02-12 13:46:53 +11:00
Artur Paszkiewicz 0858eccf86 imsm: detail-platform improvements
Print platform details per OROM, not per controller, differentiate
RST(e) platforms from legacy IMSM, print NVMe device paths, adjust port
printing to newer sysfs path.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2014-11-25 11:37:38 +11:00
Pawel Baldysiak 614902f64e imsm: add support for NVMe devices
Recognize Intel(R) NVMe devices as IMSM-capable.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2014-11-25 11:37:38 +11:00
Artur Paszkiewicz 6b781d331b imsm: support for OROMs shared by multiple HBAs
The IMSM platform code was based on an assumption that the OROM or UEFI
capability structure (represented by struct imsm_orom) always belongs to
only one HBA. This assumption is no longer valid, because of newer
platforms with dual AHCI HBAs. Each HBA can have a separate OROM, but
some versions have a combined OROM for both HBAs.

This patch implements this HBA-OROM relationship in struct orom_entry,
which matches an OROM with a list of HBA PCI ids. All the detected
orom_entries are stored and retrieved using a global array and the
functions add_orom(), add_orom_device_id() and get_orom_by_device_id().
This replaces the arrays: imsm_orom, populated_orom, imsm_efi,
populated_efi.

The scan() function is extended to find all HBAs for an OROM. The list
of their device ids is retrieved from the PCI Expansion ROM Data
Structure, hence the additional field devListOffset in struct
pciExpDataStructFormat.

In UEFI mode we can't read the PCI Expansion ROM Data Structure and the
imsm_orom structures are stored in UEFI variables. They do not provide a
similar device id list, so we also check the HBA PCI class to make sure
that the HBA has RAID mode enabled.

In super-intel.c there are changes which allow spanning of IMSM
containers over HBAs of the same type, but only if the HBAs share the
same OROM.  This is done by comparing imsm_orom pointers, which (outside
of platform-intel.c) always point to the global array containing all the
detected oroms. Additional warnings are added to
validate_container_imsm() to warn about potentially dangerous operations
in all the possible cases, e.g. when an array is assembled using disks
attached to HBAs with separate OROMs.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2014-11-25 11:34:02 +11:00
Pawel Baldysiak 0c21b485e4 IMSM: Add warning message when assemble spanned container
Due to several changes in code assemble with disks
spanned between different controllers can be obtained
in some cases. After IMSM container will be assembled, check HBA of
disks, and print proper warning if mismatch is detected.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2014-07-08 11:39:23 +10:00
NeilBrown 1011e8344a Remove lots of unnecessary white space.
Now that I am using white-space mode in Emacs I can see all of this,
and I don't like it :-)

Signed-off-by: NeilBrown <neilb@suse.de>
2013-06-19 12:31:45 +10:00
NeilBrown 9bc4ae77e4 platform-intel - cache 'intel_devices' for a few seconds.
find_intel_devices() has take a little while to run as it scans
some directory tree, and the result isn't likely to change
often.
So cache the value and only discard it after 10 seconds.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-01-07 10:34:43 +11:00
Czarnowska, Anna 29cd0821bf show 2TB volumes/disks support in --detail-platform
Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-04-02 10:17:25 +10:00
Hawrylewicz Czarnowski, Przemyslaw 70eb8219ac fix: imsm: validate strip size - tuned up
Neil's proposal seems more reasonable and shows what is really going on
here.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-12-07 12:15:55 +11:00
Przemyslaw Czarnowski 8aedc4eaf6 imsm: fix: does not allow to use invalid chunk size
Only least significant bit of chunk size provided by user has been used
in test with OROM capabilities. This way user could pass value which is
not a power of 2.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-12-06 11:41:27 +11:00
Dan Williams cd9d1ac715 imsm: fix default chunk in the !orom case
Set a valid default in the !orom case, otherwise we segfault, or
otherwise fail.

Cc: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-19 16:53:08 +10:00
Labun, Marcin 9c747fa0ff platfrom_intel: find OROM based on Intel AHCI and SAS driver device id
We use PCI device id exposed by AHCI and ISCU drivers (SAS controller)
to find OROM version table.
In this way there is no need to maintain AHCI and ISCU device id list
in mdadm. The consequence is that the OROM properties can be found by mdadm when AHCI or
SAS drivers are loaded in the system.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-14 18:18:46 +11:00
Labun, Marcin 1a90147116 Some guid manipulation utilities has been added.
It will be used for reading efi variables with capabilities.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-10 11:45:15 +11:00
Labun, Marcin 2a7e6de250 update of imsm_orom structure
The structure is update according to current specification. These values
are not used right now, but they are not "reserved" anymore.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-10 11:45:00 +11:00
Labun, Marcin fc13853f4e Platform-intel: support for OROM SAS and AHCI controller
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-10 11:44:21 +11:00
Labun Marcin a8e5382a54 imsm platform: support for Intel(R) SAS controller.
This patch adds platform support for SAS controller(s) built in Intel(R) Patsburg
chipset.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-01-26 11:06:55 +10:00
Dave Jiang 0bd16cf217 create: Check with OROM limit before setting default chunk size
Make create check with the appropriate meta data handler and see what the
largest chunk size is supported. The current 512K default is not supported
by existing imsm OROM.

[dan.j.williams@intel.com: trim the upper limit to 512k for future oroms]
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2010-06-15 18:41:53 -07:00
Dan Williams 88c32bb1ec imsm: validate arrays being created against firmware capabilities
These checks are only enabled when platform support for imsm is found,
i.e. ahci driver is loaded and talking to an Intel(R) controller, and
the option rom header is located.

They can be turned off by setting the environment variable
IMSM_NO_PLATFORM to 1.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-12-08 16:59:18 -07:00
Dan Williams 25921536da imsm: sysfs support routines for determining device connectivity
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-12-08 16:59:18 -07:00
Dan Williams b390f61061 imsm: detect option-rom capabilities
The option-rom advertises its capabilities in a data structure located in
the platform ROM region 0xc0000-0xf0000.  Attempt to detect the option-rom
and limit array creation to the platform's capabilities.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-12-08 16:59:18 -07:00