Checking num_cmd_elems for VFC adapters with kdbThis entry is similar in theme to one of my previous posts about verifying your hdisk queue_depth settings with kdb. This time we want to check if an attribute for a Virtual FC (VFC) adapter has been modified and whether or not AIX has been restarted since the change. The attribute I’m interested in is num_cmd_elems. This value is often changed from its default settings, in AIX environments, to improve I/O performance on SAN attached storage.
From kdb you can identify the VFC adapters configured on an AIX system using the vfcs subcommand. Not only does this tell you what adapters you have, but it also identifies the VIOS each adapter is connected to and the corresponding vfchost adapter. Nice!
(0)> vfcs NAME ADDRESS STATE HOST HOST_ADAP OPENED NUM_ACTIVE fcs0 0xF1000A00103D4000 0x0008 vio1 vfchost10 0x01 0x0000 fcs1 0xF1000A00103D6000 0x0008 vio2 vfchost10 0x01 0x0000
You can view the current (running) configuration of a VFC adapter using the kdb vfcs subcommand and the name of the VFC adapter, for example fcs1:
(0)> vfcs fcs1 adapter: fcs0 partition_num: 0x14 partition_name: aixlpar1 num_cmd_elems:
0xC8 location_code: U911 state: 0x8 opened: 0x1 flags: 0x1 host_name: vio1 host_device: vfchost10 maxCmds: FA maxDMALength: 100000 SCSIid: 6F1E9A portName:
C050 6F1E9A cmd_q.base_addr:
0xF1 crq[0]:
0x80 ctl_head: 0x0 ctl_tail: 0x0 cmd_head: 0x0 cmd_tail: 0x0 pool_head:
0xF1 head_active: 0x0 tail_active: 0x0 cancel_head: 0xF1000A0019758090 cancel_tail: 0xF1000A0019758E58 num_cmds_allowed: 0xFA num_cmds_active: 0x0 num_cmds_pending: 0x0 head_flush_q: 0x0 tail_flush_q: 0x0 cmd_flush_q: 0x0 no_elem: 0x0 no_dma: 0x0 no_sglist: 0x0 bad_mad: 0x0 qfull: 0x0 h_dropped: 0x0 link_down_cnt: 0x0 num_frames: 0x0 tx_lock: 0x0 rcv_lock: 0x0 ctl_lock: 0x0 lock: 0xFFFFFFFFFFFFFFFF ctl_event:
0xFF reset_cmd: 0x0 log_cmd: 0x0 link_cmd: 0x0 ctl_cmd->cmd_state: 0x0 inp_reqs: 0x12594 out_reqs: 0x1A7FD4 ctrl_reqs: 0x44 inp_bytes: 0x14973F90 out_bytes: 0xEC14EC18 npiv_logout_sent: 0x0 npiv_logout_rcvd: 0x0 act_hi_water: 0x10 pend_hi_water: 0x1
Using the output from this command we can determine the current (running) value for a number of VFC attributes, including num_cmd_elems.
So I start with an adapter with a num_cmd_elems value of 200. Both the lsattr command and kdb report 200 (C8 in hex) for num_cmd_elems.
# lsattr -El fcs1 -a num_cmd_elems num_cmd_elems 200 Maximum Number of COMMAND Elements True
# echo vfcs fcs1 | kdb | grep num_cmd_elems num_cmd_elems:
0xC8 location_code: U911
I change num_cmd_elems to 400 with chdev –P (remember, the –P flag only updates the AIX ODM, and not the running configuration of the device in the AIX kernel. You must either reboot for this change to take effect or offline & online the device).
# chdev -l fcs1 -a num_cmd_elems=400 -P fcs1 changed
Now the lsattr command reports num_cmd_elems is set to 400 in the ODM.
# lsattr -El fcs1 -a num_cmd_elems num_cmd_elems 400 Maximum Number of COMMAND Elements True But kdb still has num_cmd_elems set to C8 (200).
# echo vfcs fcs1 | kdb | grep num_cmd_elems num_cmd_elems: 0xC8 location_code: U911
Using this technique I now have a way of checking if an AIX system has been restarted since an attribute was changed on a VFC adapter.
At this point I could suggest a reboot of the system. Or I could take the adapter offline and then online for the changes to take effect. For example:
# lspath Enabled hdisk0 fscsi0 Enabled hdisk1 fscsi0 Enabled hdisk0 fscsi1 Enabled hdisk1 fscsi1
# rmpath -l hdisk0 -p fscsi1 # rmpath -l hdisk1 -p fscsi1
# lspath Enabled hdisk0 fscsi0 Enabled hdisk1 fscsi0 Defined hdisk0 fscsi1 Defined hdisk1 fscsi1
# rmdev -Rl fcs1 fscsi1 Defined fcs1 Defined
# cfgmgr
# lspath Enabled hdisk0 fscsi0 Enabled hdisk1 fscsi0 Enabled hdisk0 fscsi1 Enabled hdisk1 fscsi1
# lsattr -El fcs1 –a num_cmd_elems num_cmd_elems 400 Maximum Number of COMMAND Elements True
# echo vfcs fcs1 | kdb | grep num_cmd_elems num_cmd_elems:
0x190 location_code: U911
;; 0x190 hex = 400 decimal
Please note: Be careful when using the kdb command. If used incorrectly, you can crash an AIX system! |
I was trying this on a VIO server (PS700) and it failed to show the parameter num_cmd_elems for all the 4 FC adapters. Also checked on a physical box but same output. Any clues here ? What's the warning in first line of command output referring to ? (0)> vfcs [kdb_read_mem] no real storage @ 7C7243A6E8630090 - - - - server1(root):/> echo vfcs| kdb WARNING: Version mismatch between unix file and command kdb START END <name> 0000000000001000 00000000040E0000 start+000FD8 F00000002FF47600 F00000002FFDF9C0 __ublock+000000 000000002FF22FF4 000000002FF22FF8 environ+000000 000000002FF22FF8 000000002FF22FFC errno+000000 F1000F0A00000000 F1000F0A10000000 pvproc+000000 F1000F0A10000000 F1000F0A18000000 pvthread+000000 read vscsi_scsi_ptrs OK, ptr = 0x0 (0)> vfcs [kdb_read_mem] no real storage @ 7C7243A6E8630090 (0)> server1(root):/></name>