David Miller <da...@davemloft.net> writes: > From: Roman Mashak <m...@mojatatu.com> > Date: Tue, 6 Mar 2018 16:55:23 -0500 > >> +static size_t tcf_action_fill_size(const struct tc_action *act) >> +{ >> + if (act->ops->get_fill_size) >> + return act->ops->get_fill_size(act) + >> + tcf_action_shared_attrs_size(act); >> + return 0; >> +} > > I don't understand this. > > The shared attrs should be considered regardless of whether an action > type specific ->get_fill_size() is implemented. > > But instead, you return zero in that case.
Actually when action specific ->get_fill_size() is not implemented, I want to fall back to the current behaviour, where we always allocate NLMSG_GOODSIZE bytes for skb. So in this case size passed to tcf_add_notify is estimated in tcf_action_full_attrs_size() and smaller then NLMSG_GOODSIZE (which is page size). But may be you're right, API should return explicit size of the message, we can't expect PAGE_SIZE to be large enough. I will then change this in v3.