1. 28 3月, 2017 1 次提交
  2. 11 2月, 2017 2 次提交
    • A
      net/act_pedit: Introduce 'add' operation · 853a14ba
      Amir Vadai 提交于
      This command could be useful to inc/dec fields.
      
      For example, to forward any TCP packet and decrease its TTL:
      $ tc filter add dev enp0s9 protocol ip parent ffff: \
          flower ip_proto tcp \
          action pedit munge ip ttl add 0xff pipe \
          action mirred egress redirect dev veth0
      
      In the example above, adding 0xff to this u8 field is actually
      decreasing it by one, since the operation is masked.
      Signed-off-by: NAmir Vadai <amir@vadai.me>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      853a14ba
    • A
      net/act_pedit: Support using offset relative to the conventional network headers · 71d0ed70
      Amir Vadai 提交于
      Extend pedit to enable the user setting offset relative to network
      headers. This change would enable to work with more complex header
      schemes (vs the simple IPv4 case) where setting a fixed offset relative
      to the network header is not enough.
      
      After this patch, the action has information about the exact header type
      and field inside this header. This information could be used later on
      for hardware offloading of pedit.
      
      Backward compatibility was being kept:
      1. Old kernel <-> new userspace
      2. New kernel <-> old userspace
      3. add rule using new userspace <-> dump using old userspace
      4. add rule using old userspace <-> dump using new userspace
      
      When using the extended api, new netlink attributes are being used. This
      way, operation will fail in (1) and (3) - and no malformed rule be added
      or dumped. Of course, new user space that doesn't need the new
      functionality can use the old netlink attributes and operation will
      succeed.
      Since action can support both api's, (2) should work, and it is easy to
      write the new user space to have (4) work.
      
      The action is having a strict check that only header types and commands
      it can handle are accepted. This way future additions will be much
      easier.
      
      Usage example:
      $ tc filter add dev enp0s9 protocol ip parent ffff: \
        flower \
          ip_proto tcp \
          dst_port 80 \
        action pedit munge tcp dport set 8080 pipe \
        action mirred egress redirect dev veth0
      
      Will forward tcp port whose original dest port is 80, while modifying
      the destination port to 8080.
      Signed-off-by: NAmir Vadai <amir@vadai.me>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71d0ed70
  3. 26 7月, 2016 2 次提交
    • W
      net_sched: get rid of struct tcf_common · ec0595cc
      WANG Cong 提交于
      After the previous patch, struct tc_action should be enough
      to represent the generic tc action, tcf_common is not necessary
      any more. This patch gets rid of it to make tc action code
      more readable.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec0595cc
    • W
      net_sched: move tc_action into tcf_common · a85a970a
      WANG Cong 提交于
      struct tc_action is confusing, currently we use it for two purposes:
      1) Pass in arguments and carry out results from helper functions
      2) A generic representation for tc actions
      
      The first one is error-prone, since we need to make sure we don't
      miss anything. This patch aims to get rid of this use, by moving
      tc_action into tcf_common, so that they are allocated together
      in hashtable and can be cast'ed easily.
      
      And together with the following patch, we could really make
      tc_action a generic representation for all tc actions and each
      type of action can inherit from it.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a85a970a
  4. 13 2月, 2014 1 次提交
  5. 23 9月, 2006 1 次提交
    • D
      [PKT_SCHED]: Kill pkt_act.h inlining. · e9ce1cd3
      David S. Miller 提交于
      This was simply making templates of functions and mostly causing a lot
      of code duplication in the classifier action modules.
      
      We solve this more cleanly by having a common "struct tcf_common" that
      hash worker functions contained once in act_api.c can work with.
      
      Callers work with real action objects that have the common struct
      plus their module specific struct members.  You go from a common
      object to the higher level one using a "to_foo()" macro which makes
      use of container_of() to do the dirty work.
      
      This also kills off act_generic.h which was only used by act_simple.c
      and keeping it around was more work than the it's value.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9ce1cd3
  6. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4