1. 07 May, 2007 10 commits
    • Roland Dreier's avatar
      IPoIB: Convert to NAPI · 8d1cc86a
      Roland Dreier authored
      Convert the IP-over-InfiniBand network device driver over to using
      NAPI to handle completions for the main CQ.  This covers all receives
      as well as datagram mode sends; send completions for connected mode
      connections are still handled from interrupt context.
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      8d1cc86a
    • Roland Dreier's avatar
      IB: Return "maybe missed event" hint from ib_req_notify_cq() · ed23a727
      Roland Dreier authored
      The semantics defined by the InfiniBand specification say that
      completion events are only generated when a completions is added to a
      completion queue (CQ) after completion notification is requested.  In
      other words, this means that the following race is possible:
      
      	while (CQ is not empty)
      		ib_poll_cq(CQ);
      	// new completion is added after while loop is exited
      	ib_req_notify_cq(CQ);
      	// no event is generated for the existing completion
      
      To close this race, the IB spec recommends doing another poll of the
      CQ after requesting notification.
      
      However, it is not always possible to arrange code this way (for
      example, we have found that NAPI for IPoIB cannot poll after
      requesting notification).  Also, some hardware (eg Mellanox HCAs)
      actually will generate an event for completions added before the call
      to ib_req_notify_cq() -- which is allowed by the spec, since there's
      no way for any upper-layer consumer to know exactly when a completion
      was really added -- so the extra poll of the CQ is just a waste.
      
      Motivated by this, we add a new flag "IB_CQ_REPORT_MISSED_EVENTS" for
      ib_req_notify_cq() so that it can return a hint about whether the a
      completion may have been added before the request for notification.
      The return value of ib_req_notify_cq() is extended so:
      
      	 < 0	means an error occurred while requesting notification
      	== 0	means notification was requested successfully, and if
      		IB_CQ_REPORT_MISSED_EVENTS was passed in, then no
      		events were missed and it is safe to wait for another
      		event.
      	 > 0	is only returned if IB_CQ_REPORT_MISSED_EVENTS was
      		passed in.  It means that the consumer must poll the
      		CQ again to make sure it is empty to avoid the race
      		described above.
      
      We add a flag to enable this behavior rather than turning it on
      unconditionally, because checking for missed events may incur
      significant overhead for some low-level drivers, and consumers that
      don't care about the results of this test shouldn't be forced to pay
      for the test.
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      ed23a727
    • Michael S. Tsirkin's avatar
      IB: Add CQ comp_vector support · f4fd0b22
      Michael S. Tsirkin authored
      Add a num_comp_vectors member to struct ib_device and extend
      ib_create_cq() to pass in a comp_vector parameter -- this parallels
      the userspace libibverbs API.  Update all hardware drivers to set
      num_comp_vectors to 1 and have all ULPs pass 0 for the comp_vector
      value.  Pass the value of num_comp_vectors to userspace rather than
      hard-coding a value of 1.
      
      We want multiple CQ event vector support (via MSI-X or similar for
      adapters that can generate multiple interrupts), but it's not clear
      how many vectors we want, or how we want to deal with policy issues
      such as how to decide which vector to use or how to set up interrupt
      affinity.  This patch is useful for experimenting, since no core
      changes will be necessary when updating a driver to support multiple
      vectors, and we know that we want to make at least these changes
      anyway.
      Signed-off-by: default avatarMichael S. Tsirkin <mst@dev.mellanox.co.il>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      f4fd0b22
    • Ralph Campbell's avatar
      IB/ipath: Fix a race condition when generating ACKs · 154257f3
      Ralph Campbell authored
      Fix a problem where simple ACKs can be sent ahead of RDMA read
      responses thus implicitly NAKing the RDMA read.
      Signed-off-by: default avatarRalph Campbell <ralph.cambpell@qlogic.com>
      Signed-off-by: default avatarRobert Walsh <robert.walsh@qlogic.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      154257f3
    • Ralph Campbell's avatar
      IB/ipath: Fix two more spin lock problems · 6ed89b95
      Ralph Campbell authored
      Fix a missing unlock in ipath_rc_rcv_resp() and remove an extra unlock
      from ipath_rc_rcv_error().
      Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      6ed89b95
    • Roland Dreier's avatar
      IB/fmr_pool: Add prefix to all printks · 1a70a05d
      Roland Dreier authored
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      1a70a05d
    • Roland Dreier's avatar
      IB/srp: Set proc_name · b7f008fd
      Roland Dreier authored
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      b7f008fd
    • Ishai Rabinovitz's avatar
      IB/srp: Add orig_dgid sysfs attribute to scsi_host · 3633b3d0
      Ishai Rabinovitz authored
      Add an orig_dgid attribute in sysfs for SRP scsi_hosts, so that
      userspace can tell what the original dgid value written to the
      add_target file was, even if the connection is redirected to a
      different port while connecting.
      Signed-off-by: default avatarIshai Rabinovitz <ishai@mellanox.co.il>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      3633b3d0
    • Michael S. Tsirkin's avatar
      IPoIB/cm: Don't crash if remote side uses one QP for both directions · d6ef7d68
      Michael S. Tsirkin authored
      The IPoIB CM spec allows the use of a single connection in both
      active->passive and passive->active directions.  The current Linux
      code uses one connection for both directions, but if another node only
      uses one connection for both directions, we oops when we try to look
      up the passive connection.  Fix by checking that qp_context is
      non-NULL before dereferencing it.
      Signed-off-by: default avatarMichael S. Tsirkin <mst@dev.mellanox.co.il>
      d6ef7d68
    • Steve Wise's avatar
      RDMA/cxgb3: Support for new abort logic · aff9e39d
      Steve Wise authored
      The HW now posts 2 ABORT_RPL and/or PEER_ABORT_REQ messages.  We need
      to handle them by silenty dropping the 1st but mark that we're ready
      for the final message.  This plugs some close races between the uP and
      HW.  Also update the minimum required firmware version.
      Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      aff9e39d
  2. 01 May, 2007 8 commits
  3. 28 Apr, 2007 3 commits
    • Linus Torvalds's avatar
      Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 · b9099ff6
      Linus Torvalds authored
      * 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
        sis900: Allocate rx replacement buffer before rx operation
        usb-net/pegasus: simplify carrier detection
      b9099ff6
    • Neil Horman's avatar
      sis900: Allocate rx replacement buffer before rx operation · dc5a1449
      Neil Horman authored
      Just found a hole in my last patch.  It was reported to me that shortly after we
      integrated this patch.  The report was of an oops that took place inside of
      netif_rx when using the sis900 driver.  Looking at my origional patch I noted
      that there was a spot between the new skb_alloc and the refill_rx_ring label
      where skb got reassigned to the pointer currently held in the rx_ring for the
      purposes of receiveing the frame.  The result of this is however that the buffer
      that gets passed to netif_rx (if it is called), then gets placed right back into
      the rx_ring.  So if you receive frames fast enough the skb being processed by
      the network stack can get corrupted.  The reporter is testing out the fix I've
      written for this below (I'm not near my hardware at the moment to test myself),
      but I wanted to post it for review ASAP.  I'll post test results when I hear
      them, but I think this is a pretty straightforward fix.  It just uses a separate
      pointer to do the rx operation, so that we don't improperly reassign the pointer
      that we use to refill the rx ring.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      dc5a1449
    • Dan Williams's avatar
      usb-net/pegasus: simplify carrier detection · 1764f150
      Dan Williams authored
      Simplify pegasus carrier detection; rely only on the periodic MII
      polling.  Reverts pieces of c43c49bd.
      Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      1764f150
  4. 27 Apr, 2007 19 commits