1. 01 10月, 2008 1 次提交
    • R
      IPoIB: Use netif_tx_lock() and get rid of private tx_lock, LLTX · 943c246e
      Roland Dreier 提交于
      Currently, IPoIB is an LLTX driver that uses its own IRQ-disabling
      tx_lock.  Not only do we want to get rid of LLTX, this actually causes
      problems because of the skb_orphan() done with this tx_lock held: some
      skb destructors expect to be run with interrupts enabled.
      
      The simplest fix for this is to get rid of the driver-private tx_lock
      and stop using LLTX.  We kill off priv->tx_lock and use
      netif_tx_lock[_bh]() instead; the patch to do this is a tiny bit
      tricky because we need to update places that take priv->lock inside
      the tx_lock to disable IRQs, rather than relying on tx_lock having
      already disabled IRQs.
      
      Also, there are a couple of places where we need to disable BHs to
      make sure we have a consistent context to call netif_tx_lock() (since
      we no longer can use _irqsave() variants), and we also have to change
      ipoib_send_comp_handler() to call drain_tx_cq() through a timer rather
      than directly, because ipoib_send_comp_handler() runs in interrupt
      context and drain_tx_cq() must run in BH context so it can call
      netif_tx_lock().
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      943c246e
  2. 26 9月, 2008 2 次提交
  3. 17 9月, 2008 1 次提交
    • Y
      IPoIB: Fix deadlock on RTNL between bcast join comp and ipoib_stop() · e8224e4b
      Yossi Etigin 提交于
      Taking rtnl_lock in ipoib_mcast_join_complete() causes a deadlock with
      ipoib_stop().  We avoid it by scheduling the piece of code that takes
      the lock on ipoib_workqueue instead of executing it directly.  This
      works because we only flush the ipoib_workqueue with the RTNL not held.
      
      The deadlock happens because ipoib_stop() calls ipoib_ib_dev_down()
      which calls ipoib_mcast_dev_flush(), which calls ipoib_mcast_free(),
      which calls ipoib_mcast_leave(). The latter calls
      ib_sa_free_multicast(), and this waits until the multicast completion
      handler finishes.  This handler is ipoib_mcast_join_complete(), which
      waits for the rtnl_lock(), which was already taken by ipoib_stop().
      
      This bug was introduced in commit a77a57a1 ("IPoIB: Fix deadlock on
      RTNL in ipoib_stop()").
      Signed-off-by: NYossi Etigin <yosefe@voltaire.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      e8224e4b
  4. 20 8月, 2008 1 次提交
    • R
      IPoIB: Fix deadlock on RTNL in ipoib_stop() · a77a57a1
      Roland Dreier 提交于
      Commit c8c2afe3 ("IPoIB: Use rtnl lock/unlock when changing device
      flags") added a call to rtnl_lock() in ipoib_mcast_join_task(), which
      is run from the ipoib_workqueue.  However, ipoib_stop() (which is run
      inside rtnl_lock()) flushes this workqueue, which leads to a deadlock
      if the join task is pending.
      
      Fix this by simply not flushing the workqueue from ipoib_stop().  It
      turns out that we really don't care about workqueue tasks running
      during or after ipoib_stop(), as long as we make sure to flush the
      workqueue before unregistering a netdev.
      
      This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1114>.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      a77a57a1
  5. 09 8月, 2008 1 次提交
  6. 30 7月, 2008 1 次提交
  7. 25 7月, 2008 2 次提交
  8. 23 7月, 2008 1 次提交
  9. 15 7月, 2008 16 次提交
    • D
      netdev: Do not use TX lock to protect address lists. · b9e40857
      David S. Miller 提交于
      Now that we have a specific lock to protect the network
      device unicast and multicast lists, remove extraneous
      grabs of the TX lock in cases where the code only needs
      address list protection.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9e40857
    • D
      netdev: Add netdev->addr_list_lock protection. · e308a5d8
      David S. Miller 提交于
      Add netif_addr_{lock,unlock}{,_bh}() helpers.
      
      Use them to protect operations that operate on or read
      the network device unicast and multicast address lists.
      
      Also use them in cases where the code simply wants to
      block calls into the driver's ->set_rx_mode() and
      ->set_multicast_list() methods.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e308a5d8
    • E
      IPoIB: Double default RX/TX ring sizes · bc3a290b
      Eli Cohen 提交于
      Increase IPoIB ring sizes to twice their original sizes (RX: 128->256,
      TX: 64->128) to act as a shock absorber for high traffic peaks.  With
      the current settings, we have seen cases that there are many calls to
      netif_stop_queue(), which causes degradation in throughput.  Also,
      larger receive buffer sizes help IPoIB in CM mode to avoid experiencing
      RNR NAK conditions due to insufficient receive buffers at the SRQ.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      bc3a290b
    • E
      IPoIB/cm: Reduce connected mode TX object size · e112373f
      Eli Cohen 提交于
      Since IPoIB connected mode does not NETIF_F_SG, we only have one DMA
      mapping per send, so we don't need a mapping[] array.  Define a new
      struct with a single u64 mapping member and use it for the CM tx_ring.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      e112373f
    • E
      IPoIB: Use dev_set_mtu() to change mtu · bd360671
      Eli Cohen 提交于
      When the driver sets the MTU of the net device outside of its
      change_mtu method, it should make use of dev_set_mtu() instead of
      directly setting the mtu field of struct netdevice.  Otherwise
      functions registered to be called upon MTU change will not get called
      (this is done through call_netdevice_notifiers() in dev_set_mtu()).
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      bd360671
    • E
      IPoIB: Use rtnl lock/unlock when changing device flags · c8c2afe3
      Eli Cohen 提交于
      Use of this lock is required to synchronize changes to the netdvice's
      data structs.  Also move the call to ipoib_flush_paths() after the
      modification of the netdevice flags in set_mode().
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      c8c2afe3
    • R
      IPoIB: Get rid of ipoib_mcast_detach() wrapper · 9eae554c
      Roland Dreier 提交于
      ipoib_mcast_detach() does nothing except call ib_detach_mcast(), so just
      use the core API in the one place that does a multicast group detach.
      
      add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-105 (-105)
      function                                     old     new   delta
      ipoib_mcast_leave                            357     319     -38
      ipoib_mcast_detach                            67       -     -67
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      9eae554c
    • E
      IPoIB: Only set Q_Key once: after joining broadcast group · d0de1362
      Eli Cohen 提交于
      The current code will set the Q_Key for any join of a non-sendonly
      multicast group.  The operation involves a modify QP operation, which
      is fairly heavyweight, and is only really required after the join of
      the broadcast group.  Fix this by adding a parameter to ipoib_mcast_attach()
      to control when the Q_Key is set.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      d0de1362
    • E
      IPoIB: Remove priv->mcast_mutex · 5892eff9
      Eli Cohen 提交于
      No need for a mutex around calls to ib_attach_mcast/ib_detach_mcast
      since these operations are synchronized at the HW driver layer.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      5892eff9
    • E
      IPoIB: Remove unused IPOIB_MCAST_STARTED code · c03d4731
      Eli Cohen 提交于
      The IPOIB_MCAST_STARTED flag is not used at all since commit b3e2749b
      ("IPoIB: Don't drop multicast sends when they can be queued"), so
      remove it.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      c03d4731
    • M
      IPoIB: Refresh paths instead of flushing them on SM change events · ee1e2c82
      Moni Shoua 提交于
      The patch tries to solve the problem of device going down and paths being
      flushed on an SM change event. The method is to mark the paths as candidates for
      refresh (by setting the new valid flag to 0), and wait for an ARP
      probe a new path record query.
      
      The solution requires a different and less intrusive handling of SM
      change event. For that, the second argument of the flush function
      changes its meaning from a boolean flag to a level.  In most cases, SM
      failover doesn't cause LID change so traffic won't stop.  In the rare
      cases of LID change, the remote host (the one that hadn't changed its
      LID) will lose connectivity until paths are refreshed. This is no
      worse than the current state.  In fact, preventing the device from
      going down saves packets that otherwise would be lost.
      Signed-off-by: NMoni Levy <monil@voltaire.com>
      Signed-off-by: NMoni Shoua <monis@voltaire.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      ee1e2c82
    • V
      IPoIB: add LRO support · af40da89
      Vladimir Sokolovsky 提交于
      Add "ipoib_use_lro" module parameter to enable LRO and an
      "ipoib_lro_max_aggr" module parameter to set the max number of packets
      to be aggregated.  Make LRO controllable and LRO statistics accessible
      through ethtool.
      Signed-off-by: NVladimir Sokolovsky <vlad@mellanox.co.il>
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      af40da89
    • R
      IPoIB: Use multicast loopback blocking if available · 12406734
      Ron Livne 提交于
      Set IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK for IPoIB's UD QPs if
      supported by the underlying device.  This creates an improvement of up
      to 39% in bandwidth when sending multicast packets with IPoIB, and an
      improvment of 12% in cpu usage.
      Signed-off-by: NRon Livne <ronli@voltaire.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      12406734
    • R
      IPoIB/cm: Fix racy use of receive WR/SGL in ipoib_cm_post_receive_nonsrq() · a7d834c4
      Roland Dreier 提交于
      For devices that don't support SRQs, ipoib_cm_post_receive_nonsrq() is
      called from both ipoib_cm_handle_rx_wc() and ipoib_cm_nonsrq_init_rx(),
      and these two callers are not synchronized against each other.
      However, ipoib_cm_post_receive_nonsrq() always reuses the same receive
      work request and scatter list structures, so multiple callers can end
      up stepping on each other, which leads to posting garbled work
      requests.
      
      Fix this by having the caller pass in the ib_recv_wr and ib_sge
      structures to use, and allocating new local structures in
      ipoib_cm_nonsrq_init_rx().
      
      Based on a patch by Pradeep Satyanarayana <pradeep@us.ibm.com> and
      David Wilder <dwilder@us.ibm.com>, with debugging help from Hoang-Nam
      Nguyen <hnguyen@de.ibm.com>.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      a7d834c4
    • 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
  10. 21 5月, 2008 1 次提交
  11. 01 5月, 2008 1 次提交
    • E
      IB/ipoib: Fix transmit queue stalling forever · 57ce41d1
      Eli Cohen 提交于
      Commit f56bcd80 ("IPoIB: Use separate CQ for UD send completions")
      introduced a bug where the transmit queue could get stopped and never
      woken up.  The problem is that send completions are only polled at the
      end of the xmit function, so if the send queue fills up and the xmit
      path stops the queue, then there is no way for send completions to
      ever get polled, and so the transmit queue stays stopped forever.
      
      Fix this by arming the send CQ just before posting the last send
      request that fills the send queue.  Then, when the completion event
      handler is called, drain the send CQ.  Since it is possible that not
      enough send completions are in the CQ, verify that the the net queue
      has been woken up after draining the send CQ, and if not arm a timer
      and drain again at the timer function.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      57ce41d1
  12. 30 4月, 2008 2 次提交
  13. 24 4月, 2008 1 次提交
  14. 17 4月, 2008 6 次提交
  15. 12 3月, 2008 3 次提交
    • R
      IPoIB: Allocate priv->tx_ring with vmalloc() · 10313cbb
      Roland Dreier 提交于
      Commit 7143740d ("IPoIB: Add send gather support") made struct
      ipoib_tx_buf significantly larger, since the mapping member changed
      from a single u64 to an array with MAX_SKB_FRAGS + 1 entries.  This
      means that allocating tx_rings with kzalloc() may fail because there
      is not enough contiguous memory for the new, much bigger size.  Fix
      this regression by allocating the rings with vmalloc() instead.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      10313cbb
    • R
      IPoIB/cm: Set tx_wr.num_sge in connected mode post_send() · 4200406b
      Roland Dreier 提交于
      Commit 7143740d ("IPoIB: Add send gather support") made it possible
      for tx_wr.num_sge to be != 1 -- this happens if send gather support is
      enabled.  However, the code in the connected mode post_send() function
      assumes the old invariant, namely that tx_wr.num_sge is always 1.  Fix
      this by explicitly setting tx_wr.num_sge to 1 in the CM post_send().
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      4200406b
    • O
      IPoIB: Don't drop multicast sends when they can be queued · b3e2749b
      Or Gerlitz 提交于
      When set_multicast_list() is called the multicast task is restarted
      and the IPOIB_MCAST_STARTED bit is cleared.  As a result for some
      window of time, multicast packets are not transmitted nor queued but
      rather dropped by ipoib_mcast_send().  These dropped packets are
      painful in two cases:
      
       - bonding fail-over which both calls set_multicast_list() on the new
         active slave and sends Gratuitous ARP through that slave.
      
       - IP_DROP_MEMBERSHIP code which both calls set_multicast_list() on the
         device and issues IGMP leave.
      
      In both these cases, depending on the scheduling of the IPoIB
      multicast task, the packets would be dropped.  As a result, in the
      bonding case, the failover would not be detected by the peers until
      their neighbour is renewed the neighbour (which takes a few tens of
      seconds).  In the IGMP case, the IP router doesn't get an IGMP leave
      and would only learn on that from further probes on the group (also a
      delay of at least a few tens of seconds).
      
      Fix this by allowing transmission (or queuing) depending on the
      IPOIB_FLAG_OPER_UP flag instead of the IPOIB_MCAST_STARTED flag.
      Signed-off-by: NOlga Shern <olgas@voltaire.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      b3e2749b