1. 01 10月, 2008 1 次提交
  2. 21 9月, 2008 1 次提交
  3. 08 8月, 2008 1 次提交
  4. 05 8月, 2008 1 次提交
    • R
      RDMA/cma: Remove padding arrays by using struct sockaddr_storage · 3f446754
      Roland Dreier 提交于
      There are a few places where the RDMA CM code handles IPv6 by doing
      
      	struct sockaddr		addr;
      	u8			pad[sizeof(struct sockaddr_in6) -
      				    sizeof(struct sockaddr)];
      
      This is fragile and ugly; handle this in a better way with just
      
      	struct sockaddr_storage	addr;
      
      [ Also roll in patch from Aleksey Senin <alekseys@voltaire.com> to
        switch to struct sockaddr_storage and get rid of padding arrays in
        struct rdma_addr. ]
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      3f446754
  5. 25 7月, 2008 2 次提交
  6. 23 7月, 2008 4 次提交
  7. 22 7月, 2008 2 次提交
  8. 15 7月, 2008 9 次提交
    • O
      RDMA/cma: Simplify locking needed for serialization of callbacks · de910bd9
      Or Gerlitz 提交于
      The RDMA CM has some logic in place to make sure that callbacks on a
      given CM ID are delivered to the consumer in a serialized manner.
      Specifically it has code to protect against a device removal racing
      with a running callback function.
      
      This patch simplifies this logic by using a mutex per ID instead of a
      wait queue and atomic variable.  This means that cma_disable_remove()
      now is more properly named to cma_disable_callback(), and
      cma_enable_remove() can now be removed because it just would become a
      trivial wrapper around mutex_unlock().
      Signed-off-by: NOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      de910bd9
    • O
      RDMA/addr: Keep pointer to netdevice in struct rdma_dev_addr · 64c5e613
      Or Gerlitz 提交于
      Keep a pointer to the local (src) netdevice in struct rdma_dev_addr,
      and copy it in as part of rdma_copy_addr().  Use rdma_translate_ip()
      in cma_new_conn_id() to reduce some code duplication and also make
      sure the src_dev member gets set.
      
      In a high-availability configuration the netdevice pointer can be used
      by the RDMA CM to align RDMA sessions to use the same links as the IP
      stack does under fail-over and route change cases.
      Signed-off-by: NOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      64c5e613
    • S
      RDMA/core: Add iWARP protocol statistics attributes in sysfs · 7f624d02
      Steve Wise 提交于
      This patch adds a sysfs attribute group called "proto_stats" under
      /sys/class/infiniband/$device/ and populates this group with protocol
      statistics if they exist for a given device.  Currently, only iWARP
      stats are defined, but the code is designed to allow InfiniBand
      protocol stats if they become available.  These stats are per-device
      and more importantly -not- per port.
      
      Details:
      
      - Add union rdma_protocol_stats in ib_verbs.h.  This union allows
        defining transport-specific stats.  Currently only iwarp stats are
        defined.
      
      - Add struct iw_protocol_stats to define the current set of iwarp
        protocol stats.
      
      - Add new ib_device method called get_proto_stats() to return protocol
        statistics.
      
      - Add logic in core/sysfs.c to create iwarp protocol stats attributes
        if the device is an RNIC and has a get_proto_stats() method.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      7f624d02
    • R
      468f2239
    • R
      IB/core: Reset to error QP state transition is not allowed · e5a5e7d5
      Ralph Campbell 提交于
      I was reviewing the QP state transition diagram in the IB 1.2.1 spec
      and the code for qp_state_table[], and noticed that the code allows a
      QP to be modified from IB_QPS_RESET to IB_QPS_ERR whereas the notes
      for figure 124 (pg 457) specifically says that this transition isn't
      allowed.  This is a clarification from earlier versions of the IB
      spec, which were ambiguous in this area and suggested that the RESET
      to ERR transition was allowed.
      
      Fix up the qp_state_table[] to make RESET->ERR not allowed.
      Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      e5a5e7d5
    • S
      RDMA/core: Add memory management extensions support · 00f7ec36
      Steve Wise 提交于
      This patch adds support for the IB "base memory management extension"
      (BMME) and the equivalent iWARP operations (which the iWARP verbs
      mandates all devices must implement).  The new operations are:
      
       - Allocate an ib_mr for use in fast register work requests.
      
       - Allocate/free a physical buffer lists for use in fast register work
         requests.  This allows device drivers to allocate this memory as
         needed for use in posting send requests (eg via dma_alloc_coherent).
      
       - New send queue work requests:
         * send with remote invalidate
         * fast register memory region
         * local invalidate memory region
         * RDMA read with invalidate local memory region (iWARP only)
      
      Consumer interface details:
      
       - A new device capability flag IB_DEVICE_MEM_MGT_EXTENSIONS is added
         to indicate device support for these features.
      
       - New send work request opcodes IB_WR_FAST_REG_MR, IB_WR_LOCAL_INV,
         IB_WR_RDMA_READ_WITH_INV are added.
      
       - A new consumer API function, ib_alloc_mr() is added to allocate
         fast register memory regions.
      
       - New consumer API functions, ib_alloc_fast_reg_page_list() and
         ib_free_fast_reg_page_list() are added to allocate and free
         device-specific memory for fast registration page lists.
      
       - A new consumer API function, ib_update_fast_reg_key(), is added to
         allow the key portion of the R_Key and L_Key of a fast registration
         MR to be updated.  Consumers call this if desired before posting
         a IB_WR_FAST_REG_MR work request.
      
      Consumers can use this as follows:
      
       - MR is allocated with ib_alloc_mr().
      
       - Page list memory is allocated with ib_alloc_fast_reg_page_list().
      
       - MR R_Key/L_Key "key" field is updated with ib_update_fast_reg_key().
      
       - MR made VALID and bound to a specific page list via
         ib_post_send(IB_WR_FAST_REG_MR)
      
       - MR made INVALID via ib_post_send(IB_WR_LOCAL_INV),
         ib_post_send(IB_WR_RDMA_READ_WITH_INV) or an incoming send with
         invalidate operation.
      
       - MR is deallocated with ib_dereg_mr()
      
       - page lists dealloced via ib_free_fast_reg_page_list().
      
      Applications can allocate a fast register MR once, and then can
      repeatedly bind the MR to different physical block lists (PBLs) via
      posting work requests to a send queue (SQ).  For each outstanding
      MR-to-PBL binding in the SQ pipe, a fast_reg_page_list needs to be
      allocated (the fast_reg_page_list is owned by the low-level driver
      from the consumer posting a work request until the request completes).
      Thus pipelining can be achieved while still allowing device-specific
      page_list processing.
      
      The 32-bit fast register memory key/STag is composed of a 24-bit index
      and an 8-bit key.  The application can change the key each time it
      fast registers thus allowing more control over the peer's use of the
      key/STag (ie it can effectively be changed each time the rkey is
      rebound to a page list).
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      00f7ec36
    • R
      RDMA: Remove subversion $Id tags · f3781d2e
      Roland Dreier 提交于
      They don't get updated by git and so they're worse than useless.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f3781d2e
    • M
      IB/sa: Fail requests made while creating new SM AH · 164ba089
      Moni Shoua 提交于
      This patch solves a race that occurs after an event occurs that causes
      the SA query module to flush its SM address handle (AH).  When SM AH
      becomes invalid and needs an update it is handled by the global
      workqueue.  On the other hand this event is also handled in the IPoIB
      driver by queuing work in the ipoib_workqueue that does multicast
      joins.  Although queuing is in the right order, it is done to 2
      different workqueues and so there is no guarantee that the first to be
      queued is the first to be executed.
      
      This causes a problem because IPoIB may end up sending an request to
      the old SM, which will take a long time to time out (since the old SM
      is gone); this leads to a much longer than necessary interruption in
      multicast traffer.
      
      The patch sets the SA query module's SM AH to NULL when the event
      occurs, and until update_sm_ah() is done, any request that needs sm_ah
      fails with -EAGAIN return status.
      
      For consumers, the patch doesn't make things worse.  Before the patch,
      MADs are sent to the wrong SM so the request gets lost.  Consumers can
      be improved if they examine the return code and respond to EAGAIN
      properly but even without an improvement the situation is not getting
      worse.
      Signed-off-by: NMoni Levy <monil@voltaire.com>
      Signed-off-by: NMoni Shoua <monis@voltaire.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      164ba089
    • S
      RDMA: Fix license text · a9474917
      Sean Hefty 提交于
      The license text for several files references a third software license
      that was inadvertently copied in.  Update the license to what was
      intended.  This update was based on a request from HP.
      Signed-off-by: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      a9474917
  9. 12 7月, 2008 1 次提交
  10. 05 7月, 2008 1 次提交
  11. 21 6月, 2008 4 次提交
  12. 19 6月, 2008 1 次提交
  13. 07 6月, 2008 1 次提交
    • R
      IB/umem: Avoid sign problems when demoting npages to integer · 8079ffa0
      Roland Dreier 提交于
      On a 64-bit architecture, if ib_umem_get() is called with a size value
      that is so big that npages is negative when cast to int, then the
      length of the page list passed to get_user_pages(), namely
      
      	min_t(int, npages, PAGE_SIZE / sizeof (struct page *))
      
      will be negative, and get_user_pages() will immediately return 0 (at
      least since 900cf086, "Be more robust about bad arguments in
      get_user_pages()").  This leads to an infinite loop in ib_umem_get(),
      since the code boils down to:
      
      	while (npages) {
      		ret = get_user_pages(...);
      		npages -= ret;
      	}
      
      Fix this by taking the minimum as unsigned longs, so that the value of
      npages is never truncated.
      
      The impact of this bug isn't too severe, since the value of npages is
      checked against RLIMIT_MEMLOCK, so a process would need to have an
      astronomical limit or have CAP_IPC_LOCK to be able to trigger this,
      and such a process could already cause lots of mischief.  But it does
      let buggy userspace code cause a kernel lock-up; for example I hit
      this with code that passes a negative value into a memory registartion
      function where it is promoted to a huge u64 value.
      
      Cc: <stable@kernel.org>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      8079ffa0
  14. 24 5月, 2008 1 次提交
  15. 21 5月, 2008 1 次提交
    • G
      IB: fix race in device_create · 6c06aec2
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Reviewed-by: NRoland Dreier <rolandd@cisco.com>
      Cc: Sean Hefty <sean.hefty@intel.com>
      Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6c06aec2
  16. 29 4月, 2008 1 次提交
    • A
      IB: expand ib_umem_get() prototype · cb9fbc5c
      Arthur Kepner 提交于
      Add a new parameter, dmasync, to the ib_umem_get() prototype.  Use dmasync = 1
      when mapping user-allocated CQs with ib_umem_get().
      Signed-off-by: NArthur Kepner <akepner@sgi.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Jes Sorensen <jes@sgi.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Roland Dreier <rdreier@cisco.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Grant Grundler <grundler@parisc-linux.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cb9fbc5c
  17. 20 4月, 2008 1 次提交
  18. 19 4月, 2008 1 次提交
  19. 17 4月, 2008 6 次提交
    • E
      IB/core: Add support for modify CQ · 2dd57162
      Eli Cohen 提交于
      Add support for modifying CQ parameters for controlling event
      generation moderation.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      2dd57162
    • R
      IB/core: Add support for "send with invalidate" work requests · 0f39cf3d
      Roland Dreier 提交于
      Add a new IB_WR_SEND_WITH_INV send opcode that can be used to mark a
      "send with invalidate" work request as defined in the iWARP verbs and
      the InfiniBand base memory management extensions.  Also put "imm_data"
      and a new "invalidate_rkey" member in a new "ex" union in struct
      ib_send_wr. The invalidate_rkey member can be used to pass in an
      R_Key/STag to be invalidated.  Add this new union to struct
      ib_uverbs_send_wr.  Add code to copy the invalidate_rkey field in
      ib_uverbs_post_send().
      
      Fix up low-level drivers to deal with the change to struct ib_send_wr,
      and just remove the imm_data initialization from net/sunrpc/xprtrdma/,
      since that code never does any send with immediate operations.
      
      Also, move the existing IB_DEVICE_SEND_W_INV flag to a new bit, since
      the iWARP drivers currently in the tree set the bit.  The amso1100
      driver at least will silently fail to honor the IB_SEND_INVALIDATE bit
      if passed in as part of userspace send requests (since it does not
      implement kernel bypass work request queueing).  Remove the flag from
      all existing drivers that set it until we know which ones are OK.
      
      The values chosen for the new flag is not consecutive to avoid clashing
      with flags defined in the XRC patches, which are not merged yet but
      which are already in use and are likely to be merged soon.
      
      This resurrects a patch sent long ago by Mikkel Hagen <mhagen@iol.unh.edu>.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      0f39cf3d
    • D
      IB/core: Check optional verbs before using them · 7ce5eacb
      Dotan Barak 提交于
      Make sure that a device implements the modify_srq and reg_phys_mr
      optional methods before calling them.
      Signed-off-by: NDotan Barak <dotanb@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      7ce5eacb
    • E
      IB/core: Add creation flags to struct ib_qp_init_attr · b846f25a
      Eli Cohen 提交于
      Add a create_flags member to struct ib_qp_init_attr that will allow a
      kernel verbs consumer to create a pass special flags when creating a QP.
      Add a flag value for telling low-level drivers that a QP will be used
      for IPoIB UD LSO.  The create_flags member will also be useful for XRC
      and ehca low-latency QP support.
      
      Since no create_flags handling is implemented yet, add code to all
      low-level drivers to return -EINVAL if create_flags is non-zero.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      b846f25a
    • R
      IB: Use shorter list_splice_init() for brevity · 157de229
      Robert P. J. Day 提交于
      Convert list_splice() + INIT_LIST_HEAD() to the equivalent list_splice_init()
      Signed-off-by: NRobert P. J. Day <rpjday@crashcourse.ca>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      157de229
    • J
      RDMA/iwcm: Test rdma_create_id() for IS_ERR rather than 0 · 10f32065
      Julia Lawall 提交于
      The function rdma_create_id() always returns either a valid pointer or
      a value made with ERR_PTR, so its result should be tested with IS_ERR,
      not with a test for 0.
      
      The problem was found using the following semantic match.
      (http://www.emn.fr/x-info/coccinelle/)
      
      //<smpl>
      @a@
      expression E, E1;
      statement S,S1;
      position p;
      @@
      
      E = rdma_create_id(...)
      ... when != E = E1
      if@p (E) S else S1
      
      @n@
      position a.p;
      expression E,E1;
      statement S,S1;
      @@
      
      E = NULL
      ... when != E = E1
      if@p (E) S else S1
      
      @depends on !n@
      expression E;
      statement S,S1;
      position a.p;
      @@
      
      * if@p (E)
        S else S1
      //</smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      10f32065