1. 24 4月, 2015 2 次提交
  2. 23 4月, 2015 1 次提交
  3. 22 4月, 2015 7 次提交
    • J
      mac80211: allow segmentation offloads · 80616c0d
      Johannes Berg 提交于
      Implement the necessary software segmentation on the normal
      TX path so that fast-xmit can use segmentation offload if
      the hardware (or driver) supports it.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      80616c0d
    • J
      mac80211: allow drivers to support S/G · 680a0dab
      Johannes Berg 提交于
      If drivers want to support S/G (really just gather DMA on TX) then
      we can now easily support this on the fast-xmit path since it just
      needs to write to the ethernet header (and already has a check for
      that being possible.)
      
      However, disallow this on the regular TX path (which has to handle
      fragmentation, software crypto, etc.) by calling skb_linearize().
      
      Also allow the related HIGHDMA since that's not interesting to the
      code in mac80211 at all anyway.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      680a0dab
    • J
      mac80211: allow checksum offload only in fast-xmit · 2d981fdd
      Johannes Berg 提交于
      When we go through the complete TX processing, there are a number
      of things like fragmentation and software crypto that require the
      checksum to be calculated already.
      
      In favour of maintainability, instead of adding the necessary call
      to skb_checksum_help() in all the places that need it, just do it
      once before the regular TX processing.
      
      Right now this only affects the TI wlcore and QCA ath10k drivers
      since they're the only ones using checksum offload. The previous
      commits enabled fast-xmit for them in almost all cases.
      
      For wlcore this even fixes a corner case: when a key fails to be
      programmed to hardware software encryption gets used, encrypting
      frames with a bad checksum.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2d981fdd
    • J
      mac80211: extend fast-xmit to cover IBSS · 3ffd8840
      Johannes Berg 提交于
      IBSS can be supported very easily since it uses the standard station
      authorization state etc. so it just needs to be covered by the header
      building switch statement.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      3ffd8840
    • J
      mac80211: extend fast-xmit for more ciphers · e495c247
      Johannes Berg 提交于
      When crypto is offloaded then in some cases it's all handled
      by the device, and in others only some space for the IV must
      be reserved in the frame. Handle both of these cases in the
      fast-xmit path, up to a limit of 18 bytes of space for IVs.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e495c247
    • J
      mac80211: extend fast-xmit to driver fragmentation · 725b812c
      Johannes Berg 提交于
      If the driver handles fragmentation then it wouldn't
      be done in software so we can still use the fast-xmit
      path in that case.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      725b812c
    • J
      mac80211: add TX fastpath · 17c18bf8
      Johannes Berg 提交于
      In order to speed up mac80211's TX path, add the "fast-xmit" cache
      that will cache the data frame 802.11 header and other data to be
      able to build the frame more quickly. This cache is rebuilt when
      external triggers imply changes, but a lot of the checks done per
      packet today are simplified away to the check for the cache.
      
      There's also a more detailed description in the code.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      17c18bf8
  4. 20 4月, 2015 2 次提交
    • J
      mac80211: lock rate control · 35c347ac
      Johannes Berg 提交于
      Both minstrel (reported by Sven Eckelmann) and the iwlwifi rate
      control aren't properly taking concurrency into account. It's
      likely that the same is true for other rate control algorithms.
      
      In the case of minstrel this manifests itself in crashes when an
      update and other data access are run concurrently, for example
      when the stations change bandwidth or similar. In iwlwifi, this
      can cause firmware crashes.
      
      Since fixing all rate control algorithms will be very difficult,
      just provide locking for invocations. This protects the internal
      data structures the algorithms maintain.
      
      I've manipulated hostapd to test this, by having it change its
      advertised bandwidth roughly ever 150ms. At the same time, I'm
      running a flood ping between the client and the AP, which causes
      this race of update vs. get_rate/status to easily happen on the
      client. With this change, the system survives this test.
      Reported-by: NSven Eckelmann <sven@open-mesh.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      35c347ac
    • B
      mac80211: introduce plink lock for plink fields · 48bf6bed
      Bob Copeland 提交于
      The mesh plink code uses sta->lock to serialize access to the
      plink state fields between the peer link state machine and the
      peer link timer.  Some paths (e.g. those involving
      mps_qos_null_tx()) unfortunately hold this spinlock across
      frame tx, which is soon to be disallowed.  Add a new spinlock
      just for plink access.
      Signed-off-by: NBob Copeland <me@bobcopeland.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      48bf6bed
  5. 18 4月, 2015 5 次提交
  6. 17 4月, 2015 5 次提交
  7. 16 4月, 2015 2 次提交
    • R
      lib/string_helpers.c: change semantics of string_escape_mem · 41416f23
      Rasmus Villemoes 提交于
      The current semantics of string_escape_mem are inadequate for one of its
      current users, vsnprintf().  If that is to honour its contract, it must
      know how much space would be needed for the entire escaped buffer, and
      string_escape_mem provides no way of obtaining that (short of allocating a
      large enough buffer (~4 times input string) to let it play with, and
      that's definitely a big no-no inside vsnprintf).
      
      So change the semantics for string_escape_mem to be more snprintf-like:
      Return the size of the output that would be generated if the destination
      buffer was big enough, but of course still only write to the part of dst
      it is allowed to, and (contrary to snprintf) don't do '\0'-termination.
      It is then up to the caller to detect whether output was truncated and to
      append a '\0' if desired.  Also, we must output partial escape sequences,
      otherwise a call such as snprintf(buf, 3, "%1pE", "\123") would cause
      printf to write a \0 to buf[2] but leaving buf[0] and buf[1] with whatever
      they previously contained.
      
      This also fixes a bug in the escaped_string() helper function, which used
      to unconditionally pass a length of "end-buf" to string_escape_mem();
      since the latter doesn't check osz for being insanely large, it would
      happily write to dst.  For example, kasprintf(GFP_KERNEL, "something and
      then %pE", ...); is an easy way to trigger an oops.
      
      In test-string_helpers.c, the -ENOMEM test is replaced with testing for
      getting the expected return value even if the buffer is too small.  We
      also ensure that nothing is written (by relying on a NULL pointer deref)
      if the output size is 0 by passing NULL - this has to work for
      kasprintf("%pE") to work.
      
      In net/sunrpc/cache.c, I think qword_add still has the same semantics.
      Someone should definitely double-check this.
      
      In fs/proc/array.c, I made the minimum possible change, but longer-term it
      should stop poking around in seq_file internals.
      
      [andriy.shevchenko@linux.intel.com: simplify qword_add]
      [andriy.shevchenko@linux.intel.com: add missed curly braces]
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      41416f23
    • I
      kernel: conditionally support non-root users, groups and capabilities · 2813893f
      Iulia Manda 提交于
      There are a lot of embedded systems that run most or all of their
      functionality in init, running as root:root.  For these systems,
      supporting multiple users is not necessary.
      
      This patch adds a new symbol, CONFIG_MULTIUSER, that makes support for
      non-root users, non-root groups, and capabilities optional.  It is enabled
      under CONFIG_EXPERT menu.
      
      When this symbol is not defined, UID and GID are zero in any possible case
      and processes always have all capabilities.
      
      The following syscalls are compiled out: setuid, setregid, setgid,
      setreuid, setresuid, getresuid, setresgid, getresgid, setgroups,
      getgroups, setfsuid, setfsgid, capget, capset.
      
      Also, groups.c is compiled out completely.
      
      In kernel/capability.c, capable function was moved in order to avoid
      adding two ifdef blocks.
      
      This change saves about 25 KB on a defconfig build.  The most minimal
      kernels have total text sizes in the high hundreds of kB rather than
      low MB.  (The 25k goes down a bit with allnoconfig, but not that much.
      
      The kernel was booted in Qemu.  All the common functionalities work.
      Adding users/groups is not possible, failing with -ENOSYS.
      
      Bloat-o-meter output:
      add/remove: 7/87 grow/shrink: 19/397 up/down: 1675/-26325 (-24650)
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NIulia Manda <iulia.manda21@gmail.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2813893f
  8. 15 4月, 2015 1 次提交
    • D
      mm: remove GFP_THISNODE · 4167e9b2
      David Rientjes 提交于
      NOTE: this is not about __GFP_THISNODE, this is only about GFP_THISNODE.
      
      GFP_THISNODE is a secret combination of gfp bits that have different
      behavior than expected.  It is a combination of __GFP_THISNODE,
      __GFP_NORETRY, and __GFP_NOWARN and is special-cased in the page
      allocator slowpath to fail without trying reclaim even though it may be
      used in combination with __GFP_WAIT.
      
      An example of the problem this creates: commit e97ca8e5 ("mm: fix
      GFP_THISNODE callers and clarify") fixed up many users of GFP_THISNODE
      that really just wanted __GFP_THISNODE.  The problem doesn't end there,
      however, because even it was a no-op for alloc_misplaced_dst_page(),
      which also sets __GFP_NORETRY and __GFP_NOWARN, and
      migrate_misplaced_transhuge_page(), where __GFP_NORETRY and __GFP_NOWAIT
      is set in GFP_TRANSHUGE.  Converting GFP_THISNODE to __GFP_THISNODE is a
      no-op in these cases since the page allocator special-cases
      __GFP_THISNODE && __GFP_NORETRY && __GFP_NOWARN.
      
      It's time to just remove GFP_THISNODE entirely.  We leave __GFP_THISNODE
      to restrict an allocation to a local node, but remove GFP_THISNODE and
      its obscurity.  Instead, we require that a caller clear __GFP_WAIT if it
      wants to avoid reclaim.
      
      This allows the aforementioned functions to actually reclaim as they
      should.  It also enables any future callers that want to do
      __GFP_THISNODE but also __GFP_NORETRY && __GFP_NOWARN to reclaim.  The
      rule is simple: if you don't want to reclaim, then don't set __GFP_WAIT.
      
      Aside: ovs_flow_stats_update() really wants to avoid reclaim as well, so
      it is unchanged.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Christoph Lameter <cl@linux.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Pravin Shelar <pshelar@nicira.com>
      Cc: Jarno Rajahalme <jrajahalme@nicira.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4167e9b2
  9. 14 4月, 2015 13 次提交
  10. 13 4月, 2015 2 次提交