1. 15 7月, 2008 9 次提交
    • 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
    • E
      IPoIB: Copy small received SKBs in connected mode · f89271da
      Eli Cohen 提交于
      The connected mode implementation in the IPoIB driver has a large
      overhead in the way SKBs are handled in the receive flow.  It usually
      allocates an SKB with as big as was used in the currently received SKB
      and moves unused fragments from the old SKB to the new one. This
      involves a loop on all the remaining fragments and incurs overhead on
      the CPU.  This patch, for small SKBs, allocates an SKB just large
      enough to contain the received data and copies to it the data from the
      received SKB.  The newly allocated SKB is passed to the stack and the
      old SKB is reposted.
      
      When running netperf, UDP small messages, without this pach I get:
      
          UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
          14.4.3.178 (14.4.3.178) port 0 AF_INET
          Socket  Message  Elapsed      Messages
          Size    Size     Time         Okay Errors   Throughput
          bytes   bytes    secs            #      #   10^6bits/sec
      
          114688     128   10.00     5142034      0     526.31
          114688           10.00     1130489            115.71
      
      With this patch I get both send and receive at ~315 mbps.
      
      The reason that send performance actually slows down is as follows:
      When using this patch, the overhead of the CPU for handling RX packets
      is dramatically reduced.  As a result, we do not experience RNR NAK
      messages from the receiver which cause the connection to be closed and
      reopened again; when the patch is not used, the receiver cannot handle
      the packets fast enough so there is less time to post new buffers and
      hence the mentioned RNR NACKs.  So what happens is that the
      application *thinks* it posted a certain number of packets for
      transmission but these packets are flushed and do not really get
      transmitted.  Since the connection gets opened and closed many times,
      each time netperf gets the CPU time that otherwise would have been
      given to IPoIB to actually transmit the packets.  This can be verified
      when looking at the port counters -- the output of ifconfig and the
      oputput of netperf (this is for the case without the patch):
      
          tx packets
          ==========
          port counter:   1,543,996
          ifconfig:       1,581,426
          netperf:        5,142,034
      
          rx packets
          ==========
          netperf         1,1304,089
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      f89271da
    • 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
    • R
      fd91b1bf
    • E
      IB/mlx4: Optimize QP stamping · 9670e553
      Eli Cohen 提交于
      The idea is that for QPs with fixed size work requests (eg selective
      signaling QPs), before stamping the WQE, we read the value of the DS
      field, which gives the effective size of the descriptor as used in the
      previous post.  Then we stamp only that area, since the rest of the
      descriptor is already stamped.
      
      When initializing the send queue buffer, make sure the DS field is
      initialized to the max descriptor size so that the subsequent stamping
      will be done on the entire descriptor area.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      9670e553
    • 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
    • C
      RDMA/nes: Remove unnecessary memset() · 929555a2
      Christophe Jaillet 提交于
      Remove an explicit memset(..., 0, ...) of a 'listener' structure
      allocated with kzalloc().
      Signed-off-by: NChristophe Jaillet <christophe.jaillet@wanadoo.fr>
      Acked-by: NFaisal Latif <faisal@neteffect.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      929555a2
    • R
      IB/srp: Remove use of cached P_Key/GID queries · 969a60f9
      Roland Dreier 提交于
      The SRP initiator is currently using ib_find_cached_pkey() and
      ib_get_cached_gid() in situations where the uncached ib_find_pkey()
      and ib_query_gid() functions serve just as well: sleeping is allowed
      and performance is not an issue.  Since we want to eliminate the
      cached operations in the long term, convert SRP to use the uncached
      variants.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      969a60f9
  2. 12 7月, 2008 1 次提交
  3. 09 7月, 2008 1 次提交
  4. 05 7月, 2008 1 次提交
  5. 24 6月, 2008 1 次提交
  6. 21 6月, 2008 4 次提交
  7. 19 6月, 2008 1 次提交
  8. 11 6月, 2008 1 次提交
    • R
      RDMA/nes: Fix off-by-one in nes_reg_user_mr() error path · 24797a34
      Roland Dreier 提交于
      nes_reg_user_mr() should fail if page_count becomes >= 1024 * 512
      rather than just testing for strict >, because page_count is
      essentially used as an index into an array with 1024 * 512 entries, so
      allowing the loop to continue with page_count == 1024 * 512 means that
      memory after the end of the array is corrupted.  This leads to a crash
      triggerable by a userspace application that requests registration of a
      too-big region.
      
      Also get rid of the call to pci_free_consistent() here to avoid
      corrupting state with a double free, since the same memory will be
      freed in the code jumped to at reg_user_mr_err.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      24797a34
  9. 10 6月, 2008 1 次提交
    • R
      IB/core: Remove IB_DEVICE_SEND_W_INV capability flag · 4c0283fc
      Roland Dreier 提交于
      In 2.6.26, we added some support for send with invalidate work
      requests, including a device capability flag to indicate whether a
      device supports such requests.  However, the support was incomplete:
      the completion structure was not extended with a field for the key
      contained in incoming send with invalidate requests.
      
      Full support for memory management extensions (send with invalidate,
      local invalidate, fast register through a send queue, etc) is planned
      for 2.6.27.  Since send with invalidate is not very useful by itself,
      just remove the IB_DEVICE_SEND_W_INV bit before the 2.6.26 final
      release; we will add an IB_DEVICE_MEM_MGT_EXTENSIONS bit in 2.6.27,
      which makes things simpler for applications, since they will not have
      quite as confusing an array of fine-grained bits to check.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      4c0283fc
  10. 07 6月, 2008 3 次提交
    • 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
    • R
      IB/ipath: Fix SM trap forwarding · 27676a3e
      Ralph Campbell 提交于
      SM/SMA traps received by the ipath driver should be forwarded to the
      SM if it is running on the host.  The ib_ipath driver was incorrectly
      replying with "bad method."
      Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      27676a3e
    • J
  11. 27 5月, 2008 2 次提交
    • R
      IB/ipath: Fix device capability flags · 03031f71
      Ralph Campbell 提交于
      The driver supports a few features (RNR NAK, port active event, SRQ
      resize) that were not reported in the device capability flags.  This
      patch fixes that.
      Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      03031f71
    • R
      IB/ipath: Avoid test_bit() on u64 SDMA status value · e8ffef73
      Roland Dreier 提交于
      Gabriel C <nix.or.die@googlemail.com> pointed out that when the x86
      bitops are updated to operate on unsigned long, the code in
      sdma_abort_task() will produce warnings:
      
          drivers/infiniband/hw/ipath/ipath_sdma.c: In function 'sdma_abort_task':
          drivers/infiniband/hw/ipath/ipath_sdma.c:267: warning: passing argument 2 of 'constant_test_bit' from incompatible pointer type
      
      and so on, because it uses test_bit() to operation on a u64 value
      (returned by ipath_read_kref64() for a hardware register).
      
      Fix up these warnings by converting the test_bit() operations to &ing
      with appropriate symbolic defines of the bits within the hardware
      register.  This has the benign side-effect of making the code more
      self-documenting as well.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      e8ffef73
  12. 24 5月, 2008 1 次提交
  13. 21 5月, 2008 3 次提交
    • J
      IPoIB: Test for NULL broadcast object in ipiob_mcast_join_finish() · e1d50dce
      Jack Morgenstein 提交于
      We saw a kernel oops in our regression testing when a multicast "join
      finish" occurred just after the interface was -- this is
      <https://bugs.openfabrics.org/show_bug.cgi?id=1040>.  The test
      randomly causes the HCA physical port to go down then up.
      
      The cause of this is that ipoib_mcast_join_finish() processing happen
      just after ipoib_mcast_dev_flush() was invoked (in which case the
      broadcast pointer is NULL).  This patch tests for and handles the case
      where priv->broadcast is NULL.
      
      Cc: <stable@kernel.org>
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      e1d50dce
    • R
      IB/mlx4: Fix creation of kernel QP with max number of send s/g entries · cd155c1c
      Roland Dreier 提交于
      When creating a kernel QP where the consumer asked for a send queue
      with lots of scatter/gater entries, set_kernel_sq_size() incorrectly
      returned an error if the send queue stride is larger than the
      hardware's maximum send work request descriptor size.  This is not a
      problem; the only issue is to make sure that the actual descriptors
      used do not overflow the maximum descriptor size, so check this instead.
      
      Clamp the returned max_send_sge value to be no bigger than what
      query_device returns for the max_sge to avoid confusing hapless users,
      even if the hardware is capable of handling a few more s/g entries.
      
      This bug caused NFS/RDMA mounts to fail when the server adapter used
      the mlx4 driver.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      cd155c1c
    • 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
  14. 17 5月, 2008 3 次提交
  15. 16 5月, 2008 2 次提交
    • R
      IB/ipath: Fix UC receive completion opcode for RDMA WRITE with immediate · df3f0da8
      Ralph Campbell 提交于
      When I fixed the RC receive completion opcode in 2bfc8e9e ("IB/ipath:
      Return the correct opcode for RDMA WRITE with immediate"), I forgot to
      fix UC, which had the same problem for RDMA write with immediate
      returning the wrong opcode.
      Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      df3f0da8
    • R
      IB/ipath: Fix printk format for ipath_sdma_status · cd80ec6f
      Roland Dreier 提交于
      Commit f018c7e1 ("IB/ipath: Change ipath_devdata.ipath_sdma_status to be
      unsigned long") changed ipath_sdma_status to be unsigned long, but left
      a few debug messages that printed it out with a %016llx format, which
      generates the warnings
      
          drivers/infiniband/hw/ipath/ipath_sdma.c:348: warning: format '%016llx' expects type 'long long unsigned int', but argument  3 has type 'long unsigned int'
          drivers/infiniband/hw/ipath/ipath_sdma.c:618: warning: format '%016llx' expects type 'long long unsigned int', but argument  3 has type 'long unsigned int'
      
      Fix this by changing the format used to print out the value to %08lx
      (8 hex digits are now sufficient, because the highest bit used is 31).
      
      Warnings reported by Randy Dunlap <randy.dunlap@oracle.com>.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      cd80ec6f
  16. 14 5月, 2008 6 次提交