Skip to contentSkip to conversation

nfs client question -- kernel version 2.4.18

DISCUSSION David Myer 3 participants 5 messages May 19, 2003 – May 20, 2003

Subsystems (2)
lore
Share & tools
lore

David Myer

author
#0 lore raw

Hi,

I am trying to understand nfs client code in 2.4.18. Would appreciate the following advise.

1) in call_encode function (clnt.c), it initializes the iov base and len for send and recv, why it is only init iov[0] ? Does it mean it only use ONE IOV for data send and receive ? If so, if I have use my own type of buffer underneath, can I just copy it into iov[0] ?

2) In nfs2xdr.c's nfs_xdr_readdirres function, when nfs tries to get XDR data, it uses iov[1], I am not sure when the header and payload got splitted into iov[0] and iov[1]. I assume this happened ( in case of udp), in data copy in udp_data_ready, but I did not see this "split copy" happening.

3) In command line, I am trying to mount using tcp by mount address1:/dir /address2:/mydir -o tcp it returned
nfs server reported service unavailable: Protocol not available..

I saw on server side, when doing rpcinfo -p, mount daemon does have tcp, what else special I need to configure, on server or client side in order to mount using tcp ?

Thanks much
Dave

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == David Myer <[email protected]> writes:

> Hi, I am trying to understand nfs client code in 2.4.18. Would > appreciate the following advise.

> 1) in call_encode function (clnt.c), it initializes > the iov base and len for send and recv, why it is only init > iov[0] ? Does it mean it only use ONE IOV for data send and > receive ?

The code shold be pretty clear there: half the buffer goes to the send iovec, the other half goes to the receive iovec.

> If so, if I have use my own type of buffer underneath, can I > just copy it into iov[0] ?

I suppose. Why would you do that though?

> 2) In nfs2xdr.c's nfs_xdr_readdirres function, when > nfs tries to get XDR data, it uses iov[1], I am not sure when > the header and payload got splitted into iov[0] and iov[1]. I > assume this happened ( in case of udp), in data copy in > udp_data_ready, but I did not see this "split copy" happening.

That's what csum_partial_copy_to_page_cache() does. In nfs*_xdr_readdirargs(), we preallocate the RPC header (== iov[0]) so that the readdir data ends up in the page cache page iov[1].

> 3) In command line, I am trying to mount using tcp by > mount address1:/dir /address2:/mydir -o tcp it returned nfs > server reported service unavailable: Protocol not available..

> I saw on server side, when doing rpcinfo -p, mount daemon does > have tcp, what else special I need to configure, on server or > client side in order to mount using tcp ?

Err... An actual NFS daemon that supports TCP?

Cheers,
Trond

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

author
#2 lore raw

Thanks for the reply.

I am not using skbuf underneath but have my own buffer management and socket redirect stuff (can you believe that ?), I am trying to avoid to do the copy stuff here.

I am running both client and server in 2.4.18, do you mean that the server side does NOT support tcp ? eh ?

Thanks again
David

--- Trond Myklebust <[email protected]>

Quoted 56 lines · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == David Myer <[email protected]>

writes:

> Hi, I am trying to understand nfs client code
in 2.4.18. Would
> appreciate the following advise.

> 1) in call_encode function (clnt.c), it
initializes
> the iov base and len for send and recv, why
it is only init
> iov[0] ? Does it mean it only use ONE IOV for
data send and
> receive ?

The code shold be pretty clear there: half the
buffer goes to the send
iovec, the other half goes to the receive iovec.

> If so, if I have use my own type of buffer
underneath, can I
> just copy it into iov[0] ?

I suppose. Why would you do that though?

> 2) In nfs2xdr.c's nfs_xdr_readdirres
function, when
> nfs tries to get XDR data, it uses iov[1], I
am not sure when
> the header and payload got splitted into
iov[0] and iov[1]. I
> assume this happened ( in case of udp), in
data copy in
> udp_data_ready, but I did not see this "split
copy" happening.

That's what csum_partial_copy_to_page_cache() does. In
nfs*_xdr_readdirargs(), we preallocate the RPC header (== iov[0]) so
that the readdir data ends up in the page cache page iov[1].

> 3) In command line, I am trying to mount
using tcp by
> mount address1:/dir /address2:/mydir -o tcp
it returned nfs
> server reported service unavailable: Protocol
not available..

> I saw on server side, when doing rpcinfo -p,
mount daemon does
> have tcp, what else special I need to
configure, on server or
> client side in order to mount using tcp ?

Quoted 4 lines

Err... An actual NFS daemon that supports TCP?

Cheers,
Trond

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

author
#3 lore raw

nfs over tcp in linux kernel version 2.4.18

Hi,

Can anyone advise me if nfs server over tcp is supported in 2.4.18 kernel version ? How to setup/enable on both server/client side ? Tried to looked at FAQ but information did not seem be there.

Do I need to apply any patches ?

Thanks
David

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#4 lore raw

Re: nfs over tcp in linux kernel version 2.4.18

Hello!!

You need to patch 2.4.18 to be able to use NFS over TCP.

And recompile the kernel.

http://www.fys.uio.no/%7Etrondmy/src/2.4.18/

for the patches.

It works quite well....

I believe the client already has it. Just use -t for a TCP mount.

Dan

Quoted 18 lines · On Tuesday, May 20, 2003, at 01:02 PM, [email protected] wrote:

Hi,

Can anyone advise me if nfs server over tcp is supported in 2.4.18 kernel version ? How to setup/enable on both server/client side ? Tried to looked at FAQ but information did not seem be there.

Do I need to apply any patches ?

Thanks
David

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

Quoted 8 lines

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs