1. 22 4月, 2017 1 次提交
    • J
      IB/core: Fix sysfs registration error flow · b312be3d
      Jack Morgenstein 提交于
      The kernel commit cited below restructured ib device management
      so that the device kobject is initialized in ib_alloc_device.
      
      As part of the restructuring, the kobject is now initialized in
      procedure ib_alloc_device, and is later added to the device hierarchy
      in the ib_register_device call stack, in procedure
      ib_device_register_sysfs (which calls device_add).
      
      However, in the ib_device_register_sysfs error flow, if an error
      occurs following the call to device_add, the cleanup procedure
      device_unregister is called. This call results in the device object
      being deleted -- which results in various use-after-free crashes.
      
      The correct cleanup call is device_del -- which undoes device_add
      without deleting the device object.
      
      The device object will then (correctly) be deleted in the
      ib_register_device caller's error cleanup flow, when the caller invokes
      ib_dealloc_device.
      
      Fixes: 55aeed06 ("IB/core: Make ib_alloc_device init the kobject")
      Cc: <stable@vger.kernel.org> # v4.2+
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      b312be3d
  2. 25 1月, 2017 1 次提交
  3. 08 10月, 2016 1 次提交
  4. 12 7月, 2016 1 次提交
  5. 24 6月, 2016 1 次提交
  6. 07 6月, 2016 4 次提交
  7. 27 5月, 2016 1 次提交
    • C
      IB/core: Make device counter infrastructure dynamic · b40f4757
      Christoph Lameter 提交于
      In practice, each RDMA device has a unique set of counters that the
      hardware implements.  Having a central set of counters that they must
      all adhere to is limiting and causes many useful counters to not be
      available.
      
      Therefore we create a dynamic counter registration infrastructure.
      
      The driver must implement a stats structure allocation routine, in
      which the driver must place the directory name it wants, a list of
      names for all of the counters, an array of u64 counters themselves,
      plus a few generic configuration options.
      
      We then implement a core routine to create a sysfs file for each
      of the named stats elements, and a core routine to retrieve the
      stats when any of the sysfs attribute files are read.
      
      To avoid excessive beating on the stats generation routine in the
      drivers, the core code also caches the stats for a short period of
      time so that someone attempting to read all of the stats in a
      given device's directory will not result in a stats generation
      call per file read.
      
      Future work will attempt to standardize just the shared stats
      elements, and possibly add a method to get the stats via netlink
      in addition to sysfs.
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NMark Bloch <markb@mellanox.com>
      Reviewed-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      [ Add caching, make structure names more informative, add i40iw support,
        other significant rewrites from the original patch ]
      b40f4757
  8. 12 2月, 2016 1 次提交
  9. 04 2月, 2016 1 次提交
  10. 20 1月, 2016 2 次提交
  11. 24 12月, 2015 3 次提交
  12. 23 12月, 2015 2 次提交
  13. 22 10月, 2015 1 次提交
  14. 31 8月, 2015 1 次提交
  15. 15 7月, 2015 1 次提交
  16. 13 6月, 2015 1 次提交
    • I
      IB/mad: Add support for additional MAD info to/from drivers · 4cd7c947
      Ira Weiny 提交于
      In order to support alternate sized MADs (and variable sized MADs on OPA
      devices) add in/out MAD size parameters to the process_mad core call.
      
      In addition, add an out_mad_pkey_index to communicate the pkey index the driver
      wishes the MAD stack to use when sending OPA MAD responses.
      
      The out MAD size and the out MAD PKey index are required by the MAD
      stack to generate responses on OPA devices.
      
      Furthermore, the in and out MAD parameters are made generic by specifying them
      as ib_mad_hdr rather than ib_mad.
      
      Drivers are modified as needed and are protected by BUG_ON flags if the MAD
      sizes passed to them is incorrect.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      4cd7c947
  17. 21 5月, 2015 1 次提交
    • I
      IB/core: Add per port immutable struct to ib_device · 7738613e
      Ira Weiny 提交于
      As of commit 5eb620c8 "IB/core: Add helpers for uncached GID and P_Key
      searches"; pkey_tbl_len and gid_tbl_len are immutable data which are stored in
      the ib_device.
      
      The per port core capability flags to be added later are also immutable data to
      be stored in the ib_device object.
      
      In preparation for this create a structure for per port immutable data and
      place the pkey and gid table lengths within this structure.
      
      "get_port_immutable" is added as a mandatory device function to allow the
      drivers to fill in this data.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      7738613e
  18. 06 6月, 2014 1 次提交
    • H
      IB/core: Fix kobject leak on device register error flow · 584482ac
      Haggai Eran 提交于
      The ports kobject isn't being released during error flow in device
      registration.  This patch refactors the ports kobject cleanup into a
      single function called from both the error flow in device registration
      and from the unregistration function.
      
      A couple of attributes aren't being deleted (iw_stats_group, and
      ib_class_attributes).  While this may be handled implicitly by the
      destruction of their kobjects, it seems better to handle all the
      attributes the same way.
      Signed-off-by: NHaggai Eran <haggaie@mellanox.com>
      
      [ Make free_port_list_attributes() static.  - Roland ]
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      584482ac
  19. 05 6月, 2014 2 次提交
  20. 19 1月, 2014 1 次提交
  21. 09 11月, 2013 1 次提交
  22. 04 7月, 2013 1 次提交
  23. 25 6月, 2013 1 次提交
  24. 03 4月, 2012 1 次提交
  25. 06 3月, 2012 1 次提交
  26. 28 2月, 2012 1 次提交
  27. 01 11月, 2011 1 次提交
  28. 12 10月, 2011 1 次提交
  29. 26 10月, 2010 1 次提交
  30. 22 5月, 2010 1 次提交
    • R
      IB/core: Allow device-specific per-port sysfs files · 9a6edb60
      Ralph Campbell 提交于
      Add a new parameter to ib_register_device() so that low-level device
      drivers can pass in a pointer to a callback function that will be
      called for each port that is registered in sysfs.  This allows
      low-level device drivers to create files in
      
          /sys/class/infiniband/<hca>/ports/<N>/
      
      without having to poke through the internals of the RDMA sysfs handling.
      
      There is no need for an unregister function since the kobject
      reference will go to zero when ib_unregister_device() is called.
      Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      9a6edb60
  31. 19 3月, 2010 1 次提交
  32. 08 3月, 2010 1 次提交