1. 18 8月, 2015 6 次提交
  2. 14 8月, 2015 5 次提交
    • E
      mac80211: fix BIT position for TDLS WIDE extended cap · 8f9c98df
      Emmanuel Grumbach 提交于
      The bit was not according to ieee80211 specification.
      Fix that.
      Reviewed-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8f9c98df
    • J
      average: provide macro to create static EWMA · 2377799c
      Johannes Berg 提交于
      Having the EWMA parameters stored in the runtime struct imposes
      memory requirements for the constant values that could just be
      inlined in the code. This particularly makes sense if there are
      a lot of such structs, for example in mac80211 in the station
      table where each station has a number of these in an array, and
      there can be many stations.
      
      Provide a macro DECLARE_EWMA() that declares the necessary struct
      and inline functions to access it with the parameters hard-coded;
      using this also means the user no longer needs to 'select AVERAGE'
      as it's entirely self-contained.
      
      In the mac80211 case, on x86-64, this actually slightly *reduces*
      code size, while also saving 80 bytes of runtime memory per sta.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2377799c
    • D
      net: Introduce VRF related flags and helpers · 4e3c8992
      David Ahern 提交于
      Add a VRF_MASTER flag for interfaces and helper functions for determining
      if a device is a VRF_MASTER.
      
      Add link attribute for passing VRF_TABLE id.
      
      Add vrf_ptr to netdevice.
      
      Add various macros for determining if a device is a VRF device, the index
      of the master VRF device and table associated with VRF device.
      Signed-off-by: NShrijeet Mukherjee <shm@cumulusnetworks.com>
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e3c8992
    • A
      net: ipv6 sysctl option to ignore routes when nexthop link is down · 35103d11
      Andy Gospodarek 提交于
      Like the ipv4 patch with a similar title, this adds a sysctl to allow
      the user to change routing behavior based on whether or not the
      interface associated with the nexthop was an up or down link.  The
      default setting preserves the current behavior, but anyone that enables
      it will notice that nexthops on down interfaces will no longer be
      selected:
      
      net.ipv6.conf.all.ignore_routes_with_linkdown = 0
      net.ipv6.conf.default.ignore_routes_with_linkdown = 0
      net.ipv6.conf.lo.ignore_routes_with_linkdown = 0
      ...
      
      When the above sysctls are set, not only will link status be reported to
      userspace, but an indication that a nexthop is dead and will not be used
      is also reported.
      
      1000::/8 via 7000::2 dev p7p1  metric 1024 dead linkdown  pref medium
      1000::/8 via 8000::2 dev p8p1  metric 1024  pref medium
      7000::/8 dev p7p1  proto kernel  metric 256 dead linkdown  pref medium
      8000::/8 dev p8p1  proto kernel  metric 256  pref medium
      9000::/8 via 8000::2 dev p8p1  metric 2048  pref medium
      9000::/8 via 7000::2 dev p7p1  metric 1024 dead linkdown  pref medium
      fe80::/64 dev p7p1  proto kernel  metric 256 dead linkdown  pref medium
      fe80::/64 dev p8p1  proto kernel  metric 256  pref medium
      
      This also adds devconf support and notification when sysctl values
      change.
      
      v2: drop use of rt6i_nhflags since it is not needed right now
      Signed-off-by: NAndy Gospodarek <gospo@cumulusnetworks.com>
      Signed-off-by: NDinesh Dutt <ddutt@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35103d11
    • J
      Add a matching set of device_ functions for determining mac/phy · 4c96b7dc
      Jeremy Linton 提交于
      OF has some helper functions for parsing MAC and PHY settings.
      In cases where the platform is providing this information rather
      than the device itself, there needs to be similar functions for ACPI.
      
      These functions are slightly modified versions of the ones in
      of_net which can use information provided via DT or ACPI.
      Signed-off-by: NJeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c96b7dc
  3. 11 8月, 2015 1 次提交
  4. 10 8月, 2015 4 次提交
  5. 07 8月, 2015 6 次提交
    • J
      net_dbg_ratelimited: turn into no-op when !DEBUG · d92cff89
      Jason A. Donenfeld 提交于
      The pr_debug family of functions turns into a no-op when -DDEBUG is not
      specified, opting instead to call "no_printk", which gets compiled to a
      no-op (but retains gcc's nice warnings about printf-style arguments).
      
      The problem with net_dbg_ratelimited is that it is defined to be a
      variant of net_ratelimited_function, which expands to essentially:
      
          if (net_ratelimit())
              pr_debug(fmt, ...);
      
      When DEBUG is not defined, then this becomes,
      
          if (net_ratelimit())
              ;
      
      This seems benign, except it isn't. Firstly, there's the obvious
      overhead of calling net_ratelimit needlessly, which does quite some book
      keeping for the rate limiting. Given that the pr_debug and
      net_dbg_ratelimited family of functions are sprinkled liberally through
      performance critical code, with developers assuming they'll be compiled
      out to a no-op most of the time, we certainly do not want this needless
      book keeping. Secondly, and most visibly, even though no debug message
      is printed when DEBUG is not defined, if there is a flood of
      invocations, dmesg winds up peppered with messages such as
      "net_ratelimit: 320 callbacks suppressed". This is because our
      aforementioned net_ratelimit() function actually prints this text in
      some circumstances. It's especially odd to see this when there isn't any
      other accompanying debug message.
      
      So, in sum, it doesn't make sense to have this function's current
      behavior, and instead it should match what every other debug family of
      functions in the kernel does with !DEBUG -- nothing.
      
      This patch replaces calls to net_dbg_ratelimited when !DEBUG with
      no_printk, keeping with the idiom of all the other debug print helpers.
      
      Also, though not strictly neccessary, it guards the call with an if (0)
      so that all evaluation of any arguments are sure to be compiled out.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d92cff89
    • G
      net/mlx5_core: Support physical port counters · efea389d
      Gal Pressman 提交于
      Added physical port counters in the following standard formats to
      ethtool statistics:
        - IEEE 802.3
        - RFC2863
        - RFC2819
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      efea389d
    • A
      net/mlx5e: Light-weight netdev open/stop · 5c50368f
      Achiad Shochat 提交于
      Create/destroy TIRs, TISs and flow tables upon PCI probe/remove rather
      than upon the netdev ndo_open/stop.
      
      Upon ndo_stop(), redirect all RX traffic to the (lately introduced)
      "Drop RQ" and then close only the RX/TX rings, leaving the TIRs,
      TISs and flow tables alive.
      Signed-off-by: NAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c50368f
    • A
      net/mlx5_core: Introduce access function to modify RSS/LRO params · d9eea403
      Achiad Shochat 提交于
      To be used by the mlx5 Eth driver in following commit.
      
      This is in preparation for netdev "light-weight" open/stop flow
      change described in previous commit.
      Signed-off-by: NAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d9eea403
    • N
      mm: check __PG_HWPOISON separately from PAGE_FLAGS_CHECK_AT_* · f4c18e6f
      Naoya Horiguchi 提交于
      The race condition addressed in commit add05cec ("mm: soft-offline:
      don't free target page in successful page migration") was not closed
      completely, because that can happen not only for soft-offline, but also
      for hard-offline.  Consider that a slab page is about to be freed into
      buddy pool, and then an uncorrected memory error hits the page just
      after entering __free_one_page(), then VM_BUG_ON_PAGE(page->flags &
      PAGE_FLAGS_CHECK_AT_PREP) is triggered, despite the fact that it's not
      necessary because the data on the affected page is not consumed.
      
      To solve it, this patch drops __PG_HWPOISON from page flag checks at
      allocation/free time.  I think it's justified because __PG_HWPOISON
      flags is defined to prevent the page from being reused, and setting it
      outside the page's alloc-free cycle is a designed behavior (not a bug.)
      
      For recent months, I was annoyed about BUG_ON when soft-offlined page
      remains on lru cache list for a while, which is avoided by calling
      put_page() instead of putback_lru_page() in page migration's success
      path.  This means that this patch reverts a major change from commit
      add05cec about the new refcounting rule of soft-offlined pages, so
      "reuse window" revives.  This will be closed by a subsequent patch.
      Signed-off-by: NNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Dean Nelson <dnelson@redhat.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: David Rientjes <rientjes@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f4c18e6f
    • M
      fs, file table: reinit files_stat.max_files after deferred memory initialisation · 4248b0da
      Mel Gorman 提交于
      Dave Hansen reported the following;
      
      	My laptop has been behaving strangely with 4.2-rc2.  Once I log
      	in to my X session, I start getting all kinds of strange errors
      	from applications and see this in my dmesg:
      
              	VFS: file-max limit 8192 reached
      
      The problem is that the file-max is calculated before memory is fully
      initialised and miscalculates how much memory the kernel is using.  This
      patch recalculates file-max after deferred memory initialisation.  Note
      that using memory hotplug infrastructure would not have avoided this
      problem as the value is not recalculated after memory hot-add.
      
      4.1:             files_stat.max_files = 6582781
      4.2-rc2:         files_stat.max_files = 8192
      4.2-rc2 patched: files_stat.max_files = 6562467
      
      Small differences with the patch applied and 4.1 but not enough to matter.
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Reported-by: NDave Hansen <dave.hansen@intel.com>
      Cc: Nicolai Stange <nicstange@gmail.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Alex Ng <alexng@microsoft.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4248b0da
  6. 01 8月, 2015 1 次提交
  7. 31 7月, 2015 3 次提交
  8. 30 7月, 2015 1 次提交
  9. 29 7月, 2015 2 次提交
  10. 28 7月, 2015 4 次提交
    • R
      cpufreq: Avoid attempts to create duplicate symbolic links · 559ed407
      Rafael J. Wysocki 提交于
      After commit 87549141 (cpufreq: Stop migrating sysfs files on
      hotplug) there is a problem with CPUs that share cpufreq policy
      objects with other CPUs and are initially offline.
      
      Say CPU1 shares a policy with CPU0 which is online and is registered
      first.  As part of the registration process, cpufreq_add_dev() is
      called for it.  It creates the policy object and a symbolic link
      to it from the CPU1's sysfs directory.  If CPU1 is registered
      subsequently and it is offline at that time, cpufreq_add_dev() will
      attempt to create a symbolic link to the policy object for it, but
      that link is present already, so a warning about that will be
      triggered.
      
      To avoid that warning, make cpufreq use an additional CPU mask
      containing related CPUs that are actually present for each policy
      object.  That mask is initialized when the policy object is populated
      after its creation (for the first online CPU using it) and it includes
      CPUs from the "policy CPUs" mask returned by the cpufreq driver's
      ->init() callback that are physically present at that time.  Symbolic
      links to the policy are created only for the CPUs in that mask.
      
      If cpufreq_add_dev() is invoked for an offline CPU, it checks the
      new mask and only creates the symlink if the CPU was not in it (the
      CPU is added to the mask at the same time).
      
      In turn, cpufreq_remove_dev() drops the given CPU from the new mask,
      removes its symlink to the policy object and returns, unless it is
      the CPU owning the policy object.  In that case, the policy object
      is moved to a new CPU's sysfs directory or deleted if the CPU being
      removed was the last user of the policy.
      
      While at it, notice that cpufreq_remove_dev() can't fail, because
      its return value is ignored, so make it ignore return values from
      __cpufreq_remove_dev_prepare() and __cpufreq_remove_dev_finish()
      and prevent these functions from aborting on errors returned by
      __cpufreq_governor().  Also drop the now unused sif argument from
      them.
      
      Fixes: 87549141 (cpufreq: Stop migrating sysfs files on hotplug)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reported-and-tested-by: NRussell King <linux@arm.linux.org.uk>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      559ed407
    • H
      net/mlx4_en: Add support for hardware accelerated 802.1ad vlan · e38af4fa
      Hadar Hen Zion 提交于
      To enable device support in accelerated 802.1ad vlan, the port
      capability "packet has vlan enable" (phv_en) should be set.
      Firmware won't work properly, in case phv_en is not set.
      
      The user can enable "phv_en" port capability with the new ethtool
      private flag phv-bit. The phv-bit private flag default value is OFF,
      users who are interested in 802.1ad hardware acceleration should turn ON
      the phv-bit private flag:
      $ ethtool --set-priv-flags eth1 phv-bit on
      
      Once the private flag is set, the device is ready for 802.1ad vlan
      acceleration.
      
      The user should also change the interface device features and turn on
      "tx-vlan-stag-hw-insert" which is off by default:
      $ ethtool -K eth1  tx-vlan-stag-hw-insert on
      
      "phv-bit" private flag setting is available only for Physical
      Functions(PF), the Virtual Function (VF) will be able to use the feature
      by setting "tx-vlan-stag-hw-insert" ethtool device feature only if the
      feature was enabled by the Hypervisor.
      Signed-off-by: NHadar Hen Zion <hadarh@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e38af4fa
    • H
      net/mlx4: Prepare VLAN macros for 802.1ad Hardware accelerated support · e802f8e4
      Hadar Hen Zion 提交于
      To add Hardware accelerated support in 802.1ad vlan, replace
      Current VLAN macros to CVLAN.
      Replace:
      MLX4_WQE_CTRL_INS_VLAN
      MLX4_CQE_VLAN_PRESENT_MASK
      With:
      MLX4_WQE_CTRL_INS_CVLAN
      MLX4_CQE_CVLAN_PRESENT_MASK
      Signed-off-by: NHadar Hen Zion <hadarh@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e802f8e4
    • H
      net/mlx4_core: Preparations for 802.1ad VLAN support · 77fc29c4
      Hadar Hen Zion 提交于
      mlx4_core preparation to support hardware accelerated 802.1ad VLAN
      device.
      
      To allow 802.1ad accelerated device, "packet has vlan" (phv)
      Firmware capability should be available. Firmware without the
      phv capability won't behave properly and can't support 802.1ad device
      acceleration.
      
      The driver checks the Firmware capability and sets the phv bit
      accordingly in SET_PORT command.
      Signed-off-by: NHadar Hen Zion <hadarh@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      77fc29c4
  11. 27 7月, 2015 6 次提交
    • T
      of: constify drv arg of of_driver_match_device stub · 35068ce8
      Tomeu Vizoso 提交于
      With this change the stub has the same signature as the actual function,
      preventing this compiler warning when building without CONFIG_OF:
      
         drivers/base/property.c: In function 'fwnode_driver_match_device':
      >> drivers/base/property.c:608:38: warning: passing argument 2 of 'of_driver_match_device' discards 'const' qualifier from pointer target type
            return of_driver_match_device(dev, drv);
                                               ^
         In file included from drivers/base/property.c:18:0:
         include/linux/of_device.h:61:19: note: expected 'struct device_driver *' but argument is of type 'const struct device_driver *'
          static inline int of_driver_match_device(struct device *dev,
                            ^
      Signed-off-by: NTomeu Vizoso <tomeu.vizoso@collabora.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      35068ce8
    • A
      net/macb: convert to kernel doc · e018a0cc
      Andy Shevchenko 提交于
      This patch coverts struct description to the kernel doc format. There is no
      functional change.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e018a0cc
    • A
      net/mlx5e: TX latency optimization to save DMA reads · 88a85f99
      Achiad Shochat 提交于
      A regular TX WQE execution involves two or more DMA reads -
      one to fetch the WQE, and another one per WQE gather entry.
      
      These DMA reads obviously increase the TX latency.
      There are two mlx5 mechanisms to bypass these DMA reads:
      1) Inline WQE
      2) Blue Flame (BF)
      
      An inline WQE contains a whole packet, thus saves the DMA read/s
      of the regular WQE gather entry/s. Inline WQE support was already
      added in the previous commit.
      
      A BF WQE is written directly to the device I/O mapped memory, thus
      enables saving the DMA read that fetches the WQE.
      
      The BF WQE I/O write must be in cache line granularity, thus uses
      the CPU write combining mechanism.
      A BF WQE I/O write acts also as a TX doorbell for notifying the
      device of new TX WQEs.
      A BF WQE is written to the same I/O mapped address as the regular TX
      doorbell, thus this address is being mapped twice - once by ioremap()
      and once by io_mapping_map_wc().
      
      While both mechanisms reduce the TX latency, they both consume more CPU
      cycles than a regular WQE:
      - A BF WQE must still be written to host memory, in addition to being
        written directly to the device I/O mapped memory.
      - An inline WQE involves copying the SKB data into it.
      
      To handle this tradeoff, we introduce here a heuristic algorithm that
      strives to avoid using these two mechanisms in case the TX queue is
      being back-pressured by the device, and limit their usage rate otherwise.
      
      An inline WQE will always be "Blue Flamed" (written directly to the
      device I/O mapped memory) while a BF WQE may not be inlined (may contain
      gather entries).
      
      Preliminary testing using netperf UDP_RR shows that the latency goes down
      from 17.5us to 16.9us, while the message rate (tested with pktgen) stays
      the same.
      Signed-off-by: NAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88a85f99
    • S
      net/mlx5e: Allocate DMA coherent memory on reader NUMA node · 311c7c71
      Saeed Mahameed 提交于
      By affinity hints and XPS, each mlx5e channel is assigned a CPU
      core.
      
      Channel DMA coherent memory that is written by the NIC and read
      by SW (e.g CQ buffer) is allocated on the NUMA node of the CPU
      core assigned for the channel.
      
      Channel DMA coherent memory that is written by SW and read by the
      NIC (e.g SQ/RQ buffer) is allocated on the NUMA node of the NIC.
      
      Doorbell record (written by SW and read by the NIC) is an
      exception since it is accessed by SW more frequently.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      311c7c71
    • S
      net/mlx5e: Support ETH_RSS_HASH_XOR · 2be6967c
      Saeed Mahameed 提交于
      The ConnectX-4 HW implements inverted XOR8.
      To make it act as XOR we re-order the HW RSS indirection table.
      
      Set XOR to be the default RSS hash function and add ethtool API to
      control it.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2be6967c
    • N
      lwtunnel: export linux/lwtunnel.h to userspace · e0910bac
      Nicolas Dichtel 提交于
      Note also that include/linux/lwtunnel.h is not needed.
      
      CC: Thomas Graf <tgraf@suug.ch>
      CC: Roopa Prabhu <roopa@cumulusnetworks.com>
      Fixes: 499a2425 ("lwtunnel: infrastructure for handling light weight tunnels like mpls")
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0910bac
  12. 25 7月, 2015 1 次提交