1. 08 Apr, 2009 5 commits
    • Chien Tung's avatar
      RDMA/nes: Add wide_ppm_offset parm for switch compatibility · a4849fc1
      Chien Tung authored
      We have observed unstable link with a new BNT switch.
      
      Add wide_ppm_offset parameter to allow the user to control the clock
      ppm offset on the CX4 interface for better compatibility.  Default is
      100ppm, setting it to 1 will increase it to 300ppm.  Change default
      SerDes1 reference clock to external source.
      Signed-off-by: default avatarChien Tung <chien.tin.tung@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      a4849fc1
    • Chien Tung's avatar
      RDMA/nes: Fix SFP+ PHY initialization · 1b949324
      Chien Tung authored
      SFP+ PHY initialization has very long delays, incorrect settings for
      direct attach copper cables, and inconsistent link detection.
      
      Adjust delays to the minimum required by the PHY.  Worst case is now
      less than 4 seconds.  Add new register settings for direct attach
      cables.  Change link detection logic to use two new registers for more
      consistent link state detection.  Reorganize code to shorten line
      length.
      Signed-off-by: default avatarChien Tung <chien.tin.tung@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      1b949324
    • Faisal Latif's avatar
      RDMA/nes: Fix nes_nic_cm_xmit() error handling · 5962c2c8
      Faisal Latif authored
      We are getting crash or hung situation when we are running network
      cable pull tests during RDMA traffic.
      
      In schedule_nes_timer(), we return an error if nes_nic_cm_xmit()
      returns failure.  This is changed to success as skb is being put on
      the timer routines to be processed later.  In send_syn() case, we are
      indicating connect failure once from nes_connect() and the other when
      the rexmit retries expires.
      
      The other issue is skb->users which we are incrementing before calling
      nes_nic_cm_xmit() which calls dev_queue_xmit() but in case of failure
      we are decrementing the skb->users at the same time putting the skb on
      the rexmit path.  Even if dev_queue_xmit() fails, the skb->users is
      decremented already.  We are removing the decrement of skb->users in
      case of failure from both schedule_nes_timer() as well as from
      nes_cm_timer_tick().
      
      There is also extra check in nes_cm_timer_tick() for rexmit failure
      which does a break from the loop is removed.  This causes problem as
      the other nodes have their cm_node->ref_count incremented and are not
      processed.
      Signed-off-by: default avatarFaisal Latif <faisal.latif@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      5962c2c8
    • Faisal Latif's avatar
      RDMA/nes: Fix error handling issues · 79fc3d74
      Faisal Latif authored
      Fix issues found by static code analysis:
      
      (1) Check if cm_node was successfully created for loopback connection.
      
      (2) schedule_nes_timer() does not free up allocated memory after
          encountering an error.  There is a WARN_ON() for this condition.
      
      (3) there is a cm_node->freed flag which is set but not used.
      Reported-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarFaisal Latif <faisal.latif@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      79fc3d74
    • Don Wood's avatar
      RDMA/nes: Fix incorrect casts on 32-bit architectures · 7a5efb62
      Don Wood authored
      The were some incorrect casts to unsigned long that caused 64-bit values
      to be truncated on 32-bit architectures and made the driver pass invalid
      adresses and lengths to the hardware.  The problems were primarily seen
      with kernels with highmem configured but some could show up in
      non-highmem kernels, too.
      Signed-off-by: default avatarDon Wood <donald.e.wood@intel.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      7a5efb62
  2. 28 Mar, 2009 35 commits