[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200129.111116.26679152804758998.davem@davemloft.net>
Date: Wed, 29 Jan 2020 11:11:16 +0100 (CET)
From: David Miller <davem@...emloft.net>
To: vinicius.gomes@...el.com
Cc: netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
jiri@...nulli.us, vladimir.oltean@....com, po.liu@....com
Subject: Re: [PATCH net v2 1/3] taprio: Fix enabling offload with wrong
number of traffic classes
From: Vinicius Costa Gomes <vinicius.gomes@...el.com>
Date: Tue, 28 Jan 2020 15:52:25 -0800
> @@ -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
This feedback applies to the existing code too, but don't we need to have
a call to netdev_reset_tc() in the error paths after we commit these
settings?
Because ->num_tc for the device should be reset to zero for sure if we
can't complete this configuration change successfully.
Powered by blists - more mailing lists