Path priority for RDAC devices
cover Path priority for RDAC devices
Hi Christophe,
Few months ago I submitted path checker code for RDAC devices.
Recently I found that the priority of the paths are not being set properly.
Here are 2 patches that fix the problem and set the priority appropriately.
Please let me know what do you think.
Thanks
chandra
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------PATCH 1/2 Undo fix priority made earlier
While debugging I found that multipath was not selecting the preferred path many a times (inlcuding the failback scenarios).
Added a priority callout function and the expected behavior was still not seen (patch 2 of 2).
More debugging revealed that the changes I made to work in the ghost mode was wrong. Reverting those changes made the multipath behave properly.
libmultipath/discovery.c +1 -1
@@ -699,7 +699,7 @@if (mask &DI_CHECKER &&get_state (pp)) goto blank; -if (mask &DI_PRIO && pp->state ==PATH_UP ) +if (mask &DI_PRIO && pp->state !=PATH_DOWN )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_UP ) +if (pp->state !=PATH_DOWN ) priority += pp->priority; } pgp->priority = priority;
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------PATCH 2/2 Add path priority callout for RDAC
In reply to Chandra SeetharamanRDAC currently doesn't have a path priority callout. This affects the expected behavior of multipath. i.e multipath's active path group doesn't always lead to the preferred path of the device.
This patch sets the priority of a path based on the preferred path that is queried from the controller through the C9 inquiry page.
path_priority/pp_rdac/Makefile new file +25 -0
@@ -0,0 +1,25 @@ +EXEC = mpath_prio_rdac +BUILD = glibc +OBJS = pp_rdac.o + +TOPDIR = ../.. +include $(TOPDIR)/Makefile.inc + +all: $(BUILD) + +glibc: $(OBJS) + $(CC) -o $(EXEC) $(OBJS) $(LDFLAGS) + +klibc: $(OBJS) + $(CC) -static -o $(EXEC) $(OBJS) + +install: $(EXEC) + install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC) + +uninstall: + rm $(DESTDIR)$(bindir)/$(EXEC) +clean: + rm -f *.o $(EXEC) + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $<
path_priority/pp_rdac/pp_rdac.c new file +113 -0
113 lines not on this page · raw message
Signature · 4 lines
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [email protected] | .......you may get it.
----------------------------------------------------------------------