1. Check the attributes of the FC remote port(s) using the below command:
# udevadm info --attribute-walk --path=/sys/class/fc_remote_ports/rport-x:y-z
2. Then create udev rules that match all viable rports by matching the ‘role’ mentioned in the attributes returned in the above command. For example, create /etc/udev/rules.d/99-tmo.rules and include the below contents.
ACTION!="add|change", GOTO="tmo_end" KERNELS=="rport-?*", SUBSYSTEM=="XXXX", ATTR{roles}=="XXXX", ATTR{dev_loss_tmo}="xx" LABEL="tmo_end"
In the example, attributes returned from the 1st command’s output where,
SUBSYSTEM="fc_remote_ports" roles="FCP Target" dev_loss_tmo=30
So the rule to increase the dev_loss_tmo to 700000 will be as;
ACTION!="add|change", GOTO="tmo_end" KERNELS=="rport-?*", SUBSYSTEM=="fc_remote_ports", ATTR{roles}=="FCP Target", ATTR{dev_loss_tmo}="700000" LABEL="tmo_end"
3. Then reload the udev rules:
# udevadm control --reload
4. Trigger the rules for the subsystem:
# udevadm trigger --subsystem-match="XXXX"
Note: If the attribute fast_io_fail_tmo returns 0 or off, enable it as well for the dev_loss_tmo attribute to take effect.
For example:
ACTION!="add|change", GOTO="tmo_end" KERNELS=="rport-?*", SUBSYSTEM=="fc_remote_ports", ATTR{roles}=="FCP Target", ATTR{dev_loss_tmo}="700000", ATTR{fast_io_fail_tmo}="5" LABEL="tmo_end"