public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH nfs-utils v2 0/4] rpcctl: Various Improvements
@ 2025-01-27 21:50 Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 1/4] rpcctl: Rename {read,write}_addr_file() Anna Schumaker
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Anna Schumaker @ 2025-01-27 21:50 UTC (permalink / raw)
  To: linux-nfs, steved; +Cc: anna

From: Anna Schumaker <anna.schumaker@oracle.com>

These patches depend on the corresponding kernel patches posted at the
same time. They update the rpcctl tool to use the new sunrpc sysfs
features, in a backwards compatible way that will run on older kernels.

v2:
 * Update `rpcctl client` output to include rpc program and version

Thanks,
Anna

Anna Schumaker (4):
  rpcctl: Rename {read,write}_addr_file()
  rpcctl: Add support for the xprtsec sysfs attribute
  rpcctl: Display new rpc_clnt sysfs attributes
  rpcctl: Add support for `rpcctl switch add-xprt`

 tools/rpcctl/rpcctl.man |  4 ++++
 tools/rpcctl/rpcctl.py  | 50 ++++++++++++++++++++++++++++-------------
 2 files changed, 38 insertions(+), 16 deletions(-)

-- 
2.48.1


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

* [PATCH nfs-utils v2 1/4] rpcctl: Rename {read,write}_addr_file()
  2025-01-27 21:50 [PATCH nfs-utils v2 0/4] rpcctl: Various Improvements Anna Schumaker
@ 2025-01-27 21:50 ` Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 2/4] rpcctl: Add support for the xprtsec sysfs attribute Anna Schumaker
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Anna Schumaker @ 2025-01-27 21:50 UTC (permalink / raw)
  To: linux-nfs, steved; +Cc: anna

From: Anna Schumaker <anna.schumaker@oracle.com>

There is nothing address specific about these functions, so name them
something more generic so they can be reused.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
---
 tools/rpcctl/rpcctl.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
index 0221fbb68be1..654b2f60a894 100755
--- a/tools/rpcctl/rpcctl.py
+++ b/tools/rpcctl/rpcctl.py
@@ -20,8 +20,8 @@ if not sunrpc.is_dir():
     sys.exit(1)
 
 
-def read_addr_file(path):
-    """Read an xprt address file."""
+def read_sysfs_file(path):
+    """Read a sysfs file."""
     try:
         with open(path, 'r') as f:
             return f.readline().strip()
@@ -29,11 +29,11 @@ def read_addr_file(path):
         return "(enoent)"
 
 
-def write_addr_file(path, newaddr):
-    """Write a new address to an xprt address file."""
+def write_sysfs_file(path, input):
+    """Write 'input' to a sysfs file."""
     with open(path, 'w') as f:
-        f.write(newaddr)
-    return read_addr_file(path)
+        f.write(input)
+    return read_sysfs_file(path)
 
 
 def read_info_file(path):
@@ -56,8 +56,8 @@ class Xprt:
         self.name = path.stem.rsplit("-", 1)[0]
         self.type = path.stem.split("-")[2]
         self.info = read_info_file(path / "xprt_info")
-        self.dstaddr = read_addr_file(path / "dstaddr")
-        self.srcaddr = read_addr_file(path / "srcaddr")
+        self.dstaddr = read_sysfs_file(path / "dstaddr")
+        self.srcaddr = read_sysfs_file(path / "srcaddr")
         self.read_state()
 
     def __lt__(self, rhs):
@@ -106,7 +106,7 @@ class Xprt:
 
     def set_dstaddr(self, newaddr):
         """Change the dstaddr of an xprt."""
-        self.dstaddr = write_addr_file(self.path / "dstaddr", newaddr)
+        self.dstaddr = write_sysfs_file(self.path / "dstaddr", newaddr)
 
     def set_state(self, state):
         """Change the state of an xprt."""
-- 
2.48.1


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

* [PATCH nfs-utils v2 2/4] rpcctl: Add support for the xprtsec sysfs attribute
  2025-01-27 21:50 [PATCH nfs-utils v2 0/4] rpcctl: Various Improvements Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 1/4] rpcctl: Rename {read,write}_addr_file() Anna Schumaker
@ 2025-01-27 21:50 ` Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 3/4] rpcctl: Display new rpc_clnt sysfs attributes Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt` Anna Schumaker
  3 siblings, 0 replies; 8+ messages in thread
From: Anna Schumaker @ 2025-01-27 21:50 UTC (permalink / raw)
  To: linux-nfs, steved; +Cc: anna

From: Anna Schumaker <anna.schumaker@oracle.com>

This was recently added to the Linux kernel, so running rpcctl on
kernels that don't have this attribute will print out "unknown" in its
place instead.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
---
 tools/rpcctl/rpcctl.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
index 654b2f60a894..ce22e424b804 100755
--- a/tools/rpcctl/rpcctl.py
+++ b/tools/rpcctl/rpcctl.py
@@ -20,13 +20,13 @@ if not sunrpc.is_dir():
     sys.exit(1)
 
 
-def read_sysfs_file(path):
+def read_sysfs_file(path, *, missing="enoent"):
     """Read a sysfs file."""
     try:
         with open(path, 'r') as f:
             return f.readline().strip()
     except FileNotFoundError:
-        return "(enoent)"
+        return f"({missing})"
 
 
 def write_sysfs_file(path, input):
@@ -58,6 +58,7 @@ class Xprt:
         self.info = read_info_file(path / "xprt_info")
         self.dstaddr = read_sysfs_file(path / "dstaddr")
         self.srcaddr = read_sysfs_file(path / "srcaddr")
+        self.xprtsec = read_sysfs_file(path / "xprtsec", missing="unknown")
         self.read_state()
 
     def __lt__(self, rhs):
@@ -67,7 +68,8 @@ class Xprt:
     def _xprt(self):
         main = ", main" if self.info.get("main_xprt") else ""
         return f"{self.name}: {self.type}, {self.dstaddr}, " \
-               f"port {self.info['dst_port']}, state <{self.state}>{main}"
+               f"port {self.info['dst_port']}, sec {self.xprtsec}, " \
+               f"state <{self.state}>{main}"
 
     def _src_reqs(self):
         return f"	Source: {self.srcaddr}, port {self.info['src_port']}, " \
-- 
2.48.1


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

* [PATCH nfs-utils v2 3/4] rpcctl: Display new rpc_clnt sysfs attributes
  2025-01-27 21:50 [PATCH nfs-utils v2 0/4] rpcctl: Various Improvements Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 1/4] rpcctl: Rename {read,write}_addr_file() Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 2/4] rpcctl: Add support for the xprtsec sysfs attribute Anna Schumaker
@ 2025-01-27 21:50 ` Anna Schumaker
  2025-01-27 21:50 ` [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt` Anna Schumaker
  3 siblings, 0 replies; 8+ messages in thread
From: Anna Schumaker @ 2025-01-27 21:50 UTC (permalink / raw)
  To: linux-nfs, steved; +Cc: anna

From: Anna Schumaker <anna.schumaker@oracle.com>

This includes the rpc program name, rpc version, and maximum number of
connections.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
---
 tools/rpcctl/rpcctl.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
index ce22e424b804..130f245a64e8 100755
--- a/tools/rpcctl/rpcctl.py
+++ b/tools/rpcctl/rpcctl.py
@@ -185,14 +185,13 @@ class Xprt:
 class XprtSwitch:
     """Represents a group of xprt connections."""
 
-    def __init__(self, path, sep=":"):
+    def __init__(self, path):
         """Read in xprt switch information from sysfs."""
         self.path = path
         self.name = path.stem
         self.info = read_info_file(path / "xprt_switch_info")
         self.xprts = sorted([Xprt(p) for p in self.path.iterdir()
                              if p.is_dir()])
-        self.sep = sep
 
     def __lt__(self, rhs):
         """Compare the name of two xprt switch instances."""
@@ -200,7 +199,7 @@ class XprtSwitch:
 
     def __str__(self):
         """Return a string representation of an xprt switch."""
-        switch = f"{self.name}{self.sep} " \
+        switch = f"{self.name}: " \
                  f"xprts {self.info['num_xprts']}, " \
                  f"active {self.info['num_active']}, " \
                  f"queue {self.info['queue_len']}"
@@ -258,7 +257,11 @@ class RpcClient:
         """Read in rpc client information from sysfs."""
         self.path = path
         self.name = path.stem
-        self.switch = XprtSwitch(path / (path / "switch").readlink(), sep=",")
+        self.switch = XprtSwitch(path / (path / "switch").readlink())
+        self.program = read_sysfs_file(path / "program", missing="unknown")
+        self.version = read_sysfs_file(path / "rpc_version", missing="unknown")
+        self.max_connect = read_sysfs_file(path / "max_connect",
+                                           missing="unknown")
 
     def __lt__(self, rhs):
         """Compare the name of two rpc client instances."""
@@ -266,7 +269,9 @@ class RpcClient:
 
     def __str__(self):
         """Return a string representation of an rpc client."""
-        return f"{self.name}: {self.switch}"
+        return f"{self.name}: {self.program}, rpc version {self.version}, " \
+               f"max_connect {self.max_connect}" \
+               f"\n  {' ' * len(self.name)}{self.switch}"
 
     def add_command(subparser):
         """Add parser options for the `rpcctl client` command."""
-- 
2.48.1


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

* [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt`
  2025-01-27 21:50 [PATCH nfs-utils v2 0/4] rpcctl: Various Improvements Anna Schumaker
                   ` (2 preceding siblings ...)
  2025-01-27 21:50 ` [PATCH nfs-utils v2 3/4] rpcctl: Display new rpc_clnt sysfs attributes Anna Schumaker
@ 2025-01-27 21:50 ` Anna Schumaker
  2025-02-05 22:23   ` Steve Dickson
  3 siblings, 1 reply; 8+ messages in thread
From: Anna Schumaker @ 2025-01-27 21:50 UTC (permalink / raw)
  To: linux-nfs, steved; +Cc: anna

From: Anna Schumaker <anna.schumaker@oracle.com>

This is used to add an xprt to the switch at runtime.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
---
 tools/rpcctl/rpcctl.man |  4 ++++
 tools/rpcctl/rpcctl.py  | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/tools/rpcctl/rpcctl.man b/tools/rpcctl/rpcctl.man
index b87ba0df41c0..2ee168c8f3c5 100644
--- a/tools/rpcctl/rpcctl.man
+++ b/tools/rpcctl/rpcctl.man
@@ -12,6 +12,7 @@ rpcctl \- Displays SunRPC connection information
 .BR "rpcctl client show " "\fR[ \fB\-h \f| \fB\-\-help \fR] [ \fIXPRT \fR]"
 .P
 .BR "rpcctl switch" " \fR[ \fB\-h \fR| \fB\-\-help \fR] { \fBset \fR| \fBshow \fR}"
+.BR "rpcctl switch add-xprt" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
 .BR "rpcctl switch set" " \fR[ \fB\-h \fR| \fB\-\-help \fR] \fISWITCH \fBdstaddr \fINEWADDR"
 .BR "rpcctl switch show" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
 .P
@@ -29,6 +30,9 @@ Show detailed information about the RPC clients on this system.
 If \fICLIENT \fRwas provided, then only show information about a single RPC client.
 .P
 .SS rpcctl switch \fR- \fBCommands operating on groups of transports
+.IP "\fBadd-xprt \fISWITCH"
+Add an aditional transport to the \fISWITCH\fR.
+Note that the new transport will take its values from the "main" transport.
 .IP "\fBset \fISWITCH \fBdstaddr \fINEWADDR"
 Change the destination address of all transports in the \fISWITCH \fRto \fINEWADDR\fR.
 \fINEWADDR \fRcan be an IP address, DNS name, or anything else resolvable by \fBgethostbyname\fR(3).
diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
index 130f245a64e8..29ae7d26f50e 100755
--- a/tools/rpcctl/rpcctl.py
+++ b/tools/rpcctl/rpcctl.py
@@ -213,6 +213,12 @@ class XprtSwitch:
         parser.set_defaults(func=XprtSwitch.show, switch=None)
         subparser = parser.add_subparsers()
 
+        add = subparser.add_parser("add-xprt",
+                                   help="Add an xprt to the switch")
+        add.add_argument("switch", metavar="SWITCH", nargs=1,
+                         help="Name of a specific xprt switch to modify")
+        add.set_defaults(func=XprtSwitch.add_xprt)
+
         show = subparser.add_parser("show", help="Show xprt switches")
         show.add_argument("switch", metavar="SWITCH", nargs='?',
                           help="Name of a specific switch to show")
@@ -236,6 +242,11 @@ class XprtSwitch:
             return [XprtSwitch(xprt_switches / name)]
         return [XprtSwitch(f) for f in sorted(xprt_switches.iterdir())]
 
+    def add_xprt(args):
+        """Handle the `rpcctl switch add-xprt` command."""
+        for switch in XprtSwitch.get_by_name(args.switch[0]):
+            write_sysfs_file(switch.path / "add_xprt", "1")
+
     def show(args):
         """Handle the `rpcctl switch show` command."""
         for switch in XprtSwitch.get_by_name(args.switch):
-- 
2.48.1


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

* Re: [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt`
  2025-01-27 21:50 ` [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt` Anna Schumaker
@ 2025-02-05 22:23   ` Steve Dickson
  2025-02-06 21:44     ` Anna Schumaker
  0 siblings, 1 reply; 8+ messages in thread
From: Steve Dickson @ 2025-02-05 22:23 UTC (permalink / raw)
  To: Anna Schumaker, linux-nfs



On 1/27/25 4:50 PM, Anna Schumaker wrote:
> From: Anna Schumaker <anna.schumaker@oracle.com>
> 
> This is used to add an xprt to the switch at runtime.
> 
> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
> ---
>   tools/rpcctl/rpcctl.man |  4 ++++
>   tools/rpcctl/rpcctl.py  | 11 +++++++++++
>   2 files changed, 15 insertions(+)
> 
> diff --git a/tools/rpcctl/rpcctl.man b/tools/rpcctl/rpcctl.man
> index b87ba0df41c0..2ee168c8f3c5 100644
> --- a/tools/rpcctl/rpcctl.man
> +++ b/tools/rpcctl/rpcctl.man
> @@ -12,6 +12,7 @@ rpcctl \- Displays SunRPC connection information
>   .BR "rpcctl client show " "\fR[ \fB\-h \f| \fB\-\-help \fR] [ \fIXPRT \fR]"
>   .P
>   .BR "rpcctl switch" " \fR[ \fB\-h \fR| \fB\-\-help \fR] { \fBset \fR| \fBshow \fR}"
> +.BR "rpcctl switch add-xprt" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
>   .BR "rpcctl switch set" " \fR[ \fB\-h \fR| \fB\-\-help \fR] \fISWITCH \fBdstaddr \fINEWADDR"
>   .BR "rpcctl switch show" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
>   .P
> @@ -29,6 +30,9 @@ Show detailed information about the RPC clients on this system.
>   If \fICLIENT \fRwas provided, then only show information about a single RPC client.
>   .P
>   .SS rpcctl switch \fR- \fBCommands operating on groups of transports
> +.IP "\fBadd-xprt \fISWITCH"
> +Add an aditional transport to the \fISWITCH\fR.
> +Note that the new transport will take its values from the "main" transport.
>   .IP "\fBset \fISWITCH \fBdstaddr \fINEWADDR"
>   Change the destination address of all transports in the \fISWITCH \fRto \fINEWADDR\fR.
>   \fINEWADDR \fRcan be an IP address, DNS name, or anything else resolvable by \fBgethostbyname\fR(3).
> diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
> index 130f245a64e8..29ae7d26f50e 100755
> --- a/tools/rpcctl/rpcctl.py
> +++ b/tools/rpcctl/rpcctl.py
> @@ -213,6 +213,12 @@ class XprtSwitch:
>           parser.set_defaults(func=XprtSwitch.show, switch=None)
>           subparser = parser.add_subparsers()
>   
> +        add = subparser.add_parser("add-xprt",
> +                                   help="Add an xprt to the switch")
> +        add.add_argument("switch", metavar="SWITCH", nargs=1,
> +                         help="Name of a specific xprt switch to modify")
> +        add.set_defaults(func=XprtSwitch.add_xprt)
> +
>           show = subparser.add_parser("show", help="Show xprt switches")
>           show.add_argument("switch", metavar="SWITCH", nargs='?',
>                             help="Name of a specific switch to show")
> @@ -236,6 +242,11 @@ class XprtSwitch:
>               return [XprtSwitch(xprt_switches / name)]
>           return [XprtSwitch(f) for f in sorted(xprt_switches.iterdir())]
>   
> +    def add_xprt(args):
> +        """Handle the `rpcctl switch add-xprt` command."""
> +        for switch in XprtSwitch.get_by_name(args.switch[0]):
> +            write_sysfs_file(switch.path / "add_xprt", "1")
> +
>       def show(args):
>           """Handle the `rpcctl switch show` command."""
>           for switch in XprtSwitch.get_by_name(args.switch):
Question... is this support needed by a kernel patch? if so is
it in a public kernel?

steved.


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

* Re: [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt`
  2025-02-05 22:23   ` Steve Dickson
@ 2025-02-06 21:44     ` Anna Schumaker
  2025-02-07 11:08       ` Steve Dickson
  0 siblings, 1 reply; 8+ messages in thread
From: Anna Schumaker @ 2025-02-06 21:44 UTC (permalink / raw)
  To: Steve Dickson, Anna Schumaker, linux-nfs

Hi Steve,

On 2/5/25 5:23 PM, Steve Dickson wrote:
> 
> 
> On 1/27/25 4:50 PM, Anna Schumaker wrote:
>> From: Anna Schumaker <anna.schumaker@oracle.com>
>>
>> This is used to add an xprt to the switch at runtime.
>>
>> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
>> ---
>>   tools/rpcctl/rpcctl.man |  4 ++++
>>   tools/rpcctl/rpcctl.py  | 11 +++++++++++
>>   2 files changed, 15 insertions(+)
>>
>> diff --git a/tools/rpcctl/rpcctl.man b/tools/rpcctl/rpcctl.man
>> index b87ba0df41c0..2ee168c8f3c5 100644
>> --- a/tools/rpcctl/rpcctl.man
>> +++ b/tools/rpcctl/rpcctl.man
>> @@ -12,6 +12,7 @@ rpcctl \- Displays SunRPC connection information
>>   .BR "rpcctl client show " "\fR[ \fB\-h \f| \fB\-\-help \fR] [ \fIXPRT \fR]"
>>   .P
>>   .BR "rpcctl switch" " \fR[ \fB\-h \fR| \fB\-\-help \fR] { \fBset \fR| \fBshow \fR}"
>> +.BR "rpcctl switch add-xprt" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
>>   .BR "rpcctl switch set" " \fR[ \fB\-h \fR| \fB\-\-help \fR] \fISWITCH \fBdstaddr \fINEWADDR"
>>   .BR "rpcctl switch show" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
>>   .P
>> @@ -29,6 +30,9 @@ Show detailed information about the RPC clients on this system.
>>   If \fICLIENT \fRwas provided, then only show information about a single RPC client.
>>   .P
>>   .SS rpcctl switch \fR- \fBCommands operating on groups of transports
>> +.IP "\fBadd-xprt \fISWITCH"
>> +Add an aditional transport to the \fISWITCH\fR.
>> +Note that the new transport will take its values from the "main" transport.
>>   .IP "\fBset \fISWITCH \fBdstaddr \fINEWADDR"
>>   Change the destination address of all transports in the \fISWITCH \fRto \fINEWADDR\fR.
>>   \fINEWADDR \fRcan be an IP address, DNS name, or anything else resolvable by \fBgethostbyname\fR(3).
>> diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
>> index 130f245a64e8..29ae7d26f50e 100755
>> --- a/tools/rpcctl/rpcctl.py
>> +++ b/tools/rpcctl/rpcctl.py
>> @@ -213,6 +213,12 @@ class XprtSwitch:
>>           parser.set_defaults(func=XprtSwitch.show, switch=None)
>>           subparser = parser.add_subparsers()
>>   +        add = subparser.add_parser("add-xprt",
>> +                                   help="Add an xprt to the switch")
>> +        add.add_argument("switch", metavar="SWITCH", nargs=1,
>> +                         help="Name of a specific xprt switch to modify")
>> +        add.set_defaults(func=XprtSwitch.add_xprt)
>> +
>>           show = subparser.add_parser("show", help="Show xprt switches")
>>           show.add_argument("switch", metavar="SWITCH", nargs='?',
>>                             help="Name of a specific switch to show")
>> @@ -236,6 +242,11 @@ class XprtSwitch:
>>               return [XprtSwitch(xprt_switches / name)]
>>           return [XprtSwitch(f) for f in sorted(xprt_switches.iterdir())]
>>   +    def add_xprt(args):
>> +        """Handle the `rpcctl switch add-xprt` command."""
>> +        for switch in XprtSwitch.get_by_name(args.switch[0]):
>> +            write_sysfs_file(switch.path / "add_xprt", "1")
>> +
>>       def show(args):
>>           """Handle the `rpcctl switch show` command."""
>>           for switch in XprtSwitch.get_by_name(args.switch):
> Question... is this support needed by a kernel patch? if so is
> it in a public kernel?

I'm about to post v3 of the patchset adding the kernel side of this. I'm hopeful it'll go in with the next merge window.

Anna

> 
> steved.
> 


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

* Re: [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt`
  2025-02-06 21:44     ` Anna Schumaker
@ 2025-02-07 11:08       ` Steve Dickson
  0 siblings, 0 replies; 8+ messages in thread
From: Steve Dickson @ 2025-02-07 11:08 UTC (permalink / raw)
  To: Anna Schumaker, Anna Schumaker, linux-nfs

Hey Anna!

On 2/6/25 4:44 PM, Anna Schumaker wrote:
> Hi Steve,
> 
> On 2/5/25 5:23 PM, Steve Dickson wrote:
>>
>>
>> On 1/27/25 4:50 PM, Anna Schumaker wrote:
>>> From: Anna Schumaker <anna.schumaker@oracle.com>
>>>
>>> This is used to add an xprt to the switch at runtime.
>>>
>>> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
>>> ---
>>>    tools/rpcctl/rpcctl.man |  4 ++++
>>>    tools/rpcctl/rpcctl.py  | 11 +++++++++++
>>>    2 files changed, 15 insertions(+)
>>>
>>> diff --git a/tools/rpcctl/rpcctl.man b/tools/rpcctl/rpcctl.man
>>> index b87ba0df41c0..2ee168c8f3c5 100644
>>> --- a/tools/rpcctl/rpcctl.man
>>> +++ b/tools/rpcctl/rpcctl.man
>>> @@ -12,6 +12,7 @@ rpcctl \- Displays SunRPC connection information
>>>    .BR "rpcctl client show " "\fR[ \fB\-h \f| \fB\-\-help \fR] [ \fIXPRT \fR]"
>>>    .P
>>>    .BR "rpcctl switch" " \fR[ \fB\-h \fR| \fB\-\-help \fR] { \fBset \fR| \fBshow \fR}"
>>> +.BR "rpcctl switch add-xprt" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
>>>    .BR "rpcctl switch set" " \fR[ \fB\-h \fR| \fB\-\-help \fR] \fISWITCH \fBdstaddr \fINEWADDR"
>>>    .BR "rpcctl switch show" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
>>>    .P
>>> @@ -29,6 +30,9 @@ Show detailed information about the RPC clients on this system.
>>>    If \fICLIENT \fRwas provided, then only show information about a single RPC client.
>>>    .P
>>>    .SS rpcctl switch \fR- \fBCommands operating on groups of transports
>>> +.IP "\fBadd-xprt \fISWITCH"
>>> +Add an aditional transport to the \fISWITCH\fR.
>>> +Note that the new transport will take its values from the "main" transport.
>>>    .IP "\fBset \fISWITCH \fBdstaddr \fINEWADDR"
>>>    Change the destination address of all transports in the \fISWITCH \fRto \fINEWADDR\fR.
>>>    \fINEWADDR \fRcan be an IP address, DNS name, or anything else resolvable by \fBgethostbyname\fR(3).
>>> diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
>>> index 130f245a64e8..29ae7d26f50e 100755
>>> --- a/tools/rpcctl/rpcctl.py
>>> +++ b/tools/rpcctl/rpcctl.py
>>> @@ -213,6 +213,12 @@ class XprtSwitch:
>>>            parser.set_defaults(func=XprtSwitch.show, switch=None)
>>>            subparser = parser.add_subparsers()
>>>    +        add = subparser.add_parser("add-xprt",
>>> +                                   help="Add an xprt to the switch")
>>> +        add.add_argument("switch", metavar="SWITCH", nargs=1,
>>> +                         help="Name of a specific xprt switch to modify")
>>> +        add.set_defaults(func=XprtSwitch.add_xprt)
>>> +
>>>            show = subparser.add_parser("show", help="Show xprt switches")
>>>            show.add_argument("switch", metavar="SWITCH", nargs='?',
>>>                              help="Name of a specific switch to show")
>>> @@ -236,6 +242,11 @@ class XprtSwitch:
>>>                return [XprtSwitch(xprt_switches / name)]
>>>            return [XprtSwitch(f) for f in sorted(xprt_switches.iterdir())]
>>>    +    def add_xprt(args):
>>> +        """Handle the `rpcctl switch add-xprt` command."""
>>> +        for switch in XprtSwitch.get_by_name(args.switch[0]):
>>> +            write_sysfs_file(switch.path / "add_xprt", "1")
>>> +
>>>        def show(args):
>>>            """Handle the `rpcctl switch show` command."""
>>>            for switch in XprtSwitch.get_by_name(args.switch):
>> Question... is this support needed by a kernel patch? if so is
>> it in a public kernel?
> 
> I'm about to post v3 of the patchset adding the kernel side of this. I'm hopeful it'll go in with the next merge window.
> 
So I'm assuming 'rpcctl switch add-xprt' will fail without the
kernel patch.

If that is the case... would it make sense to commit the first 3
patches and deal with this after kernel patch goes in?

steved.



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

end of thread, other threads:[~2025-02-07 11:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-27 21:50 [PATCH nfs-utils v2 0/4] rpcctl: Various Improvements Anna Schumaker
2025-01-27 21:50 ` [PATCH nfs-utils v2 1/4] rpcctl: Rename {read,write}_addr_file() Anna Schumaker
2025-01-27 21:50 ` [PATCH nfs-utils v2 2/4] rpcctl: Add support for the xprtsec sysfs attribute Anna Schumaker
2025-01-27 21:50 ` [PATCH nfs-utils v2 3/4] rpcctl: Display new rpc_clnt sysfs attributes Anna Schumaker
2025-01-27 21:50 ` [PATCH nfs-utils v2 4/4] rpcctl: Add support for `rpcctl switch add-xprt` Anna Schumaker
2025-02-05 22:23   ` Steve Dickson
2025-02-06 21:44     ` Anna Schumaker
2025-02-07 11:08       ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox