[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <857eqnmxa1.fsf@sevai.TCC.com>
Date: Wed, 07 Mar 2018 15:43:50 -0500
From: Roman Mashak <mrv@...atatu.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, kernel@...atatu.com, jhs@...atatu.com,
xiyou.wangcong@...il.com, jiri@...nulli.us
Subject: Re: [PATCH v2 net-next 3/4] net sched actions: calculate add/delete event message size
David Miller <davem@...emloft.net> writes:
> From: Roman Mashak <mrv@...atatu.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.
Powered by blists - more mailing lists