linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Cc: Petr Vorel <pvorel@suse.cz>, Martin Doucha <mdoucha@suse.cz>,
	NeilBrown <neilb@suse.de>, Jeff Layton <jlayton@kernel.org>,
	Steve Dickson <steved@redhat.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna@kernel.org>,
	linux-nfs@vger.kernel.org, Cyril Hrubis <chrubis@suse.cz>
Subject: [PATCH 3/4] nfsstat01.sh: Add support for NFSv4*
Date: Wed, 31 Jan 2024 16:14:45 +0100	[thread overview]
Message-ID: <20240131151446.936281-4-pvorel@suse.cz> (raw)
In-Reply-To: <20240131151446.936281-1-pvorel@suse.cz>

NFSv4, NFSv4.1 and NFSv4.2 have following changes:
* server (/proc/net/rpc/nfsd) has "remove" remove 1) in proc4ops line 2)
  in column 31.
* client (/proc/net/rpc/nfs) has "remove" record in column 24.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Dear NFS developers,

I hope I found correct column (reading utils/nfsstat/nfsstat.c [1] and
comparing content of /proc/net/rpc/nfs{,d} and nfsstat output), but
please correct me, if other value should be tested.

You can test this LTP patchset with these commands:

git clone -b rename-net.nfs.v2 https://github.com/pevik/ltp.git && cd ltp
# optionally install LTP build dependencies with ./ci/YOUR_DISTRO.sh
make autotools && ./configure
for i in testcases/lib testcases/kernel/fs/fsstress/ testcases/network/nfs*/; do cd $i && make -j`nproc` && make install; cd -; done

PATH=/opt/ltp/testcases/bin:$PATH LTP_SINGLE_FS_TYPE=ext4 nfsstat01.sh -v4.1 # -v can be 3, 4, 4.1, 4.2

Kind regards,
Petr

[1] https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=utils/nfsstat/nfsstat.c;h=ca845325f0dc02a4f005dd44b010fcadcff4d3c7;hb=HEAD

 testcases/network/nfs/nfsstat01/nfsstat01.sh | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/testcases/network/nfs/nfsstat01/nfsstat01.sh b/testcases/network/nfs/nfsstat01/nfsstat01.sh
index 4c09ae135..c2856eff1 100755
--- a/testcases/network/nfs/nfsstat01/nfsstat01.sh
+++ b/testcases/network/nfs/nfsstat01/nfsstat01.sh
@@ -45,7 +45,9 @@ get_calls()
 #           tracking using the 'nfsstat' command and /proc/net/rpc
 do_test()
 {
-	local client_calls server_calls new_server_calls new_client_calls field
+	local client_calls server_calls new_server_calls new_client_calls
+	local client_field server_field
+	local client_v=$VERSION server_v=$VERSION
 
 	tst_res TINFO "checking RPC calls for server/client"
 
@@ -75,21 +77,23 @@ do_test()
 
 	tst_res TINFO "checking NFS calls for server/client"
 	case $VERSION in
-	2) field=13
+	2) client_field=13 server_field=13
 	;;
-	*) field=15
+	3) client_field=15 server_field=15
+	;;
+	4*) client_field=24 server_field=31 client_v=4 server_v=4ops
 	;;
 	esac
 
-	server_calls="$(get_calls proc$VERSION $field nfsd)"
-	client_calls="$(get_calls proc$VERSION $field nfs)"
+	server_calls="$(get_calls proc$server_v $server_field nfsd)"
+	client_calls="$(get_calls proc$client_v $client_field nfs)"
 	tst_res TINFO "calls $server_calls/$client_calls"
 
 	tst_res TINFO "Checking for tracking of NFS calls for server/client"
 	rm -f nfsstat01.tmp
 
-	new_server_calls="$(get_calls proc$VERSION $field nfsd)"
-	new_client_calls="$(get_calls proc$VERSION $field nfs)"
+	new_server_calls="$(get_calls proc$server_v $server_field nfsd)"
+	new_client_calls="$(get_calls proc$client_v $client_field nfs)"
 	tst_res TINFO "new calls $new_server_calls/$new_client_calls"
 
 	if [ "$new_server_calls" -le "$server_calls" ]; then
-- 
2.43.0


  parent reply	other threads:[~2024-01-31 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 15:14 [PATCH 0/4] nfsstat: Test also on NFSv4* Petr Vorel
2024-01-31 15:14 ` [PATCH 1/4 v2] runtest/net.nfs: Rename test names Petr Vorel
2024-01-31 15:14 ` [PATCH 2/4] nfsstat01.sh: Validate parsing /proc/net/rpc/nfs{,d} Petr Vorel
2024-01-31 15:14 ` Petr Vorel [this message]
2024-01-31 15:14 ` [PATCH 4/4] nfsstat01.sh: Run on all NFS versions, TCP and UDP Petr Vorel
2024-02-08 14:44   ` Martin Doucha
2024-02-09  8:49     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240131151446.936281-4-pvorel@suse.cz \
    --to=pvorel@suse.cz \
    --cc=anna@kernel.org \
    --cc=chrubis@suse.cz \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    --cc=neilb@suse.de \
    --cc=steved@redhat.com \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).