28 Feb, 2018

1 commit

  • These pernet_operations are from net/sched directory, and they call only
    tc_action_net_init() and tc_action_net_exit():

    bpf_net_ops
    connmark_net_ops
    csum_net_ops
    gact_net_ops
    ife_net_ops
    ipt_net_ops
    xt_net_ops
    mirred_net_ops
    nat_net_ops
    pedit_net_ops
    police_net_ops
    sample_net_ops
    simp_net_ops
    skbedit_net_ops
    skbmod_net_ops
    tunnel_key_net_ops
    vlan_net_ops

    1)tc_action_net_init() just allocates and initializes per-net memory.
    2)There should not be in-flight packets at the time of tc_action_net_exit()
    call, or another pernet_operations send packets to dying net (except
    netlink). So, it seems they can be marked as async.

    Signed-off-by: Kirill Tkhai
    Signed-off-by: David S. Miller

    Kirill Tkhai
     

17 Feb, 2018

4 commits


14 Dec, 2017

1 commit


06 Dec, 2017

1 commit


30 Nov, 2017

1 commit

  • Similar to commit d7fb60b9cafb ("net_sched: get rid of tcfa_rcu"),
    TC actions don't need to respect RCU grace period, because it
    is either just detached from tc filter (standalone case) or
    it is removed together with tc filter (bound case) in which case
    RCU grace period is already respected at filter layer.

    Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action")
    Reported-by: Eric Dumazet
    Cc: Jamal Hadi Salim
    Cc: Jiri Pirko
    Cc: Yotam Gigi
    Signed-off-by: Cong Wang
    Reviewed-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Cong Wang
     

09 Nov, 2017

1 commit

  • This reverts commit ceffcc5e254b450e6159f173e4538215cebf1b59.
    If we hold that refcnt, the netns can never be destroyed until
    all actions are destroyed by user, this breaks our netns design
    which we expect all actions are destroyed when we destroy the
    whole netns.

    Cc: Lucas Bates
    Cc: Jamal Hadi Salim
    Cc: Jiri Pirko
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

03 Nov, 2017

1 commit

  • TC actions have been destroyed asynchronously for a long time,
    previously in a RCU callback and now in a workqueue. If we
    don't hold a refcnt for its netns, we could use the per netns
    data structure, struct tcf_idrinfo, after it has been freed by
    netns workqueue.

    Hold refcnt to ensure netns destroy happens after all actions
    are gone.

    Fixes: ddf97ccdd7cb ("net_sched: add network namespace support for tc actions")
    Reported-by: Lucas Bates
    Tested-by: Lucas Bates
    Cc: Jamal Hadi Salim
    Cc: Jiri Pirko
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

01 Nov, 2017

1 commit

  • For the time being I will be available in my private mail. Update both the
    MAINTAINERS file and the individual modules MODULE_AUTHOR directive with
    the new address.

    Signed-off-by: Yotam Gigi
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yotam Gigi
     

29 Oct, 2017

1 commit

  • Similar to commit c78e1746d3ad
    ("net: sched: fix call_rcu() race on classifier module unloads"),
    we need to wait for flying RCU callback tcf_sample_cleanup_rcu().

    Cc: Yotam Gigi
    Cc: Daniel Borkmann
    Cc: Jiri Pirko
    Cc: Jamal Hadi Salim
    Cc: "Paul E. McKenney"
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

31 Aug, 2017

1 commit

  • Typically, each TC filter has its own action. All the actions of the
    same type are saved in its hash table. But the hash buckets are too
    small that it degrades to a list. And the performance is greatly
    affected. For example, it takes about 0m11.914s to insert 64K rules.
    If we convert the hash table to IDR, it only takes about 0m1.500s.
    The improvement is huge.

    But please note that the test result is based on previous patch that
    cls_flower uses IDR.

    Signed-off-by: Chris Mi
    Signed-off-by: Jiri Pirko
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Chris Mi
     

14 Apr, 2017

1 commit


02 Feb, 2017

2 commits

  • The ASSERT_RTNL is not necessary in the init function, as it does not
    touch any rtnl protected structures, as opposed to the mirred action which
    does have to hold a net device.

    Reported-by: Cong Wang
    Reviewed-by: Jiri Pirko
    Signed-off-by: Yotam Gigi
    Signed-off-by: David S. Miller

    Yotam Gigi
     
  • Fix error path of in sample init, by releasing the tc hash in case of
    failure in psample_group creation.

    Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action")
    Reported-by: Cong Wang
    Reviewed-by: Jiri Pirko
    Signed-off-by: Yotam Gigi
    Signed-off-by: David S. Miller

    Yotam Gigi
     

25 Jan, 2017

1 commit

  • This action allows the user to sample traffic matched by tc classifier.
    The sampling consists of choosing packets randomly and sampling them using
    the psample module. The user can configure the psample group number, the
    sampling rate and the packet's truncation (to save kernel-user traffic).

    Example:
    To sample ingress traffic from interface eth1, one may use the commands:

    tc qdisc add dev eth1 handle ffff: ingress

    tc filter add dev eth1 parent ffff: \
    matchall action sample rate 12 group 4

    Where the first command adds an ingress qdisc and the second starts
    sampling randomly with an average of one sampled packet per 12 packets on
    dev eth1 to psample group 4.

    Signed-off-by: Yotam Gigi
    Signed-off-by: Jiri Pirko
    Acked-by: Jamal Hadi Salim
    Reviewed-by: Simon Horman
    Signed-off-by: David S. Miller

    Yotam Gigi