1. 02 7月, 2019 9 次提交
  2. 29 6月, 2019 10 次提交
  3. 27 6月, 2019 11 次提交
  4. 26 6月, 2019 4 次提交
  5. 25 6月, 2019 1 次提交
  6. 24 6月, 2019 3 次提交
    • V
      mlxsw: core: Add support for negative temperature readout · f485cc36
      Vadim Pasternak 提交于
      Extend macros MLXSW_REG_MTMP_TEMP_TO_MC() to allow support of negative
      temperature readout, since chip and others thermal components are
      capable of operating within the negative temperature.
      With no such support negative temperature will be consider as very high
      temperature and it will cause wrong readout and thermal shutdown.
      For negative values 2`s complement is used.
      Tested in chamber.
      Example of chip ambient temperature readout with chamber temperature:
      -10 Celsius:
      temp1:             -6.0C  (highest =  -5.0C)
      -5 Celsius:
      temp1:             -1.0C  (highest =  -1.0C)
      
      v2 (Andrew Lunn):
      * Replace '%u' with '%d' in mlxsw_hwmon_module_temp_show()
      Signed-off-by: NVadim Pasternak <vadimp@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f485cc36
    • V
      mlxsw: core: Add the hottest thermal zone detection · 6f73862f
      Vadim Pasternak 提交于
      When multiple sensors are mapped to the same cooling device, the
      cooling device should be set according the worst sensor from the
      sensors associated with this cooling device.
      
      Provide the hottest thermal zone detection and enforce cooling device
      to follow the temperature trends of the hottest zone only.
      Prevent competition for the cooling device control from others zones,
      by "stable trend" indication. A cooling device will not perform any
      actions associated with a zone with a "stable trend".
      
      When other thermal zone is detected as a hottest, a cooling device is
      to be switched to following temperature trends of new hottest zone.
      
      Thermal zone score is represented by 32 bits unsigned integer and
      calculated according to the next formula:
      For T < TZ<t><i>, where t from {normal trip = 0, high trip = 1, hot
      trip = 2, critical = 3}:
      TZ<i> score = (T + (TZ<t><i> - T) / 2) / (TZ<t><i> - T) * 256 ** j;
      Highest thermal zone score s is set as MAX(TZ<i>score);
      Following this formula, if TZ<i> is in trip point higher than TZ<k>,
      the higher score is to be always assigned to TZ<i>.
      
      For two thermal zones located at the same kind of trip point, the higher
      score will be assigned to the zone which is closer to the next trip
      point. Thus, the highest score will always be assigned objectively to
      the hottest thermal zone.
      
      All the thermal zones initially are to be configured with mode
      "enabled" with the "step_wise" governor.
      Signed-off-by: NVadim Pasternak <vadimp@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f73862f
    • V
      mlxsw: core: Extend thermal core with per inter-connect device thermal zones · f14f4e62
      Vadim Pasternak 提交于
      Add a dedicated thermal zone for each inter-connect device. The
      current temperature is obtained from inter-connect temperature sensor
      and the default trip points are set to the same values as default ASIC
      trip points. These settings could be changed from the user space.
      A cooling device (fan) is bound to all inter-connect devices.
      Signed-off-by: NVadim Pasternak <vadimp@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f14f4e62
  7. 19 6月, 2019 2 次提交
    • J
      xdp: tracking page_pool resources and safe removal · 99c07c43
      Jesper Dangaard Brouer 提交于
      This patch is needed before we can allow drivers to use page_pool for
      DMA-mappings. Today with page_pool and XDP return API, it is possible to
      remove the page_pool object (from rhashtable), while there are still
      in-flight packet-pages. This is safely handled via RCU and failed lookups in
      __xdp_return() fallback to call put_page(), when page_pool object is gone.
      In-case page is still DMA mapped, this will result in page note getting
      correctly DMA unmapped.
      
      To solve this, the page_pool is extended with tracking in-flight pages. And
      XDP disconnect system queries page_pool and waits, via workqueue, for all
      in-flight pages to be returned.
      
      To avoid killing performance when tracking in-flight pages, the implement
      use two (unsigned) counters, that in placed on different cache-lines, and
      can be used to deduct in-flight packets. This is done by mapping the
      unsigned "sequence" counters onto signed Two's complement arithmetic
      operations. This is e.g. used by kernel's time_after macros, described in
      kernel commit 1ba3aab3 and 5a581b36, and also explained in RFC1982.
      
      The trick is these two incrementing counters only need to be read and
      compared, when checking if it's safe to free the page_pool structure. Which
      will only happen when driver have disconnected RX/alloc side. Thus, on a
      non-fast-path.
      
      It is chosen that page_pool tracking is also enabled for the non-DMA
      use-case, as this can be used for statistics later.
      
      After this patch, using page_pool requires more strict resource "release",
      e.g. via page_pool_release_page() that was introduced in this patchset, and
      previous patches implement/fix this more strict requirement.
      
      Drivers no-longer call page_pool_destroy(). Drivers already call
      xdp_rxq_info_unreg() which call xdp_rxq_info_unreg_mem_model(), which will
      attempt to disconnect the mem id, and if attempt fails schedule the
      disconnect for later via delayed workqueue.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Reviewed-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99c07c43
    • J
      mlx5: more strict use of page_pool API · 29b006a6
      Jesper Dangaard Brouer 提交于
      The mlx5 driver is using page_pool, but not for DMA-mapping (currently), and
      is a little too relaxed about returning or releasing page resources, as it
      is not strictly necessary, when not using DMA-mappings.
      
      As this patchset is working towards tracking page_pool resources, to know
      about in-flight frames on shutdown. Then fix places where mlx5 leak
      page_pool resource.
      
      In case of dma_mapping_error, then recycle into page_pool.
      
      In mlx5e_free_rq() moved the page_pool_destroy() call to after the
      mlx5e_page_release() calls, as it is more correct.
      
      In mlx5e_page_release() when no recycle was requested, then release page
      from the page_pool, via page_pool_release_page().
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Reviewed-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29b006a6