1. 27 7月, 2018 2 次提交
  2. 23 7月, 2018 1 次提交
    • J
      nfp: avoid buffer leak when FW communication fails · 07300f77
      Jakub Kicinski 提交于
      After device is stopped we reset the rings by moving all free buffers
      to positions [0, cnt - 2], and clear the position cnt - 1 in the ring.
      We then proceed to clear the read/write pointers.  This means that if
      we try to reset the ring again the code will assume that the next to
      fill buffer is at position 0 and swap it with cnt - 1.  Since we
      previously cleared position cnt - 1 it will lead to leaking the first
      buffer and leaving ring in a bad state.
      
      This scenario can only happen if FW communication fails, in which case
      the ring will never be used again, so the fact it's in a bad state will
      not be noticed.  Buffer leak is the only problem.  Don't try to move
      buffers in the ring if the read/write pointers indicate the ring was
      never used or have already been reset.
      
      nfp_net_clear_config_and_disable() is now fully idempotent.
      
      Found by code inspection, FW communication failures are very rare,
      and reconfiguring a live device is not common either, so it's unlikely
      anyone has ever noticed the leak.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      07300f77
  3. 18 7月, 2018 1 次提交
  4. 14 7月, 2018 4 次提交
  5. 30 6月, 2018 2 次提交
  6. 13 6月, 2018 2 次提交
    • J
      nfp: remove phys_port_name on flower's vNIC · fe06a64e
      Jakub Kicinski 提交于
      .ndo_get_phys_port_name was recently extended to support multi-vNIC
      FWs.  These are firmwares which can have more than one vNIC per PF
      without associated port (e.g. Adaptive Buffer Management FW), therefore
      we need a way of distinguishing the vNICs.  Unfortunately, it's too
      late to make flower use the same naming.  Flower users may depend on
      .ndo_get_phys_port_name returning -EOPNOTSUPP, for example the name
      udev gave the PF vNIC was just the bare PCI device-based name before
      the change, and will have 'nn0' appended after.
      
      To ensure flower's vNIC doesn't have phys_port_name attribute, add
      a flag to vNIC struct and set it in flower code.  New projects will
      not set the flag adhere to the naming scheme from the start.
      
      Fixes: 51c1df83 ("nfp: assign vNIC id as phys_port_name of vNICs which are not ports")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fe06a64e
    • J
      nfp: include all ring counters in interface stats · 29f534c4
      Jakub Kicinski 提交于
      We are gathering software statistics on per-ring basis.
      .ndo_get_stats64 handler adds the rings up.  Unfortunately
      we are currently only adding up active rings, which means
      that if user decreases the number of active rings the
      statistics from deactivated rings will no longer be counted
      and total interface statistics may go backwards.
      
      Always sum all possible rings, the stats are allocated
      statically for max number of rings, so we don't have to
      worry about them being removed.  We could add the stats
      up when user changes the ring count, but it seems unnecessary..
      Adding up inactive rings will be very quick since no datapath
      will be touching them.
      
      Fixes: 164d1e9e ("nfp: add support for ethtool .set_channels")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29f534c4
  7. 29 5月, 2018 2 次提交
  8. 24 5月, 2018 1 次提交
  9. 19 4月, 2018 1 次提交
  10. 04 4月, 2018 1 次提交
  11. 30 3月, 2018 1 次提交
  12. 08 2月, 2018 3 次提交
  13. 23 1月, 2018 1 次提交
  14. 20 1月, 2018 5 次提交
  15. 15 1月, 2018 1 次提交
  16. 11 1月, 2018 1 次提交
    • J
      nfp: always unmask aux interrupts at init · fc233650
      Jakub Kicinski 提交于
      The link state and exception interrupts may be masked when we probe.
      The firmware should in theory prevent sending (and automasking) those
      interrupts if the device is disabled, but if my reading of the FW code
      is correct there are firmwares out there with race conditions in this
      area.  The interrupt may also be masked if previous driver which used
      the device was malfunctioning and we didn't load the FW (there is no
      other good way to comprehensively reset the PF).
      
      Note that FW unmasks the data interrupts by itself when vNIC is
      enabled, such helpful operation is not performed for LSC/EXN interrupts.
      
      Always unmask the auxiliary interrupts after request_irq().  On the
      remove path add missing PCI write flush before free_irq().
      
      Fixes: 4c352362 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc233650
  17. 10 1月, 2018 3 次提交
  18. 06 1月, 2018 2 次提交
  19. 18 12月, 2017 1 次提交
  20. 03 12月, 2017 2 次提交
  21. 16 11月, 2017 1 次提交
    • M
      mm: remove __GFP_COLD · 453f85d4
      Mel Gorman 提交于
      As the page free path makes no distinction between cache hot and cold
      pages, there is no real useful ordering of pages in the free list that
      allocation requests can take advantage of.  Juding from the users of
      __GFP_COLD, it is likely that a number of them are the result of copying
      other sites instead of actually measuring the impact.  Remove the
      __GFP_COLD parameter which simplifies a number of paths in the page
      allocator.
      
      This is potentially controversial but bear in mind that the size of the
      per-cpu pagelists versus modern cache sizes means that the whole per-cpu
      list can often fit in the L3 cache.  Hence, there is only a potential
      benefit for microbenchmarks that alloc/free pages in a tight loop.  It's
      even worse when THP is taken into account which has little or no chance
      of getting a cache-hot page as the per-cpu list is bypassed and the
      zeroing of multiple pages will thrash the cache anyway.
      
      The truncate microbenchmarks are not shown as this patch affects the
      allocation path and not the free path.  A page fault microbenchmark was
      tested but it showed no sigificant difference which is not surprising
      given that the __GFP_COLD branches are a miniscule percentage of the
      fault path.
      
      Link: http://lkml.kernel.org/r/20171018075952.10627-9-mgorman@techsingularity.netSigned-off-by: NMel Gorman <mgorman@techsingularity.net>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      453f85d4
  22. 05 11月, 2017 2 次提交