From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Andre Guedes <andre.guedes@linux.intel.com>, netdev@vger.kernel.org
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
davem@davemloft.net, vladimir.oltean@nxp.com, po.liu@nxp.com
Subject: Re: [PATCH net v1 1/3] taprio: Fix enabling offload with wrong number of traffic classes
Date: Mon, 27 Jan 2020 11:18:51 -0800 [thread overview]
Message-ID: <87h80giu78.fsf@linux.intel.com> (raw)
In-Reply-To: <158015173854.43591.3142751689916523701@aguedesl-mac01.jf.intel.com>
Hi Andre,
Andre Guedes <andre.guedes@linux.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
next prev parent reply other threads:[~2020-01-27 19:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-25 0:53 [PATCH net v1 0/3] taprio: Some fixes Vinicius Costa Gomes
2020-01-25 0:53 ` [PATCH net v1 1/3] taprio: Fix enabling offload with wrong number of traffic classes Vinicius Costa Gomes
2020-01-25 16:53 ` Vladimir Oltean
2020-01-27 19:02 ` Andre Guedes
2020-01-27 19:18 ` Vinicius Costa Gomes [this message]
2020-01-25 0:53 ` [PATCH net v1 2/3] taprio: Fix still allowing changing the flags during runtime Vinicius Costa Gomes
2020-01-25 16:44 ` Vladimir Oltean
2020-01-25 20:25 ` Vinicius Costa Gomes
2020-01-25 0:53 ` [PATCH net v1 3/3] taprio: Allow users not to specify "flags" when changing schedules Vinicius Costa Gomes
2020-01-25 16:52 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h80giu78.fsf@linux.intel.com \
--to=vinicius.gomes@intel.com \
--cc=andre.guedes@linux.intel.com \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=po.liu@nxp.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).