[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87h80giu78.fsf@linux.intel.com>
Date: Mon, 27 Jan 2020 11:18:51 -0800
From: Vinicius Costa Gomes <vinicius.gomes@...el.com>
To: Andre Guedes <andre.guedes@...ux.intel.com>, netdev@...r.kernel.org
Cc: jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
davem@...emloft.net, vladimir.oltean@....com, po.liu@....com
Subject: Re: [PATCH net v1 1/3] taprio: Fix enabling offload with wrong number of traffic classes
Hi Andre,
Andre Guedes <andre.guedes@...ux.intel.com> writes:
> Hi Vinicius,
>
> Quoting Vinicius Costa Gomes (2020-01-24 16:53:18)
>> diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
>> index c609373c8661..ad0dadcfcdba 100644
>> --- a/net/sched/sch_taprio.c
>> +++ b/net/sched/sch_taprio.c
>> @@ -1444,6 +1444,19 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
>>
>> taprio_set_picos_per_byte(dev, q);
>>
>> + if (mqprio) {
>> + netdev_set_num_tc(dev, mqprio->num_tc);
>> + for (i = 0; i < mqprio->num_tc; i++)
>> + netdev_set_tc_queue(dev, i,
>> + mqprio->count[i],
>> + mqprio->offset[i]);
>> +
>> + /* Always use supplied priority mappings */
>> + for (i = 0; i <= TC_BITMASK; i++)
>> + netdev_set_prio_tc_map(dev, i,
>> + mqprio->prio_tc_map[i]);
>> + }
>> +
>> if (FULL_OFFLOAD_IS_ENABLED(taprio_flags))
>> err = taprio_enable_offload(dev, mqprio, q, new_admin, extack);
>> else
>
> If something goes wrong later within this function (e.g.
> taprio_enable_offload() returns error), don't we want to roll back these
> changes to the netdev object?
If something goes wrong, and change() returns an error, taprio_destroy()
is called, and the changes are undone.
Cheers,
--
Vinicius
Powered by blists - more mailing lists