]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: convert tcf_exts from list to pointer array
authorWANG Cong <xiyou.wangcong@gmail.com>
Sun, 14 Aug 2016 05:35:00 +0000 (22:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Aug 2016 23:27:51 +0000 (19:27 -0400)
commit0fbde5cfaa35b6c4b6bbb3be0980ffd18f105c83
tree12a58165f757c38f9fe5e85371e84413f2bfe848
parent9e30d7f9183154eaf3e6bdd8574b3a5f8019f48b
net_sched: convert tcf_exts from list to pointer array

As pointed out by Jamal, an action could be shared by
multiple filters, so we can't use list to chain them
any more after we get rid of the original tc_action.
Instead, we could just save pointers to these actions
in tcf_exts, since they are refcount'ed, so convert
the list to an array of pointers.

The "ugly" part is the action API still accepts list
as a parameter, I just introduce a helper function to
convert the array of pointers to a list, instead of
relying on the C99 feature to iterate the array.

Fixes: 1d2f0fe9d59b ("net_sched: move tc_action into tcf_common")
Reported-by: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
include/net/act_api.h
include/net/pkt_cls.h
net/sched/act_api.c
net/sched/cls_api.c