Use multibus policy for NetApp NVMe-FC namespace controllers.
The search logic in find_hwe() looks for vendor/product matches backwards, and
quits if a match is found. Therefore specific sub-entries of a generic entry
have to be listed below the generic ones. Therefore, pull the generic NVME
entry with ".*" product name match on top. The NetApp-specific one is put
into the NetApp section. This way, more vendor-specific exceptions for NVME
may be added later.
---
 libmultipath/hwtable.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 448effe3c859..1cde60a6a41d 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -77,6 +77,20 @@
 #endif
 
 static struct hwentry default_hw[] = {
+       /*
+       * Generic NVMe devices
+       *
+       * Due to the parsing logic in find_hwe(), generic entries
+       * have to be put on top of this list, and more specific ones
+       * below.
+       */
+       {
+               .vendor        = "NVME",
+               .product       = ".*",
+               .uid_attribute = "ID_WWN",
+               .checker_name  = NONE,
+               .retain_hwhandler = RETAIN_HWHANDLER_OFF,
+       },
        /*
         * Apple
         *
@@ -666,6 +680,19 @@ static struct hwentry default_hw[] = {
                .pgpolicy      = MULTIBUS,
                .no_path_retry = 24,
        },
+       /*
+        * NetApp NVMe-FC namespace devices: MULTIBUS preferred
+        *
+        * The table is searched backwards, so place this after generic NVMe
+        */
+       {
+               .vendor        = "NVME",
+               .product       = "(NetApp |)ONTAP Controller)",
+               .uid_attribute = "ID_WWN",
+               .checker_name  = NONE,
+               .pgpolicy      = MULTIBUS,
+               .retain_hwhandler = RETAIN_HWHANDLER_OFF,
+       },
        /*
         * Nexenta
         *
@@ -1133,16 +1160,6 @@ static struct hwentry default_hw[] = {
                .prio_name     = PRIO_ALUA,
                .no_path_retry = 30,
        },
-       /*
-        * Generic NVMe devices
-        */
-       {
-               .vendor        = "NVME",
-               .product       = ".*",
-               .uid_attribute = "ID_WWN",
-               .checker_name  = NONE,
-               .retain_hwhandler = RETAIN_HWHANDLER_OFF,
-       },
        /*
         * Dot Hill Systems - Seagate Technology
         */
-- 
2.15.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to