1. 10 12月, 2014 1 次提交
  2. 09 12月, 2014 2 次提交
  3. 08 10月, 2014 1 次提交
    • E
      net: better IFF_XMIT_DST_RELEASE support · 02875878
      Eric Dumazet 提交于
      Testing xmit_more support with netperf and connected UDP sockets,
      I found strange dst refcount false sharing.
      
      Current handling of IFF_XMIT_DST_RELEASE is not optimal.
      
      Dropping dst in validate_xmit_skb() is certainly too late in case
      packet was queued by cpu X but dequeued by cpu Y
      
      The logical point to take care of drop/force is in __dev_queue_xmit()
      before even taking qdisc lock.
      
      As Julian Anastasov pointed out, need for skb_dst() might come from some
      packet schedulers or classifiers.
      
      This patch adds new helper to cleanly express needs of various drivers
      or qdiscs/classifiers.
      
      Drivers that need skb_dst() in their ndo_start_xmit() should call
      following helper in their setup instead of the prior :
      
      	dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
      ->
      	netif_keep_dst(dev);
      
      Instead of using a single bit, we use two bits, one being
      eventually rebuilt in bonding/team drivers.
      
      The other one, is permanent and blocks IFF_XMIT_DST_RELEASE being
      rebuilt in bonding/team. Eventually, we could add something
      smarter later.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Julian Anastasov <ja@ssi.bg>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      02875878
  4. 07 10月, 2014 1 次提交
  5. 29 9月, 2014 1 次提交
  6. 14 9月, 2014 2 次提交
  7. 28 4月, 2014 1 次提交
  8. 14 1月, 2014 1 次提交
  9. 19 12月, 2013 2 次提交
  10. 18 12月, 2013 1 次提交
  11. 20 4月, 2013 1 次提交
  12. 15 1月, 2013 1 次提交
  13. 15 8月, 2012 2 次提交
    • E
      userns: Convert cls_flow to work with user namespaces enabled · a6c6796c
      Eric W. Biederman 提交于
      The flow classifier can use uids and gids of the sockets that
      are transmitting packets and do insert those uids and gids
      into the packet classification calcuation.  I don't fully
      understand the details but it appears that we can depend
      on specific uids and gids when making traffic classification
      decisions.
      
      To work with user namespaces enabled map from kuids and kgids
      into uids and gids in the initial user namespace giving raw
      integer values the code can play with and depend on.
      
      To avoid issues of userspace depending on uids and gids in
      packet classifiers installed from other user namespaces
      and getting confused deny all packet classifiers that
      use uids or gids that are not comming from a netlink socket
      in the initial user namespace.
      
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Changli Gao <xiaosuo@gmail.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      a6c6796c
    • E
      net sched: Pass the skb into change so it can access NETLINK_CB · af4c6641
      Eric W. Biederman 提交于
      cls_flow.c plays with uids and gids.  Unless I misread that
      code it is possible for classifiers to depend on the specific uid and
      gid values.  Therefore I need to know the user namespace of the
      netlink socket that is installing the packet classifiers.  Pass
      in the rtnetlink skb so I can access the NETLINK_CB of the passed
      packet.  In particular I want access to sk_user_ns(NETLINK_CB(in_skb).ssk).
      
      Pass in not the user namespace but the incomming rtnetlink skb into
      the the classifier change routines as that is generally the more useful
      parameter.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      af4c6641
  14. 02 4月, 2012 1 次提交
  15. 15 12月, 2011 1 次提交
  16. 29 11月, 2011 1 次提交
  17. 01 11月, 2011 1 次提交
  18. 25 10月, 2011 1 次提交
  19. 06 7月, 2011 1 次提交
  20. 22 6月, 2011 1 次提交
  21. 20 1月, 2011 1 次提交
  22. 14 1月, 2011 1 次提交
    • P
      netfilter: fix Kconfig dependencies · c7066f70
      Patrick McHardy 提交于
      Fix dependencies of netfilter realm match: it depends on NET_CLS_ROUTE,
      which itself depends on NET_SCHED; this dependency is missing from netfilter.
      
      Since matching on realms is also useful without having NET_SCHED enabled and
      the option really only controls whether the tclassid member is included in
      route and dst entries, rename the config option to IP_ROUTE_CLASSID and move
      it outside of traffic scheduling context to get rid of the NET_SCHED dependeny.
      Reported-by: NVladis Kletnieks <Valdis.Kletnieks@vt.edu>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      c7066f70
  23. 22 8月, 2010 1 次提交
  24. 20 8月, 2010 1 次提交
  25. 05 8月, 2010 1 次提交
  26. 18 5月, 2010 1 次提交
  27. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  28. 21 11月, 2009 1 次提交
  29. 03 6月, 2009 1 次提交
  30. 14 11月, 2008 1 次提交
  31. 21 9月, 2008 1 次提交
  32. 15 7月, 2008 1 次提交
  33. 06 2月, 2008 2 次提交
  34. 05 2月, 2008 1 次提交
  35. 01 2月, 2008 1 次提交
    • P
      [NET_SCHED]: Add flow classifier · e5dfb815
      Patrick McHardy 提交于
      Add new "flow" classifier, which is meant to extend the SFQ hashing
      capabilities without hard-coding new hash functions and also allows
      deterministic mappings of keys to classes, replacing some out of tree
      iptables patches like IPCLASSIFY (maps IPs to classes), IPMARK (maps
      IPs to marks, with fw filters to classes), ...
      
      Some examples:
      
      - Classic SFQ hash:
      
        tc filter add ... flow hash \
        	keys src,dst,proto,proto-src,proto-dst divisor 1024
      
      - Classic SFQ hash, but using information from conntrack to work properly in
        combination with NAT:
      
        tc filter add ... flow hash \
        	keys nfct-src,nfct-dst,proto,nfct-proto-src,nfct-proto-dst divisor 1024
      
      - Map destination IPs of 192.168.0.0/24 to classids 1-257:
      
        tc filter add ... flow map \
        	key dst addend -192.168.0.0 divisor 256
      
      - alternatively:
      
        tc filter add ... flow map \
        	key dst and 0xff
      
      - similar, but reverse ordered:
      
        tc filter add ... flow map \
        	key dst and 0xff xor 0xff
      
      Perturbation is currently not supported because we can't reliable kill the
      timer on destruction.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5dfb815