1. 12 Dec, 2015 23 commits
  2. 09 Dec, 2015 17 commits
    • Tejun Heo's avatar
      cgroup: fix sock_cgroup_data initialization on earlier compilers · ad2c8c73
      Tejun Heo authored
      sock_cgroup_data is a struct containing an anonymous union.
      sock_cgroup_set_prioidx() and sock_cgroup_set_classid() were
      initializing a field inside the anonymous union as follows.
       struct sock_ccgroup_data skcd_buf = { .val = VAL };
      While this is fine on more recent compilers, gcc-4.4.7 triggers the
      following errors.
       include/linux/cgroup-defs.h: In function ‘sock_cgroup_set_prioidx’:
       include/linux/cgroup-defs.h:619: error: unknown field ‘val’ specified in initializer
       include/linux/cgroup-defs.h:619: warning: missing braces around initializer
       include/linux/cgroup-defs.h:619: warning: (near initialization for ‘skcd_buf.<anonymous>’)
      This is because .val belongs to the anonymous union nested inside the
      struct but the initializer is missing the nesting.  Fix it by adding
      an extra pair of braces.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarAlaa Hleihel <alaa@dev.mellanox.co.il>
      Fixes: bd1060a1
       ("sock, cgroup: add sock->sk_cgroup")
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Julia Lawall's avatar
      chelsio: constify cmac_ops structures · 264a4aca
      Julia Lawall authored
      The cmac_ops structures are never modified, so declare them as const.
      Done with the help of Coccinelle.
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Eric Dumazet's avatar
      bnx2x: remove rx_pkt/rx_calls · 5abe2558
      Eric Dumazet authored
      These fields are updated but never read.
      Remove the overhead.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Eric Dumazet's avatar
      bnx2x: avoid soft lockup in bnx2x_poll() · 4d6acb62
      Eric Dumazet authored
      Under heavy TX load, bnx2x_poll() can loop forever and trigger
      soft lockup bugs.
      A napi poll handler must yield after one TX completion round,
      risk of livelock is too high otherwise.
      Bug is very easy to trigger using a debug build, and udp flood, because
      of added cpu cycles in TX completion, and we do not receive enough
      packets to break the loop.
      Reported-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Ariel Elior <ariel.elior@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Herbert Xu's avatar
      rhashtable: Remove unnecessary wmb for future_tbl · 46c749ea
      Herbert Xu authored
      The patch 9497df88
      Fix reader/rehash race") added a pair of barriers.  In fact the
      wmb is superfluous because every subsequent write to the old or
      new hash table uses rcu_assign_pointer, which itself carriers a
      full barrier prior to the assignment.
      Therefore we may remove the explicit wmb.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • David S. Miller's avatar
      Merge branch 'cxgb4-update-kconfig-and-fixes' · bc22ff53
      David S. Miller authored
      Hariprasad Shenai says:
      Update Kconfig and some fixes for cxgb4
      This series update Kconfig to add description for Chelsio's next
      generation T6 family of adapters, also fixes ethtool stats alignment
      and prevents simultaneous execution of service_ofldq thread, deals with
      queue wrap around and adds some fl counters for debugging purpose and
      device ID for new T5 adapters.
      This patch series has been created against net-next tree and includes
      patches on cxgb4 driver.
      We have included all the maintainers of respective drivers. Kindly review
      the change and let us know in case of any review comments.
      V2: Declare 'service_ofldq_running' as bool in Patch 4/7 ("cxgb4: prevent
          simultaneous execution of service_ofldq()") based on review comment
          by David Miller
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Hariprasad Shenai's avatar
    • Hariprasad Shenai's avatar
      cxgb4: Add FL DMA mapping error and low counter · 70055dd0
      Hariprasad Shenai authored
      Add Free List DMA Mapping Errors to SGE Queue info for
      Free Lists. Add Free List "Low" counter to count the number of times we
      see the number of pointers that we _think_ the hardware sees in the
      Free List below the Egress Threshold.
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Hariprasad Shenai's avatar
      cxgb4: Deal with wrap-around of queue for Work request · 8d0557d2
      Hariprasad Shenai authored
      The WR headers  may not fit within one descriptor.
      So we need to deal with wrap-around here.
      Based on original patch by Pranjal Joshi <pjoshi@chelsio.com>
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Hariprasad Shenai's avatar
      cxgb4: prevent simultaneous execution of service_ofldq() · 126fca64
      Hariprasad Shenai authored
      Change mutual exclusion mechanism to prevent multiple threads of
      execution from running in service_ofldq() at the same time.  The old
      mechanism used an implicit guard on the down-call path and none on the
      restart path and wasn't working. This checking makes the mechanism
      explicit and is much easier to understand as a result.
      Based on original work by Casey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Hariprasad Shenai's avatar
      cxgb4: Use ACCES_ONCE macro to read queue's consumer index · 632be194
      Hariprasad Shenai authored
      Use helper macro ACCESS_ONCE() to load from the SGE status page
      to prevent the compiler loading multiple times.
      Based on original work by Mike Werner <werner@chelsio.com>
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Hariprasad Shenai's avatar
    • Hariprasad Shenai's avatar
    • yankejian's avatar
      net: hns: optimize XGE capability by reducing cpu usage · 9cbe9fd5
      yankejian authored
      here is the patch raising the performance of XGE by:
      1)changes the way page management method for enet momery, and
      2)reduces the count of rmb, and
      3)adds Memory prefetching
      Signed-off-by: default avatarKejian Yan <yankejian@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Tejun Heo's avatar
      sock, cgroup: add sock->sk_cgroup · bd1060a1
      Tejun Heo authored
      In cgroup v1, dealing with cgroup membership was difficult because the
      number of membership associations was unbound.  As a result, cgroup v1
      grew several controllers whose primary purpose is either tagging
      membership or pull in configuration knobs from other subsystems so
      that cgroup membership test can be avoided.
      net_cls and net_prio controllers are examples of the latter.  They
      allow configuring network-specific attributes from cgroup side so that
      network subsystem can avoid testing cgroup membership; unfortunately,
      these are not only cumbersome but also problematic.
      Both net_cls and net_prio aren't properly hierarchical.  Both inherit
      configuration from the parent on creation but there's no interaction
      afterwards.  An ancestor doesn't restrict the behavior in its subtree
      in anyway and configuration changes aren't propagated downwards.
      Especially when combined with cgroup delegation, this is problematic
      because delegatees can mess up whatever network configuration
      implemented at the system level.  net_prio would allow the delegatees
      to set whatever priority value regardless of CAP_NET_ADMIN and net_cls
      the same for classid.
      While it is possible to solve these issues from controller side by
      implementing hierarchical allowable ranges in both controllers, it
      would involve quite a bit of complexity in the controllers and further
      obfuscate network configuration as it becomes even more difficult to
      tell what's actually being configured looking from the network side.
      While not much can be done for v1 at this point, as membership
      handling is sane on cgroup v2, it'd be better to make cgroup matching
      behave like other network matches and classifiers than introducing
      further complications.
      In preparation, this patch updates sock->sk_cgrp_data handling so that
      it points to the v2 cgroup that sock was created in until either
      net_prio or net_cls is used.  Once either of the two is used,
      sock->sk_cgrp_data reverts to its previous role of carrying prioidx
      and classid.  This is to avoid adding yet another cgroup related field
      to struct sock.
      As the mode switching can happen at most once per boot, the switching
      mechanism is aimed at lowering hot path overhead.  It may leak a
      finite, likely small, number of cgroup refs and report spurious
      prioidx or classid on switching; however, dynamic updates of prioidx
      and classid have always been racy and lossy - socks between creation
      and fd installation are never updated, config changes don't update
      existing sockets at all, and prioidx may index with dead and recycled
      cgroup IDs.  Non-critical inaccuracies from small race windows won't
      make any noticeable difference.
      This patch doesn't make use of the pointer yet.  The following patch
      will implement netfilter match for cgroup2 membership.
      v2: Use sock_cgroup_data to avoid inflating struct sock w/ another
          cgroup specific field.
      v3: Add comments explaining why sock_data_prioidx() and
          sock_data_classid() use different fallback values.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Daniel Wagner <daniel.wagner@bmw-carit.de>
      CC: Neil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Tejun Heo's avatar
      net: wrap sock->sk_cgrp_prioidx and ->sk_classid inside a struct · 2a56a1fe
      Tejun Heo authored
      Introduce sock->sk_cgrp_data which is a struct sock_cgroup_data.
      ->sk_cgroup_prioidx and ->sk_classid are moved into it.  The struct
      and its accessors are defined in cgroup-defs.h.  This is to prepare
      for overloading the fields with a cgroup pointer.
      This patch mostly performs equivalent conversions but the followings
      are noteworthy.
      * Equality test before updating classid is removed from
        sock_update_classid().  This shouldn't make any noticeable
        difference and a similar test will be implemented on the helper side
      * sock_update_netprioidx() now takes struct sock_cgroup_data and can
        be moved to netprio_cgroup.h without causing include dependency
        loop.  Moved.
      * The dummy version of sock_update_netprioidx() converted to a static
        inline function while at it.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Tejun Heo's avatar
      netprio_cgroup: limit the maximum css->id to USHRT_MAX · 297dbde1
      Tejun Heo authored
      netprio builds per-netdev contiguous priomap array which is indexed by
      css->id.  The array is allocated using kzalloc() effectively limiting
      the maximum ID supported to some thousand range.  This patch caps the
      maximum supported css->id to USHRT_MAX which should be way above what
      is actually useable.
      This allows reducing sock->sk_cgrp_prioidx to u16 from u32.  The freed
      up part will be used to overload the cgroup related fields.
      sock->sk_cgrp_prioidx's position is swapped with sk_mark so that the
      two cgroup related fields are adjacent.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarDaniel Wagner <daniel.wagner@bmw-carit.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      CC: Neil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>