1. 12 8月, 2019 1 次提交
    • H
      net: phy: prepare phylib to deal with PHY's extending Clause 22 · f4069cd7
      Heiner Kallweit 提交于
      The integrated PHY in 2.5Gbps chip RTL8125 is the first (known to me)
      PHY that uses standard Clause 22 for all modes up to 1Gbps and adds
      2.5Gbps control using vendor-specific registers. To use phylib for
      the standard part little extensions are needed:
      - Move most of genphy_config_aneg to a new function
        __genphy_config_aneg that takes a parameter whether restarting
        auto-negotiation is needed (depending on whether content of
        vendor-specific advertisement register changed).
      - Don't clear phydev->lp_advertising in genphy_read_status so that
        we can set non-C22 mode flags before.
      
      Basically both changes mimic the behavior of the equivalent Clause 45
      functions.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4069cd7
  2. 11 8月, 2019 2 次提交
  3. 10 8月, 2019 3 次提交
  4. 09 8月, 2019 3 次提交
  5. 03 8月, 2019 1 次提交
  6. 02 8月, 2019 5 次提交
    • G
      net/mlx5: Add flow counter pool · 558101f1
      Gavi Teitz 提交于
      Add a pool of flow counters, based on flow counter bulks, removing the
      need to allocate a new counter via a costly FW command during the flow
      creation process. The time it takes to acquire/release a flow counter
      is cut from ~50 [us] to ~50 [ns].
      
      The pool is part of the mlx5 driver instance, and provides flow
      counters for aging flows. mlx5_fc_create() was modified to provide
      counters for aging flows from the pool by default, and
      mlx5_destroy_fc() was modified to release counters back to the pool
      for later reuse. If bulk allocation is not supported or fails, and for
      non-aging flows, the fallback behavior is to allocate and free
      individual counters.
      
      The pool is comprised of three lists of flow counter bulks, one of
      fully used bulks, one of partially used bulks, and one of unused
      bulks. Counters are provided from the partially used bulks first, to
      help limit bulk fragmentation.
      
      The pool maintains a threshold, and strives to maintain the amount of
      available counters below it. The pool is increased in size when a
      counter acquisition request is made and there are no available
      counters, and it is decreased in size when the last counter in a bulk
      is released and there are more available counters than the threshold.
      All pool size changes are done in the context of the
      acquiring/releasing process.
      
      The value of the threshold is directly correlated to the amount of
      used counters the pool is providing, while constrained by a hard
      maximum, and is recalculated every time a bulk is allocated/freed.
      This ensures that the pool only consumes large amounts of memory for
      available counters if the pool is being used heavily. When fully
      populated and at the hard maximum, the buffer of available counters
      consumes ~40 [MB].
      Signed-off-by: NGavi Teitz <gavi@mellanox.com>
      Reviewed-by: NVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      558101f1
    • E
      net/mlx5: E-Switch, Verify support QoS element type · 6cedde45
      Eli Cohen 提交于
      Check if firmware supports the requested element type before
      attempting to create the element type.
      In addition, explicitly specify the request element type and tsar type.
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Reviewed-by: NPaul Blakey <paulb@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      6cedde45
    • S
      net/mlx5: Fix offset of tisc bits reserved field · 7761f9ee
      Saeed Mahameed 提交于
      First reserved field is off by one instead of reserved_at_1 it should be
      reserved_at_2, fix that.
      
      Fixes: a12ff35e ("net/mlx5: Introduce TLS TX offload hardware bits and structures")
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      7761f9ee
    • G
      net/mlx5: Add flow counter bulk allocation hardware bits and command · 8536a6bf
      Gavi Teitz 提交于
      Add a handle to invoke the new FW capability of allocating a bulk of
      flow counters.
      Signed-off-by: NGavi Teitz <gavi@mellanox.com>
      Reviewed-by: NVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      8536a6bf
    • G
      net/mlx5: Refactor and optimize flow counter bulk query · 6f06e04b
      Gavi Teitz 提交于
      Towards introducing the ability to allocate bulks of flow counters,
      refactor the flow counter bulk query process, removing functions and
      structs whose names indicated being used for flow counter bulk
      allocation FW commands, despite them actually only being used to
      support bulk querying, and migrate their functionality to correctly
      named functions in their natural location, fs_counters.c.
      
      Additionally, optimize the bulk query process by:
       * Extracting the memory used for the query to mlx5_fc_stats so
         that it is only allocated once, and not for each bulk query.
       * Querying all the counters in one function call.
      Signed-off-by: NGavi Teitz <gavi@mellanox.com>
      Reviewed-by: NVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      6f06e04b
  7. 01 8月, 2019 1 次提交
  8. 31 7月, 2019 7 次提交
  9. 29 7月, 2019 3 次提交
  10. 28 7月, 2019 2 次提交
    • B
      gpio: don't WARN() on NULL descs if gpiolib is disabled · ffe0bbab
      Bartosz Golaszewski 提交于
      If gpiolib is disabled, we use the inline stubs from gpio/consumer.h
      instead of regular definitions of GPIO API. The stubs for 'optional'
      variants of gpiod_get routines return NULL in this case as if the
      relevant GPIO wasn't found. This is correct so far.
      
      Calling other (non-gpio_get) stubs from this header triggers a warning
      because the GPIO descriptor couldn't have been requested. The warning
      however is unconditional (WARN_ON(1)) and is emitted even if the passed
      descriptor pointer is NULL.
      
      We don't want to force the users of 'optional' gpio_get to check the
      returned pointer before calling e.g. gpiod_set_value() so let's only
      WARN on non-NULL descriptors.
      
      Cc: stable@vger.kernel.org
      Reported-by: NClaus H. Stovgaard <cst@phaseone.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      ffe0bbab
    • T
      net: stmmac: Make MDIO bus reset optional · 1a981c05
      Thierry Reding 提交于
      The Tegra EQOS driver already resets the MDIO bus at probe time via the
      reset GPIO specified in the phy-reset-gpios device tree property. There
      is no need to reset the bus again later on.
      
      This avoids the need to query the device tree for the snps,reset GPIO,
      which is not part of the Tegra EQOS device tree bindings. This quiesces
      an error message from the generic bus reset code if it doesn't find the
      snps,reset related delays.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a981c05
  11. 27 7月, 2019 2 次提交
  12. 26 7月, 2019 7 次提交
  13. 25 7月, 2019 3 次提交
    • J
      sched/fair: Use RCU accessors consistently for ->numa_group · cb361d8c
      Jann Horn 提交于
      The old code used RCU annotations and accessors inconsistently for
      ->numa_group, which can lead to use-after-frees and NULL dereferences.
      
      Let all accesses to ->numa_group use proper RCU helpers to prevent such
      issues.
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Fixes: 8c8a743c ("sched/numa: Use {cpu, pid} to create task groups for shared faults")
      Link: https://lkml.kernel.org/r/20190716152047.14424-3-jannh@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      cb361d8c
    • J
      sched/fair: Don't free p->numa_faults with concurrent readers · 16d51a59
      Jann Horn 提交于
      When going through execve(), zero out the NUMA fault statistics instead of
      freeing them.
      
      During execve, the task is reachable through procfs and the scheduler. A
      concurrent /proc/*/sched reader can read data from a freed ->numa_faults
      allocation (confirmed by KASAN) and write it back to userspace.
      I believe that it would also be possible for a use-after-free read to occur
      through a race between a NUMA fault and execve(): task_numa_fault() can
      lead to task_numa_compare(), which invokes task_weight() on the currently
      running task of a different CPU.
      
      Another way to fix this would be to make ->numa_faults RCU-managed or add
      extra locking, but it seems easier to wipe the NUMA fault statistics on
      execve.
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Fixes: 82727018 ("sched/numa: Call task_numa_free() from do_execve()")
      Link: https://lkml.kernel.org/r/20190716152047.14424-1-jannh@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      16d51a59
    • L
      access: avoid the RCU grace period for the temporary subjective credentials · d7852fbd
      Linus Torvalds 提交于
      It turns out that 'access()' (and 'faccessat()') can cause a lot of RCU
      work because it installs a temporary credential that gets allocated and
      freed for each system call.
      
      The allocation and freeing overhead is mostly benign, but because
      credentials can be accessed under the RCU read lock, the freeing
      involves a RCU grace period.
      
      Which is not a huge deal normally, but if you have a lot of access()
      calls, this causes a fair amount of seconday damage: instead of having a
      nice alloc/free patterns that hits in hot per-CPU slab caches, you have
      all those delayed free's, and on big machines with hundreds of cores,
      the RCU overhead can end up being enormous.
      
      But it turns out that all of this is entirely unnecessary.  Exactly
      because access() only installs the credential as the thread-local
      subjective credential, the temporary cred pointer doesn't actually need
      to be RCU free'd at all.  Once we're done using it, we can just free it
      synchronously and avoid all the RCU overhead.
      
      So add a 'non_rcu' flag to 'struct cred', which can be set by users that
      know they only use it in non-RCU context (there are other potential
      users for this).  We can make it a union with the rcu freeing list head
      that we need for the RCU case, so this doesn't need any extra storage.
      
      Note that this also makes 'get_current_cred()' clear the new non_rcu
      flag, in case we have filesystems that take a long-term reference to the
      cred and then expect the RCU delayed freeing afterwards.  It's not
      entirely clear that this is required, but it makes for clear semantics:
      the subjective cred remains non-RCU as long as you only access it
      synchronously using the thread-local accessors, but you _can_ use it as
      a generic cred if you want to.
      
      It is possible that we should just remove the whole RCU markings for
      ->cred entirely.  Only ->real_cred is really supposed to be accessed
      through RCU, and the long-term cred copies that nfs uses might want to
      explicitly re-enable RCU freeing if required, rather than have
      get_current_cred() do it implicitly.
      
      But this is a "minimal semantic changes" change for the immediate
      problem.
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NPaul E. McKenney <paulmck@linux.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Jan Glauber <jglauber@marvell.com>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Jayachandran Chandrasekharan Nair <jnair@marvell.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d7852fbd