1. 18 6月, 2009 2 次提交
    • R
      nfs41: Process the RPC call direction · f4a2e418
      Ricardo Labiaga 提交于
      Reading and storing the RPC direction is a three step process.
      
      1. xs_tcp_read_calldir() reads the RPC direction, but it will not store it
      in the XDR buffer since the 'struct rpc_rqst' is not yet available.
      
      2. The 'struct rpc_rqst' is obtained during the TCP_RCV_COPY_DATA state.
      This state need not necessarily be preceeded by the TCP_RCV_READ_CALLDIR.
      For example, we may be reading a continuation packet to a large reply.
      Therefore, we can't simply obtain the 'struct rpc_rqst' during the
      TCP_RCV_READ_CALLDIR state and assume it's available during TCP_RCV_COPY_DATA.
      
      This patch adds a new TCP_RCV_READ_CALLDIR flag to indicate the need to
      read the RPC direction.  It then uses TCP_RCV_COPY_CALLDIR to indicate the
      RPC direction needs to be saved after the 'struct rpc_rqst' has been allocated.
      
      3. The 'struct rpc_rqst' is obtained by the xs_tcp_read_data() helper
      functions.  xs_tcp_read_common() then saves the RPC direction in the XDR
      buffer if TCP_RCV_COPY_CALLDIR is set.  This will happen when we're reading
      the data immediately after the direction was read.  xs_tcp_read_common()
      then clears this flag.
      
      [was nfs41: Skip past the RPC call direction]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfs41: sunrpc: Add RPC direction back into the XDR buffer]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfs41: sunrpc: Don't skip past the RPC call direction]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      f4a2e418
    • R
      nfs41: Add ability to read RPC call direction on TCP stream. · 18dca02a
      Ricardo Labiaga 提交于
      NFSv4.1 callbacks can arrive over an existing connection. This patch adds
      the logic to read the RPC call direction (call or reply). It does this by
      updating the state machine to look for the call direction invoking
      xs_tcp_read_calldir(...) after reading the XID.
      
      [nfs41: Keep track of RPC call/reply direction with a flag]
      
      As per 11/14/08 review of RFC 53/85.
      
      Add a new flag to track whether the incoming message is an RPC call or an
      RPC reply.  TCP_RPC_REPLY is set in the 'struct sock_xprt' tcp_flags in
      xs_tcp_read_calldir() if the message is an RPC reply sent on the forechannel.
      It is cleared if the message is an RPC request sent on the back channel.
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      18dca02a
  2. 03 5月, 2009 1 次提交
  3. 20 3月, 2009 4 次提交
  4. 12 3月, 2009 10 次提交
  5. 07 2月, 2009 1 次提交
    • I
      net/sunrpc/xprtsock.c: some common code found · 1f0fa154
      Ilpo Järvinen 提交于
      $ diff-funcs xs_udp_write_space net/sunrpc/xprtsock.c
      net/sunrpc/xprtsock.c xs_tcp_write_space
       --- net/sunrpc/xprtsock.c:xs_udp_write_space()
       +++ net/sunrpc/xprtsock.c:xs_tcp_write_space()
      @@ -1,4 +1,4 @@
      - * xs_udp_write_space - callback invoked when socket buffer space
      + * xs_tcp_write_space - callback invoked when socket buffer space
        *                             becomes available
        * @sk: socket whose state has changed
        *
      @@ -7,12 +7,12 @@
        * progress, otherwise we'll waste resources thrashing kernel_sendmsg
        * with a bunch of small requests.
        */
      -static void xs_udp_write_space(struct sock *sk)
      +static void xs_tcp_write_space(struct sock *sk)
       {
       	read_lock(&sk->sk_callback_lock);
      
      -	/* from net/core/sock.c:sock_def_write_space */
      -	if (sock_writeable(sk)) {
      +	/* from net/core/stream.c:sk_stream_write_space */
      +	if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) {
       		struct socket *sock;
       		struct rpc_xprt *xprt;
      
      
      $ codiff net/sunrpc/xprtsock.o net/sunrpc/xprtsock.o.new
      net/sunrpc/xprtsock.c:
        xs_tcp_write_space | -163
        xs_udp_write_space | -163
       2 functions changed, 326 bytes removed
      
      net/sunrpc/xprtsock.c:
        xs_write_space | +179
       1 function changed, 179 bytes added
      
      net/sunrpc/xprtsock.o.new:
       3 functions changed, 179 bytes added, 326 bytes removed, diff: -147
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f0fa154
  6. 03 11月, 2008 1 次提交
  7. 31 10月, 2008 1 次提交
  8. 30 10月, 2008 2 次提交
  9. 29 10月, 2008 3 次提交
  10. 14 10月, 2008 1 次提交
  11. 10 7月, 2008 1 次提交
    • C
      SUNRPC: Ensure all transports set rq_xtime consistently · b22602a6
      Chuck Lever 提交于
      The RPC client uses the rq_xtime field in each RPC request to determine the
      round-trip time of the request.  Currently, the rq_xtime field is
      initialized by each transport just before it starts enqueing a request to
      be sent.  However, transports do not handle initializing this value
      consistently; sometimes they don't initialize it at all.
      
      To make the measurement of request round-trip time consistent for all
      RPC client transport capabilities, pull rq_xtime initialization into the
      RPC client's generic transport logic.  Now all transports will get a
      standardized RTT measure automatically, from:
      
        xprt_transmit()
      
      to
      
        xprt_complete_rqst()
      
      This makes round-trip time calculation more accurate for the TCP transport.
      The socket ->sendmsg() method can return "-EAGAIN" if the socket's output
      buffer is full, so the TCP transport's ->send_request() method may call
      the ->sendmsg() method repeatedly until it gets all of the request's bytes
      queued in the socket's buffer.
      
      Currently, the TCP transport sets the rq_xtime field every time through
      that loop so the final value is the timestamp just before the *last* call
      to the underlying socket's ->sendmsg() method.  After this patch, the
      rq_xtime field contains a timestamp that reflects the time just before the
      *first* call to ->sendmsg().
      
      This is consequential under heavy workloads because large requests often
      take multiple ->sendmsg() calls to get all the bytes of a request queued.
      The TCP transport causes the request to sleep until the remote end of the
      socket has received enough bytes to clear space in the socket's local
      output buffer.  This delay can be quite significant.
      
      The method introduced by this patch is a more accurate measure of RTT
      for stream transports, since the server can cause enough back pressure
      to delay (ie increase the latency of) requests from the client.
      
      Additionally, this patch corrects the behavior of the RDMA transport, which
      entirely neglected to initialize the rq_xtime field.  RPC performance
      metrics for RDMA transports now display correct RPC request round trip
      times.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Acked-by: NTom Talpey <thomas.talpey@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b22602a6
  12. 20 4月, 2008 3 次提交
    • T
      SUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests · 7c1d71cf
      Trond Myklebust 提交于
      NFSv4 requires us to ensure that we break the TCP connection before we're
      allowed to retransmit a request. However in the case where we're
      retransmitting several requests that have been sent on the same
      connection, we need to ensure that we don't interfere with the attempt to
      reconnect and/or break the connection again once it has been established.
      
      We therefore introduce a 'connection' cookie that is bumped every time a
      connection is broken. This allows requests to track if they need to force a
      disconnection.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7c1d71cf
    • T
      SUNRPC: remove XS_SENDMSG_RETRY · 06b4b681
      Trond Myklebust 提交于
      The condition for exiting from the loop in xs_tcp_send_request() should be
      that we find we're not making progress (i.e. number of bytes sent is 0).
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      06b4b681
    • T
      SUNRPC: Fix up xprt_write_space() · b6ddf64f
      Trond Myklebust 提交于
      The rest of the networking layer uses SOCK_ASYNC_NOSPACE to signal whether
      or not we have someone waiting for buffer memory. Convert the SUNRPC layer
      to use the same idiom.
      Remove the unlikely()s in xs_udp_write_space and xs_tcp_write_space. In
      fact, the most common case will be that there is nobody waiting for buffer
      space.
      
      SOCK_NOSPACE is there to tell the TCP layer whether or not the cwnd was
      limited by the application window. Ensure that we follow the same idiom as
      the rest of the networking layer here too.
      
      Finally, ensure that we clear SOCK_ASYNC_NOSPACE once we wake up, so that
      write_space() doesn't keep waking things up on xprt->pending.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b6ddf64f
  13. 06 3月, 2008 1 次提交
  14. 29 2月, 2008 1 次提交
  15. 30 1月, 2008 8 次提交