Re: [PATCH net v3 2/2] taprio: Fix still allowing changing the flags during runtime
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Date: 2020-01-31 17:58:04
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Date: 2020-01-31 17:58:04
Jakub Kicinski [off-list ref] writes:
On Wed, 29 Jan 2020 17:37:21 -0800, Vinicius Costa Gomes wrote:quoted
+static int taprio_new_flags(const struct nlattr *attr, u32 old, + struct netlink_ext_ack *extack) +{ + u32 new = 0;TCA_TAPRIO_ATTR_FLAGS doesn't seem to be in the netlink policy 😖
Will add it.
quoted
+ if (attr) + new = nla_get_u32(attr); + + if (old != TAPRIO_FLAGS_INVALID && old != new) { + NL_SET_ERR_MSG_MOD(extack, "Changing 'flags' of a running schedule is not supported"); + return -ENOTSUPP;-EOPNOTSUPP
Will fix.
quoted
+ } + + if (!taprio_flags_valid(new)) { + NL_SET_ERR_MSG_MOD(extack, "Specified 'flags' are not valid"); + return -EINVAL; + } + + return new; +}