Thread (19 messages) flat view 19 messages, 4 authors, 2016-08-14

Re: [Patch net 5/5] net_sched: convert tcf_exts from list to flex_array

From: Amir Vadai <hidden>
Date: 2016-08-09 08:04:12

On Mon, Aug 8, 2016 at 11:46 PM, Cong Wang [off-list ref] wrote:
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 a flex array.

The ugly part is the action API still accepts list
as a parameter, I just introduce a helper function to
convert the flex array of pointers to a list.

Fixes: a85a970af265 ("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 <redacted>
---
[...]
-#define tc_single_action(_exts) \
-       (list_is_singular(&(_exts)->actions))
+#define tc_no_actions(_exts)  (&(_exts)->nr_actions == 0)
+#define tc_single_action(_exts) (&(_exts)->nr_actions == 1)
Should remove the '&' here.

Amir

[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help