[pnfs] Callback design

Iyer, Rahul Rahul.Iyer at netapp.com
Fri Apr 6 02:43:10 EDT 2007


Hi,
here's what i think will be a decent design for the callback code. I've
divided this into two parts - the client and the server:
 
The client side
----------------------
 
xs_tcp_data_recv is a function in which the the rpc_request is read in.
We could read in the request here and check for the call/reply flag. If
the call flag is set, then we know it is a callback. This function calls
xs_tcp_read_request. Here, on finding an xid we haven't seen, we check
if the call flag is set. If so, it is a callback, else we drop the
request. 
If the call flag is set, then we need an rpc_rqst struct. This can be
gotten from the rpc_slot table via code similar to xprt_reserve, except
we cannot sleep here. If we couldn't get an rpc_rqst, we could:
1. drop the callback and hope for a retransmission at some time when
congestion is low.
2. allocate an rpc_rqst using GFP_ATOMIC. If even this fails, drop the
callback.
 
For simplicity of a first cut implementation, we could go with the first
for now.
 
We then proceed to set up the required xdr_bus via rpc_malloc and then
after setting up the required pointers, queue it up on a list for the
callback server to process.
 
We need to spawn a different callback server from the v4 case. This
server looks at the list of rpc_rqsts and then dequeues one. It then
copies the relevant fields to it's svc_rqst and then pass it on to a
function much like svc_process, but doesn't send anything. To send the
reply, we use sonething like xprt_transmit (slightly modified).
 
On the server, I was thinking of creating a new rpc_clnt as is done in
the current v4 callback code in the server. However, I was thinking of
creating a different back channel version of the rpc_xprt struct.
Functions such as the send_request would need to be set to use the
existing socket.
 
Here's what's left: 
1. I need to figure out how to send a packet using the svc_* side of
things
2. Find where the code checks the call/reply header and redirect to wake
up the appropriate calling thread
 
I'm less familiar with the server code, so any help on doing this would
be appreciated.
Regards
Rahul
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20070405/fd7aeb87/attachment.htm 


More information about the pNFS mailing list