1. 09 9月, 2010 22 次提交
    • Z
      RDS/IB: print string constants in more places · 59f740a6
      Zach Brown 提交于
      This prints the constant identifier for work completion status and rdma
      cm event types, like we already do for IB event types.
      
      A core string array helper is added that each string type uses.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      59f740a6
    • Z
      RDS/IB: track signaled sends · f046011c
      Zach Brown 提交于
      We're seeing bugs today where IB connection shutdown clears the send
      ring while the tasklet is processing completed sends.  Implementation
      details cause this to dereference a null pointer.  Shutdown needs to
      wait for send completion to stop before tearing down the connection.  We
      can't simply wait for the ring to empty because it may contain
      unsignaled sends that will never be processed.
      
      This patch tracks the number of signaled sends that we've posted and
      waits for them to complete.  It also makes sure that the tasklet has
      finished executing.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      f046011c
    • Z
      rds: fix rds_send_xmit() serialization · 0f4b1c7e
      Zach Brown 提交于
      rds_send_xmit() was changed to hold an interrupt masking spinlock instead of a
      mutex so that it could be called from the IB receive tasklet path.  This broke
      the TCP transport because its xmit method can block and masks and unmasks
      interrupts.
      
      This patch serializes callers to rds_send_xmit() with a simple bit instead of
      the current spinlock or previous mutex.  This enables rds_send_xmit() to be
      called from any context and to call functions which block.  Getting rid of the
      c_send_lock exposes the bare c_lock acquisitions which are changed to block
      interrupts.
      
      A waitqueue is added so that rds_conn_shutdown() can wait for callers to leave
      rds_send_xmit() before tearing down partial send state.  This lets us get rid
      of c_senders.
      
      rds_send_xmit() is changed to check the conn state after acquiring the
      RDS_IN_XMIT bit to resolve races with the shutdown path.  Previously both
      worked with the conn state and then the lock in the same order, allowing them
      to race and execute the paths concurrently.
      
      rds_send_reset() isn't racing with rds_send_xmit() now that rds_conn_shutdown()
      properly ensures that rds_send_xmit() can't start once the conn state has been
      changed.  We can remove its previous use of the spinlock.
      
      Finally, c_send_generation is redundant.  Callers can race to test the c_flags
      bit by simply retrying instead of racing to test the c_send_generation atomic.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      0f4b1c7e
    • Z
      RDS/IB: get the xmit max_sge from the RDS IB device on the connection · 89bf9d41
      Zach Brown 提交于
      rds_ib_xmit_rdma() was calling ib_get_client_data() to get at the rds_ibdevice
      just to get the max_sge for the transmit.  This patch instead has it get it
      directly off the rds_ibdev which is stored on the connection.
      
      The current code won't free the rds_ibdev until all the IB connections that use
      it are freed.  So it's safe to reference the rds_ibdev this way.  In the future
      it also makes it easier to support proper reference counting of the rds_ibdev
      struct.
      
      As an additional bonus, this gets rid of the performance hit of calling in to
      the IB stack to look up the rds_ibdev.  The current implementation in the IB
      stack acquires an interrupt blocking spinlock to protect the registration of
      client callback data.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      89bf9d41
    • C
      rds: Fix reference counting on the for xmit_atomic and xmit_rdma · 1cc2228c
      Chris Mason 提交于
      This makes sure we have the proper number of references in
      rds_ib_xmit_atomic and rds_ib_xmit_rdma.  We also consistently
      drop references the same way for all message types as the IOs end.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      1cc2228c
    • C
      rds: Fix RDMA message reference counting · c9e65383
      Chris Mason 提交于
      The RDS send_xmit code was trying to get fancy with message
      counting and was dropping the final reference on the RDMA messages
      too early.  This resulted in memory corruption and oopsen.
      
      The fix here is to always add a ref as the parts of the message passes
      through rds_send_xmit, and always drop a ref as the parts of the message
      go through completion handling.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      c9e65383
    • A
      51e2cba8
    • A
      RDS: Perform unmapping ops in stages · ff3d7d36
      Andy Grover 提交于
      Previously, RDS would wait until the final send WR had completed
      and then handle cleanup. With silent ops, we do not know
      if an atomic, rdma, or data op will be last. This patch
      handles any of these cases by keeping a pointer to the last
      op in the message in m_last_op.
      
      When the TX completion event fires, rds dispatches to per-op-type
      cleanup functions, and then does whole-message cleanup, if the
      last op equalled m_last_op.
      
      This patch also moves towards having op-specific functions take
      the op struct, instead of the overall rm struct.
      
      rds_ib_connection has a pointer to keep track of a a partially-
      completed data send operation. This patch changes it from an
      rds_message pointer to the narrower rm_data_op pointer, and
      modifies places that use this pointer as needed.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      ff3d7d36
    • A
      RDS: Rename data op members prefix from m_ to op_ · 6c7cc6e4
      Andy Grover 提交于
      For consistency.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      6c7cc6e4
    • A
      RDS: Remove struct rds_rdma_op · f8b3aaf2
      Andy Grover 提交于
      A big changeset, but it's all pretty dumb.
      
      struct rds_rdma_op was already embedded in struct rm_rdma_op.
      Remove rds_rdma_op and put its members in rm_rdma_op. Rename
      members with "op_" prefix instead of "r_", for consistency.
      
      Of course this breaks a lot, so fixup the code accordingly.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      f8b3aaf2
    • A
      RDS: Implement silent atomics · 241eef3e
      Andy Grover 提交于
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      241eef3e
    • A
      RDS/IB: Make all flow control code conditional on i_flowctl · c8de3f10
      Andy Grover 提交于
      Maybe things worked fine with the flow control code running
      even in the non-flow-control case, but making it explicitly
      conditional helps the non-fc case be easier to read.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      c8de3f10
    • A
      RDS: Remove unsignaled_bytes sysctl · 1d34f175
      Andy Grover 提交于
      Removed unsignaled_bytes sysctl and code to signal
      based on it. I believe unsignaled_wrs is more than
      sufficient for our purposes.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      1d34f175
    • A
      RDS: rewrite rds_ib_xmit · da5a06ce
      Andy Grover 提交于
      Now that the header always goes first, it is possible to
      simplify rds_ib_xmit. Instead of having a path to handle 0-byte
      dgrams and another path to handle >0, these can both be handled
      in one path. This lets us eliminate xmit_populate_wr().
      
      Rename sent to bytes_sent, to differentiate better from other
      variable named "send".
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      da5a06ce
    • A
      RDS/IB: Remove ib_[header/data]_sge() functions · 919ced4c
      Andy Grover 提交于
      These functions were to cope with differently ordered
      sg entries depending on RDS 3.0 or 3.1+. Now that
      we've dropped 3.0 compatibility we no longer need them.
      
      Also, modify usage sites for these to refer to sge[0] or [1]
      directly. Reorder code to initialize header sgs first.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      919ced4c
    • A
      RDS/IB: Remove dead code · 6f3d05db
      Andy Grover 提交于
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      6f3d05db
    • A
      RDS/IB: eliminate duplicate code · 9c030391
      Andy Grover 提交于
      both atomics and rdmas need to convert ib-specific completion codes
      into RDS status codes. Rename rds_ib_rdma_send_complete to
      rds_ib_send_complete, and have it take a pointer to the function to
      call with the new error code.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      9c030391
    • A
      RDS: Implement atomic operations · 15133f6e
      Andy Grover 提交于
      Implement a CMSG-based interface to do FADD and CSWP ops.
      
      Alter send routines to handle atomic ops.
      
      Add atomic counters to stats.
      
      Add xmit_atomic() to struct rds_transport
      
      Inline rds_ib_send_unmap_rdma into unmap_rm
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      15133f6e
    • A
      RDS: make m_rdma_op a member of rds_message · ff87e97a
      Andy Grover 提交于
      This eliminates a separate memory alloc, although
      it is now necessary to add an "r_active" flag, since
      it is no longer to use the m_rdma_op pointer as an
      indicator of if an rdma op is present.
      
      rdma SGs allocated from rm sg pool.
      
      rds_rm_size also gets bigger. It's a little inefficient to
      run through CMSGs twice, but it makes later steps a lot smoother.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      ff87e97a
    • A
      RDS: fold rdma.h into rds.h · 21f79afa
      Andy Grover 提交于
      RDMA is now an intrinsic part of RDS, so it's easier to just have
      a single header.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      21f79afa
    • A
      RDS: break out rdma and data ops into nested structs in rds_message · e779137a
      Andy Grover 提交于
      Clearly separate rdma-related variables in rm from data-related ones.
      This is in anticipation of adding atomic support.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      e779137a
    • A
      RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons · 8690bfa1
      Andy Grover 提交于
      Favor "if (foo)" style over "if (foo != NULL)".
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      8690bfa1
  2. 17 3月, 2010 3 次提交
  3. 30 11月, 2009 1 次提交
  4. 10 4月, 2009 2 次提交
  5. 27 2月, 2009 1 次提交