All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] Add a tool for using the new sysfs files
@ 2021-06-08 17:46 schumaker.anna
  2021-06-08 17:46 ` [RFC PATCH 1/6] nfs-sysfs: Add an nfs-sysfs.py tool schumaker.anna
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: schumaker.anna @ 2021-06-08 17:46 UTC (permalink / raw)
  To: linux-nfs; +Cc: Anna.Schumaker

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

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?
Anna


Anna Schumaker (6):
  nfs-sysfs: Add an nfs-sysfs.py tool
  nfs-sysfs.py: Add a command for printing xprt switch information
  nfs-sysfs.py: Add a command for printing individual xprts
  nfs-sysfs.py: Add a command for printing rpc-client information
  nfs-sysfs.py: Add a command for changing xprt dstaddr
  nfs-sysfs.py: Add a command for changing xprt-switch dstaddrs

 tools/nfs-sysfs/client.py    | 27 ++++++++++++++
 tools/nfs-sysfs/nfs-sysfs.py | 23 ++++++++++++
 tools/nfs-sysfs/switch.py    | 51 +++++++++++++++++++++++++++
 tools/nfs-sysfs/sysfs.py     | 28 +++++++++++++++
 tools/nfs-sysfs/xprt.py      | 68 ++++++++++++++++++++++++++++++++++++
 5 files changed, 197 insertions(+)
 create mode 100644 tools/nfs-sysfs/client.py
 create mode 100755 tools/nfs-sysfs/nfs-sysfs.py
 create mode 100644 tools/nfs-sysfs/switch.py
 create mode 100644 tools/nfs-sysfs/sysfs.py
 create mode 100644 tools/nfs-sysfs/xprt.py

-- 
2.32.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-06-14 13:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 17:46 [RFC PATCH 0/6] Add a tool for using the new sysfs files schumaker.anna
2021-06-08 17:46 ` [RFC PATCH 1/6] nfs-sysfs: Add an nfs-sysfs.py tool schumaker.anna
2021-06-08 17:46 ` [RFC PATCH 2/6] nfs-sysfs.py: Add a command for printing xprt switch information schumaker.anna
2021-06-08 17:46 ` [RFC PATCH 3/6] nfs-sysfs.py: Add a command for printing individual xprts schumaker.anna
2021-06-08 17:46 ` [RFC PATCH 4/6] nfs-sysfs.py: Add a command for printing rpc-client information schumaker.anna
2021-06-08 17:46 ` [RFC PATCH 5/6] nfs-sysfs.py: Add a command for changing xprt dstaddr schumaker.anna
2021-06-08 17:46 ` [RFC PATCH 6/6] nfs-sysfs.py: Add a command for changing xprt-switch dstaddrs schumaker.anna
2021-06-14 13:19 ` [RFC PATCH 0/6] Add a tool for using the new sysfs files Steve Dickson
2021-06-14 13:42   ` Anna Schumaker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.