[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158015173854.43591.3142751689916523701@aguedesl-mac01.jf.intel.com>
Date: Mon, 27 Jan 2020 11:02:18 -0800
From: Andre Guedes <andre.guedes@...ux.intel.com>
To: Vinicius Costa Gomes <vinicius.gomes@...el.com>,
netdev@...r.kernel.org
Cc: Vinicius Costa Gomes <vinicius.gomes@...el.com>, 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 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?
- Andre
Powered by blists - more mailing lists