From: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
These patches implement a tool that can be used to read and write the
sysfs files, with subcommands! They need Olga's most recent patches to
run.
The following subcommands are implemented:
nfs-sysfs.py rpc-client
nfs-sysfs.py xprt
nfs-sysfs.py xprt set
nfs-sysfs.py xprt-switch
nfs-sysfs.py xprt-switch set
So you can print out information about every xprt-switch with:
anna@client % ./nfs-sysfs.py xprt-switch
switch 0: num_xprts 1, num_active 1, queue_len 0
xprt 0: local, /var/run/gssproxy.sock
switch 1: num_xprts 1, num_active 1, queue_len 0
xprt 1: local, /var/run/rpcbind.sock
switch 2: num_xprts 4, num_active 4, queue_len 0
xprt 2: tcp, 192.168.111.188
xprt 3: tcp, 192.168.111.188
xprt 5: tcp, 192.168.111.188
xprt 6: tcp, 192.168.111.188
switch 3: num_xprts 1, num_active 1, queue_len 0
xprt 7: tcp, 192.168.111.1
switch 4: num_xprts 1, num_active 1, queue_len 0
xprt 4: tcp, 192.168.111.188
And information about each xprt:
anna@client % ./nfs-sysfs.py xprt
xprt 0: local, /var/run/gssproxy.sock, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
xprt 1: local, /var/run/rpcbind.sock, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
xprt 2: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
xprt 3: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
xprt 4: tcp, 192.168.111.188, state <BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
xprt 5: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
xprt 6: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
xprt 7: tcp, 192.168.111.1, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
You can use the `set` subcommand to change the dstaddr of individual xprts:
anna@client % ./nfs-sysfs.py xprt --id 2
xprt 2: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
anna@client % sudo ./nfs-sysfs.py xprt set --id 2 --dstaddr server2.nowheycreamery.vm
xprt 2: tcp, 192.168.111.186, state <CONNECTED,BOUND>, num_reqs 2
cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
Or for changing the dstaddr of all xprts attached to a switch:
anna@client % ./nfs-sysfs.py xprt-switch --id 2
switch 2: num_xprts 4, num_active 4, queue_len 0
xprt 2: tcp, 192.168.111.188
xprt 3: tcp, 192.168.111.188
xprt 5: tcp, 192.168.111.188
xprt 6: tcp, 192.168.111.188
anna@client % sudo ./nfs-sysfs.py xprt-switch set --id 2 --dstaddr server2.nowheycreamery.vm
switch 2: num_xprts 4, num_active 4, queue_len 0
xprt 2: tcp, 192.168.111.186
xprt 3: tcp, 192.168.111.186
xprt 5: tcp, 192.168.111.186
xprt 6: tcp, 192.168.111.186
I'm sure this needs lots of polish before it's ready for inclusion,
along with needing a Makefile so it can be installed (I've just been
running it out of the nfs-utils/tools/nfs-sysfs/ directory). But it's
still a start, and I wanted to post it before going on New Baby Leave
Part 2 (June 12 - July 11).
What does everybody think?