[PATCH] qdisc: add hfsc qdisc support
Cong Wang
xiyou.wangcong at gmail.com
Mon Jul 28 10:06:27 PDT 2014
On Mon, Jul 28, 2014 at 9:49 AM, Cong Wang <xiyou.wangcong at gmail.com> wrote:
> On Sat, Jul 26, 2014 at 8:22 AM, Thomas Haller <thaller at redhat.com> wrote:
>>> +int rtnl_hfsc_set_defcls(struct rtnl_qdisc *qdisc, uint32_t defcls)
>>> +{
>>> + struct rtnl_hfsc_qdisc *hfsc;
>>> +
>>> + if (!(hfsc = hfsc_qdisc_data(qdisc)))
>>> + return -NLE_OPNOTSUPP;
>>
>> shouldn't the set function allocate some data if it is not allocated yet
>> (and possibly fail with -NLE_NOMEM)?
>>
>> And the same for other _set_ functions.
>>
>
> Makes sense, will change them.
>
Hmm, looking at rtnl_tc_data_check(), it could fail if we call rtnl_hfsc_*()
on a non-hfsc qdisc, in this case OPNOTSUPP is correct. And of course
when memory allocation fails, NOMEM is correct. We can't carry the error
code out of rtnl_tc_data_check(), so I don't know which is the right way.
More information about the libnl
mailing list