mbox series

[v4,0/9] Add a tool for using the new sysfs files

Message ID 20211022205606.66392-1-Anna.Schumaker@Netapp.com (mailing list archive)
Headers show
Series Add a tool for using the new sysfs files | expand

Message

Anna Schumaker Oct. 22, 2021, 8:55 p.m. UTC
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!

The following subcommands are implemented:
	rpcsys rpc-client
 	rpcsys xprt
 	rpcsys xprt set
 	rpcsys xprt-switch
 	rpcsys xprt-switch set

So you can print out information about every xprt-switch with:
	anna@client ~ % rpcsys xprt-switch
	switch 0: num_xprts 1, num_active 1, queue_len 0
		xprt 0: local, /var/run/gssproxy.sock [main]
	switch 1: num_xprts 1, num_active 1, queue_len 0
		xprt 1: local, /var/run/rpcbind.sock [main]
	switch 2: num_xprts 1, num_active 1, queue_len 0
		xprt 2: tcp, 192.168.111.1 [main]
	switch 3: num_xprts 4, num_active 4, queue_len 0
		xprt 3: tcp, 192.168.111.188 [main]
		xprt 4: tcp, 192.168.111.188
		xprt 5: tcp, 192.168.111.188
		xprt 6: tcp, 192.168.111.188

And information about each xprt:
	anna@client ~ % rpcsys xprt
	xprt 0: local, /var/run/gssproxy.sock, port 0, state <MAIN,CONNECTED,BOUND>
		Source: (einval), port 0, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
	xprt 1: local, /var/run/rpcbind.sock, port 0, state <MAIN,CONNECTED,BOUND>
		Source: (einval), port 0, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
	xprt 2: tcp, 192.168.111.1, port 2049, state <MAIN,CONNECTED,BOUND>
		Source: 192.168.111.222, port 959, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
	xprt 3: tcp, 192.168.111.188, port 2049, state <MAIN,CONNECTED,BOUND>
		Source: 192.168.111.222, port 921, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
	xprt 4: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
		Source: 192.168.111.222, port 726, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
	xprt 5: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
		Source: 192.168.111.222, port 671, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
	xprt 6: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
		Source: 192.168.111.222, port 934, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0

You can use the `set` subcommand to change the dstaddr of individual xprts:
	anna@client ~ % sudo rpcsys xprt --id 4 
	xprt 4: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
		Source: 192.168.111.222, port 726, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
	anna@client ~ % sudo rpcsys xprt set --id 4 --dstaddr server2.nowheycreamery.com
	xprt 4: tcp, 192.168.111.186, port 2049, state <CONNECTED,BOUND>
		Source: 192.168.111.222, port 726, Requests: 2
		Congestion: cur 0, win 256, Slots: min 2, max 65536
		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0

Or for changing the dstaddr of all xprts attached to a switch:
	anna@client % rpcsys xprt-switch --id 3
	switch 3: num_xprts 4, num_active 4, queue_len 0
		xprt 3: tcp, 192.168.111.188 [main]
		xprt 4: tcp, 192.168.111.188
		xprt 5: tcp, 192.168.111.188
		xprt 6: tcp, 192.168.111.188
	anna@client % sudo rpcsys xprt-switch set --id 4 --dstaddr server2.nowheycreamery.vm
	switch 3: num_xprts 4, num_active 4, queue_len 0
		xprt 2: tcp, 192.168.111.186 [main]
		xprt 3: tcp, 192.168.111.186
		xprt 5: tcp, 192.168.111.186
		xprt 6: tcp, 192.168.111.186


I renamed the tool to "rpcsys" after the discussion at the bakeathon. I
think this is at least a better name, but if anybody has other ideas
please let me know!

Thoughts?
Anna

Anna Schumaker (9):
  rpcsys: Add a rpcsys.py tool
  rpcsys: Add a command for printing xprt switch information
  rpcsys: Add a command for printing individual xprts
  rpcsys: Add a command for printing rpc-client information
  rpcsys: Add a command for changing xprt dstaddr
  rpcsys: Add a command for changing xprt-switch dstaddrs
  rpcsys: Add a command for changing xprt state
  rpcsys: Add a man page
  rpcsys: Add installation to the Makefile

 .gitignore               |   2 +
 configure.ac             |   1 +
 tools/Makefile.am        |   2 +-
 tools/rpcsys/Makefile.am |  20 ++++++++
 tools/rpcsys/client.py   |  27 +++++++++++
 tools/rpcsys/rpcsys      |   5 ++
 tools/rpcsys/rpcsys.man  |  88 ++++++++++++++++++++++++++++++++++
 tools/rpcsys/rpcsys.py   |  23 +++++++++
 tools/rpcsys/switch.py   |  51 ++++++++++++++++++++
 tools/rpcsys/sysfs.py    |  29 +++++++++++
 tools/rpcsys/xprt.py     | 101 +++++++++++++++++++++++++++++++++++++++
 11 files changed, 348 insertions(+), 1 deletion(-)
 create mode 100644 tools/rpcsys/Makefile.am
 create mode 100644 tools/rpcsys/client.py
 create mode 100644 tools/rpcsys/rpcsys
 create mode 100644 tools/rpcsys/rpcsys.man
 create mode 100755 tools/rpcsys/rpcsys.py
 create mode 100644 tools/rpcsys/switch.py
 create mode 100644 tools/rpcsys/sysfs.py
 create mode 100644 tools/rpcsys/xprt.py

Comments

Chuck Lever III Oct. 23, 2021, 3:50 p.m. UTC | #1
> On Oct 22, 2021, at 4:55 PM, schumaker.anna@gmail.com wrote:
> 
> 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!
> 
> The following subcommands are implemented:
> 	rpcsys rpc-client
> 	rpcsys xprt
> 	rpcsys xprt set
> 	rpcsys xprt-switch
> 	rpcsys xprt-switch set
> 
> So you can print out information about every xprt-switch with:
> 	anna@client ~ % rpcsys xprt-switch
> 	switch 0: num_xprts 1, num_active 1, queue_len 0
> 		xprt 0: local, /var/run/gssproxy.sock [main]
> 	switch 1: num_xprts 1, num_active 1, queue_len 0
> 		xprt 1: local, /var/run/rpcbind.sock [main]
> 	switch 2: num_xprts 1, num_active 1, queue_len 0
> 		xprt 2: tcp, 192.168.111.1 [main]
> 	switch 3: num_xprts 4, num_active 4, queue_len 0
> 		xprt 3: tcp, 192.168.111.188 [main]
> 		xprt 4: tcp, 192.168.111.188
> 		xprt 5: tcp, 192.168.111.188
> 		xprt 6: tcp, 192.168.111.188
> 
> And information about each xprt:
> 	anna@client ~ % rpcsys xprt
> 	xprt 0: local, /var/run/gssproxy.sock, port 0, state <MAIN,CONNECTED,BOUND>
> 		Source: (einval), port 0, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 	xprt 1: local, /var/run/rpcbind.sock, port 0, state <MAIN,CONNECTED,BOUND>
> 		Source: (einval), port 0, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 	xprt 2: tcp, 192.168.111.1, port 2049, state <MAIN,CONNECTED,BOUND>
> 		Source: 192.168.111.222, port 959, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 	xprt 3: tcp, 192.168.111.188, port 2049, state <MAIN,CONNECTED,BOUND>
> 		Source: 192.168.111.222, port 921, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 	xprt 4: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> 		Source: 192.168.111.222, port 726, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 	xprt 5: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> 		Source: 192.168.111.222, port 671, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 	xprt 6: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> 		Source: 192.168.111.222, port 934, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 
> You can use the `set` subcommand to change the dstaddr of individual xprts:
> 	anna@client ~ % sudo rpcsys xprt --id 4 
> 	xprt 4: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> 		Source: 192.168.111.222, port 726, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 	anna@client ~ % sudo rpcsys xprt set --id 4 --dstaddr server2.nowheycreamery.com
> 	xprt 4: tcp, 192.168.111.186, port 2049, state <CONNECTED,BOUND>
> 		Source: 192.168.111.222, port 726, Requests: 2
> 		Congestion: cur 0, win 256, Slots: min 2, max 65536
> 		Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> 
> Or for changing the dstaddr of all xprts attached to a switch:
> 	anna@client % rpcsys xprt-switch --id 3
> 	switch 3: num_xprts 4, num_active 4, queue_len 0
> 		xprt 3: tcp, 192.168.111.188 [main]
> 		xprt 4: tcp, 192.168.111.188
> 		xprt 5: tcp, 192.168.111.188
> 		xprt 6: tcp, 192.168.111.188
> 	anna@client % sudo rpcsys xprt-switch set --id 4 --dstaddr server2.nowheycreamery.vm
> 	switch 3: num_xprts 4, num_active 4, queue_len 0
> 		xprt 2: tcp, 192.168.111.186 [main]
> 		xprt 3: tcp, 192.168.111.186
> 		xprt 5: tcp, 192.168.111.186
> 		xprt 6: tcp, 192.168.111.186
> 
> 
> I renamed the tool to "rpcsys" after the discussion at the bakeathon. I
> think this is at least a better name, but if anybody has other ideas
> please let me know!
> 
> Thoughts?

Anna, very nice!

How about naming it "rpcctl" to follow the pattern of:

 systemctl
 resolvectl
 hostnamectl


> Anna
> 
> Anna Schumaker (9):
>  rpcsys: Add a rpcsys.py tool
>  rpcsys: Add a command for printing xprt switch information
>  rpcsys: Add a command for printing individual xprts
>  rpcsys: Add a command for printing rpc-client information
>  rpcsys: Add a command for changing xprt dstaddr
>  rpcsys: Add a command for changing xprt-switch dstaddrs
>  rpcsys: Add a command for changing xprt state
>  rpcsys: Add a man page
>  rpcsys: Add installation to the Makefile
> 
> .gitignore               |   2 +
> configure.ac             |   1 +
> tools/Makefile.am        |   2 +-
> tools/rpcsys/Makefile.am |  20 ++++++++
> tools/rpcsys/client.py   |  27 +++++++++++
> tools/rpcsys/rpcsys      |   5 ++
> tools/rpcsys/rpcsys.man  |  88 ++++++++++++++++++++++++++++++++++
> tools/rpcsys/rpcsys.py   |  23 +++++++++
> tools/rpcsys/switch.py   |  51 ++++++++++++++++++++
> tools/rpcsys/sysfs.py    |  29 +++++++++++
> tools/rpcsys/xprt.py     | 101 +++++++++++++++++++++++++++++++++++++++
> 11 files changed, 348 insertions(+), 1 deletion(-)
> create mode 100644 tools/rpcsys/Makefile.am
> create mode 100644 tools/rpcsys/client.py
> create mode 100644 tools/rpcsys/rpcsys
> create mode 100644 tools/rpcsys/rpcsys.man
> create mode 100755 tools/rpcsys/rpcsys.py
> create mode 100644 tools/rpcsys/switch.py
> create mode 100644 tools/rpcsys/sysfs.py
> create mode 100644 tools/rpcsys/xprt.py
> 
> -- 
> 2.33.1
> 

--
Chuck Lever
Anna Schumaker Oct. 25, 2021, 7:09 p.m. UTC | #2
On Sat, Oct 23, 2021 at 11:50 AM Chuck Lever III <chuck.lever@oracle.com> wrote:
>
>
>
> > On Oct 22, 2021, at 4:55 PM, schumaker.anna@gmail.com wrote:
> >
> > 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!
> >
> > The following subcommands are implemented:
> >       rpcsys rpc-client
> >       rpcsys xprt
> >       rpcsys xprt set
> >       rpcsys xprt-switch
> >       rpcsys xprt-switch set
> >
> > So you can print out information about every xprt-switch with:
> >       anna@client ~ % rpcsys xprt-switch
> >       switch 0: num_xprts 1, num_active 1, queue_len 0
> >               xprt 0: local, /var/run/gssproxy.sock [main]
> >       switch 1: num_xprts 1, num_active 1, queue_len 0
> >               xprt 1: local, /var/run/rpcbind.sock [main]
> >       switch 2: num_xprts 1, num_active 1, queue_len 0
> >               xprt 2: tcp, 192.168.111.1 [main]
> >       switch 3: num_xprts 4, num_active 4, queue_len 0
> >               xprt 3: tcp, 192.168.111.188 [main]
> >               xprt 4: tcp, 192.168.111.188
> >               xprt 5: tcp, 192.168.111.188
> >               xprt 6: tcp, 192.168.111.188
> >
> > And information about each xprt:
> >       anna@client ~ % rpcsys xprt
> >       xprt 0: local, /var/run/gssproxy.sock, port 0, state <MAIN,CONNECTED,BOUND>
> >               Source: (einval), port 0, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >       xprt 1: local, /var/run/rpcbind.sock, port 0, state <MAIN,CONNECTED,BOUND>
> >               Source: (einval), port 0, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >       xprt 2: tcp, 192.168.111.1, port 2049, state <MAIN,CONNECTED,BOUND>
> >               Source: 192.168.111.222, port 959, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >       xprt 3: tcp, 192.168.111.188, port 2049, state <MAIN,CONNECTED,BOUND>
> >               Source: 192.168.111.222, port 921, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >       xprt 4: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> >               Source: 192.168.111.222, port 726, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >       xprt 5: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> >               Source: 192.168.111.222, port 671, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >       xprt 6: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> >               Source: 192.168.111.222, port 934, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >
> > You can use the `set` subcommand to change the dstaddr of individual xprts:
> >       anna@client ~ % sudo rpcsys xprt --id 4
> >       xprt 4: tcp, 192.168.111.188, port 2049, state <CONNECTED,BOUND>
> >               Source: 192.168.111.222, port 726, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >       anna@client ~ % sudo rpcsys xprt set --id 4 --dstaddr server2.nowheycreamery.com
> >       xprt 4: tcp, 192.168.111.186, port 2049, state <CONNECTED,BOUND>
> >               Source: 192.168.111.222, port 726, Requests: 2
> >               Congestion: cur 0, win 256, Slots: min 2, max 65536
> >               Queues: binding 0, sending 0, pending 0, backlog 0, tasks 0
> >
> > Or for changing the dstaddr of all xprts attached to a switch:
> >       anna@client % rpcsys xprt-switch --id 3
> >       switch 3: num_xprts 4, num_active 4, queue_len 0
> >               xprt 3: tcp, 192.168.111.188 [main]
> >               xprt 4: tcp, 192.168.111.188
> >               xprt 5: tcp, 192.168.111.188
> >               xprt 6: tcp, 192.168.111.188
> >       anna@client % sudo rpcsys xprt-switch set --id 4 --dstaddr server2.nowheycreamery.vm
> >       switch 3: num_xprts 4, num_active 4, queue_len 0
> >               xprt 2: tcp, 192.168.111.186 [main]
> >               xprt 3: tcp, 192.168.111.186
> >               xprt 5: tcp, 192.168.111.186
> >               xprt 6: tcp, 192.168.111.186
> >
> >
> > I renamed the tool to "rpcsys" after the discussion at the bakeathon. I
> > think this is at least a better name, but if anybody has other ideas
> > please let me know!
> >
> > Thoughts?
>
> Anna, very nice!
>
> How about naming it "rpcctl" to follow the pattern of:

Good suggestion! I can go with that.

>
>  systemctl
>  resolvectl
>  hostnamectl
>
>
> > Anna
> >
> > Anna Schumaker (9):
> >  rpcsys: Add a rpcsys.py tool
> >  rpcsys: Add a command for printing xprt switch information
> >  rpcsys: Add a command for printing individual xprts
> >  rpcsys: Add a command for printing rpc-client information
> >  rpcsys: Add a command for changing xprt dstaddr
> >  rpcsys: Add a command for changing xprt-switch dstaddrs
> >  rpcsys: Add a command for changing xprt state
> >  rpcsys: Add a man page
> >  rpcsys: Add installation to the Makefile
> >
> > .gitignore               |   2 +
> > configure.ac             |   1 +
> > tools/Makefile.am        |   2 +-
> > tools/rpcsys/Makefile.am |  20 ++++++++
> > tools/rpcsys/client.py   |  27 +++++++++++
> > tools/rpcsys/rpcsys      |   5 ++
> > tools/rpcsys/rpcsys.man  |  88 ++++++++++++++++++++++++++++++++++
> > tools/rpcsys/rpcsys.py   |  23 +++++++++
> > tools/rpcsys/switch.py   |  51 ++++++++++++++++++++
> > tools/rpcsys/sysfs.py    |  29 +++++++++++
> > tools/rpcsys/xprt.py     | 101 +++++++++++++++++++++++++++++++++++++++
> > 11 files changed, 348 insertions(+), 1 deletion(-)
> > create mode 100644 tools/rpcsys/Makefile.am
> > create mode 100644 tools/rpcsys/client.py
> > create mode 100644 tools/rpcsys/rpcsys
> > create mode 100644 tools/rpcsys/rpcsys.man
> > create mode 100755 tools/rpcsys/rpcsys.py
> > create mode 100644 tools/rpcsys/switch.py
> > create mode 100644 tools/rpcsys/sysfs.py
> > create mode 100644 tools/rpcsys/xprt.py
> >
> > --
> > 2.33.1
> >
>
> --
> Chuck Lever
>
>
>