1. 08 8月, 2017 3 次提交
  2. 05 8月, 2017 7 次提交
  3. 01 6月, 2017 1 次提交
  4. 26 5月, 2017 1 次提交
  5. 18 5月, 2017 3 次提交
  6. 18 2月, 2017 1 次提交
  7. 16 2月, 2017 1 次提交
  8. 11 2月, 2017 1 次提交
  9. 04 2月, 2017 1 次提交
  10. 26 1月, 2017 1 次提交
    • J
      net sched actions: Add support for user cookies · 1045ba77
      Jamal Hadi Salim 提交于
      Introduce optional 128-bit action cookie.
      Like all other cookie schemes in the networking world (eg in protocols
      like http or existing kernel fib protocol field, etc) the idea is to save
      user state that when retrieved serves as a correlator. The kernel
      _should not_ intepret it.  The user can store whatever they wish in the
      128 bits.
      
      Sample exercise(showing variable length use of cookie)
      
      .. create an accept action with cookie a1b2c3d4
      sudo $TC actions add action ok index 1 cookie a1b2c3d4
      
      .. dump all gact actions..
      sudo $TC -s actions ls action gact
      
          action order 0: gact action pass
           random type none pass val 0
           index 1 ref 1 bind 0 installed 5 sec used 5 sec
          Action statistics:
          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
          backlog 0b 0p requeues 0
          cookie a1b2c3d4
      
      .. bind the accept action to a filter..
      sudo $TC filter add dev lo parent ffff: protocol ip prio 1 \
      u32 match ip dst 127.0.0.1/32 flowid 1:1 action gact index 1
      
      ... send some traffic..
      $ ping 127.0.0.1 -c 3
      PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
      64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.020 ms
      64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.027 ms
      64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.038 ms
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1045ba77
  11. 03 12月, 2016 2 次提交
  12. 28 9月, 2016 1 次提交
  13. 22 9月, 2016 3 次提交
  14. 23 8月, 2016 1 次提交
  15. 18 8月, 2016 2 次提交
  16. 25 7月, 2016 1 次提交
  17. 08 6月, 2016 1 次提交
  18. 17 5月, 2016 3 次提交
  19. 12 3月, 2016 1 次提交
  20. 11 3月, 2016 1 次提交
  21. 02 3月, 2016 3 次提交
    • J
      net: sched: cls_u32 add bit to specify software only rules · 9e8ce79c
      John Fastabend 提交于
      In the initial implementation the only way to stop a rule from being
      inserted into the hardware table was via the device feature flag.
      However this doesn't work well when working on an end host system
      where packets are expect to hit both the hardware and software
      datapaths.
      
      For example we can imagine a rule that will match an IP address and
      increment a field. If we install this rule in both hardware and
      software we may increment the field twice. To date we have only
      added support for the drop action so we have been able to ignore
      these cases. But as we extend the action support we will hit this
      example plus more such cases. Arguably these are not even corner
      cases in many working systems these cases will be common.
      
      To avoid forcing the driver to always abort (i.e. the above example)
      this patch adds a flag to add a rule in software only. A careful
      user can use this flag to build software and hardware datapaths
      that work together. One example we have found particularly useful
      is to use hardware resources to set the skb->mark on the skb when
      the match may be expensive to run in software but a mark lookup
      in a hash table is cheap. The idea here is hardware can do in one
      lookup what the u32 classifier may need to traverse multiple lists
      and hash tables to compute. The flag is only passed down on inserts.
      On deletion to avoid stale references in hardware we always try
      to remove a rule if it exists.
      
      The flags field is part of the classifier specific options. Although
      it is tempting to lift this into the generic structure doing this
      proves difficult do to how the tc netlink attributes are implemented
      along with how the dump/change routines are called. There is also
      precedence for putting seemingly generic pieces in the specific
      classifier options such as TCA_U32_POLICE, TCA_U32_ACT, etc. So
      although not ideal I've left FLAGS in the u32 options as well as it
      simplifies the code greatly and user space has already learned how
      to manage these bits ala 'tc' tool.
      
      Another thing if trying to update a rule we require the flags to
      be unchanged. This is to force user space, software u32 and
      the hardware u32 to keep in sync. Thanks to Simon Horman for
      catching this case.
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e8ce79c
    • J
      net: cls_u32: move TC offload feature bit into cls_u32 offload logic · 2b6ab0d3
      John Fastabend 提交于
      In the original series drivers would get offload requests for cls_u32
      rules even if the feature bit is disabled. This meant the driver had
      to do a boiler plate check on the feature bit before adding/deleting
      the rule.
      
      This patch lifts the check into the core code and removes it from the
      driver specific case.
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b6ab0d3
    • J
      net: sched: consolidate offload decision in cls_u32 · 6843e7a2
      John Fastabend 提交于
      The offload decision was originally very basic and tied to if the dev
      implemented the appropriate ndo op hook. The next step is to allow
      the user to more flexibly define if any paticular rule should be
      offloaded or not. In order to have this logic in one function lift
      the current check into a helper routine tc_should_offload().
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6843e7a2
  22. 18 2月, 2016 1 次提交
    • J
      net: pack tc_cls_u32_knode struct slighter better · e014860e
      John Fastabend 提交于
      By packing the structure we can remove a few holes as Jamal
      suggests.
      
      before:
      
      struct tc_cls_u32_knode {
      	struct tcf_exts *          exts;                 /*     0     8 */
      	u8                         fshift;               /*     8     1 */
      
      	/* XXX 3 bytes hole, try to pack */
      
      	u32                        handle;               /*    12     4 */
      	u32                        val;                  /*    16     4 */
      	u32                        mask;                 /*    20     4 */
      	u32                        link_handle;          /*    24     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct tc_u32_sel *        sel;                  /*    32     8 */
      
      	/* size: 40, cachelines: 1, members: 7 */
      	/* sum members: 33, holes: 2, sum holes: 7 */
      	/* last cacheline: 40 bytes */
      };
      
      after:
      
      struct tc_cls_u32_knode {
      	struct tcf_exts *          exts;                 /*     0     8 */
      	struct tc_u32_sel *        sel;                  /*     8     8 */
      	u32                        handle;               /*    16     4 */
      	u32                        val;                  /*    20     4 */
      	u32                        mask;                 /*    24     4 */
      	u32                        link_handle;          /*    28     4 */
      	u8                         fshift;               /*    32     1 */
      
      	/* size: 40, cachelines: 1, members: 7 */
      	/* padding: 7 */
      	/* last cacheline: 40 bytes */
      };
      Suggested-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e014860e