2021-10-22 20:56:34

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH v4 0/9] Add a tool for using the new sysfs files

From: Anna Schumaker <[email protected]>

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

--
2.33.1


2021-10-22 20:56:33

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH v4 6/9] rpcsys: Add a command for changing xprt-switch dstaddrs

From: Anna Schumaker <[email protected]>

This is basically the same as for xprts, but it iterates through all
xprts attached to the switch to apply the new address.

Signed-off-by: Anna Schumaker <[email protected]>
---
tools/rpcsys/switch.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/tools/rpcsys/switch.py b/tools/rpcsys/switch.py
index 5384f970235c..859b82e07895 100644
--- a/tools/rpcsys/switch.py
+++ b/tools/rpcsys/switch.py
@@ -30,7 +30,22 @@ def list_xprt_switches(args):
if args.id == None or xs.id == args.id[0]:
print(xs)

+def set_xprt_switch_property(args):
+ switch = XprtSwitch(sysfs.SUNRPC / "xprt-switches" / f"switch-{args.id[0]}")
+ try:
+ for xprt in switch.xprts:
+ xprt.set_dstaddr(args.dstaddr[0])
+ print(switch)
+ except Exception as e:
+ print(e)
+
def add_command(subparser):
parser = subparser.add_parser("xprt-switch", help="Commands for xprt switches")
parser.add_argument("--id", metavar="ID", nargs=1, type=int, help="Id of a specific xprt-switch to show")
parser.set_defaults(func=list_xprt_switches)
+
+ subparser = parser.add_subparsers()
+ parser = subparser.add_parser("set", help="Set an xprt switch property")
+ parser.add_argument("--id", metavar="ID", nargs=1, type=int, required=True, help="Id of an xprt-switch to modify")
+ parser.add_argument("--dstaddr", metavar="dstaddr", nargs=1, type=str, help="New dstaddr to set")
+ parser.set_defaults(func=set_xprt_switch_property)
--
2.33.1

2021-10-22 20:56:33

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH v4 2/9] rpcsys: Add a command for printing xprt switch information

From: Anna Schumaker <[email protected]>

This combines the information found in xprt_switch_info with a subset of
the information found in each xprt subdirectory

Signed-off-by: Anna Schumaker <[email protected]>
---
tools/rpcsys/rpcsys.py | 6 ++++++
tools/rpcsys/switch.py | 35 +++++++++++++++++++++++++++++++++++
tools/rpcsys/sysfs.py | 10 ++++++++++
tools/rpcsys/xprt.py | 12 ++++++++++++
4 files changed, 63 insertions(+)
create mode 100644 tools/rpcsys/switch.py
create mode 100644 tools/rpcsys/xprt.py

diff --git a/tools/rpcsys/rpcsys.py b/tools/rpcsys/rpcsys.py
index 8ff59ea9e81b..90efcbed7ac8 100755
--- a/tools/rpcsys/rpcsys.py
+++ b/tools/rpcsys/rpcsys.py
@@ -9,5 +9,11 @@ def show_small_help(args):
print("sunrpc dir:", sysfs.SUNRPC)
parser.set_defaults(func=show_small_help)

+
+import switch
+subparser = parser.add_subparsers(title="commands")
+switch.add_command(subparser)
+
+
args = parser.parse_args()
args.func(args)
diff --git a/tools/rpcsys/switch.py b/tools/rpcsys/switch.py
new file mode 100644
index 000000000000..afb6963a0a1f
--- /dev/null
+++ b/tools/rpcsys/switch.py
@@ -0,0 +1,35 @@
+import sysfs
+import xprt
+
+class XprtSwitch:
+ def __init__(self, path):
+ self.path = path
+ self.id = int(str(path).rsplit("-", 1)[1])
+
+ self.xprts = [ xprt.Xprt(p) for p in self.path.iterdir() if p.is_dir() ]
+ self.xprts.sort()
+
+ self.__dict__.update(sysfs.read_info_file(path / "xprt_switch_info"))
+
+ def __lt__(self, rhs):
+ return self.path < rhs.path
+
+ def __str__(self):
+ line = "switch %s: num_xprts %s, num_active %s, queue_len %s" % \
+ (self.id, self.num_xprts, self.num_active, self.queue_len)
+ for x in self.xprts:
+ line += "\n %s" % x.small_str()
+ return line
+
+
+def list_xprt_switches(args):
+ switches = [ XprtSwitch(f) for f in (sysfs.SUNRPC / "xprt-switches").iterdir() ]
+ switches.sort()
+ for xs in switches:
+ if args.id == None or xs.id == args.id[0]:
+ print(xs)
+
+def add_command(subparser):
+ parser = subparser.add_parser("xprt-switch", help="Commands for xprt switches")
+ parser.add_argument("--id", metavar="ID", nargs=1, type=int, help="Id of a specific xprt-switch to show")
+ parser.set_defaults(func=list_xprt_switches)
diff --git a/tools/rpcsys/sysfs.py b/tools/rpcsys/sysfs.py
index c9d477063585..79f844af34a6 100644
--- a/tools/rpcsys/sysfs.py
+++ b/tools/rpcsys/sysfs.py
@@ -17,3 +17,13 @@ SUNRPC = pathlib.Path(MOUNT) / "kernel" / "sunrpc"
if not SUNRPC.is_dir():
print("ERROR: sysfs does not have sunrpc directory")
sys.exit(1)
+
+
+def read_info_file(path):
+ res = dict()
+ with open(path) as info:
+ for line in info:
+ if "=" in line:
+ (key, val) = line.strip().split("=")
+ res[key] = int(val)
+ return res
diff --git a/tools/rpcsys/xprt.py b/tools/rpcsys/xprt.py
new file mode 100644
index 000000000000..d37537771c1d
--- /dev/null
+++ b/tools/rpcsys/xprt.py
@@ -0,0 +1,12 @@
+class Xprt:
+ def __init__(self, path):
+ self.path = path
+ self.id = int(str(path).rsplit("-", 2)[1])
+ self.type = str(path).rsplit("-", 2)[2]
+ self.dstaddr = open(path / "dstaddr", 'r').readline().strip()
+
+ def __lt__(self, rhs):
+ return self.id < rhs.id
+
+ def small_str(self):
+ return "xprt %s: %s, %s" % (self.id, self.type, self.dstaddr)
--
2.33.1

2021-10-22 20:56:33

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH v4 5/9] rpcsys: Add a command for changing xprt dstaddr

From: Anna Schumaker <[email protected]>

Using the socket module for dns resolution

Signed-off-by: Anna Schumaker <[email protected]>
---
tools/rpcsys/xprt.py | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/tools/rpcsys/xprt.py b/tools/rpcsys/xprt.py
index fbdd9bfc9375..2160cb0a9575 100644
--- a/tools/rpcsys/xprt.py
+++ b/tools/rpcsys/xprt.py
@@ -1,3 +1,4 @@
+import socket
import sysfs

class Xprt:
@@ -34,6 +35,12 @@ class Xprt:
return "xprt %s: %s, %s%s" % (self.id, self.type, self.dstaddr,
f" [main]" if self.main_xprt else "" )

+ def set_dstaddr(self, newaddr):
+ resolved = socket.gethostbyname(newaddr)
+ with open(self.path / "dstaddr", 'w') as f:
+ f.write(resolved)
+ self.dstaddr = open(self.path / "dstaddr", 'r').readline().strip()
+

def list_xprts(args):
xprts = [ Xprt(f) for f in (sysfs.SUNRPC / "xprt-switches").glob("**/xprt-*") ]
@@ -42,7 +49,28 @@ def list_xprts(args):
if args.id == None or xprt.id == args.id[0]:
print(xprt)

+def get_xprt(id):
+ xprts = [ Xprt(f) for f in (sysfs.SUNRPC / "xprt-switches").glob("**/xprt-*") ]
+ for xprt in xprts:
+ if xprt.id == id:
+ return xprt
+
+def set_xprt_property(args):
+ xprt = get_xprt(args.id[0])
+ try:
+ if args.dstaddr != None:
+ xprt.set_dstaddr(args.dstaddr[0])
+ print(xprt)
+ except Exception as e:
+ print(e)
+
def add_command(subparser):
parser = subparser.add_parser("xprt", help="Commands for individual xprts")
parser.add_argument("--id", metavar="ID", nargs=1, type=int, help="Id of a specific xprt to show")
parser.set_defaults(func=list_xprts)
+
+ subparser = parser.add_subparsers()
+ parser = subparser.add_parser("set", help="Set an xprt property")
+ parser.add_argument("--id", metavar="ID", nargs=1, type=int, required=True, help="Id of a specific xprt to modify")
+ parser.add_argument("--dstaddr", metavar="dstaddr", nargs=1, type=str, help="New dstaddr to set")
+ parser.set_defaults(func=set_xprt_property)
--
2.33.1

2021-10-23 15:51:28

by Chuck Lever III

[permalink] [raw]
Subject: Re: [PATCH v4 0/9] Add a tool for using the new sysfs files



> On Oct 22, 2021, at 4:55 PM, [email protected] wrote:
>
> From: Anna Schumaker <[email protected]>
>
> 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



2021-10-25 19:20:47

by Anna Schumaker

[permalink] [raw]
Subject: Re: [PATCH v4 0/9] Add a tool for using the new sysfs files

On Sat, Oct 23, 2021 at 11:50 AM Chuck Lever III <[email protected]> wrote:
>
>
>
> > On Oct 22, 2021, at 4:55 PM, [email protected] wrote:
> >
> > From: Anna Schumaker <[email protected]>
> >
> > 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
>
>
>