Subject: Re: [patch net-next RFC 1/9] net_sch: red: Add offload ability to RED qdisc

From: Jiri Pirko <[email-masked]>
Date: Tue, 31 Oct 2017 08:41:51 +0100

Mon, Oct 30, 2017 at 08:24:20PM CET, [email-masked] wrote:
>On 10/30/17 7:54 AM, Nogah Frankel wrote:
>>>> diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
>>>> index 0e88cc2..743c42a 100644
>>>> --- a/include/uapi/linux/pkt_sched.h
>>>> +++ b/include/uapi/linux/pkt_sched.h
>>>> @@ -255,6 +255,7 @@ struct tc_red_qopt {
>>>>  #define TC_RED_ECN		1
>>>>  #define TC_RED_HARDDROP		2
>>>>  #define TC_RED_ADAPTATIVE	4
>>>> +#define TC_RED_OFFLOADED	8
>>>>  };
>>>>
>>>>  struct tc_red_xstats {
>>>
>>> What keeps a user from setting this flag in the tc_red_qopt it
>>> passes into the a change operation?
>> 
>> Nothing keeps the user from doing it, but it has no effect.
>> The decision to offload is the driver's only.
>> It is basically a read-only flag.
>> 
>
>If it is read-only, then attempts to set it from userspace should cause
>the command to fail.

That breaks uapi. Consider existing userspace app sending garbage in
that bit and new kernel which randomly fails upon the garbage.