Changes to Userspace multipath code to support lsi-rdac
cover Changes to Userspace multipath code to support lsi-rdac
Hi All,
While working on lsi-rdac hardware handler, I found that the checkers "tur" and "readsector0" are not serving the lsi-rdac properly. Also, the storage device has a active/passive state which need to be handled properly.
So, I wrote a new path checker for lsi-rdac, to use the C4 inquiry page to get the current owner of the lun and set the state as UP(active) or GHOST(passive). Changes are in patch 1/3.
After applying the above patch, I realized the priorities are not set properly. Made some changes to use the GHOST state while setting priorities. Changes are in patch 2/3.
Debugging the above patches found that the wait time (5 seconds) in multipathd was not sufficient for the devices to appear in /dev/ It was taking about 20 seconds. Changed the wait time to be 60 seconds. Change in patch 3/3.
Please provide me with your feedback/comment on these changes regarding correctness, completeness etc.,
Thanks & regards,
chandra
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------PATCH 1/3 C4 Inquiry based path checker
libcheckers/Makefile +1 -1
@@ -6,7 +6,7 @@ include ../Makefile.inc -OBJS = checkers.o readsector0.o tur.o directio.o emc_clariion.o hp_sw.o +OBJS = checkers.o readsector0.o tur.o directio.o emc_clariion.o hp_sw.o rdac.o all: $(BUILD)
libcheckers/rdac.c new file +109 -0
109 lines not on this page · raw message
libcheckers/checkers.c +10 -0
@@ -7,6 +7,7 @@#include "tur.h" #include "hp_sw.h" #include "emc_clariion.h" +#include "rdac.h" #include "readsector0.h" static struct checker checkers[] = {
@@ -48,6 +49,15 @@ }, { .fd = 0, + .name = RDAC, + .message = "", + .context = NULL, + .check = rdac, + .init = rdac_init, + .free = rdac_free + }, + { + .fd = 0, .name = READSECTOR0, .message = "", .context = NULL,
libcheckers/rdac.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef _RDAC_H +#define _RDAC_H + +int rdac (struct checker *); +int rdac_init (struct checker *); +void rdac_free (struct checker *); + +#endif /* _RDAC_H */
libcheckers/checkers.h +1 -0
@@ -14,6 +14,7 @@#define DIRECTIO "directio"#define TUR "tur"#define HP_SW "hp_sw" +#define RDAC "rdac"#define EMC_CLARIION "emc_clariion"#define READSECTOR0 "readsector0"
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------PATCH 2/3 Fix the priority calculation to use PATH_GHOST state
In reply to Chandra Seetharamanlibmultipath/discovery.c +1 -1
@@ -699,7 +699,7 @@if (mask &DI_CHECKER &&get_state (pp)) goto blank; -if (mask &DI_PRIO && pp->state !=PATH_DOWN ) +if (mask &DI_PRIO && pp->state ==PATH_UP )get_prio (pp);if (mask &DI_WWID && !strlen (pp->wwid))
libmultipath/switchgroup.c +1 -1
@@ -28,7 +28,7 @@ priority =0 ; vector_foreach_slot (pgp->paths, pp, j) { -if (pp->state !=PATH_DOWN ) +if (pp->state ==PATH_UP ) priority += pp->priority; } pgp->priority = priority;
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------PATCH 3/3 Increase the wait time for device to appear in /dev
In reply to Chandra Seetharamanlibmultipath/discovery.c +1 -1
@@ -112,7 +112,7 @@* not multipath(8), ran by udev */ #if DAEMON -#define WAIT_MAX_SECONDS 5 +#define WAIT_MAX_SECONDS 60#define WAIT_LOOP_PER_SECOND 5 static int
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------Quoted 14 lines · Chandra Seetharaman
Hi All,
While working on lsi-rdac hardware handler, I found that the checkers "tur" and "readsector0" are not serving the lsi-rdac properly. Also, the storage device has a active/passive state which need to be handled properly.
So, I wrote a new path checker for lsi-rdac, to use the C4 inquiry page to get the current owner of the lun and set the state as UP(active) or GHOST(passive). Changes are in patch 1/3.
After applying the above patch, I realized the priorities are not set properly. Made some changes to use the GHOST state while setting priorities. Changes are in patch 2/3.
Quoted 7 lines
Debugging the above patches found that the wait time (5 seconds) in multipathd was not sufficient for the devices to appear in
/dev/It was taking about 20 seconds. Changed the wait time to be 60 seconds. Change in patch 3/3.Please provide me with your feedback/comment on these changes regarding correctness, completeness etc.,
Looks very good. I merged the 3 patches.
In 1/3, I changed the DEF_TIMEOUT name to avoid surcharging the one in checker.h
I'm having a hard time push to kernel.org, so don't expect to see the git tree updated soon.
Thanks,
cvaroqui
Hi,
Quoted 3 lines
I'm having a hard time push to kernel.org, so don't expect to see the git tree updated soon.
hmm. git.kernel.org seems to work well, at least to get stuff - I have nothing to push.
Is there any other place where one could grab the latest multipath-tools, and probably recent kernel modules to test?
Thanks,
Signature · 2 lines
Bernd Zeimetz <[email protected]> <http://bzed.de/>
Cool,
Thanks.
chandra
Quoted 33 lines · Christophe Varoqui
Quoted 14 lines · Chandra Seetharaman
Hi All,
While working on lsi-rdac hardware handler, I found that the checkers "tur" and "readsector0" are not serving the lsi-rdac properly. Also, the storage device has a active/passive state which need to be handled properly.
So, I wrote a new path checker for lsi-rdac, to use the C4 inquiry page to get the current owner of the lun and set the state as UP(active) or GHOST(passive). Changes are in patch 1/3.
After applying the above patch, I realized the priorities are not set properly. Made some changes to use the GHOST state while setting priorities. Changes are in patch 2/3.
Quoted 7 lines
Debugging the above patches found that the wait time (5 seconds) in multipathd was not sufficient for the devices to appear in
/dev/It was taking about 20 seconds. Changed the wait time to be 60 seconds. Change in patch 3/3.Please provide me with your feedback/comment on these changes regarding correctness, completeness etc.,
Looks very good. I merged the 3 patches.
In 1/3, I changed the
DEF_TIMEOUTname to avoid surcharging the one inchecker.hI'm having a hard time push to kernel.org, so don't expect to see the git tree updated soon.
Thanks,
cvaroqui
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------